node-min.js revision 9deeb19e619d3ec49429bb3cb6e11ac94f60c1d0
YUI.add("node-base",function(C){var H=Array.prototype.slice,G=".",E="nodeName",J="nodeType",B="ownerDocument",I="tagName",D="_yuid",F=function(M){var L=M[D];if(L&&F._instances[L]&&F._instances[L]._node!==M){M[D]=null;}this._initPlugins();L=C.stamp(M);if(!L){L=C.guid();}this[D]=L;this._conf={};this._node=M;this._stateProxy=M;F._instances[L]=this;},K=function(M){var L=null;if(M){L=(typeof M==="string")?function(N){return C.Selector.test(N,M);}:function(N){return M(F.get(N));};}return L;};F.NAME="Node";F.re_aria=/^(?:role$|aria-)/;F.DOM_EVENTS={abort:true,beforeunload:true,blur:true,change:true,click:true,close:true,command:true,contextmenu:true,drag:true,dragstart:true,dragenter:true,dragover:true,dragleave:true,dragend:true,drop:true,dblclick:true,error:true,focus:true,keydown:true,keypress:true,keyup:true,load:true,mousedown:true,mousemove:true,mouseout:true,mouseover:true,mouseup:true,mousemultiwheel:true,mousewheel:true,submit:true,mouseenter:true,mouseleave:true,scroll:true,reset:true,resize:true,select:true,textInput:true,unload:true};C.mix(F.DOM_EVENTS,C.Env.evt.plugins);F._instances={};F.plug=function(){var L=H.call(arguments,0);L.unshift(F);C.Plugin.Host.plug.apply(C.Base,L);return F;};F.unplug=function(){var L=H.call(arguments,0);L.unshift(F);C.Plugin.Host.unplug.apply(C.Base,L);return F;};F.getDOMNode=function(L){if(L){return(L.nodeType)?L:L._node||null;}return null;};F.scrubVal=function(M,L){if(L&&M){if(typeof M==="object"||typeof M==="function"){if(J in M||C.DOM.isWindow(M)){M=F.get(M);}else{if(M.item||(M[0]&&M[0][J])){M=C.all(M);}}}}else{if(M===undefined){M=L;}}return M;};F.addMethod=function(L,N,M){if(L&&N&&typeof N==="function"){F.prototype[L]=function(){M=M||this;var P=H.call(arguments),O;if(P[0]&&P[0] instanceof F){P[0]=P[0]._node;}if(P[1]&&P[1] instanceof F){P[1]=P[1]._node;}P.unshift(this._node);O=F.scrubVal(N.apply(M,P),this);return O;};}else{}};F.importMethod=function(N,L,M){if(typeof L==="string"){M=M||L;F.addMethod(M,N[L],N);}else{C.each(L,function(O){F.importMethod(N,O);});}};F.get=function(O,P){var L=null,N,M;if(O){if(typeof O==="string"){if(O.indexOf("doc")===0){O=C.config.doc;}else{if(O.indexOf("win")===0){O=C.config.win;}else{O=C.Selector.query(O,P,true);}}if(!O){return null;}}else{if(O instanceof F){return O;}}M=O._yuid;L=F._instances[M];N=L?L._node:null;if(!L||(N&&O!==N)){L=new F(O);}}return L;};F.create=function(){return F.get(C.DOM.create.apply(C.DOM,arguments));};F.ATTRS={text:{getter:function(){return C.DOM.getText(this._node);},setter:function(L){C.DOM.setText(this._node,L);return L;}},"options":{getter:function(){return this.getElementsByTagName("option");}},"elements":{getter:function(){return C.all(this._node.elements);}},"children":{getter:function(){var O=this._node,N=O.children,P,M,L;if(!N){P=O.childNodes;N=[];for(M=0,L=P.length;M<L;++M){if(P[M][I]){N[N.length]=P[M];}}}return C.all(N);}},value:{getter:function(){return C.DOM.getValue(this._node);},setter:function(L){C.DOM.setValue(this._node,L);return L;}},getter:function(){return this._data;},setter:function(L){this._data=L;return L;}};F.DEFAULT_SETTER=function(L,N){var M=this._stateProxy,O;if(L.indexOf(G)>-1){O=L;L=L.split(G);C.Object.setValue(M,L,N);}else{if(M[L]!==undefined){M[L]=N;}}return N;};F.DEFAULT_GETTER=function(L){var M=this._stateProxy,N;if(L.indexOf&&L.indexOf(G)>-1){N=C.Object.getValue(M,L.split(G));}else{if(M[L]!==undefined){N=M[L];}}return N?C.Node.scrubVal(N,this):N;};C.augment(F,C.Event.Target);C.augment(F,C.Plugin.Host);C.mix(F.prototype,{toString:function(){var N="",M=this[D]+": not bound to a node",L=this._node;if(L){N+=L[E];if(L.id){N+="#"+L.id;}if(L.className){N+="."+L.className.replace(" ",".");}N+=" "+this[D];}return N||M;},get:function(L){var M=F.ATTRS[L],N;if(M&&M.getter){N=M.getter.call(this);}else{if(F.re_aria.test(L)){N=this._node.getAttribute(L,2);}else{N=F.DEFAULT_GETTER.apply(this,arguments);}}return N;},set:function(L,N){var M=F.ATTRS[L];if(M&&M.setter){M.setter.call(this,N);}else{if(F.re_aria.test(L)){this._node.setAttribute(L,N);}else{F.DEFAULT_SETTER.apply(this,arguments);}}return this;},create:F.create,compareTo:function(L){var M=this._node;if(L instanceof C.Node){L=L._node;}return M===L;},inDoc:function(M){var L=this._node;M=(M)?M._node||M:L[B];if(M.documentElement){return C.DOM.contains(M.documentElement,L);}},getById:function(N){var M=this._node,L=C.DOM.byId(N,M[B]);if(L&&C.DOM.contains(M,L)){L=C.get(L);}else{L=null;}return L;},ancestor:function(L){return F.get(C.DOM.elementByAxis(this._node,"parentNode",K(L)));},previous:function(M,L){return F.get(C.DOM.elementByAxis(this._node,"previousSibling",K(M),L));},next:function(N,M,L){return F.get(C.DOM.elementByAxis(this._node,"nextSibling",K(M),L));},query:function(L){return C.get(C.Selector.query(L,this._node,true));},queryAll:function(L){return C.all(C.Selector.query(L,this._node));},test:function(L){return C.Selector.test(this._node,L);},remove:function(){var L=this._node;L.parentNode.removeChild(L);return this;},replace:function(L){var M=this._node;M.parentNode.replaceChild(L,M);return this;},purge:function(M,L){C.Event.purgeElement(this._node,M,L);},destroy:function(L){delete F._instances[this[D]];if(L){this.purge(true);}this._node=null;},invoke:function(S,M,L,R,Q,P){var O=this._node,N;if(M&&M instanceof C.Node){M=M._node;}if(L&&L instanceof C.Node){L=L._node;}N=O[S](M,L,R,Q,P);return C.Node.scrubVal(N,this);},each:function(M,L){L=L||this;return M.call(L,this);},item:function(L){return this;},size:function(){return this._node?1:0;},insert:function(M,L){if(M){if(typeof L==="number"){L=this._node.childNodes[L];}if(M._node){M=M._node;}C.DOM.addHTML(this._node,M,L);}return this;},prepend:function(L){return this.insert(L,0);},append:function(L){return this.insert(L,null);},setContent:function(L){C.DOM.addHTML(this._node,L,"replace");return this;},hasMethod:function(M){var L=this._node;return(L&&(typeof L==="function"));}},true);C.Node=F;C.get=C.Node.get;C.first=C.Node.get;C.Array._diff=function(M,L){var Q=[],S=false,O,N,R,P;
outer:for(O=0,R=M.length;O<R;O++){S=false;for(N=0,P=L.length;N<P;N++){if(M[O]===L[N]){S=true;continue outer;}}if(!S){Q[Q.length]=M[O];}}return Q;};C.Array.diff=function(M,L){return{added:C.Array._diff(L,M),removed:C.Array._diff(M,L)};};var A=function(M){var L=M.nodes||[],N=M.doc||C.config.doc;if(typeof L==="string"){this._query=L;L=C.Selector.query(L,N);}C.stamp(this);A._instances[this[D]]=this;this._nodes=L;};A.NAME="NodeList";A.getDOMNodes=function(L){return L._nodes;};A._instances=[];A.each=function(L,O,N){var M=L._nodes;if(M&&M.length){C.Array.each(M,O,N||L);}else{}};A.addMethod=function(L,O,N){var M=A._getTempNode();if(L&&O){A.prototype[L]=function(){var Q=[],P=arguments;C.Array.each(this._nodes,function(V){var U="_yuid",S=C.Node._instances[V[U]],T,R;if(!S){S=M;M._node=V;}T=N||S;R=O.apply(T,P);if(R!==undefined&&R!==S){Q[Q.length]=R;}});return Q.length?Q:this;};}else{}};A.importMethod=function(N,L,M){if(typeof L==="string"){M=M||L;A.addMethod(L,N[L]);}else{C.each(L,function(O){A.importMethod(N,O);});}};A._getTempNode=function(){var L=A._tempNode;if(!L){L=C.Node.create("<div></div>");A._tempNode=L;}return L;};C.mix(A.prototype,{item:function(L){return C.get((this._nodes||[])[L]);},each:function(N,M){var L=this;C.Array.each(this._nodes,function(P,O){P=C.get(P);return N.call(M||P,P,O,L);});return L;},batch:function(N,M){var O=this,L=A._getTempNode();C.Array.each(this._nodes,function(R,Q){var P=C.Node._instances[R[D]];if(!P){P=L;L._node=R;}return N.call(M||P,P,Q,O);});return O;},some:function(N,M){var L=this;return C.Array.some(this._nodes,function(P,O){P=C.get(P);M=M||P;return N.call(M,P,O,L);});},indexOf:function(L){return C.Array.indexOf(this._nodes,C.Node.getDOMNode(L));},filter:function(L){return C.all(C.Selector.filter(this._nodes,L));},modulus:function(N,M){M=M||0;var L=[];A.each(this,function(P,O){if(O%N===M){L.push(P);}});return C.all(L);},odd:function(){return this.modulus(2,1);},even:function(){return this.modulus(2);},destructor:function(){delete A._instances[this[D]];},refresh:function(){var M,L,N=this._nodes;if(this._query){if(N&&N[0]&&N[0].ownerDocument){M=N[0].ownerDocument;}this._nodes=C.Selector.query(this._query,M||C.config.doc);L=C.Array.diff(N,this._nodes);L.added=L.added?C.all(L.added):null;L.removed=L.removed?C.all(L.removed):null;this.fire("refresh",L);}return this;},on:function(P,O,N,M){var L=H(arguments);L[2]=N||this;this.batch(function(Q){Q.on.apply(Q,L);});},after:function(P,O,N,M){var L=H(arguments);L[2]=N||this;this.batch(function(Q){Q.after.apply(Q,L);});},size:function(){return this._nodes.length;},get:function(M){var L=[],N=A._getTempNode();A.each(this,function(P){var O=C.Node._instances[P[D]];if(!O){O=N;N._node=P;}L[L.length]=O.get(M);});return L;},toString:function(){var O="",N=this[D]+": not bound to any nodes",L=this._nodes,M;if(L&&L[0]){M=L[0];O+=M[E];if(M.id){O+="#"+M.id;}if(M.className){O+="."+M.className.replace(" ",".");}if(L.length>1){O+="...["+L.length+" items]";}}return O||N;}},true);A.importMethod(C.Node.prototype,["append","detach","detachAll","insert","plug","prepend","remove","set","setContent","unplug"]);C.NodeList=A;C.all=function(M,O,L){var N=new A({nodes:M,doc:O});return N;};C.Node.all=C.all;C.Array.each(["replaceChild","appendChild","insertBefore","removeChild","hasChildNodes","cloneNode","hasAttribute","removeAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select"],function(L){C.Node.prototype[L]=function(P,N,M){var O=this.invoke(L,P,N,M);return O;};});F.importMethod(C.DOM,["contains","setAttribute","getAttribute"]);if(!document.documentElement.hasAttribute){C.Node.prototype.hasAttribute=function(L){return C.DOM.getAttribute(C.Node.getDOMNode(this),L)!=="";};}C.NodeList.importMethod(C.Node.prototype,["getAttribute","setAttribute"]);(function(M){var L=["hasClass","addClass","removeClass","replaceClass","toggleClass"];M.Node.importMethod(M.DOM,L);M.NodeList.importMethod(M.Node.prototype,L);})(C);C.Node.prototype.delegate=function(Q,P,L,O){O=O||this;var N=Array.prototype.slice.call(arguments,4),M=["delegate",P,C.Node.getDOMNode(this),Q,L,O];M=M.concat(N);return C.on.apply(C,M);};},"@VERSION@",{requires:["dom-base","event-custom","selector-css2"]});YUI.add("node-style",function(A){(function(C){var B=["getStyle","getComputedStyle","setStyle","setStyles"];C.Node.importMethod(C.DOM,B);C.NodeList.importMethod(C.Node.prototype,B);})(A);},"@VERSION@",{requires:["dom-style","node-base"]});YUI.add("node-screen",function(A){A.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(B){A.Node.ATTRS[B]={getter:function(){var C=Array.prototype.slice.call(arguments);C.unshift(A.Node.getDOMNode(this));return A.DOM[B].apply(this,C);}};});A.Node.ATTRS.scrollLeft={getter:function(){var B=A.Node.getDOMNode(this);return("scrollLeft" in B)?B.scrollLeft:A.DOM.docScrollX(B);},setter:function(C){var B=A.Node.getDOMNode(this);if(B){if("scrollLeft" in B){B.scrollLeft=C;}else{if(B.document||B.nodeType===9){A.DOM._getWin(B).scrollTo(C,A.DOM.docScrollY(B));}}}else{}}};A.Node.ATTRS.scrollTop={getter:function(){var B=A.Node.getDOMNode(this);return("scrollTop" in B)?B.scrollTop:A.DOM.docScrollY(B);},setter:function(C){var B=A.Node.getDOMNode(this);if(B){if("scrollTop" in B){B.scrollTop=C;}else{if(B.document||B.nodeType===9){A.DOM._getWin(B).scrollTo(A.DOM.docScrollX(B),C);}}}else{}}};A.Node.importMethod(A.DOM,["getXY","setXY","getX","setX","getY","setY"]);A.Node.ATTRS.region={getter:function(){var B=A.Node.getDOMNode(this);if(B&&!B.tagName){if(B.nodeType===9){B=B.documentElement;}else{if(B.alert){B=B.document.documentElement;}}}return A.DOM.region(B);}};A.Node.ATTRS.viewportRegion={getter:function(){return A.DOM.viewportRegion(A.Node.getDOMNode(this));}};A.Node.importMethod(A.DOM,"inViewportRegion");A.Node.prototype.intersect=function(B,D){var C=A.Node.getDOMNode(this);if(B instanceof A.Node){B=A.Node.getDOMNode(B);}return A.DOM.intersect(C,B,D);};A.Node.prototype.inRegion=function(B,D,E){var C=A.Node.getDOMNode(this);
if(B instanceof A.Node){B=A.Node.getDOMNode(B);}return A.DOM.inRegion(C,B,D,E);};},"@VERSION@",{requires:["dom-screen"]});YUI.add("node",function(A){},"@VERSION@",{use:["node-base","node-style","node-screen"],skinnable:false,requires:["dom"]});