mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-01 15:55:03 -04:00
4 lines
29 KiB
JavaScript
4 lines
29 KiB
JavaScript
|
// Developed by Robert Nyman/DOMAssistant team, code/licensing: http://domassistant.googlecode.com/, documentation: http://www.domassistant.com/documentation, version 2.8
|
||
|
var DOMAssistant=function(){var j=function(){},o=window,g=o.$,k=o.$$,d=/*@cc_on!@*/false,i=d&&parseFloat(navigator.appVersion)<6,h,c={},q={},a=true,n=Array.prototype.slice,p={accesskey:"accessKey","class":"className",colspan:"colSpan","for":"htmlFor",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",valign:"vAlign",cellspacing:"cellSpacing",cellpadding:"cellPadding"},m={rules:/\s*,\s*/g,selector:/^(\w+|\*)?(#[\w\u00C0-\uFFFF\-=$]+)?((\.[\w\u00C0-\uFFFF\-]+)*)?((\[\w+\s*([~^$*|])?(=\s*([-\w\u00C0-\uFFFF\s.]+|"[^"]*"|'[^']*'))?\]+)*)?((:\w[-\w]*(\((odd|even|\-?\d*n?([-+]\d+)?|[:#]?[-\w\u00C0-\uFFFF.]+|"[^"]*"|'[^']*'|((\w*\.[-\w\u00C0-\uFFFF]+)*)?|(\[#?\w+([~^$*|])?=?[-\w\u00C0-\uFFFF\s.'"]+\]+)|(:\w[-\w]*\(.+\)))\))?)*)?([+>~])?/,selectorSplit:/(?:\[.*\]|\(.*\)|[^\s+>~[(])+|[+>~]/g,id:/^#([-\w\u00C0-\uFFFF=$]+)$/,tag:/^\w+/,relation:/^[+>~]$/,pseudo:/^:(\w[-\w]*)(\((.+)\))?$/,pseudos:/:(\w[-\w]*)(\((([^(]+)|([^(]+\([^(]+)\))\))?/g,attribs:/\[(\w+)\s*([~^$*|])?(=)?\s*([^\[\]]*|"[^"]*"|'[^']*')?\](?=$|\[|:|\s)/g,classes:/\.([-\w\u00C0-\uFFFF]+)/g,quoted:/^["'](.*)["']$/,nth:/^((odd|even)|([1-9]\d*)|((([1-9]\d*)?)n([-+]\d+)?)|(-(([1-9]\d*)?)n\+(\d+)))$/,special:/(:check|:enabl|\bselect)ed\b/},f=function(t,u,r){var s=t.tagName;while((t=t[u+"Sibling"])&&(t.nodeType!==1||(r?t.tagName!==s:t.tagName==="!"))){}return t},b=function(r){return typeof r!=="undefined"},l=function(r){return(l=r[0].compareDocumentPosition?function(s){return s.sort(function(u,t){return 3-(u.compareDocumentPosition(t)&6)})}:d?function(s){return s.sort(function(u,t){return u.sourceIndex-t.sourceIndex})}:function(s){return s.sort(function(w,u){var v=document.createRange(),t=document.createRange();v.setStart(w,0);v.setEnd(w,0);t.setStart(u,0);t.setEnd(u,0);return v.compareBoundaryPoints(Range.START_TO_END,t)})})(r)};var e=function(s,r){s.push.apply(s,n.apply(r));return s};if(d){e=function(t,s){if(s.slice){return t.concat(s)}var r=0,u;while((u=s[r++])){t[t.length]=u}return t}}return{isIE:d,camel:p,def:b,allMethods:[],publicMethods:["prev","next","hasChild","cssSelect","elmsByClass","elmsByAttribute","elmsByTag"],harmonize:function(){o.$=g;o.$$=k;return this},initCore:function(){this.applyMethod.call(o,"$",this.$);this.applyMethod.call(o,"$$",this.$$);o.DOMAssistant=this;if(d){j=Array}j.prototype=[];(function(r){r.each=function(v,u){for(var t=0,s=this.length;t<s;t++){if(v.call(u||this[t],this[t],t,this)===false){break}}return this};r.first=function(){return b(this[0])?DOMAssistant.addMethodsToElm(this[0]):null};r.end=function(){return this.previousSet};r.indexOf=r.indexOf||function(u){for(var t=0,s=this.length;t<s;t++){if(t in this&&this[t]===u){return t}}return -1};r.map=function(w,v){var u=[];for(var t=0,s=this.length;t<s;t++){if(t in this){u[t]=w.call(v||this[t],this[t],t,this)}}return u};r.filter=function(w,v){var u=new j();u.previousSet=this;for(var t=0,s=this.length;t<s;t++){if(t in this&&w.call(v||this[t],this[t],t,this)){u.push(this[t])}}return u};r.every=function(v,u){for(var t=0,s=this.length;t<s;t++){if(t in this&&!v.call(u||this[t],this[t],t,this)){return false}}return true};r.some=function(v,u){for(var t=0,s=this.length;t<s;t++){if(t in this&&v.call(u||this[t],this[t],t,this)){return true}}return false}})(j.prototype);this.attach(this)},addMethods:function(r,s){if(!b(this.allMethods[r])){this.allMethods[r]=s;this.addHTMLArrayPrototype(r,s)}},addMethodsToElm:function(s){for(var r in this.allMethods){if(b(this.allMethods[r])){this.applyMethod.call(s,r,this.allMethods[r])}}return s},applyMethod:function(s,r){if(typeof this[s]!=="function"){this[s]=r}},attach:function(t){var r=t.publicMethods;if(!b(r)){for(var v in t){if(v!=="init"&&b(t[v])){this.addMethods(v,t[v])}}}else{if(r.constructor===Array){for(var s=0,u;(u=r[s]);s++){this.addMethods(u,t[u])}}}if(typeof t.init==="function"){t.init()}},addHTMLArrayPrototype:function(r,s){j.prototype[r]=function(){var v=new j();v.previousSet=this;for(var u=0,t=this.length;u<t;u++){v.push(s.apply(DOMAssistant.$$(this[u]),arguments))}return v}},cleanUp:function(u){var s=u.all||u.getEle
|
||
|
/*@cc_on @if(@_win32||@_win64)document.write("<script id=\"ieScriptLoad\" defer src=\"//:\"><\/script>");document.getElementById("ieScriptLoad").onreadystatechange=function(){if(this.readyState==="complete"){e()}}@end@*/
|
||
|
if(document.addEventListener){document.addEventListener("DOMContentLoaded",e,false)}if(/KHTML|WebKit|iCab/i.test(navigator.userAgent)){a=setInterval(function(){if(/loaded|complete/i.test(document.readyState)){e();clearInterval(a)}},10)}window.onload=e;return{DOMReady:function(){for(var j=0,h=arguments.length,k;j<h;j++){k=arguments[j];if(!k.DOMReady&&!b[k]){if(typeof k==="string"){b[k]=true;k=new Function(k)}k.DOMReady=true;f.push(k)}}if(g){d()}},setErrorHandling:function(h){c=h}}}();DOMAssistant.DOMReady=DOMAssistant.DOMLoad.DOMReady;
|