MooTools
MooTools
MooTools (logo).png
Developer(s) The MooTools Dev Team
Initial release March 7, 2007; 10 years ago (2007-03-07)[1]
Stable release
1.6.0 / January 14, 2016; 20 months ago (2016-01-14)[2]
Repository https://github.com/mootools/mootools-core
Written in JavaScript
Type Ajax framework / JavaScript Framework
License MIT License[3]
Website mootools.net

MooTools (My Object-Oriented Tools)[4] is a lightweight, object-oriented JavaScript framework. It is released under the free, open-source MIT License.[5]

History

Valerio Proietti first authored the framework and released it in September 2006[6] taking as his inspiration Prototype and Dean Edward's base2. MooTools originated from Moo.fx, a popular JavaScript effects library released in October 2005 by Valerio Proietti as an add-on to the Prototype Javascript Framework.[7] which is still maintained and used. It can be used as a lighter alternative to script.aculo.us or other, bigger libraries. It provides simple, basic effects, and guarantees a small library size.

Whereas Prototype extended--prototyped--many of JavaScript's native String, Array, and Function objects with additional methods, Proietti desired a framework that (at the time)[8] further extended the native Element object as well[6] to offer greater control of the Document Object Model (DOM).[9]

Components

MooTools includes a number of components, but not all need to be loaded for each application. Some of the component categories are:

  • Core: A collection of utility functions that all the other components require.[10]
  • More: An official collection of add-ons that extend the Core and provide enhanced functionality.[11]
  • Class: The base library for Class object instantiation.[12]
  • Natives: A collection of JavaScript Native Object enhancements. The Natives add functionality, compatibility, and new methods that simplify coding.
  • Element: Contains a large number of enhancements and compatibility standardization to the HTML Element object.[13]
  • Fx: An advanced effects-API to animate page elements.[14]
  • Request: Includes XHR interface, Cookie, JSON, and HTML retrieval-specific tools for developers to exploit.[15]
  • Window: Provides a cross-browser interface to client-specific information, such as the dimensions of the window.[16]

Browser compatibility

MooTools is compatible and tested with:[17]

Benefits

MooTools provides the user with a number of advantages over native JavaScript. These include:

  • An extensible and modular framework allowing developers to choose their own customized combination of components.[18]
  • MooTools follows object-oriented practices and the DRY principle.[19]
  • An advanced effects component, with optimized transitions such as easing equations used by many Flash developers.[20]
  • Enhancements to the DOM, enabling developers to easily add, modify, select, and delete DOM elements. Storing and retrieving information with Element storage is also supported.[21]

The framework includes built-in functions for manipulation of CSS, DOM elements, native JavaScript objects, Ajax requests, DOM effects, and more. MooTools also provides a detailed, coherent application programming interface (API)[22] as well as a custom downloads module allowing developers to download only the modules and dependencies they need for a particular app.[23][24]

Emphasis on modularity and reusability

Every JavaScript framework has its philosophy, and MooTools is interested in taking full advantage of the flexibility and power of JavaScript in a way that emphasizes greater modularity and code reuse. MooTools accomplishes these goals in a way that is intuitive to a developer coming from a class-based inheritance language like Java with the MooTools Class object.

Class is an object of key/value pairs that can contain either properties or methods (functions). Class is effortlessly mixed and extended with other Class instantiations allowing for the greatest focus of MooTools: Code reuse achieved through maximizing the power of JavaScript's prototypical inheritance, but in a Class object syntax more familiar to classical inheritance models.[25]

Object-oriented programming

MooTools contains a robust Class creation and inheritance system that resembles most classically based Object-oriented programming languages. For example, the following is MooTools' equivalent of the examples in Wikipedia's polymorphism page:

var Animal = new Class({

    initialize: function(name) {
        this.name = name;
    }

});

var Cat = new Class({
    Extends: Animal,

    talk: function {
        return 'Meow!';
    }

});

var Dog = new Class({

    Extends: Animal,

    talk: function {
        return 'Arf! Arf!';
    }

});

var animals = {
    a: new Cat('Missy'),
    b: new Cat('Mr. Bojangles'),
    c: new Dog('Lassie')
};

Object.each(animals, function(animal) {
    alert(animal.name + ': ' + animal.talk);
});
 
// alerts the following:
//
// Missy: Meow!
// Mr. Bojangles: Meow!
// Lassie: Arf! Arf!

See also

References

  1. ^ Earliest known release
  2. ^ https://github.com/mootools/mootools-core/releases/tag/1.6.0
  3. ^ "MooTools". mootools.net. 
  4. ^ MooTools at FOSDEM slides
  5. ^ The Official MooTools Website
  6. ^ a b Newton, Aaron (September 18, 2008). MooTools Essentials: The Official MooTools Reference for JavaScript and Ajax Development (1st ed.). Apress. pp. xvi. ISBN 1-4302-0983-6. 
  7. ^ Newton, Aaron (September 18, 2008). MooTools Essentials: The Official MooTools Reference for JavaScript and Ajax Development (1st ed.). Apress. pp. xv. ISBN 1-4302-0983-6. 
  8. ^ Version 1.6.1 of Prototype includes "an element metadata storage system." Prototype 1.6.1 released by Sam Stephenson, written September 1st, 2009. Retrieved March 21, 2010.
  9. ^ Note that MooTools does not extend the native Object--all JavaScript primitives like String and Function inherit from it--but instead provides a convenient Hash for the purpose: Think of it like having a set of utility methods that allow for nearly effortless object manipulation of regular JavaScript objects that are otherwise unaffected by the process. (Newton, Aaron (September 18, 2008). MooTools Essentials: The Official MooTools Reference for JavaScript and Ajax Development (1st ed.). Apress. pp. xvi. ISBN 1-4302-0983-6. )
  10. ^ MooTools Core
  11. ^ MooTools More
  12. ^ MooTools Class
  13. ^ MooTools Element
  14. ^ MooTools Fx Class
  15. ^ MooTools Request Class
  16. ^ In addition to getting the size for any Element, you can easily get the dimensions of the window
  17. ^ MooTools lists its compatibility on its homepage.
  18. ^ MooTools' Core Download Page
  19. ^ MooTools Class Object
  20. ^ MooTools' Effects (FX) Class
  21. ^ MooTools' Element Class - A comprehensive list of Element manipulation methods.
  22. ^ ,A Better Way to Use Elements
  23. ^ MooTools Core Builder
  24. ^ MooTools More Builder
  25. ^ jQuery versus Mootools

Further reading

External links


  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.


MooTools



 
Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.



Manage research, learning and skills at defaultLogic. Create an account using LinkedIn or facebook to manage and organize your IT knowledge. defaultLogic works like a shopping cart for information -- helping you to save, discuss and share.


  Contact Us