Time for a round-up of interesting / quality plugins on the MooTools forge or github. Again.
First off, my favourite find over the last month has to be the MooTools Router. What it does is handle application paths for hashes in the style of the Backbone.js router but it’s really a normal MooTools class. It can tackle dynamic parameters rather well and raises some warnings / events you can work with. For example:
BO.Router = Router.implement({ // routes definition routes: { '#!customer/:id/' : 'loadCustomer', '#!customer/:id/cancel/' : 'cancelCustomer', }, // router init init: function(){ console.log('init') }, loadCustomer: function() { console.log("loading customer with id " + this.param.id); BO.user.model.set({ id: this.param.id }); BO.user.model.on("change", function() { BO.user.view.render(); }); BO.user.model.fetch({ success: function() { BO.user.model.off("change"); BO.user.model.trigger("fetch"); } }); } });
Second. Twipsy – It’s a port of the Twitter Bootstrap Twipsy tooltip plugin (now renamed in BootStrap 2.0 to bootstrap-tooltip.js). Rather nice and just works. Also, extendible so you can implement the boostrap-popover.js through it.
Third. A plugin by yours truly and Arian from mootools-core – it’s scrollspy. That’s not David Walsh’ scrollspy, it’s a port of the Twitter Bootstrap scrollspy instead. It allows you to react to elements of interest that come into view and do things to them or your nav items that are somehow related.
Fourth. “MooStrap offers the initialization function of large-scale application from middle-scale. Every one initialization processing is performed and it secures that initialization of application is ensured.” – well, perhaps english is not their strong part but if you can get past things like ‘paturn’, it does provide a nice platform to build on.
Last but not least. Composer.js is a nice alternative to Backbone.js in MooTools. It is early days but it’s looking promising for the lyonbros plugin. There are some differences in terms of approaches vs Backbone or Spine but it gets the job done. Only downside is, not mature enough and lack of tests supplied make it difficult to build on it and contribute. Hopefully, easily fixed.
GitHub flavoured markdown enabled.