The MooTorial Mon, 14 Jul 2014 23:36:04 -0600 FeedCreator 1.7.2-ppt DokuWiki The MooTorial Getting Started: What is MooTools? MooTools is a lightweight abstraction layer between the browser and the code you write (this is really the definition of nearly every js framework out there - Prototype, Dojo, jQuery, YUI, etc). It offers more functionality and richer tools for writing javascript, taking what has historically been painful and fraught with buggy environments (the browsers) and presenting you with a much more reliable environment. By adding it to your environment (i.e. including the script in your page) you are ab… mootorial Wed, 18 Apr 2012 17:44:17 -0600 Core Core.js represents the first file in the library on which all others depend. Here are the docs for Core.js MooTools MooTools has a namespace which contains a version number. This namespace isn't used for much else, but it's useful if you need to query the page to see what version of MooTools is in the environment: mootorial Wed, 20 Apr 2011 01:30:59 -0600 Color The Color class provides utilities for handling all sorts of color functions in javascript including blending, inverting, setting hue, saturation, and brightness. Here is the documentation for Color.js. Constructor /*you can use hex values*/ var black = new Color('#000'); var white = new Color('#fff'); /*you can use numerical color values*/ var purple = new Color([255,0,255]); /* mix black with white and purple, each time at 10% of the new color*/ var darkpurple = black.mix(white, purple, 10… mootorial:08-plugins:02-utilityplugins Fri, 14 Jan 2011 06:59:49 -0600 Events The Events class is a collection of functions for handling events across browsers. Here is the documentation for Event.js. Whenever you add an event to a DOM element (not to be confused with the //Events// class in Class.Extras) the argument passed to that function will be the event native. This has been extended like other natives to have additional properties by MooTools. mootorial:03-native Fri, 14 Jan 2011 03:53:31 -0600 Hash Here is the documentation for Hash.js. The Hash returns a hash map object with various helper functions for managing a JavaScript object. We must use .set, .get, and .remove to add/change, retrieve and remove values; we must not access the internal object directly. null values are allowed. Pass in an object to convert to a Hash. mootorial:03-native Fri, 14 Jan 2011 03:51:29 -0600 Strings Strings Here is the documentation page for String.js. String.test Tests a string against a regular expression; optional second parameter for Regex options. Accepts regular expressions in both string and regexp mode. "I like cookies".test("cookie"); // returns true mootorial:03-native Fri, 14 Jan 2011 03:48:36 -0600 Numbers Here is the documentation for Number.js. Number.toInt, .toFloat Number.toInt() just returns the number; useful because toInt must work on both Strings and Numbers. Note that if you call .toInt() on a float, you'll get an integer back. var x = 10; x.toInt(); //returns 10 mootorial:03-native Fri, 14 Jan 2011 03:48:13 -0600 Arrays Here is the documentation for Array.js. Array.each Array.each() iterates through the array executing the specified function for each item in the array. The anonymous function can be passed two arguments (optional) - the item and the index. .each() is really just a pointer to .forEach, which MooTools implements for browsers that don't already support it. Here's the documentation at Mozilla on .forEach. mootorial:03-native Fri, 14 Jan 2011 03:45:01 -0600 Functions Here is the documentation for Function.js. Function.create .create automatically wraps the function into another one with the defined set of functionalities, therefore shortens your code. It's used throughout mootools itself, as the foundation for .pass, .bind, .delay, .periodical. mootorial:03-native Fri, 14 Jan 2011 03:37:43 -0600 Drag.Move Here is the documentation for Drag.Move.js. Drag.Move extends Drag to support moving an element around the page. The usage is pretty straight forward: new Drag.Move($('fxTarget')); It takes all the options that Drag takes and adds two new ones: mootorial:08-plugins:01-drag Fri, 14 Jan 2011 03:30:55 -0600 Class.Extras - old revision restored Class.Extras This file contains a few basic functionalities that are useful for many types of classes. You can add the functionality in these extras to any one of your classes easily by using Class.implement. Here are the docs for Class.Extras.js Aaron Newton mootorial:02-class Sun, 29 Aug 2010 20:47:09 -0600