Changeset 5270 for lang/javascript
- Timestamp:
- 01/22/08 15:58:08 (5 years ago)
- Location:
- lang/javascript
- Files:
-
- 3 added
- 1 removed
- 19 modified
- 7 copied
-
bokuscheme (added)
-
bokuscheme/lib.scm (added)
-
bokuscheme/scheme.js (added)
-
javascript-xpath/bindings/jquery/ChangeLog (modified) (1 diff)
-
javascript-xpath/bindings/jquery/release/xpath4jquery-latest.js (modified) (3 diffs)
-
javascript-xpath/bindings/jquery/version.txt (modified) (1 diff)
-
javascript-xpath/bindings/prototype/ChangeLog (modified) (1 diff)
-
javascript-xpath/bindings/prototype/release/xpath4prototype-latest.js (modified) (2 diffs)
-
javascript-xpath/bindings/prototype/version.txt (modified) (1 diff)
-
javascript-xpath/branches/support-namespace/ChangeLog (modified) (1 diff)
-
javascript-xpath/branches/support-namespace/Makefile (modified) (5 diffs)
-
javascript-xpath/branches/support-namespace/release/javascript-xpath-0.1.7-cmp.js (copied) (copied from lang/javascript/javascript-xpath/trunk/release/javascript-xpath-0.1.7-cmp.js)
-
javascript-xpath/branches/support-namespace/release/javascript-xpath-0.1.7.js (copied) (copied from lang/javascript/javascript-xpath/trunk/release/javascript-xpath-0.1.7.js)
-
javascript-xpath/branches/support-namespace/release/javascript-xpath-0.1.8-cmp.js (copied) (copied from lang/javascript/javascript-xpath/trunk/release/javascript-xpath-0.1.8-cmp.js)
-
javascript-xpath/branches/support-namespace/release/javascript-xpath-0.1.8.js (copied) (copied from lang/javascript/javascript-xpath/trunk/release/javascript-xpath-0.1.8.js)
-
javascript-xpath/branches/support-namespace/release/javascript-xpath-latest-cmp.js (modified) (9 diffs)
-
javascript-xpath/branches/support-namespace/release/javascript-xpath-latest.js (modified) (11 diffs)
-
javascript-xpath/branches/support-namespace/src/api.js (modified) (3 diffs)
-
javascript-xpath/branches/support-namespace/src/config.js (deleted)
-
javascript-xpath/branches/support-namespace/src/functionCall.js (modified) (2 diffs)
-
javascript-xpath/branches/support-namespace/src/head.js (modified) (1 diff)
-
javascript-xpath/branches/support-namespace/src/stepExpr.js (modified) (3 diffs)
-
javascript-xpath/branches/support-namespace/test/functional/analyze-test.html (modified) (1 diff)
-
javascript-xpath/branches/support-namespace/test/functional/config.js (copied) (copied from lang/javascript/javascript-xpath/trunk/test/functional/config.js)
-
javascript-xpath/branches/support-namespace/test/functional/data/0009 (copied) (copied from lang/javascript/javascript-xpath/trunk/test/functional/data/0009)
-
javascript-xpath/branches/support-namespace/test/functional/dist-test-template.html (copied) (copied from lang/javascript/javascript-xpath/trunk/test/functional/dist-test-template.html)
-
javascript-xpath/branches/support-namespace/test/functional/index.html (modified) (1 diff)
-
javascript-xpath/branches/support-namespace/test/functional/logger.js (modified) (13 diffs)
-
javascript-xpath/branches/support-namespace/tools/compress.sh (modified) (1 diff)
-
javascript-xpath/branches/support-namespace/version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/javascript-xpath/bindings/jquery/ChangeLog
r1692 r5270 1 == 0.1.2 / 2007-11-16 drry 2 3 * fixed namespace resolver 4 1 5 == 0.1.2 / 2007-11-16 amachang <seijro@gmail.com> 2 6 -
lang/javascript/javascript-xpath/bindings/jquery/release/xpath4jquery-latest.js
r1692 r5270 1 /* XPath for jQuery 0.1. 21 /* XPath for jQuery 0.1.3 2 2 * (c) 2007 Cybozu Labs, Inc. 3 3 * … … 56 56 57 57 context = context || document; 58 59 expr = document.createExpression(expr, function (prefix) { 60 var o = document.createNSResolver(context)(prefix); 61 if (o) return o; 62 return (document.contentType == "application/xhtml+xml") ? "http://www.w3.org/1999/xhtml" : ""; 63 }); 58 expr = document.createExpression(expr, null); 64 59 65 60 switch (type) { … … 68 63 case Boolean: return expr.evaluate(context, 3, null).booleanValue; 69 64 case Array: { 70 if (ordered) 65 if (ordered) 71 66 result = expr.evaluate(context, 7, null); 72 67 else -
lang/javascript/javascript-xpath/bindings/jquery/version.txt
r1692 r5270 1 0.1. 21 0.1.3 -
lang/javascript/javascript-xpath/bindings/prototype/ChangeLog
r1701 r5270 1 == 0.1.3 / 2007-11-16 drry 2 3 * fixed Namespace Resolver 4 1 5 == 0.1.2 / 2007-11-16 amachang <seijro@gmail.com> 2 6 -
lang/javascript/javascript-xpath/bindings/prototype/release/xpath4prototype-latest.js
r1701 r5270 1 /* XPath for Prototype 0.1. 21 /* XPath for Prototype 0.1.3 2 2 * (c) 2007 Cybozu Labs, Inc. 3 3 * … … 39 39 var type = ordered ? 7 : 6; 40 40 41 expr = document.createExpression(expr, function (prefix) { 42 var o = document.createNSResolver(context)(prefix); 43 if (o) return o; 44 return (document.contentType == "application/xhtml+xml") ? "http://www.w3.org/1999/xhtml" : ""; 45 }); 41 expr = document.createExpression(expr, null); 46 42 47 43 var result = expr.evaluate(context, type, null); -
lang/javascript/javascript-xpath/bindings/prototype/version.txt
r1701 r5270 1 0.1. 21 0.1.3 -
lang/javascript/javascript-xpath/branches/support-namespace/ChangeLog
r1783 r5270 1 == 0.1.8 / 2007-11-19 amachang <seijro@gmail.com> 2 3 * fixed IE's //select[@id="foo"] problem thanks nya 4 * fixed compress tool 5 6 == 0.1.7 / 2007-11-19 amachang <seijro@gmail.com> 7 8 * added config 'exportInstaller' (default value is false) 9 * added config 'useNative' (default value is true) 10 * added functional/dist-test.html and functional/dist-cmp-test.html 11 * fixed codes to pass the compress tool 12 1 13 == 0.1.6 / 2007-11-14 amachang <seijro@gmail.com> 2 14 -
lang/javascript/javascript-xpath/branches/support-namespace/Makefile
r1783 r5270 18 18 19 19 SRC_FILES = ${SRC_DIR}/head.js\ 20 ${SRC_DIR}/config.js\21 20 ${SRC_DIR}/global_decls.js\ 22 21 ${SRC_DIR}/uai.js\ … … 49 48 FUNCTEST_ORIGINAL = ${FUNC_TEST_DIR}/index.html 50 49 FUNCTEST_ANALYZE = ${FUNC_TEST_DIR}/analyze-test.html 50 FUNCTEST_DIST_TEMPLATE = ${FUNC_TEST_DIR}/dist-test-template.html 51 FUNCTEST_DIST = ${FUNC_TEST_DIR}/dist-test.html 52 FUNCTEST_DIST_CMP = ${FUNC_TEST_DIR}/dist-cmp-test.html 51 53 52 54 FUNCTEST_NOXHR = ${FUNC_TEST_DIR}/index-no-xhr.html … … 59 61 @@echo "JavaScript-XPath build complete" 60 62 61 jsxpath: ${JSXPATH_CMP} ${TESTDATA_LOCALJS} ${FUNCTEST_NOXHR} ${FUNCTEST_ANALYZE_NOXHR} 63 jsxpath: ${JSXPATH_CMP} ${TESTDATA_LOCALJS} ${FUNCTEST_NOXHR} ${FUNCTEST_ANALYZE_NOXHR} ${FUNCTEST_DIST} ${FUNCTEST_DIST_CMP} 64 62 65 63 66 ${DIST_DIR}: … … 73 76 ${FUNCTEST_ANALYZE_NOXHR}: 74 77 @@sed -e "s/<!--LOCAL_DATA_HERE-->/<script type=\"text\/javascript\" src=\"\.\/testdatas.js\"><\/script>/g" ${FUNCTEST_ANALYZE} > $@ 78 79 ${FUNCTEST_DIST}: 80 @@cat ${FUNCTEST_DIST_TEMPLATE} | sed s/@VERSION/${VER}/ > $@ 81 82 ${FUNCTEST_DIST_CMP}: 83 @@cat ${FUNCTEST_DIST_TEMPLATE} | sed s/@VERSION/${VER}-cmp/ > $@ 75 84 76 85 ${JSXPATH}: ${DIST_DIR} ${VERSION_FILE} ${SRC_FILES} Makefile … … 98 107 @@rm ${FUNCTEST_NOXHR} 99 108 @@rm ${FUNCTEST_ANALYZE_NOXHR} 109 @@rm ${FUNCTEST_DIST} 110 @@rm ${FUNCTEST_DIST_CMP} 100 111 @@rm ${TESTDATA_LOCALJS} 101 112 @@rm ${DIST_DIR}/* -
lang/javascript/javascript-xpath/branches/support-namespace/release/javascript-xpath-latest-cmp.js
r1783 r5270 1 if(!document.implementation||!document.implementation.hasFeature||!document.implementation.hasFeature("XPath",null))(function(){var ca=void(0);var da={targetFrame:ca,useInnerText:true};var ea;if(window.jsxpath){ea=window.jsxpath;}1 (function(){var ca=void(0);var da={targetFrame:ca,exportInstaller:false,useNative:true,useInnerText:true};var ea;if(window.jsxpath){ea=window.jsxpath;} 2 2 else{var fa=document.getElementsByTagName('script');var ga=fa[fa.length-1];var ha=ga.src;ea={};var ia=ha.match(/\?(.*)$/);if(ia){var ja=ia[1].split('&');for(var i=0,l=ja.length;i<l;i++){var ka=ja[i];var la=ka.split('=');var ma=la[0];var na=la[1];if(configValue==ca){configValue==true;} 3 3 else if(configValue=='false'||/^-?d+$/.test(configValue)){configValue=eval(configValue);} 4 4 ea[ma]=configValue;}}} 5 for(var n in da){if(!(n in ea))ea[n]=da[n]} 5 for(var n in da){if(!(n in ea))ea[n]=da[n];} 6 ea.hasNative=!!(document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null));if(ea.hasNative&&ea.useNative&&!ea.exportInstaller){return;} 6 7 var oa;var pa;var qa;var ra;var sa;var ta;var va;var wa;var xa;var ya;var za;var Aa;var Ba;var Ca;var Da=new function(){var ua=navigator.userAgent;if(RegExp==ca){if(ua.indexOf("Opera")>=0){this.opera=true;} 7 8 else if(ua.indexOf("Netscape")>=0){this.netscape=true;} … … 14 15 else if(ua.indexOf("BSD")>=0){this.bsd=true;} 15 16 else if(ua.indexOf("SunOS")>=0){this.sunos=true;}} 16 else{ n/*@cc_on @if(@_jscript)function jscriptVersion(){switch(@_jscript_version){case 3.0:return "4.0";case 5.0:return "5.0";case 5.1:return "5.01";case 5.5:return "5.5";case 5.6:if("XMLHttpRequest" in window)return "7.0";return "6.0";case 5.7:return "7.0";default:return true;}}17 else{ /*@cc_on @if(@_jscript)function jscriptVersion(){switch(@_jscript_version){case 3.0:return "4.0";case 5.0:return "5.0";case 5.1:return "5.01";case 5.5:return "5.5";case 5.6:if("XMLHttpRequest" in window)return "7.0";return "6.0";case 5.7:return "7.0";default:return true;}} 17 18 if(@_win16||@_win32||@_win64){this.windows=true;this.trident=jscriptVersion();} 18 19 else if(@_mac||navigator.platform.indexOf("Mac")>=0){this.mac=true;this.tasman=jscriptVersion();} 19 if(/MSIE (\d+\.\d+)b?;/.test(ua)){this.ie=RegExp.$1;this['ie'+RegExp.$1.charAt(0)]=true;}@else @*/ 20 if(/MSIE (\d+\.\d+)b?;/.test(ua)){this.ie=RegExp.$1;this['ie'+RegExp.$1.charAt(0)]=true;}@else @*/ 20 21 if(/AppleWebKit\/(\d+(?:\.\d+)*)/.test(ua)){this.applewebkit=RegExp.$1;if(RegExp.$1.charAt(0)==4){this.applewebkit2=true;} 21 22 else{this.applewebkit3=true;}} 22 else if(typeof Components=="object"&&(/Gecko\/(\d{8})/.test(ua)||navigator.product=="Gecko"&&/^(\d{8})$/.test(navigator.productSub))){this.gecko=RegExp.$1;}/*@end @*/ 23 else if(typeof Components=="object"&&(/Gecko\/(\d{8})/.test(ua)||navigator.product=="Gecko"&&/^(\d{8})$/.test(navigator.productSub))){this.gecko=RegExp.$1;}/*@end @*/ 23 24 if(typeof(opera)=="object"&&typeof(opera.version)=="function"){this.opera=opera.version();this['opera'+this.opera[0]+this.opera[2]]=true;} 24 25 else if(typeof opera=="object"&&(/Opera[\/ ](\d+\.\d+)/.test(ua))){this.opera=RegExp.$1;} … … 86 87 return this.evaluatePredicates(Fc);};pa.prototype.predicate=function(Gc){this.predicates.push(Gc);};pa.prototype.show=function(Hc){Hc=Hc||'';var t='';t+=Hc+'filter: '+'\n';Hc+=' ';t+=this.primary.show(Hc);if(this.predicates.length){t+=Hc+'predicates: '+'\n';Hc+=' ';for(var i=0;i<this.predicates.length;i++){t+=this.predicates[i].show(Hc);}} 87 88 return t;};if(!window.NodeUtil&&window.defaultConfig)window.NodeUtil=null;wa={to:function(Ic,Jc){var t,type=Jc.nodeType;if(type==1&&ea.useInnerText&&!Da.applewebkit2){t=Jc.textContent;t=(t==ca||t==null)?Jc.innerText:t;t=(t==ca||t==null)?'':t;} 88 if(typeof t!='string'){ n/*@cc_on89 if(typeof t!='string'){ /*@cc_on 89 90 if(type==1&&Jc.nodeName.toLowerCase()=='title'){t=Jc.text;} 90 91 else@*/if(type==9||type==1){if(type==9){Jc=Jc.documentElement;} 91 92 else{Jc=Jc.firstChild;} 92 for(t='',stack=[],i=0;Jc;){do{if(Jc.nodeType!=1){t+=Jc.nodeValue;} n/*@cc_on93 for(t='',stack=[],i=0;Jc;){do{if(Jc.nodeType!=1){t+=Jc.nodeValue;} /*@cc_on 93 94 else if(Jc.nodeName.toLowerCase()=='title'){t+=Jc.text;}@*/stack[i++]=Jc;} 94 95 while(Jc=Jc.firstChild);while(i&&!(Jc=stack[--i].nextSibling)){}}} 95 96 else{t=Jc.nodeValue;}} 96 switch(Ic){case 'number':return+t;case 'boolean':return!!t;default:return t;}},attrPropMap:{name:'name','class':'className',dir:'dir',id:'id',name:'name',title:'title'},attrMatch:function(Kc,Lc,Mc){ n/*@cc_on @if(@_jscript)var Nc=wa.attrPropMap[Lc];if(!Lc||Mc==null&&(Nc&&Kc[Nc]||!Nc&&Kc.getAttribute&&Kc.getAttribute(Lc))||Mc!=null&&(Nc&&Kc[Nc]==Mc||!Nc&&Kc.getAttribute&&Kc.getAttribute(Lc)==Mc)){@else @*/97 if(!Lc||Mc==null&&Kc.hasAttribute&&Kc.hasAttribute(Lc)||Mc!=null&&Kc.getAttribute&&Kc.getAttribute(Lc)==Mc){/*@end @*/ 97 switch(Ic){case 'number':return+t;case 'boolean':return!!t;default:return t;}},attrPropMap:{name:'name','class':'className',dir:'dir',id:'id',name:'name',title:'title'},attrMatch:function(Kc,Lc,Mc){ /*@cc_on @if(@_jscript)var Nc=wa.attrPropMap[Lc];if(!Lc||Mc==null&&(Nc&&Kc[Nc]||!Nc&&Kc.getAttribute&&Kc.getAttribute(Lc))||Mc!=null&&(Nc&&Kc[Nc]==Mc||!Nc&&Kc.getAttribute&&Kc.getAttribute(Lc)==Mc)){@else @*/ 98 if(!Lc||Mc==null&&Kc.hasAttribute&&Kc.hasAttribute(Lc)||Mc!=null&&Kc.getAttribute&&Kc.getAttribute(Lc)==Mc){/*@end @*/ 98 99 return true;} 99 else{return false;}},getDescendantNodes:function(Oc,Kc,Pc,Lc,Mc,Qc,Rc){if(Qc){Qc.delDescendant(Kc,Rc);} n/*@cc_on100 else{return false;}},getDescendantNodes:function(Oc,Kc,Pc,Lc,Mc,Qc,Rc){if(Qc){Qc.delDescendant(Kc,Rc);} /*@cc_on 100 101 if(!Oc.notOnlyElement||Oc.type==8||(Lc&&Oc.type==0)){var Sc=Kc.all;if(!Sc){return Pc;} 101 102 var Tc=Oc.name;if(Oc.type==8)Tc='!';else if(Oc.type==0)Tc='*';if(Tc!='*'){Sc=Sc.tags(Tc);if(!Sc){return Pc;}} 102 103 if(Lc){var Uc=[] 103 104 var i=0;if(Mc!=null&&(Lc=='id'||Lc=='name')){Sc=Sc[Mc];if(!Sc){return Pc;} 104 if(!Sc.length ){Sc=[Sc];}}105 if(!Sc.length||Sc.nodeType){Sc=[Sc];}} 105 106 while(Kc=Sc[i++]){if(wa.attrMatch(Kc,Lc,Mc))Uc.push(Kc);} 106 107 Sc=Uc;} … … 113 114 f(Kc);}})(Kc);} 114 115 else{var Tc=Oc.name;if(Kc.getElementsByTagName){var Wc=Kc.getElementsByTagName(Tc);if(Wc){var i=0;while(Kc=Wc[i++]){if(wa.attrMatch(Kc,Lc,Mc))Pc.push(Kc);}}}} 115 return Pc;},getChildNodes:function(Yc,Kc,Zc,Lc,Mc){ n/*@cc_on116 return Pc;},getChildNodes:function(Yc,Kc,Zc,Lc,Mc){ /*@cc_on 116 117 var $c;if((!Yc.notOnlyElement||Yc.type==8||(Lc&&Yc.type==0))&&($c=Kc.children)){var ad,elm;ad=Yc.name;if(Yc.type==8)ad='!';else if(Yc.type==0)ad='*';if(ad!='*'){$c=$c.tags(ad);if(!$c){return Zc;}} 117 118 if(Lc){var bd=[] 118 119 var i=0;if(Lc=='id'||Lc=='name'){$c=$c[Mc];if(!$c){return Zc;} 119 if(!$c.length ){$c=[$c];}}120 if(!$c.length||$c.nodeType){$c=[$c];}} 120 121 while(Kc=$c[i++]){if(wa.attrMatch(Kc,Lc,Mc))bd.push(Kc);} 121 122 $c=bd;} … … 124 125 for(var i=0,Kc=Kc.firstChild;Kc;i++,Kc=Kc.nextSibling){if(wa.attrMatch(Kc,Lc,Mc)){if(Yc.match(Kc))Zc.push(Kc);}} 125 126 return Zc;@*/for(var Kc=Kc.firstChild;Kc;Kc=Kc.nextSibling){if(wa.attrMatch(Kc,Lc,Mc)){if(Yc.match(Kc))Zc.push(Kc);}} 126 return Zc;}}; n/*@cc_on127 return Zc;}}; /*@cc_on 127 128 var cd=function(dd,ed,fd){this.node=dd;this.nodeType=2;this.nodeValue=dd.nodeValue;this.nodeName=dd.nodeName;this.parentNode=ed;this.ownerElement=ed;this.parentSourceIndex=fd;};@*/if(!window.Step&&window.defaultConfig)window.Step=null;za=function(gd,hd){this.axis=gd;this.reverse=za.axises[gd][0];this.func=za.axises[gd][1];this.test=hd;this.predicates=[];this._quickAttr=za.axises[gd][2]};za.axises={ancestor:[true,function(jd,kd,ld,_,md,od,pd){while(kd=kd.parentNode){if(od&&kd.nodeType==1){od.reserveDelByNode(kd,pd,true);} 128 129 if(jd.match(kd))ld.unshift(kd);} 129 130 return ld;}],'ancestor-or-self':[true,function(qd,rd,sd,_,td,ud,vd){do{if(ud&&rd.nodeType==1){ud.reserveDelByNode(rd,vd,true);} 130 131 if(qd.match(rd))sd.unshift(rd);} 131 while(rd=rd.parentNode)return sd;}],attribute:[false,function(wd,xd,yd){var zd=xd.attributes;if(zd){ n/*@cc_on132 var Ad=xd.sourceIndex;@*/if((wd.notOnlyElement&&wd.type==0)||wd.name=='*'){for(var i=0,l=zd.length;i<l;i++){var Bd=zd[i]; n/*@cc_on @if(@_jscript)if(Bd.nodeValue){yd.push(new cd(Bd,xd,Ad));}@else @*/133 yd.push(Bd);/*@end @*/ }}134 else{var Bd=zd.getNamedItem(wd.name) n/*@cc_on @if(@_jscript)if(Bd&&Bd.nodeValue){Bd=new cd(Bd,xd,Ad);;@else @*/135 if(Bd){/*@end @*/ 132 while(rd=rd.parentNode)return sd;}],attribute:[false,function(wd,xd,yd){var zd=xd.attributes;if(zd){ /*@cc_on 133 var Ad=xd.sourceIndex;@*/if((wd.notOnlyElement&&wd.type==0)||wd.name=='*'){for(var i=0,l=zd.length;i<l;i++){var Bd=zd[i]; /*@cc_on @if(@_jscript)if(Bd.nodeValue){yd.push(new cd(Bd,xd,Ad));}@else @*/ 134 yd.push(Bd);/*@end @*/ }} 135 else{var Bd=zd.getNamedItem(wd.name); /*@cc_on @if(@_jscript)if(Bd&&Bd.nodeValue){Bd=new cd(Bd,xd,Ad);;@else @*/ 136 if(Bd){/*@end @*/ 136 137 yd.push(Bd);}}} 137 138 return yd;}],child:[false,wa.getChildNodes,true],descendant:[false,wa.getDescendantNodes,true],'descendant-or-self':[false,function(wd,xd,yd,Cd,Dd,Ed,Fd){if(wa.attrMatch(xd,Cd,Dd)){if(wd.match(xd))yd.push(xd);} … … 171 172 if(Xd){Xd.doDel();}} 172 173 return be;};za.prototype.predicate=function(ee){this.predicates.push(ee);if(ee.needContextPosition||ee.datatype=='number'||ee.datatype=='void'){this.needContextPosition=true;} 173 if(this._quickAttr&&this.predicates.length==1&&ee.quickAttr){var fe=ee.attrName; n/*@cc_on @if(@_jscript)this.attrName=fe.toLowerCase();@else @*/174 this.attrName=fe;/*@end @*/ 174 if(this._quickAttr&&this.predicates.length==1&&ee.quickAttr){var fe=ee.attrName; /*@cc_on @if(@_jscript)this.attrName=fe.toLowerCase();@else @*/ 175 this.attrName=fe;/*@end @*/ 175 176 this.attrValueExpr=ee.attrValueExpr;this.quickAttr=true;}};za.prototype.show=function(ge){ge=ge||'';var t='';t+=ge+'step: '+'\n';ge+=' ';if(this.axis)t+=ge+'axis: '+this.axis+'\n';t+=this.test.show(ge);if(this.predicates.length){t+=ge+'predicates: '+'\n';ge+=' ';for(var i=0;i<this.predicates.length;i++){t+=this.predicates[i].show(ge);}} 176 177 return t;};if(!window.NodeType&&window.defaultConfig)window.NodeType=null;va=function(he,je){this.name=he;this.literal=je;switch(he){case 'comment':this.type=8;break;case 'text':this.type=3;break;case 'processing-instruction':this.type=7;break;case 'node':this.type=0;break;}};va.types={'comment':1,'text':1,'processing-instruction':1,'node':1};va.parse=function(ke){var le,literal,ch;le=ke.next();ke.next();if(ke.empty()){throw Error('bad nodetype');} … … 190 191 return this.position;},'number',true,[]],count:[function(ns){if(arguments.length!=1||!(ns=ns.evaluate(this)).isNodeSet){throw Error('Function count expects (nodeset)');} 191 192 return ns.length;},'number',false,[]],id:[function(s){var Ie,ns,i,id,elm,ctxn,doc;if(arguments.length!=1){throw Error('Function id expects (object)');} 192 ctxn=this.node;if(ctxn.nodeType==9)doc=ctxn;else doc=ctxn.ownerDocument; n/*@cc_on193 all=doc.all;@*/s=s.string(this);Ie=s.split(/\s+/);ns=new ta();for(i=0,l=Ie.length;i<l;i++){id=Ie[i]; n/*@cc_on @if(@_jscript)elm=all[id];if(elm){if(elm.length){var Je=elm;for(var j=0,l0=Je.length;j<l0;j++){var Ke=Je[j];if(id==Ke.id){ns.push(Ke);break;}}}194 else if( id==elm.id){ns.push(elm)}}@else @*/195 elm=doc.getElementById(id);if(Da.opera&&elm .id!=id){var Je=doc.getElementsByName(id);for(var j=0,l0=Je.length;j<l0;j++){elm=Je[j];if(elm.id==id){ns.push(elm);}}}196 else{if(elm)ns.push(elm)}/*@end @*/ }193 ctxn=this.node;if(ctxn.nodeType==9)doc=ctxn;else doc=ctxn.ownerDocument; /*@cc_on 194 all=doc.all;@*/s=s.string(this);Ie=s.split(/\s+/);ns=new ta();for(i=0,l=Ie.length;i<l;i++){id=Ie[i]; /*@cc_on @if(@_jscript)elm=all[id];if(elm){if((!elm.length||elm.nodeType)&&id==elm.id){ns.push(elm)} 195 else if(elm.length){var Je=elm;for(var j=0,l0=Je.length;j<l0;j++){var Ke=Je[j];if(id==Ke.id){ns.push(Ke);break;}}}}@else @*/ 196 elm=doc.getElementById(id);if(Da.opera&&elm&&elm.id!=id){var Je=doc.getElementsByName(id);for(var j=0,l0=Je.length;j<l0;j++){elm=Je[j];if(elm.id==id){ns.push(elm);}}} 197 else{if(elm)ns.push(elm)}/*@end @*/ } 197 198 ns.isSorted=false;return ns;},'nodeset',false,[]],'local-name':[function(ns){var nd;switch(arguments.length){case 0:nd=this.node;break;case 1:if((ns=ns.evaluate(this)).isNodeSet){nd=ns.first();break;} 198 199 default:throw Error('Function local-name expects (nodeset?)');break;} … … 229 230 var Se=this.args;if(Re.needContextNode){Se.needContexNode=true;} 230 231 this.needContextNode=Se.needContextNode||this.needContextNodeInfo[Se.length];};qa.prototype.show=function(Te){Te=Te||'';var t='';t+=Te+'function: '+this.name+'\n';Te+=' ';if(this.args.length){t+=Te+'arguments: '+'\n';Te+=' ';for(var i=0;i<this.args.length;i++){t+=this.args[i].show(Te);}} 231 return t;}; n/*@cc_on @if(@_jscript)var Ue=function(Ve,We,Xe,Ye){this.node=Ve;this.nodeType=Ve.nodeType;this.sourceIndex=We;this.subIndex=Xe;this.attributeName=Ye||'';this.order=String.fromCharCode(We)+String.fromCharCode(Xe)+Ye;};Ue.prototype.toString=function(){return this.order;};@else @*/232 var Ze={uuid:1,get:function($e){return $e.__ba||($e.__ba=this.uuid++);}};/*@end @*/ 233 if(!window.NodeSet&&window.defaultConfig)window.NodeSet=null;ta=function(){this.length=0;this.nodes=[];this.seen={};this.idIndexMap=null;this.reserveDels=[];};ta.prototype.isNodeSet=true;ta.prototype.isSorted=true; n/*@_cc_on232 return t;}; /*@cc_on @if(@_jscript)var Ue=function(Ve,We,Xe,Ye){this.node=Ve;this.nodeType=Ve.nodeType;this.sourceIndex=We;this.subIndex=Xe;this.attributeName=Ye||'';this.order=String.fromCharCode(We)+String.fromCharCode(Xe)+Ye;};Ue.prototype.toString=function(){return this.order;};@else @*/ 233 var Ze={uuid:1,get:function($e){return $e.__ba||($e.__ba=this.uuid++);}};/*@end @*/ 234 if(!window.NodeSet&&window.defaultConfig)window.NodeSet=null;ta=function(){this.length=0;this.nodes=[];this.seen={};this.idIndexMap=null;this.reserveDels=[];};ta.prototype.isNodeSet=true;ta.prototype.isSorted=true; /*@_cc_on 234 235 ta.prototype.shortcut=true;@*/ta.prototype.merge=function(af){this.isSorted=false;if(af.only){return this.push(af.only);} 235 236 if(this.only){var bf=this.only;delete this.only;this.push(bf);this.length--;} 236 var cf=af.nodes;for(var i=0,l=cf.length;i<l;i++){this._add(cf[i]);}};ta.prototype.sort=function(){if(this.only)return;if(this.sortOff)return;if(!this.isSorted){this.isSorted=true;this.idIndexMap=null; n/*@cc_on237 var cf=af.nodes;for(var i=0,l=cf.length;i<l;i++){this._add(cf[i]);}};ta.prototype.sort=function(){if(this.only)return;if(this.sortOff)return;if(!this.isSorted){this.isSorted=true;this.idIndexMap=null; /*@cc_on 237 238 if(this.shortcut){this.nodes.sort();} 238 239 else{this.nodes.sort(function(a,b){var df;df=a.sourceIndex-b.sourceIndex;if(df==0)return a.subIndex-a.subIndex;else return df;});} … … 241 242 else if(deep2>deep1){while(deep2--!=deep1)node2=node2.parentNode;if(gf==node2)return -1;} 242 243 while((ancestor1=gf.parentNode)!=(ancestor2=node2.parentNode)){gf=ancestor1;node2=ancestor2;} 243 while(gf=gf.nextSibling)if(gf==node2)return -1;return 1;}});}}; n/*@cc_on @if(@_jscript)ta.prototype.sourceOffset=1;ta.prototype.subOffset=2;ta.prototype.createWrapper=function(hf){var jf,child,attributes,attributesLength,sourceIndex,subIndex,attributeName;sourceIndex=hf.sourceIndex;if(typeof sourceIndex!='number'){type=hf.nodeType;switch(type){case 2:jf=hf.parentNode;sourceIndex=hf.parentSourceIndex;subIndex=-1;attributeName=hf.nodeName;break;case 9:subIndex=-2;sourceIndex=-1;break;default:child=hf;subIndex=0;do{subIndex++;sourceIndex=child.sourceIndex;if(sourceIndex){jf=child;child=child.lastChild;if(!child){child=jf;break;}244 while(gf=gf.nextSibling)if(gf==node2)return -1;return 1;}});}}; /*@cc_on @if(@_jscript)ta.prototype.sourceOffset=1;ta.prototype.subOffset=2;ta.prototype.createWrapper=function(hf){var jf,child,attributes,attributesLength,sourceIndex,subIndex,attributeName;sourceIndex=hf.sourceIndex;if(typeof sourceIndex!='number'){type=hf.nodeType;switch(type){case 2:jf=hf.parentNode;sourceIndex=hf.parentSourceIndex;subIndex=-1;attributeName=hf.nodeName;break;case 9:subIndex=-2;sourceIndex=-1;break;default:child=hf;subIndex=0;do{subIndex++;sourceIndex=child.sourceIndex;if(sourceIndex){jf=child;child=child.lastChild;if(!child){child=jf;break;} 244 245 subIndex++;}} 245 246 while(child=child.previousSibling);if(!sourceIndex){sourceIndex=hf.parentNode.sourceIndex;} 246 247 break;}} 247 248 else{subIndex=-2;} 248 sourceIndex+=this.sourceOffset;subIndex+=this.subOffset;return new Ue(hf,sourceIndex,subIndex,attributeName);};ta.prototype.reserveDelBySourceIndexAndSubIndex=function(kf,lf,mf,nf){var of=this.createIdIndexMap();var pf;if((of=of[kf])&&(pf=of[lf])){if(nf&&(this.length-mf-1)>pf||!nf&&mf<pf){var qf={value:pf,order:String.fromCharCode(pf),toString:function(){return this.order},valueOf:function(){return this.value}};this.reserveDels.push(qf);}}};@else @*/ 249 ta.prototype.reserveDelByNodeID=function(id,rf,sf){var tf=this.createIdIndexMap();var uf;if(uf=tf[id]){if(sf&&(this.length-rf-1)>uf||!sf&&rf<uf){var vf={value:uf,order:String.fromCharCode(uf),toString:function(){return this.order},valueOf:function(){return this.value}};this.reserveDels.push(vf);}}};/*@end @*/ 250 ta.prototype.reserveDelByNode=function(wf,xf,yf){ n/*@cc_on @if(@_jscript)wf=this.createWrapper(wf);this.reserveDelBySourceIndexAndSubIndex(wf.sourceIndex,wf.subIndex,xf,yf);@else @*/251 this.reserveDelByNodeID(Ze.get(wf),xf,yf);/*@end @*/ };ta.prototype.doDel=function(){if(!this.reserveDels.length)return;if(this.length<0x10000){var zf=this.reserveDels.sort(function(a,b){return b-a});}249 sourceIndex+=this.sourceOffset;subIndex+=this.subOffset;return new Ue(hf,sourceIndex,subIndex,attributeName);};ta.prototype.reserveDelBySourceIndexAndSubIndex=function(kf,lf,mf,nf){var of=this.createIdIndexMap();var pf;if((of=of[kf])&&(pf=of[lf])){if(nf&&(this.length-mf-1)>pf||!nf&&mf<pf){var qf={value:pf,order:String.fromCharCode(pf),toString:function(){return this.order},valueOf:function(){return this.value}};this.reserveDels.push(qf);}}};@else @*/ 250 ta.prototype.reserveDelByNodeID=function(id,rf,sf){var tf=this.createIdIndexMap();var uf;if(uf=tf[id]){if(sf&&(this.length-rf-1)>uf||!sf&&rf<uf){var vf={value:uf,order:String.fromCharCode(uf),toString:function(){return this.order},valueOf:function(){return this.value}};this.reserveDels.push(vf);}}};/*@end @*/ 251 ta.prototype.reserveDelByNode=function(wf,xf,yf){ /*@cc_on @if(@_jscript)wf=this.createWrapper(wf);this.reserveDelBySourceIndexAndSubIndex(wf.sourceIndex,wf.subIndex,xf,yf);@else @*/ 252 this.reserveDelByNodeID(Ze.get(wf),xf,yf);/*@end @*/ };ta.prototype.doDel=function(){if(!this.reserveDels.length)return;if(this.length<0x10000){var zf=this.reserveDels.sort(function(a,b){return b-a});} 252 253 else{var zf=this.reserveDels.sort(function(a,b){return b-a});} 253 254 for(var i=0,l=zf.length;i<l;i++){this.del(zf[i]);} 254 255 this.reserveDels=[];this.idIndexMap=null;};ta.prototype.createIdIndexMap=function(){if(this.idIndexMap){return this.idIndexMap;} 255 else{var Af=this.idIndexMap={};var Bf=this.nodes;for(var i=0,l=Bf.length;i<l;i++){var Cf=Bf[i]; n/*@cc_on @if(@_jscript)var Df=Cf.sourceIndex;var Ef=Cf.subIndex;if(!Af[Df])Af[Df]={};Af[Df][Ef]=i;@else @*/256 var id=Ze.get(Cf);Af[id]=i;/*@end @*/ }256 else{var Af=this.idIndexMap={};var Bf=this.nodes;for(var i=0,l=Bf.length;i<l;i++){var Cf=Bf[i]; /*@cc_on @if(@_jscript)var Df=Cf.sourceIndex;var Ef=Cf.subIndex;if(!Af[Df])Af[Df]={};Af[Df][Ef]=i;@else @*/ 257 var id=Ze.get(Cf);Af[id]=i;/*@end @*/ } 257 258 return Af;}};ta.prototype.del=function(Ff){this.length--;if(this.only){delete this.only;} 258 else{var Gf=this.nodes.splice(Ff,1)[0];if(this._first==Gf){delete this._first;delete this._firstSourceIndex;delete this._firstSubIndex;} n/*@cc_on @if(@_jscript)delete this.seen[Gf.sourceIndex][Gf.subIndex];@else @*/259 delete this.seen[Ze.get(Gf)];/*@end @*/ }};ta.prototype.delDescendant=function(Hf,If){if(this.only)return;var Jf=Hf.nodeType;if(Jf!=1&&Jf!=9)return;if(Da.applewebkit2)return;if(!Hf.contains){if(Jf==1){var Kf=Hf;Hf={contains:function(Lf){return Lf.compareDocumentPosition(Kf)&8;}};}259 else{var Gf=this.nodes.splice(Ff,1)[0];if(this._first==Gf){delete this._first;delete this._firstSourceIndex;delete this._firstSubIndex;} /*@cc_on @if(@_jscript)delete this.seen[Gf.sourceIndex][Gf.subIndex];@else @*/ 260 delete this.seen[Ze.get(Gf)];/*@end @*/ }};ta.prototype.delDescendant=function(Hf,If){if(this.only)return;var Jf=Hf.nodeType;if(Jf!=1&&Jf!=9)return;if(Da.applewebkit2)return;if(!Hf.contains){if(Jf==1){var Kf=Hf;Hf={contains:function(Lf){return Lf.compareDocumentPosition(Kf)&8;}};} 260 261 else{Hf={contains:function(){return true;}};}} 261 var Mf=this.nodes;for(var i=If+1;i<Mf.length;i++){ n/*@cc_on @if(@_jscript)if(Mf[i].node.nodeType==1&&Hf.contains(Mf[i].node)){@else @*/262 if(Hf.contains(Mf[i])){/*@end @*/ 263 this.del(i);i--;}}};ta.prototype._add=function(Nf,Of){ n/*@cc_on @if(@_jscript)var Pf,firstSourceIndex,firstSubIndex,sourceIndex,subIndex,attributeName;sourceIndex=Nf.sourceIndex;subIndex=Nf.subIndex;attributeName=Nf.attributeName;seen=this.seen;seen=seen[sourceIndex]||(seen[sourceIndex]={});if(Nf.nodeType==2){seen=seen[subIndex]||(seen[subIndex]={});if(seen[attributeName]){return true;}262 var Mf=this.nodes;for(var i=If+1;i<Mf.length;i++){ /*@cc_on @if(@_jscript)if(Mf[i].node.nodeType==1&&Hf.contains(Mf[i].node)){@else @*/ 263 if(Hf.contains(Mf[i])){/*@end @*/ 264 this.del(i);i--;}}};ta.prototype._add=function(Nf,Of){ /*@cc_on @if(@_jscript)var Pf,firstSourceIndex,firstSubIndex,sourceIndex,subIndex,attributeName;sourceIndex=Nf.sourceIndex;subIndex=Nf.subIndex;attributeName=Nf.attributeName;seen=this.seen;seen=seen[sourceIndex]||(seen[sourceIndex]={});if(Nf.nodeType==2){seen=seen[subIndex]||(seen[subIndex]={});if(seen[attributeName]){return true;} 264 265 seen[attributeName]=true;} 265 266 else{if(seen[subIndex]){return true;} 266 267 seen[subIndex]=true;} 267 268 if(sourceIndex>=0x10000||subIndex>=0x10000){this.shortcut=false;} 268 if(this._first||this.nodes.length==0){Pf=this._first;firstSourceIndex=this._firstSourceIndex;firstSubIndex=this._firstSubIndex;if(!Pf||firstSourceIndex>sourceIndex||(firstSourceIndex==sourceIndex&&firstSubIndex>subIndex)){this._first=Nf;this._firstSourceIndex=sourceIndex;this._firstSubIndex=subIndex}}@else @*/ 269 var Qf=this.seen;var id=Ze.get(Nf);if(Qf[id])return true;Qf[id]=true;/*@end @*/ 269 if(this._first||this.nodes.length==0){Pf=this._first;firstSourceIndex=this._firstSourceIndex;firstSubIndex=this._firstSubIndex;if(!Pf||firstSourceIndex>sourceIndex||(firstSourceIndex==sourceIndex&&firstSubIndex>subIndex)){this._first=Nf;this._firstSourceIndex=sourceIndex;this._firstSubIndex=subIndex}}@else @*/ 270 var Qf=this.seen;var id=Ze.get(Nf);if(Qf[id])return true;Qf[id]=true;/*@end @*/ 270 271 this.length++;if(Of)this.nodes.unshift(Nf);else this.nodes.push(Nf);};ta.prototype.unshift=function(Rf){if(!this.length){this.length++;this.only=Rf;return} 271 if(this.only){var Sf=this.only;delete this.only;this.unshift(Sf);this.length--;} n/*@cc_on272 if(this.only){var Sf=this.only;delete this.only;this.unshift(Sf);this.length--;} /*@cc_on 272 273 Rf=this.createWrapper(Rf);@*/return this._add(Rf,true);};ta.prototype.push=function(Tf){if(!this.length){this.length++;this.only=Tf;return;} 273 if(this.only){var Uf=this.only;delete this.only;this.push(Uf);this.length--;} n/*@cc_on274 Tf=this.createWrapper(Tf);@*/return this._add(Tf);};ta.prototype.first=function(){if(this.only)return this.only; n/*@cc_on275 if(this._first)return this._first.node;if(this.nodes.length>1)this.sort();var Vf=this.nodes[0];return Vf?Vf.node:ca;@*/if(this.nodes.length>1)this.sort();return this.nodes[0];};ta.prototype.list=function(){if(this.only)return[this.only];this.sort(); n/*@cc_on274 if(this.only){var Uf=this.only;delete this.only;this.push(Uf);this.length--;} /*@cc_on 275 Tf=this.createWrapper(Tf);@*/return this._add(Tf);};ta.prototype.first=function(){if(this.only)return this.only; /*@cc_on 276 if(this._first)return this._first.node;if(this.nodes.length>1)this.sort();var Vf=this.nodes[0];return Vf?Vf.node:ca;@*/if(this.nodes.length>1)this.sort();return this.nodes[0];};ta.prototype.list=function(){if(this.only)return[this.only];this.sort(); /*@cc_on 276 277 var i,l,Mf,results;Mf=this.nodes;results=[];for(i=0,l=Mf.length;i<l;i++){results.push(Mf[i].node);} 277 return results;@*/return this.nodes;};ta.prototype.string=function(){var Wf=this.only||this.first();return Wf?wa.to('string',Wf):'';};ta.prototype.bool=function(){return!!(this.length||this.only);};ta.prototype.number=function(){return+this.string();};ta.prototype.iterator=function(Xf){this.sort();var Yf=this;if(!Xf){var Zf=0;return function(){if(Yf.only&&Zf++==0)return Yf.only;n/*@cc_on @if(@_jscript)var $f=Yf.nodes[Zf++];if($f)return $f.node;return ca;@else @*/ 278 return Yf.nodes[Zf++];/*@end @*/};} 279 else{var Zf=0;return function(){var ag=Yf.length-(Zf++)-1;if(Yf.only&&ag==0)return Yf.only;n/*@cc_on @if(@_jscript)var bg=Yf.nodes[ag];if(bg)return bg.node;return ca;@else @*/ 280 return Yf.nodes[ag];/*@end @*/};}};var cg=function(dg){dg=dg||this;dg.XPathExpression=function(eg){if(!eg.length){throw Error('no expression');} 281 var fg=this.lexer=Ea(eg);if(fg.empty()){throw Error('no expression');} 282 this.expr=oa.parse(fg);if(!fg.empty()){throw Error('bad token: '+fg.next());}};dg.XPathExpression.prototype.evaluate=function(gg,hg){return new XPathResult(this.expr.evaluate(new Ia(gg)),hg);};dg.XPathResult=function(ig,jg){if(jg==0){switch(typeof ig){case 'object':jg++;case 'boolean':jg++;case 'string':jg++;case 'number':jg++;}} 283 this.resultType=jg;switch(jg){case 1:this.numberValue=ig.isNodeSet?ig.number():+ig;return;case 2:this.stringValue=ig.isNodeSet?ig.string():''+ig;return;case 3:this.booleanValue=ig.isNodeSet?ig.bool():!!ig;return;case 4:case 5:case 6:case 7:this.nodes=ig.list();this.snapshotLength=ig.length;this.index=0;this.invalidIteratorState=false;break;case 8:case 9:this.singleNodeValue=ig.first();return;}};dg.XPathResult.prototype.iterateNext=function(){return this.nodes[this.index++]};dg.XPathResult.prototype.snapshotItem=function(i){return this.nodes[i]};dg.XPathResult.ANY_TYPE=0;dg.XPathResult.NUMBER_TYPE=1;dg.XPathResult.STRING_TYPE=2;dg.XPathResult.BOOLEAN_TYPE=3;dg.XPathResult.UNORDERED_NODE_ITERATOR_TYPE=4;dg.XPathResult.ORDERED_NODE_ITERATOR_TYPE=5;dg.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE=6;dg.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE=7;dg.XPathResult.ANY_UNORDERED_NODE_TYPE=8;dg.XPathResult.FIRST_ORDERED_NODE_TYPE=9;dg.document.createExpression=function(kg){return new XPathExpression(kg,null);};dg.document.evaluate=function(lg,mg,_,ng){return document.createExpression(lg,null).evaluate(mg,ng);};};var og;if(ea.targetFrame){var pg=document.getElementById(ea.targetFrame);if(pg)og=pg.contentWindow;} 284 cg(og||window);})(); 278 return results;@*/return this.nodes;};ta.prototype.string=function(){var Wf=this.only||this.first();return Wf?wa.to('string',Wf):'';};ta.prototype.bool=function(){return!!(this.length||this.only);};ta.prototype.number=function(){return+this.string();};ta.prototype.iterator=function(Xf){this.sort();var Yf=this;if(!Xf){var Zf=0;return function(){if(Yf.only&&Zf++==0)return Yf.only; /*@cc_on @if(@_jscript)var $f=Yf.nodes[Zf++];if($f)return $f.node;return ca;@else @*/ 279 return Yf.nodes[Zf++];/*@end @*/ };} 280 else{var Zf=0;return function(){var ag=Yf.length-(Zf++)-1;if(Yf.only&&ag==0)return Yf.only; /*@cc_on @if(@_jscript)var bg=Yf.nodes[ag];if(bg)return bg.node;return ca;@else @*/ 281 return Yf.nodes[ag];/*@end @*/ };}};var cg=function(dg){dg=dg||this;var eg=dg.document;var ca=dg.undefined;dg.XPathExpression=function(fg){if(!fg.length){throw dg.Error('no expression');} 282 var gg=this.lexer=Ea(fg);if(gg.empty()){throw dg.Error('no expression');} 283 this.expr=oa.parse(gg);if(!gg.empty()){throw dg.Error('bad token: '+gg.next());}};dg.XPathExpression.prototype.evaluate=function(hg,ig){return new dg.XPathResult(this.expr.evaluate(new Ia(hg)),ig);};dg.XPathResult=function(jg,kg){if(kg==0){switch(typeof jg){case 'object':kg++;case 'boolean':kg++;case 'string':kg++;case 'number':kg++;}} 284 this.resultType=kg;switch(kg){case 1:this.numberValue=jg.isNodeSet?jg.number():+jg;return;case 2:this.stringValue=jg.isNodeSet?jg.string():''+jg;return;case 3:this.booleanValue=jg.isNodeSet?jg.bool():!!jg;return;case 4:case 5:case 6:case 7:this.nodes=jg.list();this.snapshotLength=jg.length;this.index=0;this.invalidIteratorState=false;break;case 8:case 9:this.singleNodeValue=jg.first();return;}};dg.XPathResult.prototype.iterateNext=function(){return this.nodes[this.index++]};dg.XPathResult.prototype.snapshotItem=function(i){return this.nodes[i]};dg.XPathResult.ANY_TYPE=0;dg.XPathResult.NUMBER_TYPE=1;dg.XPathResult.STRING_TYPE=2;dg.XPathResult.BOOLEAN_TYPE=3;dg.XPathResult.UNORDERED_NODE_ITERATOR_TYPE=4;dg.XPathResult.ORDERED_NODE_ITERATOR_TYPE=5;dg.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE=6;dg.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE=7;dg.XPathResult.ANY_UNORDERED_NODE_TYPE=8;dg.XPathResult.FIRST_ORDERED_NODE_TYPE=9;eg.createExpression=function(lg){return new dg.XPathExpression(lg,null);};eg.evaluate=function(mg,ng,_,og){return eg.createExpression(mg,null).evaluate(ng,og);};};var pg;if(ea.targetFrame){var qg=document.getElementById(ea.targetFrame);if(qg)pg=qg.contentWindow;} 285 if(ea.exportInstaller){window.install=cg;} 286 if(!ea.hasNative||!ea.useNative){cg(pg||window);}})(); -
lang/javascript/javascript-xpath/branches/support-namespace/release/javascript-xpath-latest.js
r1783 r5270 1 /* JavaScript-XPath 0.1. 61 /* JavaScript-XPath 0.1.8 2 2 * (c) 2007 Cybozu Labs, Inc. 3 3 * … … 7 7 /*--------------------------------------------------------------------------*/ 8 8 9 if (!document.implementation 10 || !document.implementation.hasFeature 11 || !document.implementation.hasFeature("XPath", null)) (function() {9 10 11 (function () { 12 12 13 13 var undefined = void(0); 14 15 14 16 15 var defaultConfig = { 17 16 targetFrame: undefined, 17 exportInstaller: false, 18 useNative: true, 18 19 useInnerText: true 19 20 }; … … 49 50 50 51 for (var n in defaultConfig) { 51 if (!(n in config)) config[n] = defaultConfig[n] 52 if (!(n in config)) config[n] = defaultConfig[n]; 52 53 } 54 55 config.hasNative = !!(document.implementation 56 && document.implementation.hasFeature 57 && document.implementation.hasFeature("XPath", null)); 58 59 if (config.hasNative && config.useNative && !config.exportInstaller) { 60 return; 61 } 62 53 63 54 64 … … 1030 1040 return nodeset; 1031 1041 } 1032 if (!all.length ) {1042 if (!all.length || all.nodeType) { 1033 1043 all = [all]; 1034 1044 } … … 1146 1156 } 1147 1157 1148 if (!children.length ) {1158 if (!children.length || children.nodeType) { 1149 1159 children = [children]; 1150 1160 } … … 1255 1265 } 1256 1266 else { 1257 var attr = attrs.getNamedItem(test.name) 1267 var attr = attrs.getNamedItem(test.name); 1258 1268 1259 1269 /*@cc_on @if (@_jscript) … … 1846 1856 elm = all[id]; 1847 1857 if (elm) { 1848 if (elm.length) { 1858 if ((!elm.length || elm.nodeType) && id == elm.id) { 1859 ns.push(elm) 1860 } 1861 else if (elm.length) { 1849 1862 var elms = elm; 1850 1863 for (var j = 0, l0 = elms.length; j < l0; j ++) { … … 1856 1869 } 1857 1870 } 1858 else if (id == elm.id) {1859 ns.push(elm)1860 }1861 1871 } 1862 1872 @else @*/ 1863 1873 elm = doc.getElementById(id); 1864 if (uai.opera && elm .id != id) {1874 if (uai.opera && elm && elm.id != id) { 1865 1875 var elms = doc.getElementsByName(id); 1866 1876 for (var j = 0, l0 = elms.length; j < l0; j ++) { … … 2696 2706 2697 2707 win = win || this; 2708 var doc = win.document; 2709 var undefined = win.undefined; 2698 2710 2699 2711 win.XPathExpression = function(expr) { 2700 2712 if (!expr.length) { 2701 throw Error('no expression');2713 throw win.Error('no expression'); 2702 2714 } 2703 2715 var lexer = this.lexer = Lexer(expr); 2704 2716 if (lexer.empty()) { 2705 throw Error('no expression');2717 throw win.Error('no expression'); 2706 2718 } 2707 2719 this.expr = BinaryExpr.parse(lexer); 2708 2720 if (!lexer.empty()) { 2709 throw Error('bad token: ' + lexer.next());2721 throw win.Error('bad token: ' + lexer.next()); 2710 2722 } 2711 2723 }; 2712 2724 2713 2725 win.XPathExpression.prototype.evaluate = function(node, type) { 2714 return new XPathResult(this.expr.evaluate(new Ctx(node)), type);2726 return new win.XPathResult(this.expr.evaluate(new Ctx(node)), type); 2715 2727 }; 2716 2728 … … 2764 2776 2765 2777 2766 win.document.createExpression = function(expr) {2767 return new XPathExpression(expr, null);2778 doc.createExpression = function(expr) { 2779 return new win.XPathExpression(expr, null); 2768 2780 }; 2769 2781 2770 win.document.evaluate = function(expr, context, _, type) {2771 return doc ument.createExpression(expr, null).evaluate(context, type);2782 doc.evaluate = function(expr, context, _, type) { 2783 return doc.createExpression(expr, null).evaluate(context, type); 2772 2784 }; 2773 2785 }; … … 2780 2792 } 2781 2793 2782 install(win || window); 2794 if (config.exportInstaller) { 2795 window.install = install; 2796 } 2797 2798 if (!config.hasNative || !config.useNative) { 2799 install(win || window); 2800 } 2801 2783 2802 2784 2803 })(); -
lang/javascript/javascript-xpath/branches/support-namespace/src/api.js
r1269 r5270 3 3 4 4 win = win || this; 5 var doc = win.document; 6 var undefined = win.undefined; 5 7 6 8 win.XPathExpression = function(expr) { 7 9 if (!expr.length) { 8 throw Error('no expression');10 throw win.Error('no expression'); 9 11 } 10 12 var lexer = this.lexer = Lexer(expr); 11 13 if (lexer.empty()) { 12 throw Error('no expression');14 throw win.Error('no expression'); 13 15 } 14 16 this.expr = BinaryExpr.parse(lexer); 15 17 if (!lexer.empty()) { 16 throw Error('bad token: ' + lexer.next());18 throw win.Error('bad token: ' + lexer.next()); 17 19 } 18 20 }; 19 21 20 22 win.XPathExpression.prototype.evaluate = function(node, type) { 21 return new XPathResult(this.expr.evaluate(new Ctx(node)), type);23 return new win.XPathResult(this.expr.evaluate(new Ctx(node)), type); 22 24 }; 23 25 … … 71 73 72 74 73 win.document.createExpression = function(expr) {74 return new XPathExpression(expr, null);75 doc.createExpression = function(expr) { 76 return new win.XPathExpression(expr, null); 75 77 }; 76 78 77 win.document.evaluate = function(expr, context, _, type) {78 return doc ument.createExpression(expr, null).evaluate(context, type);79 doc.evaluate = function(expr, context, _, type) { 80 return doc.createExpression(expr, null).evaluate(context, type); 79 81 }; 80 82 }; … … 87 89 } 88 90 89 install(win || window); 91 if (config.exportInstaller) { 92 window.install = install; 93 } 90 94 95 if (!config.hasNative || !config.useNative) { 96 install(win || window); 97 } 98 99 -
lang/javascript/javascript-xpath/branches/support-namespace/src/functionCall.js
r1771 r5270 95 95 elm = all[id]; 96 96 if (elm) { 97 if (elm.length) { 97 if ((!elm.length || elm.nodeType) && id == elm.id) { 98 ns.push(elm) 99 } 100 else if (elm.length) { 98 101 var elms = elm; 99 102 for (var j = 0, l0 = elms.length; j < l0; j ++) { … … 105 108 } 106 109 } 107 else if (id == elm.id) {108 ns.push(elm)109 }110 110 } 111 111 @else @*/ 112 112 elm = doc.getElementById(id); 113 if (uai.opera && elm .id != id) {113 if (uai.opera && elm && elm.id != id) { 114 114 var elms = doc.getElementsByName(id); 115 115 for (var j = 0, l0 = elms.length; j < l0; j ++) { -
lang/javascript/javascript-xpath/branches/support-namespace/src/head.js
r1269 r5270 7 7 /*--------------------------------------------------------------------------*/ 8 8 9 if (!document.implementation 10 || !document.implementation.hasFeature 11 || !document.implementation.hasFeature("XPath", null)) (function() {9 10 11 (function () { 12 12 13 13 var undefined = void(0); 14 14 15 var defaultConfig = { 16 targetFrame: undefined, 17 exportInstaller: false, 18 useNative: true, 19 useInnerText: true 20 }; 21 22 var config; 23 24 if (window.jsxpath) { 25 config = window.jsxpath; 26 } 27 else { 28 var scriptElms = document.getElementsByTagName('script'); 29 var scriptElm = scriptElms[scriptElms.length - 1]; 30 var scriptSrc = scriptElm.src; 31 config = {}; 32 var scriptSrcMatchResult = scriptSrc.match(/\?(.*)$/); 33 if (scriptSrcMatchResult) { 34 var configStrings = scriptSrcMatchResult[1].split('&'); 35 for (var i = 0, l = configStrings.length; i < l; i ++) { 36 var configString = configStrings[i]; 37 var configStringSplited = configString.split('='); 38 var configName = configStringSplited[0]; 39 var convigValue = configStringSplited[1]; 40 if (configValue == undefined) { 41 configValue == true; 42 } 43 else if (configValue == 'false' || /^-?d+$/.test(configValue)) { 44 configValue = eval(configValue); 45 } 46 config[configName] = configValue; 47 } 48 } 49 } 50 51 for (var n in defaultConfig) { 52 if (!(n in config)) config[n] = defaultConfig[n]; 53 } 54 55 config.hasNative = !!(document.implementation 56 && document.implementation.hasFeature 57 && document.implementation.hasFeature("XPath", null)); 58 59 if (config.hasNative && config.useNative && !config.exportInstaller) { 60 return; 61 } 62 63 -
lang/javascript/javascript-xpath/branches/support-namespace/src/stepExpr.js
r1783 r5270 115 115 return nodeset; 116 116 } 117 if (!all.length ) {117 if (!all.length || all.nodeType) { 118 118 all = [all]; 119 119 } … … 231 231 } 232 232 233 if (!children.length ) {233 if (!children.length || children.nodeType) { 234 234 children = [children]; 235 235 } … … 340 340 } 341 341 else { 342 var attr = attrs.getNamedItem(test.name) 342 var attr = attrs.getNamedItem(test.name); 343 343 344 344 /*@cc_on @if (@_jscript) -
lang/javascript/javascript-xpath/branches/support-namespace/test/functional/analyze-test.html
r1722 r5270 12 12 <!--LOCAL_DATA_HERE--> 13 13 14 <script type="text/javascript" src=". ./../src/config.js"></script>14 <script type="text/javascript" src="./config.js"></script> 15 15 <script type="text/javascript" src="../../src/uai.js"></script> 16 16 <script type="text/javascript" src="../../src/lexer.js"></script> -
lang/javascript/javascript-xpath/branches/support-namespace/test/functional/index.html
r1549 r5270 11 11 <!--LOCAL_DATA_HERE--> 12 12 13 <script type="text/javascript" src=". ./../src/config.js"></script>13 <script type="text/javascript" src="./config.js"></script> 14 14 <script type="text/javascript" src="../../src/uai.js"></script> 15 15 <script type="text/javascript" src="../../src/lexer.js"></script> -
lang/javascript/javascript-xpath/branches/support-namespace/test/functional/logger.js
r1651 r5270 4 4 if (!window.Counter) 5 5 window.Counter = null; 6 7 if (!document.createElementNS) { 8 document.createElementNS = function(ns, localName) { 9 return this.createElement(localName); 10 } 11 } 6 12 7 13 Counter = function(elem_ok, elem_all, alertClassName) { … … 15 21 Counter.prototype = { 16 22 inc: function(ok) { 17 this.elem_all. innerHTML = ++this.countAll;23 this.elem_all.replaceChild(document.createTextNode(++this.countAll), this.elem_all.firstChild) 18 24 if (ok) 19 this.elem_ok. innerHTML = ++this.countOKs;25 this.elem_ok.replaceChild(document.createTextNode(++this.countOKs), this.elem_ok.firstChild) 20 26 else 21 27 this.elem_ok.className = this.alertClassName; … … 24 30 25 31 Logger = function(header, html, id, prevId) { 26 this.container = document.createElement ('div');32 this.container = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); 27 33 this.container.id = 'test-' + id; 28 34 testLog.appendChild(this.container); 29 35 30 36 31 this.h2 = document.createElement ('h2');37 this.h2 = document.createElementNS('http://www.w3.org/1999/xhtml', 'h2'); 32 38 this.container.appendChild(this.h2); 33 39 34 this.thisAnchor = document.createElement ('a');40 this.thisAnchor = document.createElementNS('http://www.w3.org/1999/xhtml', 'a'); 35 41 this.thisAnchor.href = '#test-' + id; 36 42 this.thisAnchor.appendChild(document.createTextNode(header)); 37 43 this.h2.appendChild(this.thisAnchor); 38 44 39 this.localCountElm = document.createElement ('span');45 this.localCountElm = document.createElementNS('http://www.w3.org/1999/xhtml', 'span'); 40 46 this.localCountElm.className = 'local-counter'; 41 this.localCountElm.innerHTML = '<span class="local-counter-ok">0</span> / <span>0</span>' 47 var span; 48 span = document.createElementNS('http://www.w3.org/1999/xhtml', 'span') 49 this.localCountElm.appendChild(span); 50 span.className = 'local-counter-ok'; 51 span.appendChild(document.createTextNode('0')); 52 this.localCountElm.appendChild(document.createTextNode(' / ')); 53 span = document.createElementNS('http://www.w3.org/1999/xhtml', 'span'); 54 this.localCountElm.appendChild(span); 55 span.appendChild(document.createTextNode('0')); 42 56 this.h2.appendChild(document.createTextNode(' ')); 43 57 this.h2.appendChild(this.localCountElm); … … 46 60 47 61 48 this.anchorContainer = document.createElement ('div');62 this.anchorContainer = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); 49 63 this.container.appendChild(this.anchorContainer); 50 64 51 var anchor = document.createElement ('a');65 var anchor = document.createElementNS('http://www.w3.org/1999/xhtml', 'a'); 52 66 anchor.href = '?' + id; 53 67 anchor.appendChild(document.createTextNode('(only this test)')); … … 56 70 57 71 if (prevId) { 58 this.prevAnchor = document.createElement ('a');72 this.prevAnchor = document.createElementNS('http://www.w3.org/1999/xhtml', 'a'); 59 73 this.prevAnchor.href = '#test-' + prevId; 60 74 this.prevAnchor.appendChild(document.createTextNode('(prev)')); … … 64 78 } 65 79 66 this.pre = document.createElement ('pre');80 this.pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre'); 67 81 if (uai.ie) { 68 var dummy = document.createElement ('pre');82 var dummy = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre'); 69 83 dummy.appendChild(document.createTextNode(html)); 70 84 this.pre.innerHTML = dummy.innerHTML.replace(/\n/g, '<br/>\n').replace(/\t/g, ' ').replace(/ /g, ' '); … … 75 89 this.container.appendChild(this.pre); 76 90 77 this.table = document.createElement ('table');78 this.thead = document.createElement ('thead');79 this.tbody = document.createElement ('tbody');91 this.table = document.createElementNS('http://www.w3.org/1999/xhtml', 'table'); 92 this.thead = document.createElementNS('http://www.w3.org/1999/xhtml', 'thead'); 93 this.tbody = document.createElementNS('http://www.w3.org/1999/xhtml', 'tbody'); 80 94 this.table.appendChild(this.thead); 81 95 this.table.appendChild(this.tbody); 82 this.theadRow = document.createElement ('tr');96 this.theadRow = document.createElementNS('http://www.w3.org/1999/xhtml', 'tr'); 83 97 this.thead.appendChild(this.theadRow); 84 98 this.countCols = 0; … … 98 112 Logger.prototype = { 99 113 appendHeader: function(label) { 100 th = document.createElement ('th');114 th = document.createElementNS('http://www.w3.org/1999/xhtml', 'th'); 101 115 th.appendChild(document.createTextNode(label)); 102 116 this.theadRow.appendChild(th); … … 106 120 107 121 next:function (id) { 108 this.nextAnchor = document.createElement ('a');122 this.nextAnchor = document.createElementNS('http://www.w3.org/1999/xhtml', 'a'); 109 123 this.nextAnchor.href = '#test-' + id; 110 124 this.nextAnchor.appendChild(document.createTextNode('(next)')); … … 115 129 116 130 log: function(cols) { 117 var td, tr = document.createElement ('tr');131 var td, tr = document.createElementNS('http://www.w3.org/1999/xhtml', 'tr'); 118 132 this.tbody.appendChild(tr); 119 133 … … 126 140 c = {label: c ? (c.label || c.toString()) : c}; 127 141 128 td = document.createElement ('td');142 td = document.createElementNS('http://www.w3.org/1999/xhtml', 'td'); 129 143 td.appendChild( c.richLabel || (document.createTextNode(c.label || '(none)')) ); 130 144 tr.appendChild(td); … … 137 151 138 152 logFullSpan: function(content) { 139 var td, tr = document.createElement ('tr');153 var td, tr = document.createElementNS('http://www.w3.org/1999/xhtml', 'tr'); 140 154 this.tbody.appendChild(tr); 141 td = document.createElement ('td');155 td = document.createElementNS('http://www.w3.org/1999/xhtml', 'td'); 142 156 td.appendChild(content); 143 157 tr.appendChild(td); … … 147 161 148 162 lazyLogFullSpan: function(labelText, closure) { 149 var td, tr = document.createElement ('tr');163 var td, tr = document.createElementNS('http://www.w3.org/1999/xhtml', 'tr'); 150 164 this.tbody.appendChild(tr); 151 td = document.createElement ('td');152 var label = document.createElement ('span');165 td = document.createElementNS('http://www.w3.org/1999/xhtml', 'td'); 166 var label = document.createElementNS('http://www.w3.org/1999/xhtml', 'span'); 153 167 label.innerHTML = labelText; 154 168 label.className = "lazy-log-open"; -
lang/javascript/javascript-xpath/branches/support-namespace/tools/compress.sh
r1429 r5270 5 5 sed -e "s/\/\*@cc_on/{@cc_on}/g;s/\/\*@_cc_on/{@_cc_on}/g;s/@else @\*\//{@else@}/g;s/\/\*@end @\*\//{@end@}/g;" $1 > ${BASEDIR}/tmp.js 6 6 java -jar ${BASEDIR}/consyntools.jar Obfuscator ${BASEDIR}/tmp.js ${BASEDIR}/tmp2.js __ 7 sed -e "s/{@cc_on}/ \n\/\*@cc_on /g;s/{@_cc_on}/\n\/\*@_cc_on/g;s/{@else@}/@else @\*\//g;s/{@end@}/\/\*@end @\*\//g;" ${BASEDIR}/tmp2.js > $27 sed -e "s/{@cc_on}/ \/\*@cc_on /g;s/{@_cc_on}/ \/\*@_cc_on/g;s/{@else@}/@else @\*\/ /g;s/{@end@}/\/\*@end @\*\/ /g;" ${BASEDIR}/tmp2.js > $2 8 8 rm ${BASEDIR}/tmp.js 9 9 rm ${BASEDIR}/tmp2.js -
lang/javascript/javascript-xpath/branches/support-namespace/version.txt
r1783 r5270 1 0.1. 61 0.1.8
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)