summaryrefslogtreecommitdiff
path: root/lib/dojo/_base/query-sizzle.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dojo/_base/query-sizzle.js')
-rw-r--r--lib/dojo/_base/query-sizzle.js1445
1 files changed, 843 insertions, 602 deletions
diff --git a/lib/dojo/_base/query-sizzle.js b/lib/dojo/_base/query-sizzle.js
index ac26c1816..5d160ec55 100644
--- a/lib/dojo/_base/query-sizzle.js
+++ b/lib/dojo/_base/query-sizzle.js
@@ -5,624 +5,865 @@
*/
-if(!dojo._hasResource["dojo._base.query"]){
-dojo._hasResource["dojo._base.query"]=true;
-if(typeof dojo!="undefined"){
-dojo.provide("dojo._base.query");
-dojo.require("dojo._base.NodeList");
-dojo.query=function(_1,_2,_3){
-_3=_3||dojo.NodeList;
-if(!_1){
-return new _3();
-}
-if(_1.constructor==_3){
-return _1;
-}
-if(!dojo.isString(_1)){
-return new _3(_1);
-}
-if(dojo.isString(_2)){
-_2=dojo.byId(_2);
-if(!_2){
-return new _3();
-}
-}
-return dojo.Sizzle(_1,_2,new _3());
-};
-dojo._filterQueryResult=function(_4,_5){
-return dojo.Sizzle.filter(_5,_4);
-};
-}
-(function(ns){
-var _6=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,_7=0,_8=Object.prototype.toString;
-var _9=function(_a,_b,_c,_d){
-_c=_c||[];
-_b=_b||document;
-if(_b.nodeType!==1&&_b.nodeType!==9){
-return [];
-}
-if(!_a||typeof _a!=="string"){
-return _c;
-}
-var _e=[],m,_f,_10,_11,_12,_13,_14=true;
-_6.lastIndex=0;
-while((m=_6.exec(_a))!==null){
-_e.push(m[1]);
-if(m[2]){
-_13=RegExp.rightContext;
-break;
-}
-}
-if(_e.length>1&&_15.match.POS.exec(_a)){
-if(_e.length===2&&_15.relative[_e[0]]){
-var _16="",_17;
-while((_17=_15.match.POS.exec(_a))){
-_16+=_17[0];
-_a=_a.replace(_15.match.POS,"");
-}
-_f=_9.filter(_16,_9(_a,_b));
-}else{
-_f=_15.relative[_e[0]]?[_b]:_9(_e.shift(),_b);
-while(_e.length){
-var _18=[];
-_a=_e.shift();
-if(_15.relative[_a]){
-_a+=_e.shift();
-}
-for(var i=0,l=_f.length;i<l;i++){
-_9(_a,_f[i],_18);
-}
-_f=_18;
-}
-}
-}else{
-var ret=_d?{expr:_e.pop(),set:_19(_d)}:_9.find(_e.pop(),_e.length===1&&_b.parentNode?_b.parentNode:_b);
-_f=_9.filter(ret.expr,ret.set);
-if(_e.length>0){
-_10=_19(_f);
-}else{
-_14=false;
-}
-while(_e.length){
-var cur=_e.pop(),pop=cur;
-if(!_15.relative[cur]){
-cur="";
-}else{
-pop=_e.pop();
-}
-if(pop==null){
-pop=_b;
-}
-_15.relative[cur](_10,pop);
-}
-}
-if(!_10){
-_10=_f;
-}
-if(!_10){
-throw "Syntax error, unrecognized expression: "+(cur||_a);
-}
-if(_8.call(_10)==="[object Array]"){
-if(!_14){
-_c.push.apply(_c,_10);
-}else{
-if(_b.nodeType===1){
-for(var i=0;_10[i]!=null;i++){
-if(_10[i]&&(_10[i]===true||_10[i].nodeType===1&&_1a(_b,_10[i]))){
-_c.push(_f[i]);
-}
-}
-}else{
-for(var i=0;_10[i]!=null;i++){
-if(_10[i]&&_10[i].nodeType===1){
-_c.push(_f[i]);
-}
-}
-}
-}
-}else{
-_19(_10,_c);
-}
-if(_13){
-_9(_13,_b,_c,_d);
+if(!dojo._hasResource["dojo._base.query"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo._base.query"] = true;
+/*!
+ * Sizzle CSS Selector Engine - v0.9
+ * Copyright 2009, John Resig
+ * Redistributed with the Dojo Toolkit under the terms of the New BSD license.
+ * More information: http://sizzlejs.com/
+ *
+ * This version from github, dated 1/23/2009, commit: e374a73bbffc12ec3b5f252e7f76e593c508dfa5
+ * Modified for dojo loader, and to fit into dojo namespace. This was done by passing
+ * dojo object to anonymous function, then assigning Sizzle to dojo.Sizzle instead of window.Sizzle.
+ * Then an alias for dojo.query and dojo._filterQueryResult(). dojo.psuedos is not mapped.
+ * Finally, dojo.provide/require added.
+ */
+
+//This file gets copied to dojo/_base/query.js, so set the provide accordingly.
+if(typeof dojo != "undefined"){
+ dojo.provide("dojo._base.query");
+ dojo.require("dojo._base.NodeList");
+
+ //Start Dojo mappings.
+ dojo.query = function(/*String*/ query, /*String|DOMNode?*/ root, /*Function?*/listCtor){
+ listCtor = listCtor || dojo.NodeList;
+
+ if(!query){
+ return new listCtor();
+ }
+
+ if(query.constructor == listCtor){
+ return query;
+ }
+ if(!dojo.isString(query)){
+ return new listCtor(query); // dojo.NodeList
+ }
+ if(dojo.isString(root)){
+ root = dojo.byId(root);
+ if(!root){ return new listCtor(); }
+ }
+
+ return dojo.Sizzle(query, root, new listCtor());
+ }
+
+ dojo._filterQueryResult = function(nodeList, simpleFilter){
+ return dojo.Sizzle.filter(simpleFilter, nodeList);
+ }
}
-return _c;
+
+//Main Sizzle code follows...
+//ns argument, added for dojo, used at the end of the file.
+;(function(ns){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
+ done = 0,
+ toString = Object.prototype.toString;
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 )
+ return [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, check, mode, extra, prune = true;
+
+ // Reset the position of the chunker regexp (start from head)
+ chunker.lastIndex = 0;
+
+ while ( (m = chunker.exec(selector)) !== null ) {
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = RegExp.rightContext;
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && Expr.match.POS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ var later = "", match;
+
+ // Position selectors must be done after the filter
+ while ( (match = Expr.match.POS.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.POS, "" );
+ }
+
+ set = Sizzle.filter( later, Sizzle( selector, context ) );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ var tmpSet = [];
+
+ selector = parts.shift();
+ if ( Expr.relative[ selector ] )
+ selector += parts.shift();
+
+ for ( var i = 0, l = set.length; i < l; i++ ) {
+ Sizzle( selector, set[i], tmpSet );
+ }
+
+ set = tmpSet;
+ }
+ }
+ } else {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context );
+ set = Sizzle.filter( ret.expr, ret.set );
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop );
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, context, results, seed );
+ }
+
+ return results;
};
-_9.matches=function(_1b,set){
-return _9(_1b,null,null,set);
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
};
-_9.find=function(_1c,_1d){
-var set,_1e;
-if(!_1c){
-return [];
-}
-for(var i=0,l=_15.order.length;i<l;i++){
-var _1f=_15.order[i],_1e;
-if((_1e=_15.match[_1f].exec(_1c))){
-var _20=RegExp.leftContext;
-if(_20.substr(_20.length-1)!=="\\"){
-_1e[1]=(_1e[1]||"").replace(/\\/g,"");
-set=_15.find[_1f](_1e,_1d);
-if(set!=null){
-_1c=_1c.replace(_15.match[_1f],"");
-break;
-}
-}
-}
-}
-if(!set){
-set=_1d.getElementsByTagName("*");
-}
-return {set:set,expr:_1c};
+
+Sizzle.find = function(expr, context){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.match[ type ].exec( expr )) ) {
+ var left = RegExp.leftContext;
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
};
-_9.filter=function(_21,set,_22,not){
-var old=_21,_23=[],_24=set,_25,_26;
-while(_21&&set.length){
-for(var _27 in _15.filter){
-if((_25=_15.match[_27].exec(_21))!=null){
-var _28=_15.filter[_27],_29=null,_2a=0,_2b,_2c;
-_26=false;
-if(_24==_23){
-_23=[];
-}
-if(_15.preFilter[_27]){
-_25=_15.preFilter[_27](_25,_24,_22,_23,not);
-if(!_25){
-_26=_2b=true;
-}else{
-if(_25[0]===true){
-_29=[];
-var _2d=null,_2e;
-for(var i=0;(_2e=_24[i])!==undefined;i++){
-if(_2e&&_2d!==_2e){
-_29.push(_2e);
-_2d=_2e;
-}
-}
-}
-}
-}
-if(_25){
-for(var i=0;(_2c=_24[i])!==undefined;i++){
-if(_2c){
-if(_29&&_2c!=_29[_2a]){
-_2a++;
-}
-_2b=_28(_2c,_25,_2a,_29);
-var _2f=not^!!_2b;
-if(_22&&_2b!=null){
-if(_2f){
-_26=true;
-}else{
-_24[i]=false;
-}
-}else{
-if(_2f){
-_23.push(_2c);
-_26=true;
-}
-}
-}
-}
-}
-if(_2b!==undefined){
-if(!_22){
-_24=_23;
-}
-_21=_21.replace(_15.match[_27],"");
-if(!_26){
-return [];
-}
-break;
-}
-}
-}
-_21=_21.replace(/\s*,\s*/,"");
-if(_21==old){
-if(_26==null){
-throw "Syntax error, unrecognized expression: "+_21;
-}else{
-break;
-}
-}
-old=_21;
-}
-return _24;
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound;
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.match[ type ].exec( expr )) != null ) {
+ var filter = Expr.filter[ type ], goodArray = null, goodPos = 0, found, item;
+ anyFound = false;
+
+ if ( curLoop == result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match[0] === true ) {
+ goodArray = [];
+ var last = null, elem;
+ for ( var i = 0; (elem = curLoop[i]) !== undefined; i++ ) {
+ if ( elem && last !== elem ) {
+ goodArray.push( elem );
+ last = elem;
+ }
+ }
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) !== undefined; i++ ) {
+ if ( item ) {
+ if ( goodArray && item != goodArray[goodPos] ) {
+ goodPos++;
+ }
+
+ found = filter( item, match, goodPos, goodArray );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ expr = expr.replace(/\s*,\s*/, "");
+
+ // Improper expression
+ if ( expr == old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
};
-var _15=_9.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u0128-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u0128-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u0128-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[((?:[\w\u0128-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\]/,TAG:/^((?:[\w\u0128-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child\(?(even|odd|[\dn+-]*)\)?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)\(?(\d*)\)?(?:[^-]|$)/,PSEUDO:/:((?:[\w\u0128-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},relative:{"+":function(_30,_31){
-for(var i=0,l=_30.length;i<l;i++){
-var _32=_30[i];
-if(_32){
-var cur=_32.previousSibling;
-while(cur&&cur.nodeType!==1){
-cur=cur.previousSibling;
-}
-_30[i]=typeof _31==="string"?cur||false:cur===_31;
-}
-}
-if(typeof _31==="string"){
-_9.filter(_31,_30,true);
-}
-},">":function(_33,_34){
-if(typeof _34==="string"&&!/\W/.test(_34)){
-_34=_34.toUpperCase();
-for(var i=0,l=_33.length;i<l;i++){
-var _35=_33[i];
-if(_35){
-var _36=_35.parentNode;
-_33[i]=_36.nodeName===_34?_36:false;
-}
-}
-}else{
-for(var i=0,l=_33.length;i<l;i++){
-var _35=_33[i];
-if(_35){
-_33[i]=typeof _34==="string"?_35.parentNode:_35.parentNode===_34;
-}
-}
-if(typeof _34==="string"){
-_9.filter(_34,_33,true);
-}
-}
-},"":function(_37,_38){
-var _39="done"+(_7++),_3a=_3b;
-if(!_38.match(/\W/)){
-var _3c=_38=_38.toUpperCase();
-_3a=_3d;
-}
-_3a("parentNode",_38,_39,_37,_3c);
-},"~":function(_3e,_3f){
-var _40="done"+(_7++),_41=_3b;
-if(typeof _3f==="string"&&!_3f.match(/\W/)){
-var _42=_3f=_3f.toUpperCase();
-_41=_3d;
-}
-_41("previousSibling",_3f,_40,_3e,_42);
-}},find:{ID:function(_43,_44){
-if(_44.getElementById){
-var m=_44.getElementById(_43[1]);
-return m?[m]:[];
-}
-},NAME:function(_45,_46){
-return _46.getElementsByName?_46.getElementsByName(_45[1]):null;
-},TAG:function(_47,_48){
-return _48.getElementsByTagName(_47[1]);
-}},preFilter:{CLASS:function(_49,_4a,_4b,_4c,not){
-_49=" "+_49[1].replace(/\\/g,"")+" ";
-for(var i=0;_4a[i];i++){
-if(not^(" "+_4a[i].className+" ").indexOf(_49)>=0){
-if(!_4b){
-_4c.push(_4a[i]);
-}
-}else{
-if(_4b){
-_4a[i]=false;
-}
-}
-}
-return false;
-},ID:function(_4d){
-return _4d[1];
-},TAG:function(_4e){
-return _4e[1].toUpperCase();
-},CHILD:function(_4f){
-if(_4f[1]=="nth"){
-var _50=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(_4f[2]=="even"&&"2n"||_4f[2]=="odd"&&"2n+1"||!/\D/.test(_4f[2])&&"0n+"+_4f[2]||_4f[2]);
-_4f[2]=(_50[1]+(_50[2]||1))-0;
-_4f[3]=_50[3]-0;
-}
-_4f[0]="done"+(_7++);
-return _4f;
-},ATTR:function(_51){
-var _52=_51[1];
-if(_15.attrMap[_52]){
-_51[1]=_15.attrMap[_52];
-}
-if(_51[2]==="~="){
-_51[4]=" "+_51[4]+" ";
-}
-return _51;
-},PSEUDO:function(_53,_54,_55,_56,not){
-if(_53[1]==="not"){
-if(_53[3].match(_6).length>1){
-_53[3]=_9(_53[3],null,null,_54);
-}else{
-var ret=_9.filter(_53[3],_54,_55,true^not);
-if(!_55){
-_56.push.apply(_56,ret);
-}
-return false;
-}
-}
-return _53;
-},POS:function(_57){
-_57.unshift(true);
-return _57;
-}},filters:{enabled:function(_58){
-return _58.disabled===false&&_58.type!=="hidden";
-},disabled:function(_59){
-return _59.disabled===true;
-},checked:function(_5a){
-return _5a.checked===true;
-},selected:function(_5b){
-_5b.parentNode.selectedIndex;
-return _5b.selected===true;
-},parent:function(_5c){
-return !!_5c.firstChild;
-},empty:function(_5d){
-return !_5d.firstChild;
-},has:function(_5e,i,_5f){
-return !!_9(_5f[3],_5e).length;
-},header:function(_60){
-return /h\d/i.test(_60.nodeName);
-},text:function(_61){
-return "text"===_61.type;
-},radio:function(_62){
-return "radio"===_62.type;
-},checkbox:function(_63){
-return "checkbox"===_63.type;
-},file:function(_64){
-return "file"===_64.type;
-},password:function(_65){
-return "password"===_65.type;
-},submit:function(_66){
-return "submit"===_66.type;
-},image:function(_67){
-return "image"===_67.type;
-},reset:function(_68){
-return "reset"===_68.type;
-},button:function(_69){
-return "button"===_69.type||_69.nodeName.toUpperCase()==="BUTTON";
-},input:function(_6a){
-return /input|select|textarea|button/i.test(_6a.nodeName);
-}},setFilters:{first:function(_6b,i){
-return i===0;
-},last:function(_6c,i,_6d,_6e){
-return i===_6e.length-1;
-},even:function(_6f,i){
-return i%2===0;
-},odd:function(_70,i){
-return i%2===1;
-},lt:function(_71,i,_72){
-return i<_72[3]-0;
-},gt:function(_73,i,_74){
-return i>_74[3]-0;
-},nth:function(_75,i,_76){
-return _76[3]-0==i;
-},eq:function(_77,i,_78){
-return _78[3]-0==i;
-}},filter:{CHILD:function(_79,_7a){
-var _7b=_7a[1],_7c=_79.parentNode;
-var _7d=_7a[0];
-if(_7c&&!_7c[_7d]){
-var _7e=1;
-for(var _7f=_7c.firstChild;_7f;_7f=_7f.nextSibling){
-if(_7f.nodeType==1){
-_7f.nodeIndex=_7e++;
-}
-}
-_7c[_7d]=_7e-1;
-}
-if(_7b=="first"){
-return _79.nodeIndex==1;
-}else{
-if(_7b=="last"){
-return _79.nodeIndex==_7c[_7d];
-}else{
-if(_7b=="only"){
-return _7c[_7d]==1;
-}else{
-if(_7b=="nth"){
-var add=false,_80=_7a[2],_81=_7a[3];
-if(_80==1&&_81==0){
-return true;
-}
-if(_80==0){
-if(_79.nodeIndex==_81){
-add=true;
-}
-}else{
-if((_79.nodeIndex-_81)%_80==0&&(_79.nodeIndex-_81)/_80>=0){
-add=true;
-}
-}
-return add;
-}
-}
-}
-}
-},PSEUDO:function(_82,_83,i,_84){
-var _85=_83[1],_86=_15.filters[_85];
-if(_86){
-return _86(_82,i,_83,_84);
-}else{
-if(_85==="contains"){
-return (_82.textContent||_82.innerText||"").indexOf(_83[3])>=0;
-}else{
-if(_85==="not"){
-var not=_83[3];
-for(var i=0,l=not.length;i<l;i++){
-if(not[i]===_82){
-return false;
-}
-}
-return true;
-}
-}
-}
-},ID:function(_87,_88){
-return _87.nodeType===1&&_87.getAttribute("id")===_88;
-},TAG:function(_89,_8a){
-return (_8a==="*"&&_89.nodeType===1)||_89.nodeName===_8a;
-},CLASS:function(_8b,_8c){
-return _8c.test(_8b.className);
-},ATTR:function(_8d,_8e){
-var _8f=_8d[_8e[1]]||_8d.getAttribute(_8e[1]),_90=_8f+"",_91=_8e[2],_92=_8e[4];
-return _8f==null?false:_91==="="?_90===_92:_91==="*="?_90.indexOf(_92)>=0:_91==="~="?(" "+_90+" ").indexOf(_92)>=0:!_8e[4]?_8f:_91==="!="?_90!=_92:_91==="^="?_90.indexOf(_92)===0:_91==="$="?_90.substr(_90.length-_92.length)===_92:_91==="|="?_90===_92||_90.substr(0,_92.length+1)===_92+"-":false;
-},POS:function(_93,_94,i,_95){
-var _96=_94[2],_97=_15.setFilters[_96];
-if(_97){
-return _97(_93,i,_94,_95);
-}
-}}};
-for(var _98 in _15.match){
-_15.match[_98]=RegExp(_15.match[_98].source+/(?![^\[]*\])(?![^\(]*\))/.source);
-}
-var _19=function(_99,_9a){
-_99=Array.prototype.slice.call(_99);
-if(_9a){
-_9a.push.apply(_9a,_99);
-return _9a;
-}
-return _99;
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u0128-\uFFFF_-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u0128-\uFFFF_-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u0128-\uFFFF_-]|\\.)+)['"]*\]/,
+ ATTR: /\[((?:[\w\u0128-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\]/,
+ TAG: /^((?:[\w\u0128-\uFFFF\*_-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child\(?(even|odd|[\dn+-]*)\)?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)\(?(\d*)\)?(?:[^-]|$)/,
+ PSEUDO: /:((?:[\w\u0128-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
+ },
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ relative: {
+ "+": function(checkSet, part){
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var cur = elem.previousSibling;
+ while ( cur && cur.nodeType !== 1 ) {
+ cur = cur.previousSibling;
+ }
+ checkSet[i] = typeof part === "string" ?
+ cur || false :
+ cur === part;
+ }
+ }
+
+ if ( typeof part === "string" ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part){
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ part = part.toUpperCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = typeof part === "string" ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( typeof part === "string" ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part){
+ var doneName = "done" + (done++), checkFn = dirCheck;
+
+ if ( !part.match(/\W/) ) {
+ var nodeCheck = part = part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck);
+ },
+ "~": function(checkSet, part){
+ var doneName = "done" + (done++), checkFn = dirCheck;
+
+ if ( typeof part === "string" && !part.match(/\W/) ) {
+ var nodeCheck = part = part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck);
+ }
+ },
+ find: {
+ ID: function(match, context){
+ if ( context.getElementById ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context){
+ return context.getElementsByName ? context.getElementsByName(match[1]) : null;
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ for ( var i = 0; curLoop[i]; i++ ) {
+ if ( not ^ (" " + curLoop[i].className + " ").indexOf(match) >= 0 ) {
+ if ( !inplace )
+ result.push( curLoop[i] );
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1];
+ },
+ TAG: function(match){
+ return match[1].toUpperCase();
+ },
+ CHILD: function(match){
+ if ( match[1] == "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = "done" + (done++);
+
+ return match;
+ },
+ ATTR: function(match){
+ var name = match[1];
+
+ if ( Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( match[3].match(chunker).length > 1 ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 == i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 == i;
+ }
+ },
+ filter: {
+ CHILD: function(elem, match){
+ var type = match[1], parent = elem.parentNode;
+
+ var doneName = match[0];
+
+ if ( parent && !parent[ doneName ] ) {
+ var count = 1;
+
+ for ( var node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType == 1 ) {
+ node.nodeIndex = count++;
+ }
+ }
+
+ parent[ doneName ] = count - 1;
+ }
+
+ if ( type == "first" ) {
+ return elem.nodeIndex == 1;
+ } else if ( type == "last" ) {
+ return elem.nodeIndex == parent[ doneName ];
+ } else if ( type == "only" ) {
+ return parent[ doneName ] == 1;
+ } else if ( type == "nth" ) {
+ var add = false, first = match[2], last = match[3];
+
+ if ( first == 1 && last == 0 ) {
+ return true;
+ }
+
+ if ( first == 0 ) {
+ if ( elem.nodeIndex == last ) {
+ add = true;
+ }
+ } else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) {
+ add = true;
+ }
+
+ return add;
+ }
+ },
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
+ },
+ CLASS: function(elem, match){
+ return match.test( elem.className );
+ },
+ ATTR: function(elem, match){
+ var result = elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4];
+ return result == null ?
+ false :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !match[4] ?
+ result :
+ type === "!=" ?
+ value != check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
};
-try{
-Array.prototype.slice.call(document.documentElement.childNodes);
-}
-catch(e){
-_19=function(_9b,_9c){
-var ret=_9c||[];
-if(_8.call(_9b)==="[object Array]"){
-Array.prototype.push.apply(ret,_9b);
-}else{
-if(typeof _9b.length==="number"){
-for(var i=0,l=_9b.length;i<l;i++){
-ret.push(_9b[i]);
-}
-}else{
-for(var i=0;_9b[i];i++){
-ret.push(_9b[i]);
-}
-}
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
}
-return ret;
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes );
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
(function(){
-var _9d=document.createElement("form"),id="script"+(new Date).getTime();
-_9d.innerHTML="<input name='"+id+"'/>";
-var _9e=document.documentElement;
-_9e.insertBefore(_9d,_9e.firstChild);
-if(!!document.getElementById(id)){
-_15.find.ID=function(_9f,_a0){
-if(_a0.getElementById){
-var m=_a0.getElementById(_9f[1]);
-return m?m.id===_9f[1]||m.getAttributeNode&&m.getAttributeNode("id").nodeValue===_9f[1]?[m]:undefined:[];
-}
-};
-_15.filter.ID=function(_a1,_a2){
-var _a3=_a1.getAttributeNode&&_a1.getAttributeNode("id");
-return _a1.nodeType===1&&_a3&&_a3.nodeValue===_a2;
-};
-}
-_9e.removeChild(_9d);
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("form"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<input name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( !!document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context){
+ if ( context.getElementById ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || m.getAttributeNode && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = elem.getAttributeNode && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
})();
+
+// Check to see if the browser returns only elements
+// when doing getElementsByTagName("*")
(function(){
-var div=document.createElement("div");
-div.appendChild(document.createComment(""));
-if(div.getElementsByTagName("*").length>0){
-_15.find.TAG=function(_a4,_a5){
-var _a6=_a5.getElementsByTagName(_a4[1]);
-if(_a4[1]==="*"){
-var tmp=[];
-for(var i=0;_a6[i];i++){
-if(_a6[i].nodeType===1){
-tmp.push(_a6[i]);
-}
-}
-_a6=tmp;
-}
-return _a6;
-};
-}
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
})();
-if(document.querySelectorAll){
-(function(){
-var _a7=_9;
-_9=function(_a8,_a9,_aa,_ab){
-_a9=_a9||document;
-if(!_ab&&_a9.nodeType===9){
-try{
-return _19(_a9.querySelectorAll(_a8),_aa);
-}
-catch(e){
-}
-}
-return _a7(_a8,_a9,_aa,_ab);
-};
-_9.find=_a7.find;
-_9.filter=_a7.filter;
-_9.selectors=_a7.selectors;
-_9.matches=_a7.matches;
+
+if ( document.querySelectorAll ) (function(){
+ var oldSizzle = Sizzle;
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ if ( !seed && context.nodeType === 9 ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ Sizzle.find = oldSizzle.find;
+ Sizzle.filter = oldSizzle.filter;
+ Sizzle.selectors = oldSizzle.selectors;
+ Sizzle.matches = oldSizzle.matches;
})();
+
+if ( document.documentElement.getElementsByClassName ) {
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context) {
+ return context.getElementsByClassName(match[1]);
+ };
}
-if(document.documentElement.getElementsByClassName){
-_15.order.splice(1,0,"CLASS");
-_15.find.CLASS=function(_ac,_ad){
-return _ad.getElementsByClassName(_ac[1]);
-};
-}
-function _3d(dir,cur,_ae,_af,_b0){
-for(var i=0,l=_af.length;i<l;i++){
-var _b1=_af[i];
-if(_b1){
-_b1=_b1[dir];
-var _b2=false;
-while(_b1&&_b1.nodeType){
-var _b3=_b1[_ae];
-if(_b3){
-_b2=_af[_b3];
-break;
-}
-if(_b1.nodeType===1){
-_b1[_ae]=i;
-}
-if(_b1.nodeName===cur){
-_b2=_b1;
-break;
-}
-_b1=_b1[dir];
-}
-_af[i]=_b2;
-}
-}
-};
-function _3b(dir,cur,_b4,_b5,_b6){
-for(var i=0,l=_b5.length;i<l;i++){
-var _b7=_b5[i];
-if(_b7){
-_b7=_b7[dir];
-var _b8=false;
-while(_b7&&_b7.nodeType){
-if(_b7[_b4]){
-_b8=_b5[_b7[_b4]];
-break;
-}
-if(_b7.nodeType===1){
-_b7[_b4]=i;
-if(typeof cur!=="string"){
-if(_b7===cur){
-_b8=true;
-break;
-}
-}else{
-if(_9.filter(cur,[_b7]).length>0){
-_b8=_b7;
-break;
-}
-}
-}
-_b7=_b7[dir];
-}
-_b5[i]=_b8;
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem && elem.nodeType ) {
+ var done = elem[doneName];
+ if ( done ) {
+ match = checkSet[ done ];
+ break;
+ }
+
+ if ( elem.nodeType === 1 )
+ elem[doneName] = i;
+
+ if ( elem.nodeName === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem && elem.nodeType ) {
+ if ( elem[doneName] ) {
+ match = checkSet[ elem[doneName] ];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ elem[doneName] = i;
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
};
-var _1a=document.compareDocumentPosition?function(a,b){
-return a.compareDocumentPosition(b)&16;
-}:function(a,b){
-return a!==b&&(a.contains?a.contains(b):true);
-};
-(ns||window).Sizzle=_9;
-})(typeof dojo=="undefined"?null:dojo);
+
+// EXPOSE
+
+(ns || window).Sizzle = Sizzle;
+
+})(typeof dojo == "undefined" ? null : dojo);
+
}