Misplaced Pages

MooTools

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
(Redirected from Mootools) Software
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
This article may contain excessive or inappropriate references to self-published sources. Please help improve it by removing references to unreliable sources where they are used inappropriately. (November 2008) (Learn how and when to remove this message)
This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources.
Find sources: "MooTools" – news · newspapers · books · scholar · JSTOR (November 2008) (Learn how and when to remove this message)
(Learn how and when to remove this message)
MooTools
[REDACTED]
Developer(s)The MooTools Dev Team
Initial releaseSeptember 8, 2006; 18 years ago (2006-09-08)
Stable release1.6.0 / January 14, 2016; 9 years ago (2016-01-14)
Repositoryhttps://github.com/mootools/mootools-core
Written inJavaScript
TypeAjax framework / JavaScript Framework
LicenseMIT License
Websitemootools.net

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

Overview

MooTools provides the user with a number of options beyond native JavaScript. These include:

  • An extensible and modular framework allowing developers to choose their own customized combination of components.
  • MooTools follows object-oriented practices and the DRY principle.
  • An advanced effects component, with optimized transitions such as easing equations used by many Flash developers.
  • 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.

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), as well as a custom downloads module allowing developers to download only the modules and dependencies they need for a particular app.

History

Valerio Proietti first authored the framework and released it in September 2006 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. 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) further extended the native Element object as well to offer greater control of the Document Object Model (DOM).

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.
  • More: An official collection of add-ons that extend the Core and provide enhanced functionality.
  • Class: The base library for Class object instantiation.
  • 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.
  • Fx: An advanced effects-API to animate page elements.
  • Request: Includes XHR interface, Cookie, JSON, and HTML retrieval-specific tools for developers to exploit.
  • Window: Provides a cross-browser interface to client-specific information, such as the dimensions of the window.

Browser compatibility

MooTools is compatible and tested with:

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 intuitively 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 containing either properties or methods (functions). Class is effortlessly mixed and extended with other Class instantiations allowing for the most excellent 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.

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 Misplaced Pages'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. Original release announcement
  2. "Release 1.6.0 · mootools/Mootools-core". GitHub.
  3. "MooTools". mootools.net.
  4. "MooTools at FOSDEM slides" (PDF). Archived from the original (PDF) on 2011-07-23. Retrieved 2010-02-17.
  5. The Official MooTools Website
  6. MooTools' Core Download Page
  7. MooTools Class Object Archived 2008-08-31 at the Wayback Machine
  8. MooTools' Effects (FX) Class Archived 2008-06-23 at the Wayback Machine
  9. MooTools' Element Class - A comprehensive list of Element manipulation methods. Archived 2008-09-05 at the Wayback Machine
  10. A Better Way to Use Elements
  11. MooTools Core Builder
  12. MooTools More Builder
  13. ^ Newton, Aaron (September 18, 2008). MooTools Essentials: The Official MooTools Reference for JavaScript and Ajax Development (1st ed.). Apress. pp. xvi. ISBN 978-1-4302-0983-6.
  14. Newton, Aaron (September 18, 2008). MooTools Essentials: The Official MooTools Reference for JavaScript and Ajax Development (1st ed.). Apress. pp. xv. ISBN 978-1-4302-0983-6.
  15. Version 1.6.1 of Prototype includes "an element metadata storage system." Prototype 1.6.1 released Archived 2010-03-01 at archive.today by Sam Stephenson, written September 1st, 2009. Retrieved March 21, 2010.
  16. 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 978-1-4302-0983-6.)
  17. MooTools Core Archived 2009-10-02 at the Wayback Machine
  18. MooTools More Archived 2009-10-04 at the Wayback Machine
  19. MooTools Class Archived 2008-08-31 at the Wayback Machine
  20. MooTools Element Archived 2008-09-05 at the Wayback Machine
  21. MooTools Fx Class Archived 2008-06-23 at the Wayback Machine
  22. MooTools Request Class Archived 2008-07-30 at the Wayback Machine
  23. In addition to getting the size for any Element, you can easily get the dimensions of the window Archived 2008-09-11 at the Wayback Machine
  24. MooTools lists its compatibility on its homepage.
  25. jQuery versus Mootools

Further reading

External links

Web frameworks
.NET
C++
ColdFusion
Common Lisp
Haskell
Java
JavaScript
Perl
PHP
Python
Ruby
Rust
Scala
Smalltalk
Other languages
List of widget toolkits
Low-level platform-specific
On AmigaOS
On Classic Mac OS, macOS
On Windows
On Unix,
under X11
On BeOS, Haiku
On Android
CLI
Low Level Cross-platform
CLI
C
Java
High-level, platform-specific
On AmigaOS
On Classic Mac OS, macOS
Object Pascal
Objective-C, Swift
C++
CLI
On Windows
CLI
C++
Object Pascal
On Unix,
under X11
On Android
High-level, cross-platform
C
C++
Objective-C
CLI
Adobe Flash
Go
Haskell
Java
JavaScript
Common Lisp
Lua
Pascal
Object Pascal
Perl
PHP
Python
Ruby
Tcl
XML
shell
Dart
ECMAScript
Dialects
Engines
(comparison)
Frameworks
Client-side
Server-side
Multiple
  • Cappuccino
Libraries
People
Other
Lists
JavaScript libraries
Ajax frameworks
Comparisons
JavaScript frameworks
server-side JavaScript
Categories:
MooTools Add topic