What's been happening?

March 29th, 2008

Posted at 12:00am by Stan

Earlier today I release jGrowl 1.0.2 on the jQuery plugin page, and I also uploaded the release locally as well. This release is bundled into a zip file and contained within it is a demo page and an accompanying stylesheet. There are some pretty substantial changes in this release, including...

  • Styling is now done externally, not inline.
  • Messages can have an optional "theme" passed in, which defines secondary classes to be applied to messages. This allows for messages to be themed on a per-message basis.
  • Animation speed can be customized.
  • The global closer can be disabled.
  • Added an optional callback to the global closer.
  • Added an optional open and close callback to the individual notifications.
  • Customize the life of a message on a per-message basis.
  • jGrowl automatically starts itself up with the first message.
  • When there are no messages jGrowl will automatically shut itself down.
  • ...fixed various bugs in 1.0.1.

Overall this release is quite a bit better then the previous one. If you have any ideas for future features, or if you discover any bugs please feel free to contact me.

The new release can be downloaded at: http://stanlemon.net/files/jgrowl-1.0.2.zip

March 20th, 2008

Posted at 11:36pm by Stan

Growl

Back in November I wanted a mechanism to communicate messages after an ajax request to my PageSite users. I experimented with a number of things and initially had a terribly ugly manipulation of the green and red message boxes you'll see on this type from time to time. There were a couple of big problems though, first the code was originally written for Prototype so it sucked, and second it was not very portable. Ultimately I wanted something that looked good, was well written and could be reused in a number of different ways.

When PageSite was converted to using jQuery for all of its javascript I rehashed a lot of stuff. There was some old javascript code that had been floating around since 2004 when I first prototyped out PageSite 4.0's admin panel. To cut to the chase... I stumbled across Humanized Messages, which was close to what I wanted to do, but not yet there. This plugin got me to thinking, though, what I'd really like is something that looked like Growl. For those not on OS X, take a look at the website and you'll see that Growl is a system-wide notification system.

As a result, while Erich was out here visiting I fleshed out an initial concept. I called it jGrowl, spinning off of the OS X solution. It's pretty simple to use out of the box:

// Normal notification $.jGrowl("Here is my message!"); // Sticky notification $.jGrowl("This message is stuck!", { sticky: true });

Today I sat down and cleaned up some of the plugin, namely I removed a dependency on the metadata plugin in favor of $.fn.data() and I also namespaced all of the events, which should allow you to attach other events to the jGrowl nodes and deal with them without jGrowl unbinding them on you.

The plugin still needs some work, I'm not sure how much I like styling it with javascript - at the same rate, I like the idea of styling different notifications differently as well. I'd also like to see some callback options, the animations customizable and I'd like to potentially add some internal sorting using the "header" option. These things, though, will come in time - for now I just want to get the plugin out so I can get some feedback.

Updated 03/24/08: The plugin is available at: http://stanlemon.net/files/jgrowl-1.0.2.zip, please let me know what you think!

Powered by BlogSCL3 0.2.0alpha