📄 dojo.js
字号:
dojo.lang.toArray=function(_119,_11a){var _11b=[];for(var i=_11a||0;i<_119.length;i++){_11b.push(_119[i]);}return _11b;};dojo.provide("dojo.string");dojo.require("dojo.lang");dojo.string.trim=function(str,wh){if(!dojo.lang.isString(str)){return str;}if(!str.length){return str;}if(wh>0){return str.replace(/^\s+/,"");}else{if(wh<0){return str.replace(/\s+$/,"");}else{return str.replace(/^\s+|\s+$/g,"");}}};dojo.string.trimStart=function(str){return dojo.string.trim(str,1);};dojo.string.trimEnd=function(str){return dojo.string.trim(str,-1);};dojo.string.paramString=function(str,_122,_123){for(var name in _122){var re=new RegExp("\\%\\{"+name+"\\}","g");str=str.replace(re,_122[name]);}if(_123){str=str.replace(/%\{([^\}\s]+)\}/g,"");}return str;};dojo.string.capitalize=function(str){if(!dojo.lang.isString(str)){return "";}if(arguments.length==0){str=this;}var _127=str.split(" ");var _128="";var len=_127.length;for(var i=0;i<len;i++){var word=_127[i];word=word.charAt(0).toUpperCase()+word.substring(1,word.length);_128+=word;if(i<len-1){_128+=" ";}}return new String(_128);};dojo.string.isBlank=function(str){if(!dojo.lang.isString(str)){return true;}return (dojo.string.trim(str).length==0);};dojo.string.encodeAscii=function(str){if(!dojo.lang.isString(str)){return str;}var ret="";var _12f=escape(str);var _130,re=/%u([0-9A-F]{4})/i;while((_130=_12f.match(re))){var num=Number("0x"+_130[1]);var _132=escape("&#"+num+";");ret+=_12f.substring(0,_130.index)+_132;_12f=_12f.substring(_130.index+_130[0].length);}ret+=_12f.replace(/\+/g,"%2B");return ret;};dojo.string.summary=function(str,len){if(!len||str.length<=len){return str;}else{return str.substring(0,len).replace(/\.+$/,"")+"...";}};dojo.string.escape=function(type,str){var args=[];for(var i=1;i<arguments.length;i++){args.push(arguments[i]);}switch(type.toLowerCase()){case "xml":case "html":case "xhtml":return dojo.string.escapeXml.apply(this,args);case "sql":return dojo.string.escapeSql.apply(this,args);case "regexp":case "regex":return dojo.string.escapeRegExp.apply(this,args);case "javascript":case "jscript":case "js":return dojo.string.escapeJavaScript.apply(this,args);case "ascii":return dojo.string.encodeAscii.apply(this,args);default:return str;}};dojo.string.escapeXml=function(str,_13a){str=str.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""");if(!_13a){str=str.replace(/'/gm,"'");}return str;};dojo.string.escapeSql=function(str){return str.replace(/'/gm,"''");};dojo.string.escapeRegExp=function(str){return str.replace(/\\/gm,"\\\\").replace(/([\f\b\n\t\r])/gm,"\\$1");};dojo.string.escapeJavaScript=function(str){return str.replace(/(["'\f\b\n\t\r])/gm,"\\$1");};dojo.string.repeat=function(str,_13f,_140){var out="";for(var i=0;i<_13f;i++){out+=str;if(_140&&i<_13f-1){out+=_140;}}return out;};dojo.string.endsWith=function(str,end,_145){if(_145){str=str.toLowerCase();end=end.toLowerCase();}return str.lastIndexOf(end)==str.length-end.length;};dojo.string.endsWithAny=function(str){for(var i=1;i<arguments.length;i++){if(dojo.string.endsWith(str,arguments[i])){return true;}}return false;};dojo.string.startsWith=function(str,_149,_14a){if(_14a){str=str.toLowerCase();_149=_149.toLowerCase();}return str.indexOf(_149)==0;};dojo.string.startsWithAny=function(str){for(var i=1;i<arguments.length;i++){if(dojo.string.startsWith(str,arguments[i])){return true;}}return false;};dojo.string.has=function(str){for(var i=1;i<arguments.length;i++){if(str.indexOf(arguments[i]>-1)){return true;}}return false;};dojo.string.pad=function(str,len,c,dir){var out=String(str);if(!c){c="0";}if(!dir){dir=1;}while(out.length<len){if(dir>0){out=c+out;}else{out+=c;}}return out;};dojo.string.padLeft=function(str,len,c){return dojo.string.pad(str,len,c,1);};dojo.string.padRight=function(str,len,c){return dojo.string.pad(str,len,c,-1);};dojo.string.normalizeNewlines=function(text,_15b){if(_15b=="\n"){text=text.replace(/\r\n/g,"\n");text=text.replace(/\r/g,"\n");}else{if(_15b=="\r"){text=text.replace(/\r\n/g,"\r");text=text.replace(/\n/g,"\r");}else{text=text.replace(/([^\r])\n/g,"$1\r\n");text=text.replace(/\r([^\n])/g,"\r\n$1");}}return text;};dojo.string.splitEscaped=function(str,_15d){var _15e=[];for(var i=0,prevcomma=0;i<str.length;i++){if(str.charAt(i)=="\\"){i++;continue;}if(str.charAt(i)==_15d){_15e.push(str.substring(prevcomma,i));prevcomma=i+1;}}_15e.push(str.substr(prevcomma));return _15e;};dojo.string.addToPrototype=function(){for(var _160 in dojo.string){if(dojo.lang.isFunction(dojo.string[_160])){var func=(function(){var meth=_160;switch(meth){case "addToPrototype":return null;break;case "escape":return function(type){return dojo.string.escape(type,this);};break;default:return function(){var args=[this];for(var i=0;i<arguments.length;i++){args.push(arguments[i]);}dojo.debug(args);return dojo.string[meth].apply(dojo.string,args);};}})();if(func){String.prototype[_160]=func;}}}};dojo.provide("dojo.io.IO");dojo.require("dojo.string");dojo.io.transports=[];dojo.io.hdlrFuncNames=["load","error"];dojo.io.Request=function(url,_167,_168,_169){if((arguments.length==1)&&(arguments[0].constructor==Object)){this.fromKwArgs(arguments[0]);}else{this.url=url;if(_167){this.mimetype=_167;}if(_168){this.transport=_168;}if(arguments.length>=4){this.changeUrl=_169;}}};dojo.lang.extend(dojo.io.Request,{url:"",mimetype:"text/plain",method:"GET",content:undefined,transport:undefined,changeUrl:undefined,formNode:undefined,sync:false,bindSuccess:false,useCache:false,preventCache:false,load:function(type,data,evt){},error:function(type,_16e){},handle:function(){},abort:function(){},fromKwArgs:function(_16f){if(_16f["url"]){_16f.url=_16f.url.toString();}if(!_16f["method"]&&_16f["formNode"]&&_16f["formNode"].method){_16f.method=_16f["formNode"].method;}if(!_16f["handle"]&&_16f["handler"]){_16f.handle=_16f.handler;}if(!_16f["load"]&&_16f["loaded"]){_16f.load=_16f.loaded;}if(!_16f["changeUrl"]&&_16f["changeURL"]){_16f.changeUrl=_16f.changeURL;}_16f.encoding=dojo.lang.firstValued(_16f["encoding"],djConfig["bindEncoding"],"");_16f.sendTransport=dojo.lang.firstValued(_16f["sendTransport"],djConfig["ioSendTransport"],true);var _170=dojo.lang.isFunction;for(var x=0;x<dojo.io.hdlrFuncNames.length;x++){var fn=dojo.io.hdlrFuncNames[x];if(_170(_16f[fn])){continue;}if(_170(_16f["handle"])){_16f[fn]=_16f.handle;}}dojo.lang.mixin(this,_16f);}});dojo.io.Error=function(msg,type,num){this.message=msg;this.type=type||"unknown";this.number=num||0;};dojo.io.transports.addTransport=function(name){this.push(name);this[name]=dojo.io[name];};dojo.io.bind=function(_177){if(!(_177 instanceof dojo.io.Request)){try{_177=new dojo.io.Request(_177);}catch(e){dojo.debug(e);}}var _178="";if(_177["transport"]){_178=_177["transport"];if(!this[_178]){return _177;}}else{for(var x=0;x<dojo.io.transports.length;x++){var tmp=dojo.io.transports[x];if((this[tmp])&&(this[tmp].canHandle(_177))){_178=tmp;}}if(_178==""){return _177;}}this[_178].bind(_177);_177.bindSuccess=true;return _177;};dojo.io.queueBind=function(_17b){if(!(_17b instanceof dojo.io.Request)){try{_17b=new dojo.io.Request(_17b);}catch(e){dojo.debug(e);}}var _17c=_17b.load;_17b.load=function(){dojo.io._queueBindInFlight=false;var ret=_17c.apply(this,arguments);dojo.io._dispatchNextQueueBind();return ret;};var _17e=_17b.error;_17b.error=function(){dojo.io._queueBindInFlight=false;var ret=_17e.apply(this,arguments);dojo.io._dispatchNextQueueBind();return ret;};dojo.io._bindQueue.push(_17b);dojo.io._dispatchNextQueueBind();return _17b;};dojo.io._dispatchNextQueueBind=function(){if(!dojo.io._queueBindInFlight){dojo.io._queueBindInFlight=true;dojo.io.bind(dojo.io._bindQueue.shift());}};dojo.io._bindQueue=[];dojo.io._queueBindInFlight=false;dojo.io.argsFromMap=function(map,_181){var _182=new Object();var _183="";var enc=/utf/i.test(_181||"")?encodeURIComponent:dojo.string.encodeAscii;for(var x in map){if(!_182[x]){_183+=enc(x)+"="+enc(map[x])+"&";}}return _183;};dojo.provide("dojo.dom");dojo.require("dojo.lang");dojo.dom.ELEMENT_NODE=1;dojo.dom.ATTRIBUTE_NODE=2;dojo.dom.TEXT_NODE=3;dojo.dom.CDATA_SECTION_NODE=4;dojo.dom.ENTITY_REFERENCE_NODE=5;dojo.dom.ENTITY_NODE=6;dojo.dom.PROCESSING_INSTRUCTION_NODE=7;dojo.dom.COMMENT_NODE=8;dojo.dom.DOCUMENT_NODE=9;dojo.dom.DOCUMENT_TYPE_NODE=10;dojo.dom.DOCUMENT_FRAGMENT_NODE=11;dojo.dom.NOTATION_NODE=12;dojo.dom.dojoml="http://www.dojotoolkit.org/2004/dojoml";dojo.dom.xmlns={svg:"http://www.w3.org/2000/svg",smil:"http://www.w3.org/2001/SMIL20/",mml:"http://www.w3.org/1998/Math/MathML",cml:"http://www.xml-cml.org",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml",xul:"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",xbl:"http://www.mozilla.org/xbl",fo:"http://www.w3.org/1999/XSL/Format",xsl:"http://www.w3.org/1999/XSL/Transform",xslt:"http://www.w3.org/1999/XSL/Transform",xi:"http://www.w3.org/2001/XInclude",xforms:"http://www.w3.org/2002/01/xforms",saxon:"http://icl.com/saxon",xalan:"http://xml.apache.org/xslt",xsd:"http://www.w3.org/2001/XMLSchema",dt:"http://www.w3.org/2001/XMLSchema-datatypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/",dcq:"http://purl.org/dc/qualifiers/1.0","soap-env":"http://schemas.xmlsoap.org/soap/envelope/",wsdl:"http://schemas.xmlsoap.org/wsdl/",AdobeExtensions:"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"};dojo.dom.isNode=dojo.lang.isDomNode=function(wh){if(typeof Element=="object"){try{return wh instanceof Element;}catch(E){}}else{return wh&&!isNaN(wh.nodeType);}};dojo.lang.whatAmI.custom["node"]=dojo.dom.isNode;dojo.dom.getTagName=function(node){var _188=node.tagName;if(_188.substr(0,5).toLowerCase()!="dojo:"){if(_188.substr(0,4).toLowerCase()=="dojo"){return "dojo:"+_188.substring(4).toLowerCase();}var djt=node.getAttribute("dojoType")||node.getAttribute("dojotype");if(djt){return "dojo:"+djt.toLowerCase();}if((node.getAttributeNS)&&(node.getAttributeNS(this.dojoml,"type"))){return "dojo:"+node.getAttributeNS(this.dojoml,"type").toLowerCase();}try{djt=node.getAttribute("dojo:type");}catch(e){}if(djt){return "dojo:"+djt.toLowerCase();}if((!dj_global["djConfig"])||(!djConfig["ignoreClassNames"])){var _18a=node.className||node.getAttribute("class");if((_18a)&&(_18a.indexOf)&&(_18a.indexOf("dojo-")!=-1)){var _18b=_18a.split(" ");for(var x=0;x<_18b.length;x++){if((_18b[x].length>5)&&(_18b[x].indexOf("dojo-")>=0)){return "dojo:"+_18b[x].substr(5).toLowerCase();}}}}}return _188.toLowerCase();};dojo.dom.getUniqueId=function(){do{var id="dj_unique_"+(++arguments.callee._idIncrement);}while(document.getElementById(id));return id;};dojo.dom.getUniqueId._idIncrement=0;dojo.dom.firstElement=dojo.dom.getFirstChildElement=function(_18e,_18f){var node=_18e.firstChild;while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){node=node.nextSibling;}if(_18f&&node&&node.tagName&&node.tagName.toLowerCase()!=_18f.toLowerCase()){node=dojo.dom.nextElement(node,_18f);}return node;};dojo.dom.lastElement=dojo.dom.getLastChildElement=function(_191,_192){var node=_191.lastChild;while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){node=node.previousSibling;}if(_192&&node&&node.tagName&&node.tagName.toLowerCase()!=_192.toLowerCase()){node=dojo.dom.prevElement(node,_192);}return node;};dojo.dom.nextElement=dojo.dom.getNextSiblingElement=function(node,_195){if(!node){return null;}do{node=node.nextSibling;}while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE);if(node&&_195&&_195.toLowerCase()!=node.tagName.toLowerCase()){return dojo.dom.nextElement(node,_195);}return node;};dojo.dom.prevElement=dojo.dom.getPreviousSiblingElement=function(node,_197){if(!node){return null;}if(_197){_197=_197.toLowerCase();}do{node=node.previousSibling;}while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE);if(node&&_197&&_197.toLowerCase()!=node.tagName.toLowerCase()){return dojo.dom.prevElement(node,_197);}return node;};dojo.dom.moveChildren=function(_198,_199,trim){var _19b=0;if(trim){while(_198.hasChildNodes()&&_198.firstChild.nodeType==dojo.dom.TEXT_NODE){_198.removeChild(_198.firstChild);}while(_198.hasChildNodes()&&_198.lastChild.nodeType==dojo.dom.TEXT_NODE){_198.removeChild(_198.lastChild);}}while(_198.hasChildNodes()){_199.appendChild(_198.firstChild);_19b++;}return _19b;};dojo.dom.copyChildren=function(_19c,_19d,trim){var _19f=_19c.cloneNode(true);return this.moveChildren(_19f,_19d,trim);};dojo.dom.removeChildren=function(node){var _1a1=node.childNodes.length;while(node.hasChildNodes()){node.removeChild(node.firstChild);}return _1a1;};dojo.dom.replaceChildren=function(node,_1a3){dojo.dom.removeChildren(node);node.appendChild(_1a3);};dojo.dom.removeNode=function(node){if(node&&node.parentNode){return node.parentNode.removeChild(node);}};dojo.dom.getAncestors=function(node,_1a6,_1a7){var _1a8=[];var _1a9=dojo.lang.isFunction(_1a6);while(node){if(!_1a9||_1a6(node)){_1a8.push(node);}if(_1a7&&_1a8.length>0){return _1a8[0];}node=node.parentNode;}if(_1a7){return null;}return _1a8;};dojo.dom.getAncestorsByTag=function(node,tag,_1ac){tag=tag.toLowerCase();return dojo.dom.getAncestors(node,function(el){return ((el.tagName)&&(el.tagName.toLowerCase()==tag));},_1ac);};dojo.dom.getFirstAncestorByTag=function(node,tag){return dojo.dom.getAncestorsByTag(node,tag,true);};dojo.dom.isDescendantOf=function(node,_1b1,_1b2){if(_1b2&&node){node=node.parentNode;}while(node){if(node==_1b1){return true;}node=node.parentNode;}return false;};dojo.dom.innerXML=function(node){if(node.innerXML){return node.innerXML;}else{if(typeof XMLSerializer!="undefined"){return (new XMLSerializer()).serializeToString(node);}}};dojo.dom.createDocumentFromText=function(str,_1b5){if(!_1b5){_1b5="text/xml";}if(typeof DOMParser!="undefined"){var _1b6=new DOMParser();return _1b6.parseFromString(str,_1b5);}else{if(typeof ActiveXObject!="undefined"){var _1b7=new ActiveXObject("Microsoft.XMLDOM");if(_1b7){_1b7.async=false;_1b7.loadXML(str);return _1b7;}else{dojo.debug("toXml didn't work?");}}else{if(document.createElement){var tmp=document.createElement("xml");tmp.innerHTML=str;if(document.implementation&&document.implementation.createDocument){var _1b9=document.implementation.createDocument("foo","",null);for(var i=0;i<tmp.childNodes.length;i++){_1b9.importNode(tmp.childNodes.item(i),true);}return _1b9;}return tmp.document&&tmp.document.firstChild?tmp.document.firstChild:tmp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -