📄 mootools-beta-1.2b2.js
字号:
case"~=":A+='[contains(concat(" ", @'+E[0]+', " "), " '+E[2]+' ")]';break;case"|=":A+='[contains(concat("-", @'+E[0]+', "-"), "-'+E[2]+'-")]';break;default:A+="[@"+E[0]+"]";}}B.push(A);return B;},getItems:function(B,E){var F=[];var G=E.getDocument();var A=G.evaluate(".//"+B.join(""),E,Selectors.XPath.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var D=0,C=A.snapshotLength;D<C;D++){F[D]=A.snapshotItem(D);}return F;},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false;}};Selectors.Filter={getParam:function(H,B,A,P,Q){var F=[];var R=P.tag;if(B){var C={},E,D,O,L,K;var G=function(S){S.uid=S.uid||[Native.UID++];if(!C[S.uid]&&Selectors.Filter.match(S,P,Q)){C[S.uid]=true;F.push(S);return true;}return false;};for(var N=0,M=H.length;N<M;N++){O=H[N];switch(B){case" ":D=O.getElementsByTagName(R);P.tag=false;for(L=0,K=D.length;L<K;L++){G(D[L]);}break;case">":D=O.childNodes;for(L=0,K=D.length;L<K;L++){if(D[L].nodeType==1){G(D[L]);}}break;case"+":while((O=O.nextSibling)){if(O.nodeType==1){G(O);break;}}break;case"~":while((O=O.nextSibling)){if(O.nodeType==1&&G(O)){break;}}break;}}return F;}if(P.id){el=A.getElementById(P.id,true);P.id=false;return(el&&Selectors.Filter.match(el,P,Q))?[el]:false;}else{H=A.getElementsByTagName(R);P.tag=false;for(var J=0,I=H.length;J<I;J++){if(Selectors.Filter.match(H[J],P,Q)){F.push(H[J]);}}}return F;},getItems:$arguments(0)};Selectors.Filter.match=function(C,E,G){G=G||{};if(E.id&&E.id!=C.id){return false;}if(E.tag&&E.tag!="*"&&E.tag!=C.tagName.toLowerCase()){return false;}var B;for(B=E.classes.length;B--;B){if(!C.className||!C.className.contains(E.classes[B]," ")){return false;}}for(B=E.attributes.length;B--;B){var D=E.attributes[B];var A=Element.prototype.getProperty.call(C,D[0]);if(!A){return false;}if(!D[1]){continue;}var F;switch(D[1]){case"=":F=(A==D[2]);break;case"*=":F=(A.contains(D[2]));break;case"^=":F=(A.substr(0,D[2].length)==D[2]);break;case"$=":F=(A.substr(A.length-D[2].length)==D[2]);break;case"!=":F=(A!=D[2]);break;case"~=":F=A.contains(D[2]," ");break;case"|=":F=A.contains(D[2],"-");}if(!F){return false;}}for(B=E.pseudos.length;B--;B){if(!E.pseudos[B].parser.filter.call(C,E.pseudos[B].argument,G)){return false;}}return true;};Selectors.Method=(Browser.Features.xpath)?Selectors.XPath:Selectors.Filter;Element.implement({match:function(A){return(!A||Selectors.Filter.match(this,Selectors.parse(A)));}});Selectors.Pseudo.enabled={xpath:function(){return"[not(@disabled)]";},filter:function(){return !(this.disabled);}};Selectors.Pseudo.empty={xpath:function(){return"[not(node())]";},filter:function(){return !(this.innerText||this.textContent||"").length;}};Selectors.Pseudo.contains={xpath:function(A){return'[contains(text(), "'+A+'")]';},filter:function(B){for(var A=this.childNodes.length;A--;A){var C=this.childNodes[A];if(C.nodeName&&C.nodeType==3&&C.nodeValue.contains(B)){return true;}}return false;}};Selectors.Pseudo.nth={parser:function(E){E=(E)?E.match(/^([+-]?\d*)?([devon]+)?([+-]?\d*)?$/):[null,1,"n",0];if(!E){return false;}var D=parseInt(E[1]);var B=($chk(D))?D:1;var C=E[2]||false;var A=parseInt(E[3])||0;A=A-1;while(A<1){A+=B;}while(A>=B){A-=B;}switch(C){case"n":return{a:B,b:A,special:"n"};case"odd":return{a:2,b:0,special:"n"};case"even":return{a:2,b:1,special:"n"};case"first":return{a:0,special:"index"};case"last":return{special:"last"};case"only":return{special:"only"};default:return{a:(B-1),special:"index"};}},xpath:function(A){switch(A.special){case"n":return"[count(preceding-sibling::*) mod "+A.a+" = "+A.b+"]";case"last":return"[count(following-sibling::*) = 0]";case"only":return"[not(preceding-sibling::* or following-sibling::*)]";default:return"[count(preceding-sibling::*) = "+A.a+"]";}},filter:function(A,I){var J=0,C=this;switch(A.special){case"n":I.Positions=I.Positions||{};if(!I.Positions[this.uid]){var D=this.parentNode.childNodes;for(var G=0,F=D.length;G<F;G++){var B=D[G];if(B.nodeType!=1){continue;}B.uid=B.uid||[Native.UID++];I.Positions[B.uid]=J++;}}return(I.Positions[this.uid]%A.a==A.b);case"last":while((C=C.nextSibling)){if(C.nodeType==1){return false;}}return true;case"only":var E=C;while((E=E.previousSibling)){if(E.nodeType==1){return false;}}var H=C;while((H=H.nextSibling)){if(H.nodeType==1){return false;}}return true;case"index":while((C=C.previousSibling)){if(C.nodeType==1&&++J>A.a){return false;}}return true;}return false;}};Selectors.Pseudo.extend({even:{parser:function(){return{a:2,b:1,special:"n"};},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},odd:{parser:function(){return{a:2,b:0,special:"n"};},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},first:{parser:function(){return{a:0,special:"index"};},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},last:{parser:function(){return{special:"last"};},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},only:{parser:function(){return{special:"only"};},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter}});Element.Events.domready={onAdd:function(E){if(Browser.loaded){return E.call(this);}var H=this,D=this.getWindow(),G=this.getDocument();var C=function(){if(!arguments.callee.done){arguments.callee.done=true;E.call(H);}return true;};var I=(Browser.Engine.webkit)?["loaded","complete"]:"complete";var B=function(J){if(I.contains(J.readyState)){return C();}return false;};if(G.readyState&&Browser.Engine.webkit){(function(){if(!B(G)){arguments.callee.delay(50);}})();}else{if(G.readyState&&Browser.Engine.trident){var F=$("ie_domready");if(!F){var A=(D.location.protocol=="https:")?"//:":"javascript:void(0)";G.write('<script id="ie_domready" defer src="'+A+'"><\/script>');F=$("ie_domready");}if(!B(F)){F.addEvent("readystatechange",B.pass(F));}}else{D.addEvent("load",C);G.addEvent("DOMContentLoaded",C);}}return null;}};window.addEvent("domready",function(){Browser.loaded=true;});var JSON=new Hash({encode:function(B){switch($type(B)){case"string":return'"'+B.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(B.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var A=[];Hash.each(B,function(E,D){var C=JSON.encode(E);if(C){A.push(JSON.encode(D)+":"+C);}});return"{"+String(A)+"}";case"number":case"boolean":return String(B);case false:return"null";}return null;},$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(A){return JSON.$specialChars[A]||"\\u00"+Math.floor(A.charCodeAt()/16).toString(16)+(A.charCodeAt()%16).toString(16);},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null;}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(B,A){this.key=B;this.setOptions(A);},write:function(B){B=encodeURIComponent(B);if(this.options.domain){B+="; domain="+this.options.domain;}if(this.options.path){B+="; path="+this.options.path;}if(this.options.duration){var A=new Date();A.setTime(A.getTime()+this.options.duration*24*60*60*1000);B+="; expires="+A.toGMTString();}if(this.options.secure){B+="; secure";}this.options.document.cookie=this.key+"="+B;return this;},read:function(){var A=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return A?decodeURIComponent(A[1]):null;},erase:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});Cookie.set=function(B,C,A){return new Cookie(B,A).write(C);};Cookie.get=function(A){return new Cookie(A).read();};Cookie.remove=function(B,A){return new Cookie(B,A).erase();};var Color=new Native({initialize:function(B,C){if(arguments.length>=3){C="rgb";B=Array.slice(arguments,0,3);}else{if(typeof B=="string"){if(B.match(/rgb/)){B=B.rgbToHex().hexToRgb(true);}else{if(B.match(/hsb/)){B=B.hsbToRgb();}else{B=B.hexToRgb(true);}}}}C=C||"rgb";switch(C){case"hsb":var A=B;B=B.hsbToRgb();B.hsb=A;break;case"hex":B=B.hexToRgb(true);break;}B.rgb=B.slice(0,3);B.hsb=B.hsb||B.rgbToHsb();B.hex=B.rgbToHex();return $extend(B,this);}});Color.implement({mix:function(){var A=Array.slice(arguments);var C=($type(A.getLast())=="number")?A.pop():50;var B=this.slice();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C));}});return new Color(B,"rgb");},invert:function(){return new Color(this.map(function(A){return 255-A;}));},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb");},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb");},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb");}});function $RGB(C,B,A){return new Color([C,B,A],"rgb");}function $HSB(C,B,A){return new Color([C,B,A],"hsb");}function $HEX(A){return new Color(A,"hex");}Array.implement({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0;}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A;}else{if(C==I){G=2+D-L;}else{G=4+A-D;}}G/=6;if(G<0){G++;}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)];},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C];}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D];}}return false;}});String.implement({rgbToHsb:function(){var A=this.match(/\d{1,3}/g);return(A)?hsb.rgbToHsb():null;},hsbToRgb:function(){var A=this.match(/\d{1,3}/g);return(A)?A.hsbToRgb():null;}});var Swiff=function(J,K){if(!Swiff.fixed){Swiff.fix();}var I="Swiff_"+Native.UID++;K=$merge({id:I,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},events:{},vars:{}},K);var D=K.params,E=K.vars,B=K.id;var F=$extend({height:K.height,width:K.width},K.properties);Swiff.Events[I]={};for(var A in K.events){Swiff.Events[I][A]=function(){K.events[A].call($(K.id));};E[A]="Swiff.Events."+I+"."+A;}D.flashVars=Hash.toQueryString(E);if(Browser.Engine.trident){F.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";D.movie=J;}else{F.type="application/x-shockwave-flash";F.data=J;}var H='<object id="'+K.id+'"';for(var G in F){H+=" "+G+'="'+F[G]+'"';}H+=">";for(var C in D){H+='<param name="'+C+'" value="'+D[C]+'" />';}H+="</object>";return($(K.container)||new Element("div")).set("html",H).firstChild;};Swiff.extend({Events:{},remote:function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs);},getVersion:function(){if(!$defined(Swiff.pluginVersion)){var A;if(navigator.plugins&&navigator.mimeTypes.length){A=navigator.plugins["Shockwave Flash"];if(A&&A.description){A=A.description;}}else{if(Browser.Engine.trident){A=$try(function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");});}}Swiff.pluginVersion=(typeof A=="string")?parseInt(A.match(/\d+/)[0]):0;}return Swiff.pluginVersion;},fix:function(){Swiff.fixed=true;window.addEvent("beforeunload",function(){__flash_unloadHandler=__flash_savedUnloadHandler=$empty;});if(!Browser.Engine.trident){return ;}window.addEvent("unload",function(){Array.each(document.getElementsByTagName("object"),function(B){B.style.display="none";for(var A in B){if(typeof B[A]=="function"){B[A]=$empty;}}});});}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={};},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false;}else{this.events[B].push(A);}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]));},this);return this;},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false;},this);if(!D){return ;}this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A);},this);}});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore",transition:function(A){return -(Math.cos(Math.PI*A)-1)/2;}},initialize:function(A){this.pass=this.pass||this;this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -