Friday, January 16th, 2009
There has been a lot of interesting news in the MooTools community recently. Before it passes us by, I wanted to aggregate some of the goodies for your perusal:
It supports console.log statements in the various formats that Firebug supports (”console.log(’foo: %s, bar: %o’, foo, bar);”) and is really useful for debugging your code in non-Firebug browsers. I like to use it in conjunction with X-RAY to solve layout issues, too.
To use it, all you need to do is drag the link on the bookmarklet page into your bookmarks and then click it on any page to bring up the console (I.E. you have to right click and choose “Add to Favorites”).
You can see it in action on the test page.
- Class.toElement and $
- Use Element Storage to Go the Other Direction (The Difference Between Element.set/get and Element.store/retrieve)
- Use Closures to Extend Native Methods
- Measure the Dimensions of a Hidden Element
- Use Element.Properties to Create “Built-in” Instances of Classes
A common convention in MooTools is to have numerous classes that break out functionality. This allows you to build upon the functionality of classes through extension and also keep your code base small when you don’t need everything and the kitchen sink. Consequently we get Fx, Fx.Css, Fx.Tween, Fx.Morph, etc.
What happens when you want to extend numerous classes with the same functionality? For instance, I have a popup manager called StickyWin. One of my scripts is called StickyWin.Ajax.js, which adds Ajax functionality to all the popup classes, creating *.Ajax classes (so, for instance, StickyWin.Fx is extended to StickyWin.Fx.Ajax).
- SWF support
- xml gallery definition (quite a unique feature in lightbox clones)
- really improved autoPlay features
- refined global options management ( see changeOptions() and restoreOptions() )
- custom events ( onXmlGalleries and onClosed )
Posted by Dion Almaer at 7:38 am