diff --git a/public_html/includes/js/mootools-core.js b/public_html/includes/js/mootools-core.js
index b120ec5e..ba62ffc3 100644
--- a/public_html/includes/js/mootools-core.js
+++ b/public_html/includes/js/mootools-core.js
@@ -1,424 +1,548 @@
/*
-Script: Core.js
- MooTools - My Object Oriented JavaScript Tools.
+---
+MooTools: the javascript framework
-License:
- MIT-style license.
+web build:
+ - http://mootools.net/core/7c56cfef9dddcf170a5d68e3fb61cfd7
-Copyright:
- Copyright (c) 2006-2007 [Valerio Proietti](http://mad4milk.net/).
+packager build:
+ - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff
-Code & Documentation:
- [The MooTools production team](http://mootools.net/developers/).
+/*
+---
-Inspiration:
- - Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php)
- - Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php)
+name: Core
+
+description: The heart of MooTools.
+
+license: MIT-style license.
+
+copyright: Copyright (c) 2006-2010 [Valerio Proietti](http://mad4milk.net/).
+
+authors: The MooTools production team (http://mootools.net/developers/)
+
+inspiration:
+ - Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php)
+ - Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php)
+
+provides: [Core, MooTools, Type, typeOf, instanceOf, Native]
+
+...
*/
-var MooTools = {
- 'version': '1.2.0',
- 'build': ''
+(function(){
+
+this.MooTools = {
+ version: '1.3.2',
+ build: 'c9f1ff10e9e7facb65e9481049ed1b450959d587'
};
-
-var Native = function(options){
- options = options || {};
- var afterImplement = options.afterImplement || function(){};
- var generics = options.generics;
- generics = (generics !== false);
- var legacy = options.legacy;
- var initialize = options.initialize;
- var protect = options.protect;
- var name = options.name;
+// typeOf, instanceOf
- var object = initialize || legacy;
+var typeOf = this.typeOf = function(item){
+ if (item == null) return 'null';
+ if (item.$family) return item.$family();
- object.constructor = Native;
- object.$family = {name: 'native'};
- if (legacy && initialize) object.prototype = legacy.prototype;
- object.prototype.constructor = object;
-
- if (name){
- var family = name.toLowerCase();
- object.prototype.$family = {name: family};
- Native.typize(object, family);
+ if (item.nodeName){
+ if (item.nodeType == 1) return 'element';
+ if (item.nodeType == 3) return (/\S/).test(item.nodeValue) ? 'textnode' : 'whitespace';
+ } else if (typeof item.length == 'number'){
+ if (item.callee) return 'arguments';
+ if ('item' in item) return 'collection';
}
- var add = function(obj, name, method, force){
- if (!protect || force || !obj.prototype[name]) obj.prototype[name] = method;
- if (generics) Native.genericize(obj, name, protect);
- afterImplement.call(obj, name, method);
- return obj;
- };
-
- object.implement = function(a1, a2, a3){
- if (typeof a1 == 'string') return add(this, a1, a2, a3);
- for (var p in a1) add(this, p, a1[p], a2);
- return this;
- };
-
- object.alias = function(a1, a2, a3){
- if (typeof a1 == 'string'){
- a1 = this.prototype[a1];
- if (a1) add(this, a2, a1, a3);
+ return typeof item;
+};
+
+var instanceOf = this.instanceOf = function(item, object){
+ if (item == null) return false;
+ var constructor = item.$constructor || item.constructor;
+ while (constructor){
+ if (constructor === object) return true;
+ constructor = constructor.parent;
+ }
+ return item instanceof object;
+};
+
+// Function overloading
+
+var Function = this.Function;
+
+var enumerables = true;
+for (var i in {toString: 1}) enumerables = null;
+if (enumerables) enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'constructor'];
+
+Function.prototype.overloadSetter = function(usePlural){
+ var self = this;
+ return function(a, b){
+ if (a == null) return this;
+ if (usePlural || typeof a != 'string'){
+ for (var k in a) self.call(this, k, a[k]);
+ if (enumerables) for (var i = enumerables.length; i--;){
+ k = enumerables[i];
+ if (a.hasOwnProperty(k)) self.call(this, k, a[k]);
+ }
} else {
- for (var a in a1) this.alias(a, a1[a], a2);
+ self.call(this, a, b);
}
return this;
};
-
- return object;
};
-Native.implement = function(objects, properties){
- for (var i = 0, l = objects.length; i < l; i++) objects[i].implement(properties);
-};
-
-Native.genericize = function(object, property, check){
- if ((!check || !object[property]) && typeof object.prototype[property] == 'function') object[property] = function(){
- var args = Array.prototype.slice.call(arguments);
- return object.prototype[property].apply(args.shift(), args);
- };
-};
-
-Native.typize = function(object, family){
- if (!object.type) object.type = function(item){
- return ($type(item) === family);
- };
-};
-
-Native.alias = function(objects, a1, a2, a3){
- for (var i = 0, j = objects.length; i < j; i++) objects[i].alias(a1, a2, a3);
-};
-
-(function(objects){
- for (var name in objects) Native.typize(objects[name], name);
-})({'boolean': Boolean, 'native': Native, 'object': Object});
-
-(function(objects){
- for (var name in objects) new Native({name: name, initialize: objects[name], protect: true});
-})({'String': String, 'Function': Function, 'Number': Number, 'Array': Array, 'RegExp': RegExp, 'Date': Date});
-
-(function(object, methods){
- for (var i = methods.length; i--; i) Native.genericize(object, methods[i], true);
- return arguments.callee;
-})
-(Array, ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice', 'toString', 'valueOf', 'indexOf', 'lastIndexOf'])
-(String, ['charAt', 'charCodeAt', 'concat', 'indexOf', 'lastIndexOf', 'match', 'replace', 'search', 'slice', 'split', 'substr', 'substring', 'toLowerCase', 'toUpperCase', 'valueOf']);
-
-function $chk(obj){
- return !!(obj || obj === 0);
-};
-
-function $clear(timer){
- clearTimeout(timer);
- clearInterval(timer);
- return null;
-};
-
-function $defined(obj){
- return (obj != undefined);
-};
-
-function $empty(){};
-
-function $arguments(i){
- return function(){
- return arguments[i];
- };
-};
-
-function $lambda(value){
- return (typeof value == 'function') ? value : function(){
- return value;
- };
-};
-
-function $extend(original, extended){
- for (var key in (extended || {})) original[key] = extended[key];
- return original;
-};
-
-function $unlink(object){
- var unlinked;
-
- switch ($type(object)){
- case 'object':
- unlinked = {};
- for (var p in object) unlinked[p] = $unlink(object[p]);
- break;
- case 'hash':
- unlinked = $unlink(object.getClean());
- break;
- case 'array':
- unlinked = [];
- for (var i = 0, l = object.length; i < l; i++) unlinked[i] = $unlink(object[i]);
- break;
- default: return object;
- }
-
- return unlinked;
-};
-
-function $merge(){
- var mix = {};
- for (var i = 0, l = arguments.length; i < l; i++){
- var object = arguments[i];
- if ($type(object) != 'object') continue;
- for (var key in object){
- var op = object[key], mp = mix[key];
- mix[key] = (mp && $type(op) == 'object' && $type(mp) == 'object') ? $merge(mp, op) : $unlink(op);
+Function.prototype.overloadGetter = function(usePlural){
+ var self = this;
+ return function(a){
+ var args, result;
+ if (usePlural || typeof a != 'string') args = a;
+ else if (arguments.length > 1) args = arguments;
+ if (args){
+ result = {};
+ for (var i = 0; i < args.length; i++) result[args[i]] = self.call(this, args[i]);
+ } else {
+ result = self.call(this, a);
}
- }
- return mix;
+ return result;
+ };
};
-function $pick(){
- for (var i = 0, l = arguments.length; i < l; i++){
- if (arguments[i] != undefined) return arguments[i];
- }
- return null;
+Function.prototype.extend = function(key, value){
+ this[key] = value;
+}.overloadSetter();
+
+Function.prototype.implement = function(key, value){
+ this.prototype[key] = value;
+}.overloadSetter();
+
+// From
+
+var slice = Array.prototype.slice;
+
+Function.from = function(item){
+ return (typeOf(item) == 'function') ? item : function(){
+ return item;
+ };
};
-function $random(min, max){
- return Math.floor(Math.random() * (max - min + 1) + min);
+Array.from = function(item){
+ if (item == null) return [];
+ return (Type.isEnumerable(item) && typeof item != 'string') ? (typeOf(item) == 'array') ? item : slice.call(item) : [item];
};
-function $splat(obj){
- var type = $type(obj);
- return (type) ? ((type != 'array' && type != 'arguments') ? [obj] : obj) : [];
+Number.from = function(item){
+ var number = parseFloat(item);
+ return isFinite(number) ? number : null;
};
-var $time = Date.now || function(){
- return new Date().getTime();
+String.from = function(item){
+ return item + '';
};
-function $try(){
- for (var i = 0, l = arguments.length; i < l; i++){
- try {
- return arguments[i]();
- } catch(e){}
- }
- return null;
-};
+// hide, protect
-function $type(obj){
- if (obj == undefined) return false;
- if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;
- if (obj.nodeName){
- switch (obj.nodeType){
- case 1: return 'element';
- case 3: return (/\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';
- }
- } else if (typeof obj.length == 'number'){
- if (obj.callee) return 'arguments';
- else if (obj.item) return 'collection';
- }
- return typeof obj;
-};
+Function.implement({
-var Hash = new Native({
+ hide: function(){
+ this.$hidden = true;
+ return this;
+ },
- name: 'Hash',
-
- initialize: function(object){
- if ($type(object) == 'hash') object = $unlink(object.getClean());
- for (var key in object) this[key] = object[key];
+ protect: function(){
+ this.$protected = true;
return this;
}
});
-Hash.implement({
-
- getLength: function(){
- var length = 0;
- for (var key in this){
- if (this.hasOwnProperty(key)) length++;
+// Type
+
+var Type = this.Type = function(name, object){
+ if (name){
+ var lower = name.toLowerCase();
+ var typeCheck = function(item){
+ return (typeOf(item) == lower);
+ };
+
+ Type['is' + name] = typeCheck;
+ if (object != null){
+ object.prototype.$family = (function(){
+ return lower;
+ }).hide();
+ //<1.2compat>
+ object.type = typeCheck;
+ //1.2compat>
}
- return length;
- },
+ }
+
+ if (object == null) return null;
+
+ object.extend(this);
+ object.$constructor = Type;
+ object.prototype.$constructor = object;
+
+ return object;
+};
+
+var toString = Object.prototype.toString;
+
+Type.isEnumerable = function(item){
+ return (item != null && typeof item.length == 'number' && toString.call(item) != '[object Function]' );
+};
+
+var hooks = {};
+
+var hooksOf = function(object){
+ var type = typeOf(object.prototype);
+ return hooks[type] || (hooks[type] = []);
+};
+
+var implement = function(name, method){
+ if (method && method.$hidden) return;
+
+ var hooks = hooksOf(this);
+
+ for (var i = 0; i < hooks.length; i++){
+ var hook = hooks[i];
+ if (typeOf(hook) == 'type') implement.call(hook, name, method);
+ else hook.call(this, name, method);
+ }
+
+ var previous = this.prototype[name];
+ if (previous == null || !previous.$protected) this.prototype[name] = method;
+
+ if (this[name] == null && typeOf(method) == 'function') extend.call(this, name, function(item){
+ return method.apply(item, slice.call(arguments, 1));
+ });
+};
+
+var extend = function(name, method){
+ if (method && method.$hidden) return;
+ var previous = this[name];
+ if (previous == null || !previous.$protected) this[name] = method;
+};
+
+Type.implement({
+
+ implement: implement.overloadSetter(),
+
+ extend: extend.overloadSetter(),
+
+ alias: function(name, existing){
+ implement.call(this, name, this.prototype[existing]);
+ }.overloadSetter(),
+
+ mirror: function(hook){
+ hooksOf(this).push(hook);
+ return this;
+ }
+
+});
+
+new Type('Type', Type);
+
+// Default Types
+
+var force = function(name, object, methods){
+ var isType = (object != Object),
+ prototype = object.prototype;
+
+ if (isType) object = new Type(name, object);
+
+ for (var i = 0, l = methods.length; i < l; i++){
+ var key = methods[i],
+ generic = object[key],
+ proto = prototype[key];
+
+ if (generic) generic.protect();
+
+ if (isType && proto){
+ delete prototype[key];
+ prototype[key] = proto.protect();
+ }
+ }
+
+ if (isType) object.implement(prototype);
+
+ return force;
+};
+
+force('String', String, [
+ 'charAt', 'charCodeAt', 'concat', 'indexOf', 'lastIndexOf', 'match', 'quote', 'replace', 'search',
+ 'slice', 'split', 'substr', 'substring', 'toLowerCase', 'toUpperCase'
+])('Array', Array, [
+ 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice',
+ 'indexOf', 'lastIndexOf', 'filter', 'forEach', 'every', 'map', 'some', 'reduce', 'reduceRight'
+])('Number', Number, [
+ 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision'
+])('Function', Function, [
+ 'apply', 'call', 'bind'
+])('RegExp', RegExp, [
+ 'exec', 'test'
+])('Object', Object, [
+ 'create', 'defineProperty', 'defineProperties', 'keys',
+ 'getPrototypeOf', 'getOwnPropertyDescriptor', 'getOwnPropertyNames',
+ 'preventExtensions', 'isExtensible', 'seal', 'isSealed', 'freeze', 'isFrozen'
+])('Date', Date, ['now']);
+
+Object.extend = extend.overloadSetter();
+
+Date.extend('now', function(){
+ return +(new Date);
+});
+
+new Type('Boolean', Boolean);
+
+// fixes NaN returning as Number
+
+Number.prototype.$family = function(){
+ return isFinite(this) ? 'number' : 'null';
+}.hide();
+
+// Number.random
+
+Number.extend('random', function(min, max){
+ return Math.floor(Math.random() * (max - min + 1) + min);
+});
+
+// forEach, each
+
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+Object.extend('forEach', function(object, fn, bind){
+ for (var key in object){
+ if (hasOwnProperty.call(object, key)) fn.call(bind, object[key], key, object);
+ }
+});
+
+Object.each = Object.forEach;
+
+Array.implement({
forEach: function(fn, bind){
- for (var key in this){
- if (this.hasOwnProperty(key)) fn.call(bind, this[key], key, this);
+ for (var i = 0, l = this.length; i < l; i++){
+ if (i in this) fn.call(bind, this[i], i, this);
}
},
-
+
+ each: function(fn, bind){
+ Array.forEach(this, fn, bind);
+ return this;
+ }
+
+});
+
+// Array & Object cloning, Object merging and appending
+
+var cloneOf = function(item){
+ switch (typeOf(item)){
+ case 'array': return item.clone();
+ case 'object': return Object.clone(item);
+ default: return item;
+ }
+};
+
+Array.implement('clone', function(){
+ var i = this.length, clone = new Array(i);
+ while (i--) clone[i] = cloneOf(this[i]);
+ return clone;
+});
+
+var mergeOne = function(source, key, current){
+ switch (typeOf(current)){
+ case 'object':
+ if (typeOf(source[key]) == 'object') Object.merge(source[key], current);
+ else source[key] = Object.clone(current);
+ break;
+ case 'array': source[key] = current.clone(); break;
+ default: source[key] = current;
+ }
+ return source;
+};
+
+Object.extend({
+
+ merge: function(source, k, v){
+ if (typeOf(k) == 'string') return mergeOne(source, k, v);
+ for (var i = 1, l = arguments.length; i < l; i++){
+ var object = arguments[i];
+ for (var key in object) mergeOne(source, key, object[key]);
+ }
+ return source;
+ },
+
+ clone: function(object){
+ var clone = {};
+ for (var key in object) clone[key] = cloneOf(object[key]);
+ return clone;
+ },
+
+ append: function(original){
+ for (var i = 1, l = arguments.length; i < l; i++){
+ var extended = arguments[i] || {};
+ for (var key in extended) original[key] = extended[key];
+ }
+ return original;
+ }
+
+});
+
+// Object-less types
+
+['Object', 'WhiteSpace', 'TextNode', 'Collection', 'Arguments'].each(function(name){
+ new Type(name);
+});
+
+// Unique ID
+
+var UID = Date.now();
+
+String.extend('uniqueID', function(){
+ return (UID++).toString(36);
+});
+
+//<1.2compat>
+
+var Hash = this.Hash = new Type('Hash', function(object){
+ if (typeOf(object) == 'hash') object = Object.clone(object.getClean());
+ for (var key in object) this[key] = object[key];
+ return this;
+});
+
+Hash.implement({
+
+ forEach: function(fn, bind){
+ Object.forEach(this, fn, bind);
+ },
+
getClean: function(){
var clean = {};
for (var key in this){
if (this.hasOwnProperty(key)) clean[key] = this[key];
}
return clean;
+ },
+
+ getLength: function(){
+ var length = 0;
+ for (var key in this){
+ if (this.hasOwnProperty(key)) length++;
+ }
+ return length;
}
});
-Hash.alias('forEach', 'each');
+Hash.alias('each', 'forEach');
-function $H(object){
+Object.type = Type.isObject;
+
+var Native = this.Native = function(properties){
+ return new Type(properties.name, properties.initialize);
+};
+
+Native.type = Type.type;
+
+Native.implement = function(objects, methods){
+ for (var i = 0; i < objects.length; i++) objects[i].implement(methods);
+ return Native;
+};
+
+var arrayType = Array.type;
+Array.type = function(item){
+ return instanceOf(item, Array) || arrayType(item);
+};
+
+this.$A = function(item){
+ return Array.from(item).slice();
+};
+
+this.$arguments = function(i){
+ return function(){
+ return arguments[i];
+ };
+};
+
+this.$chk = function(obj){
+ return !!(obj || obj === 0);
+};
+
+this.$clear = function(timer){
+ clearTimeout(timer);
+ clearInterval(timer);
+ return null;
+};
+
+this.$defined = function(obj){
+ return (obj != null);
+};
+
+this.$each = function(iterable, fn, bind){
+ var type = typeOf(iterable);
+ ((type == 'arguments' || type == 'collection' || type == 'array' || type == 'elements') ? Array : Object).each(iterable, fn, bind);
+};
+
+this.$empty = function(){};
+
+this.$extend = function(original, extended){
+ return Object.append(original, extended);
+};
+
+this.$H = function(object){
return new Hash(object);
};
-Array.implement({
+this.$merge = function(){
+ var args = Array.slice(arguments);
+ args.unshift({});
+ return Object.merge.apply(null, args);
+};
- forEach: function(fn, bind){
- for (var i = 0, l = this.length; i < l; i++) fn.call(bind, this[i], i, this);
+this.$lambda = Function.from;
+this.$mixin = Object.merge;
+this.$random = Number.random;
+this.$splat = Array.from;
+this.$time = Date.now;
+
+this.$type = function(object){
+ var type = typeOf(object);
+ if (type == 'elements') return 'array';
+ return (type == 'null') ? false : type;
+};
+
+this.$unlink = function(object){
+ switch (typeOf(object)){
+ case 'object': return Object.clone(object);
+ case 'array': return Array.clone(object);
+ case 'hash': return new Hash(object);
+ default: return object;
}
-
-});
-
-Array.alias('forEach', 'each');
-
-function $A(iterable){
- if (iterable.item){
- var array = [];
- for (var i = 0, l = iterable.length; i < l; i++) array[i] = iterable[i];
- return array;
- }
- return Array.prototype.slice.call(iterable);
};
-function $each(iterable, fn, bind){
- var type = $type(iterable);
- ((type == 'arguments' || type == 'collection' || type == 'array') ? Array : Hash).each(iterable, fn, bind);
-};
+//1.2compat>
-
-/*
-Script: Browser.js
- The Browser Core. Contains Browser initialization, Window and Document, and the Browser Hash.
-
-License:
- MIT-style license.
-*/
-
-var Browser = new Hash({
- Engine: {name: 'unknown', version: ''},
- Platform: {name: (navigator.platform.match(/mac|win|linux/i) || ['other'])[0].toLowerCase()},
- Features: {xpath: !!(document.evaluate), air: !!(window.runtime)},
- Plugins: {}
-});
-
-if (window.opera) Browser.Engine = {name: 'presto', version: (document.getElementsByClassName) ? 950 : 925};
-else if (window.ActiveXObject) Browser.Engine = {name: 'trident', version: (window.XMLHttpRequest) ? 5 : 4};
-else if (!navigator.taintEnabled) Browser.Engine = {name: 'webkit', version: (Browser.Features.xpath) ? 420 : 419};
-else if (document.getBoxObjectFor != null) Browser.Engine = {name: 'gecko', version: (document.getElementsByClassName) ? 19 : 18};
-Browser.Engine[Browser.Engine.name] = Browser.Engine[Browser.Engine.name + Browser.Engine.version] = true;
-
-if (window.orientation != undefined) Browser.Platform.name = 'ipod';
-
-Browser.Platform[Browser.Platform.name] = true;
-
-Browser.Request = function(){
- return $try(function(){
- return new XMLHttpRequest();
- }, function(){
- return new ActiveXObject('MSXML2.XMLHTTP');
- });
-};
-
-Browser.Features.xhr = !!(Browser.Request());
-
-Browser.Plugins.Flash = (function(){
- var version = ($try(function(){
- return navigator.plugins['Shockwave Flash'].description;
- }, function(){
- return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
- }) || '0 r0').match(/\d+/g);
- return {version: parseInt(version[0] || 0 + '.' + version[1] || 0), build: parseInt(version[2] || 0)};
})();
-function $exec(text){
- if (!text) return text;
- if (window.execScript){
- window.execScript(text);
- } else {
- var script = document.createElement('script');
- script.setAttribute('type', 'text/javascript');
- script.text = text;
- document.head.appendChild(script);
- document.head.removeChild(script);
- }
- return text;
-};
-
-Native.UID = 1;
-
-var $uid = (Browser.Engine.trident) ? function(item){
- return (item.uid || (item.uid = [Native.UID++]))[0];
-} : function(item){
- return item.uid || (item.uid = Native.UID++);
-};
-
-var Window = new Native({
-
- name: 'Window',
-
- legacy: (Browser.Engine.trident) ? null: window.Window,
-
- initialize: function(win){
- $uid(win);
- if (!win.Element){
- win.Element = $empty;
- if (Browser.Engine.webkit) win.document.createElement("iframe"); //fixes safari 2
- win.Element.prototype = (Browser.Engine.webkit) ? window["[[DOMElement.prototype]]"] : {};
- }
- return $extend(win, Window.Prototype);
- },
-
- afterImplement: function(property, value){
- window[property] = Window.Prototype[property] = value;
- }
-
-});
-
-Window.Prototype = {$family: {name: 'window'}};
-
-new Window(window);
-
-var Document = new Native({
-
- name: 'Document',
-
- legacy: (Browser.Engine.trident) ? null: window.Document,
-
- initialize: function(doc){
- $uid(doc);
- doc.head = doc.getElementsByTagName('head')[0];
- doc.html = doc.getElementsByTagName('html')[0];
- doc.window = doc.defaultView || doc.parentWindow;
- if (Browser.Engine.trident4) $try(function(){
- doc.execCommand("BackgroundImageCache", false, true);
- });
- return $extend(doc, Document.Prototype);
- },
-
- afterImplement: function(property, value){
- document[property] = Document.Prototype[property] = value;
- }
-
-});
-
-Document.Prototype = {$family: {name: 'document'}};
-
-new Document(document);
/*
-Script: Array.js
- Contains Array Prototypes like copy, each, contains, and remove.
+---
-License:
- MIT-style license.
+name: Array
+
+description: Contains Array Prototypes like each, contains, and erase.
+
+license: MIT-style license.
+
+requires: Type
+
+provides: Array
+
+...
*/
Array.implement({
+ /**/
every: function(fn, bind){
for (var i = 0, l = this.length; i < l; i++){
- if (!fn.call(bind, this[i], i, this)) return false;
+ if ((i in this) && !fn.call(bind, this[i], i, this)) return false;
}
return true;
},
@@ -426,14 +550,10 @@ Array.implement({
filter: function(fn, bind){
var results = [];
for (var i = 0, l = this.length; i < l; i++){
- if (fn.call(bind, this[i], i, this)) results.push(this[i]);
+ if ((i in this) && fn.call(bind, this[i], i, this)) results.push(this[i]);
}
return results;
},
-
- clean: function() {
- return this.filter($defined);
- },
indexOf: function(item, from){
var len = this.length;
@@ -445,16 +565,32 @@ Array.implement({
map: function(fn, bind){
var results = [];
- for (var i = 0, l = this.length; i < l; i++) results[i] = fn.call(bind, this[i], i, this);
+ for (var i = 0, l = this.length; i < l; i++){
+ if (i in this) results[i] = fn.call(bind, this[i], i, this);
+ }
return results;
},
some: function(fn, bind){
for (var i = 0, l = this.length; i < l; i++){
- if (fn.call(bind, this[i], i, this)) return true;
+ if ((i in this) && fn.call(bind, this[i], i, this)) return true;
}
return false;
},
+ /*!ES5>*/
+
+ clean: function(){
+ return this.filter(function(item){
+ return item != null;
+ });
+ },
+
+ invoke: function(methodName){
+ var args = Array.slice(arguments, 1);
+ return this.map(function(item){
+ return item[methodName].apply(item, args);
+ });
+ },
associate: function(keys){
var obj = {}, length = Math.min(this.length, keys.length);
@@ -480,8 +616,8 @@ Array.implement({
return this.indexOf(item, from) != -1;
},
- extend: function(array){
- for (var i = 0, j = array.length; i < j; i++) this.push(array[i]);
+ append: function(array){
+ this.push.apply(this, array);
return this;
},
@@ -490,7 +626,7 @@ Array.implement({
},
getRandom: function(){
- return (this.length) ? this[$random(0, this.length - 1)] : null;
+ return (this.length) ? this[Number.random(0, this.length - 1)] : null;
},
include: function(item){
@@ -504,7 +640,7 @@ Array.implement({
},
erase: function(item){
- for (var i = this.length; i--; i){
+ for (var i = this.length; i--;){
if (this[i] === item) this.splice(i, 1);
}
return this;
@@ -518,13 +654,20 @@ Array.implement({
flatten: function(){
var array = [];
for (var i = 0, l = this.length; i < l; i++){
- var type = $type(this[i]);
- if (!type) continue;
- array = array.concat((type == 'array' || type == 'collection' || type == 'arguments') ? Array.flatten(this[i]) : this[i]);
+ var type = typeOf(this[i]);
+ if (type == 'null') continue;
+ array = array.concat((type == 'array' || type == 'collection' || type == 'arguments' || instanceOf(this[i], Array)) ? Array.flatten(this[i]) : this[i]);
}
return array;
},
+ pick: function(){
+ for (var i = 0, l = this.length; i < l; i++){
+ if (this[i] != null) return this[i];
+ }
+ return null;
+ },
+
hexToRgb: function(array){
if (this.length != 3) return null;
var rgb = this.map(function(value){
@@ -547,125 +690,37 @@ Array.implement({
});
-/*
-Script: Function.js
- Contains Function Prototypes like create, bind, pass, and delay.
-
-License:
- MIT-style license.
-*/
-
-Function.implement({
-
- extend: function(properties){
- for (var property in properties) this[property] = properties[property];
- return this;
- },
-
- create: function(options){
- var self = this;
- options = options || {};
- return function(event){
- var args = options.arguments;
- args = (args != undefined) ? $splat(args) : Array.slice(arguments, (options.event) ? 1 : 0);
- if (options.event) args = [event || window.event].extend(args);
- var returns = function(){
- return self.apply(options.bind || null, args);
- };
- if (options.delay) return setTimeout(returns, options.delay);
- if (options.periodical) return setInterval(returns, options.periodical);
- if (options.attempt) return $try(returns);
- return returns();
- };
- },
-
- pass: function(args, bind){
- return this.create({arguments: args, bind: bind});
- },
-
- attempt: function(args, bind){
- return this.create({arguments: args, bind: bind, attempt: true})();
- },
-
- bind: function(bind, args){
- return this.create({bind: bind, arguments: args});
- },
-
- bindWithEvent: function(bind, args){
- return this.create({bind: bind, event: true, arguments: args});
- },
-
- delay: function(delay, bind, args){
- return this.create({delay: delay, bind: bind, arguments: args})();
- },
-
- periodical: function(interval, bind, args){
- return this.create({periodical: interval, bind: bind, arguments: args})();
- },
-
- run: function(args, bind){
- return this.apply(bind, $splat(args));
- }
-
-});
+//<1.2compat>
+
+Array.alias('extend', 'append');
+
+var $pick = function(){
+ return Array.from(arguments).pick();
+};
+
+//1.2compat>
+
/*
-Script: Number.js
- Contains Number Prototypes like limit, round, times, and ceil.
+---
-License:
- MIT-style license.
-*/
+name: String
-Number.implement({
+description: Contains String Prototypes like camelCase, capitalize, test, and toInt.
- limit: function(min, max){
- return Math.min(max, Math.max(min, this));
- },
+license: MIT-style license.
- round: function(precision){
- precision = Math.pow(10, precision || 0);
- return Math.round(this * precision) / precision;
- },
+requires: Type
- times: function(fn, bind){
- for (var i = 0; i < this; i++) fn.call(bind, i, this);
- },
+provides: String
- toFloat: function(){
- return parseFloat(this);
- },
-
- toInt: function(base){
- return parseInt(this, base || 10);
- }
-
-});
-
-Number.alias('times', 'each');
-
-(function(math){
- var methods = {};
- math.each(function(name){
- if (!Number[name]) methods[name] = function(){
- return Math[name].apply(null, [this].concat($A(arguments)));
- };
- });
- Number.implement(methods);
-})(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']);
-
-/*
-Script: String.js
- Contains String Prototypes like camelCase, capitalize, test, and toInt.
-
-License:
- MIT-style license.
+...
*/
String.implement({
test: function(regex, params){
- return ((typeof regex == 'string') ? new RegExp(regex, params) : regex).test(this);
+ return ((typeOf(regex) == 'regexp') ? regex : new RegExp('' + regex, params)).test(this);
},
contains: function(string, separator){
@@ -720,58 +775,333 @@ String.implement({
return (rgb) ? rgb.rgbToHex(array) : null;
},
- stripScripts: function(option){
- var scripts = '';
- var text = this.replace(/