xUI Plugins
Below is a template for plugins with xUI the awesome jQuery like mobile JS framework. This might be an un-documented feature of xUI at the current version. Check the latest version on git, which is what I am using for this (1.0.0) and I have already written compiling building it on os x. Although it’s an undocumented “feature” as such, it’s basically supported because of xUI’s JavaScript architecture. I haven’t really got time to explain this now, but check out Pro JavaScript Design Patterns which will unlock OO JavaScript for you!
xUI JavaScript plugin template.
(function(x$) {
x$.fn.myPlugin = function()
{
return this.each(function()
{
console.log('myPlugin!');
});
}
})(x$);
Update 17/04/2010: After sifting through the new xUI source it seems this is an implemented, feature although the how and why it works you should definitely read the above book (Pro JavaScript Design Patterns).
Please Leave a Reply
TrackBack URL :