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)
*/
var MooTools = { 'version': '1.2.1', 'build': '0d4845aab3d9a4fdee2f0d4a6dd59210e4b697cf'
};
varNative = function(options){
options = options || {}; var name = options.name; var legacy = options.legacy; var protect = options.protect; var methods = options.implement; var generics = options.generics; var initialize = options.initialize; var afterImplement = options.afterImplement || function(){}; var object = initialize || legacy;
generics = generics !== false;
(function(){ var natives = {'Array': Array, 'Date': Date, 'Function': Function, 'Number': Number, 'RegExp': RegExp, 'String': String}; for (var n in natives) newNative({name: n, initialize: natives[n], protect: true});
var types = {'boolean': Boolean, 'native': Native, 'object': Object}; for (var t in types) Native.typize(types[t], t);
var generics = { 'Array': ["concat", "indexOf", "join", "lastIndexOf", "pop", "push", "reverse", "shift", "slice", "sort", "splice", "toString", "unshift", "valueOf"], 'String': ["charAt", "charCodeAt", "concat", "indexOf", "lastIndexOf", "match", "replace", "search", "slice", "split", "substr", "substring", "toLowerCase", "toUpperCase", "valueOf"]
}; for (var g in generics){ for (var i = generics[g].length; i--;) Native.genericize(window[g], generics[g][i], true);
};
})();
var Hash = newNative({
name: 'Hash',
initialize: function(object){ if ($type(object) == 'hash') object = $unlink(object.getClean()); for (var key in object) this[key] = object[key]; returnthis;
}
});
Hash.implement({
forEach: function(fn, bind){ for (var key in this){ if (this.hasOwnProperty(key)) fn.call(bind, this[key], key, this);
}
},
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');
Array.implement({
forEach: function(fn, bind){ for (var i = 0, l = this.length; i < l; i++) fn.call(bind, this[i], i, this);
}
});
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 $arguments(i){ returnfunction(){ return arguments[i];
};
};
function $chk(obj){ return !!(obj || obj === 0);
};
function $clear(timer){
clearTimeout(timer);
clearInterval(timer); returnnull;
};
function $defined(obj){ return (obj != undefined);
};
function $each(iterable, fn, bind){ var type = $type(iterable);
((type == 'arguments' || type == 'collection' || type == 'array') ? Array : Hash).each(iterable, fn, bind);
};
function $empty(){};
function $extend(original, extended){ for (var key in (extended || {})) original[key] = extended[key]; return original;
};
function $H(object){ returnnew Hash(object);
};
function $lambda(value){ return (typeof value == 'function') ? value : function(){ return value;
};
};
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);
}
} return mix;
};
function $pick(){ for (var i = 0, l = arguments.length; i < l; i++){ if (arguments[i] != undefined) return arguments[i];
} returnnull;
};
function $random(min, max){ return Math.floor(Math.random() * (max - min + 1) + min);
};
function $splat(obj){ var type = $type(obj); return (type) ? ((type != 'array' && type != 'arguments') ? [obj] : obj) : [];
};
var $time = Date.now || function(){ return +new Date;
};
function $try(){ for (var i = 0, l = arguments.length; i < l; i++){ try { return arguments[i]();
} catch(e){}
} returnnull;
};
function $type(obj){ if (obj == undefined) returnfalse; 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';
}
} elseif (typeof obj.length == 'number'){ if (obj.callee) return'arguments'; elseif (obj.item) return'collection';
} returntypeof obj;
};
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 = new Hash(object); 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;
};
/* Script: Browser.js The Browser Core. Contains Browser initialization, Window and Document, and the Browser Hash.
/* Script: Array.js Contains Array Prototypes like each, contains, and erase.
License: MIT-style license.
*/
Array.implement({
every: function(fn, bind){ for (var i = 0, l = this.length; i < l; i++){ if (!fn.call(bind, this[i], i, this)) returnfalse;
} returntrue;
},
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]);
} return results;
},
indexOf: function(item, from){ var len = this.length; for (var i = (from < 0) ? Math.max(0, len + from) : from || 0; i < len; i++){ if (this[i] === item) return i;
} return -1;
},
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); return results;
},
some: function(fn, bind){ for (var i = 0, l = this.length; i < l; i++){ if (fn.call(bind, this[i], i, this)) returntrue;
} returnfalse;
},
associate: function(keys){ var obj = {}, length = Math.min(this.length, keys.length); for (var i = 0; i < length; i++) obj[keys[i]] = this[i]; return obj;
},
link: function(object){ var result = {}; for (var i = 0, l = this.length; i < l; i++){ for (var key in object){ if (object[key](this[i])){
result[key] = this[i]; delete object[key]; break;
}
}
} return result;
},
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]);
} return array;
},
hexToRgb: function(array){ if (this.length != 3) returnnull; var rgb = this.map(function(value){ if (value.length == 1) value += value; return value.toInt(16);
}); return (array) ? rgb : 'rgb(' + rgb + ')';
},
rgbToHex: function(array){ if (this.length < 3) returnnull; if (this.length == 4 && this[3] == 0 && !array) return'transparent'; var hex = []; for (var i = 0; i < 3; i++){ var bit = (this[i] - 0).toString(16);
hex.push((bit.length == 1) ? '0' + bit : bit);
} return (array) ? hex : '#' + hex.join('');
}
});
/* 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]; returnthis;
},
create: function(options){ var self = this;
options = options || {}; returnfunction(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();
};
},
stopPropagation: function(){ if (this.event.stopPropagation) this.event.stopPropagation(); elsethis.event.cancelBubble = true; returnthis;
},
preventDefault: function(){ if (this.event.preventDefault) this.event.preventDefault(); elsethis.event.returnValue = false; returnthis;
}
});
/* Script: Class.js Contains the Class Function for easily creating, extending, and implementing reusable Classes.
License: MIT-style license.
*/
varClass = newNative({
name: 'Class',
initialize: function(properties){
properties = properties || {}; var klass = function(){ for (var key in this){ if ($type(this[key]) != 'function') this[key] = $unlink(this[key]);
} this.constructor = klass; if (Class.prototyping) returnthis; var instance = (this.initialize) ? this.initialize.apply(this, arguments) : this; if (this.options && this.options.initialize) this.options.initialize.call(this); return instance;
};
for (var mutator in Class.Mutators){ if (!properties[mutator]) continue;
properties = Class.Mutators[mutator](properties, properties[mutator]); delete properties[mutator];
}
removeEvent: function(type, fn){
type = Events.removeOn(type); if (!this.$events[type]) returnthis; if (!fn.internal) this.$events[type].erase(fn); returnthis;
},
removeEvents: function(events){ if ($type(events) == 'object'){ for (var type in events) this.removeEvent(type, events[type]); returnthis;
} if (events) events = Events.removeOn(events); for (var type in this.$events){ if (events && events != type) continue;
var fns = this.$events[type]; for (var i = fns.length; i--; i) this.removeEvent(type, fns[i]);
} returnthis;
}
setOptions: function(){ this.options = $merge.run([this.options].extend(arguments)); if (!this.addEvent) returnthis; for (var option in this.options){ if ($type(this.options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue; this.addEvent(option, this.options[option]); deletethis.options[option];
} returnthis;
}
});
/* Script: Element.js One of the most important items in MooTools. Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements.
License: MIT-style license.
*/
var Element = new Native({
name: 'Element',
legacy: window.Element,
initialize: function(tag, props){
var konstructor = Element.Constructors.get(tag); if (konstructor) return konstructor(props); if (typeof tag == 'string') return document.newElement(tag, props); return $(tag).set(props);
},
afterImplement: function(key, value){
Element.Prototype[key] = value; if (Array[key]) return;
Elements.implement(key, function(){
var items = [], elements = true; for (var i = 0, j = this.length; i < j; i++){
var returns = this[i][key].apply(this[i], arguments);
items.push(returns); if (elements) elements = ($type(returns) == 'element');
} return (elements) ? new Elements(items) : items;
});
}
});
Element.Prototype = {$family: {name: 'element'}};
Element.Constructors = new Hash;
var IFrame = new Native({
name: 'IFrame',
generics: false,
initialize: function(){
var params = Array.link(arguments, {properties: Object.type, iframe: $defined});
var props = params.properties || {};
var iframe = $(params.iframe) || false;
var onload = props.onload || $empty; delete props.onload;
props.id = props.name = $pick(props.id, props.name, iframe.id, iframe.name, 'IFrame_' + $time());
iframe = new Element(iframe || 'iframe', props);
var onFrameLoad = function(){
var host = $try(function(){ return iframe.contentWindow.location.host;
}); if (host && host == window.location.host){
var win = new Window(iframe.contentWindow); new Document(iframe.contentWindow.document);
$extend(win.Element.prototype, Element.Prototype);
}
onload.call(iframe.contentWindow, iframe.contentWindow.document);
};
(window.frames[props.id]) ? onFrameLoad() : iframe.addListener('load', onFrameLoad); return iframe;
}
});
var Elements = new Native({
initialize: function(elements, options){
options = $extend({ddup: true, cash: true}, options);
elements = elements || []; if (options.ddup || options.cash){
var uniques = {}, returned = []; for (var i = 0, l = elements.length; i < l; i++){
var el = $.element(elements[i], !options.cash); if (options.ddup){ if (uniques[el.uid]) continue;
uniques[el.uid] = true;
}
returned.push(el);
}
elements = returned;
} return (options.cash) ? $extend(elements, this) : elements;
}
$.element = function(el, nocash){
$uid(el); if (!nocash && !el.$family && !(/^object|embed$/i).test(el.tagName)){
var proto = Element.Prototype; for (var p in proto) el[p] = proto[p];
}; return el;
};
var get = function(uid){ return (storage[uid] || (storage[uid] = {}));
};
var clean = function(item, retain){ if (!item) return;
var uid = item.uid; if (Browser.Engine.trident){ if (item.clearAttributes){
var clone = retain && item.cloneNode(false);
item.clearAttributes(); if (clone) item.mergeAttributes(clone);
} elseif (item.removeEvents){
item.removeEvents();
} if ((/object/i).test(item.tagName)){ for (var p in item){ if (typeof item[p] == 'function') item[p] = $empty;
}
Element.dispose(item);
}
} if (!uid) return;
collected[uid] = storage[uid] = null;
};
var purge = function(){
Hash.each(collected, clean); if (Browser.Engine.trident) $A(document.getElementsByTagName('object')).each(clean); if (window.CollectGarbage) CollectGarbage();
collected = storage = null;
};
var walk = function(element, walk, start, match, all, nocash){
var el = element[start || walk];
var elements = []; while (el){ if (el.nodeType == 1 && (!match || Element.match(el, match))){ if (!all) return $(el, nocash);
elements.push(el);
}
el = el[walk];
} return (all) ? new Elements(elements, {ddup: false, cash: !nocash}) : null;
};
var html = {
set: function(){
var html = Array.flatten(arguments).join('');
var wrap = Browser.Engine.trident && translations[this.get('tag')]; if (wrap){
var first = wrapper;
first.innerHTML = wrap[1] + html + wrap[2]; for (var i = wrap[0]; i--;) first = first.firstChild; this.empty().adopt(first.childNodes);
} else { this.innerHTML = html;
}
}
};
html.erase = html.set;
return html;
})();
if (Browser.Engine.webkit && Browser.Engine.version < 420) Element.Properties.text = {
get: function(){ if (this.innerText) returnthis.innerText;
var temp = this.ownerDocument.newElement('div', {html: this.innerHTML}).inject(this.ownerDocument.body);
var text = temp.innerText;
temp.destroy(); return text;
}
};
/* Script: Element.Event.js Contains Element methods for dealing with events, and custom Events.
addEvent: function(type, fn){
var events = this.retrieve('events', {});
events[type] = events[type] || {'keys': [], 'values': []}; if (events[type].keys.contains(fn)) returnthis;
events[type].keys.push(fn);
var realType = type, custom = Element.Events.get(type), condition = fn, self = this; if (custom){ if (custom.onAdd) custom.onAdd.call(this, fn); if (custom.condition){
condition = function(event){ if (custom.condition.call(this, event)) return fn.call(this, event); returntrue;
};
}
realType = custom.base || realType;
}
var defn = function(){ return fn.call(self);
};
var nativeEvent = Element.NativeEvents[realType]; if (nativeEvent){ if (nativeEvent == 2){
defn = function(event){
event = new Event(event, self.getWindow()); if (condition.call(self, event) === false) event.stop();
};
} this.addListener(realType, defn);
}
events[type].values.push(defn); returnthis;
},
removeEvent: function(type, fn){
var events = this.retrieve('events'); if (!events || !events[type]) returnthis;
var pos = events[type].keys.indexOf(fn); if (pos == -1) returnthis;
events[type].keys.splice(pos, 1);
var value = events[type].values.splice(pos, 1)[0];
var custom = Element.Events.get(type); if (custom){ if (custom.onRemove) custom.onRemove.call(this, fn);
type = custom.base || type;
} return (Element.NativeEvents[type]) ? this.removeListener(type, value) : this;
},
addEvents: function(events){ for (var event in events) this.addEvent(event, events[event]); returnthis;
},
removeEvents: function(events){ if ($type(events) == 'object'){ for (var type in events) this.removeEvent(type, events[type]); returnthis;
}
var attached = this.retrieve('events'); if (!attached) returnthis; if (!events){ for (var type in attached) this.removeEvents(type); this.eliminate('events');
} elseif (attached[events]){ while (attached[events].keys[0]) this.removeEvent(events, attached[events].keys[0]);
attached[events] = null;
} returnthis;
},
var $check = function(event){
var related = event.relatedTarget; if (related == undefined) returntrue; if (related === false) returnfalse; return ($type(this) != 'document' && related != this && related.prefix != 'xul' && !this.hasChild(related));
};
/* Script: Element.Dimensions.js Contains methods to work with size, scroll, or positioning of Elements and the window object.
License: MIT-style license.
Credits: - Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html). - Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html).
*/
/* Script: Selectors.js Adds advanced CSS Querying capabilities for targeting elements. Also includes pseudoselectors support.
License: MIT-style license.
*/
Native.implement([Document, Element], {
getElements: function(expression, nocash){
expression = expression.split(',');
var items, local = {}; for (var i = 0, l = expression.length; i < l; i++){
var selector = expression[i], elements = Selectors.Utils.search(this, selector, local); if (i != 0 && elements.item) elements = $A(elements);
items = (i == 0) ? elements : (items.item) ? $A(items).concat(elements) : items.concat(elements);
} returnnew Elements(items, {ddup: (expression.length > 1), cash: !nocash});
}
});
Element.implement({
match: function(selector){ if (!selector || (selector == this)) returntrue;
var tagid = Selectors.Utils.parseTagAndID(selector);
var tag = tagid[0], id = tagid[1]; if (!Selectors.Filters.byID(this, id) || !Selectors.Filters.byTag(this, tag)) returnfalse;
var parsed = Selectors.Utils.parseSelector(selector); return (parsed) ? Selectors.Utils.filter(this, parsed, {}) : true;
}
chk: function(item, uniques){ if (!uniques) returntrue;
var uid = $uid(item); if (!uniques[uid]) return uniques[uid] = true; returnfalse;
},
parseNthArgument: function(argument){ if (Selectors.Cache.nth[argument]) return Selectors.Cache.nth[argument];
var parsed = argument.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/); if (!parsed) returnfalse;
var inta = parseInt(parsed[1]);
var a = (inta || inta === 0) ? inta : 1;
var special = parsed[2] || false;
var b = parseInt(parsed[3]) || 0; if (a != 0){
b--; while (b < 1) b += a; while (b >= a) b -= a;
} else {
a = b;
special = 'index';
} switch (special){ case'n': parsed = {a: a, b: b, special: 'n'}; break; case'odd': parsed = {a: 2, b: 0, special: 'n'}; break; case'even': parsed = {a: 2, b: 1, special: 'n'}; break; case'first': parsed = {a: 0, special: 'index'}; break; case'last': parsed = {special: 'last-child'}; break; case'only': parsed = {special: 'only-child'}; break; default: parsed = {a: (a - 1), special: 'index'};
}
return Selectors.Cache.nth[argument] = parsed;
},
parseSelector: function(selector){ if (Selectors.Cache.parsed[selector]) return Selectors.Cache.parsed[selector];
var m, parsed = {classes: [], pseudos: [], attributes: []}; while ((m = Selectors.RegExps.combined.exec(selector))){
var cn = m[1], an = m[2], ao = m[3], av = m[5], pn = m[6], pa = m[7]; if (cn){
parsed.classes.push(cn);
} elseif (pn){
var parser = Selectors.Pseudo.get(pn); if (parser) parsed.pseudos.push({parser: parser, argument: pa}); else parsed.attributes.push({name: pn, operator: '=', value: pa});
} elseif (an){
parsed.attributes.push({name: an, operator: ao, value: av});
}
} if (!parsed.classes.length) delete parsed.classes; if (!parsed.attributes.length) delete parsed.attributes; if (!parsed.pseudos.length) delete parsed.pseudos; if (!parsed.classes && !parsed.attributes && !parsed.pseudos) parsed = null; return Selectors.Cache.parsed[selector] = parsed;
},
parseTagAndID: function(selector){
var tag = selector.match(Selectors.RegExps.tag);
var id = selector.match(Selectors.RegExps.id); return [(tag) ? tag[1] : '*', (id) ? id[1] : false];
},
filter: function(item, parsed, local){
var i; if (parsed.classes){ for (i = parsed.classes.length; i--; i){
var cn = parsed.classes[i]; if (!Selectors.Filters.byClass(item, cn)) returnfalse;
}
} if (parsed.attributes){ for (i = parsed.attributes.length; i--; i){
var att = parsed.attributes[i]; if (!Selectors.Filters.byAttribute(item, att.name, att.operator, att.value)) returnfalse;
}
} if (parsed.pseudos){ for (i = parsed.pseudos.length; i--; i){
var psd = parsed.pseudos[i]; if (!Selectors.Filters.byPseudo(item, psd.parser, psd.argument, local)) returnfalse;
}
} returntrue;
},
getByTagAndID: function(ctx, tag, id){ if (id){
--> --------------------
--> maximum size reached
--> --------------------
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.30Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.