📄 dojo.js
字号:
/* Copyright (c) 2004-2005 The Dojo Foundation, Licensed under the Academic Free License version 2.1 or above */var dj_global=this;function dj_undef(_1,_2){if(!_2){_2=dj_global;}return (typeof _2[_1]=="undefined");}function dj_eval_object_path(_3,_4){if(typeof _3!="string"){return dj_global;}if(_3.indexOf(".")==-1){return dj_undef(_3)?undefined:dj_global[_3];}var _5=_3.split(/\./);var _6=dj_global;for(var i=0;i<_5.length;++i){if(!_4){_6=_6[_5[i]];if((typeof _6=="undefined")||(!_6)){return _6;}}else{if(dj_undef(_5[i],_6)){_6[_5[i]]={};}_6=_6[_5[i]];}}return _6;}if(dj_undef("djConfig")){var djConfig={};}var dojo;if(dj_undef("dojo")){dojo={};}function dj_debug(){var _8=arguments;if(dj_undef("println",dojo.hostenv)){dj_throw("dj_debug not available (yet?)");}if(!dojo.hostenv.is_debug_){return;}var _9=dj_global["jum"];var s=_9?"":"DEBUG: ";for(var i=0;i<_8.length;++i){s+=_8[i];}if(_9){jum.debug(s);}else{dojo.hostenv.println(s);}}function dj_throw(_11){var he=dojo.hostenv;if(dj_undef("hostenv",dojo)&&dj_undef("println",dojo)){dojo.hostenv.println("FATAL: "+_11);}throw Error(_11);}function dj_error_to_string(_13){return ((!dj_undef("message",_13))?_13.message:(dj_undef("description",_13)?_13:_13.description));}function dj_rethrow(_14,_15){var _16=dj_error_to_string(_15);dj_throw(_14+": "+_16);}function dj_eval(s){return dj_global.eval?dj_global.eval(s):eval(s);}function dj_unimplemented(_17,_18){var _19="'"+_17+"' not implemented";if((typeof _18!="undefined")&&(_18)){_19+=" "+_18;}dj_throw(_19);}function dj_inherits(_20,_21){if(typeof _21!="function"){dj_throw("superclass: "+_21+" borken");}_20.prototype=new _21();_20.prototype.constructor=_20;_20["super"]=_21;}dojo.render={name:"",ver:0,os:{win:false,linux:false,osx:false},html:{capable:false,support:{builtin:false,plugin:false},ie:false,opera:false,khtml:false,safari:false,moz:false},svg:{capable:false,support:{builtin:false,plugin:false},corel:false,adobe:false,batik:false},swf:{capable:false,support:{builtin:false,plugin:false},mm:false},swt:{capable:false,support:{builtin:false,plugin:false},ibm:false}};dojo.hostenv=(function(){var djc=djConfig;function _def(obj,_24,def){return (dj_undef(_24,obj)?def:obj[_24]);}return {is_debug_:_def(djc,"isDebug",false),base_script_uri_:_def(djc,"baseScriptUri",undefined),base_relative_path_:_def(djc,"baseRelativePath",""),library_script_uri_:_def(djc,"libraryScriptUri",""),auto_build_widgets_:_def(djc,"parseWidgets",true),name_:"(unset)",version_:"(unset)",pkgFileName:"__package__",loading_modules_:{},addedToLoadingCount:[],removedFromLoadingCount:[],inFlightCount:0,modulePrefixes_:{dojo:{name:"dojo",value:"src"}},setModulePrefix:function(_26,_27){this.modulePrefixes_[_26]={name:_26,value:_27};},getModulePrefix:function(_28){var mp=this.modulePrefixes_;if((mp[_28])&&(mp[_28]["name"])){return mp[_28].value;}return _28;},getTextStack:[],loadUriStack:[],loadedUris:[],modules_:{},modulesLoadedFired:false,modulesLoadedListeners:[],getName:function(){return this.name_;},getVersion:function(){return this.version_;},getText:function(uri){dj_unimplemented("getText","uri="+uri);},getLibraryScriptUri:function(){dj_unimplemented("getLibraryScriptUri","");}};})();dojo.hostenv.getBaseScriptUri=function(){if(!dj_undef("base_script_uri_",this)){return this.base_script_uri_;}var uri=this.library_script_uri_;if(!uri){uri=this.library_script_uri_=this.getLibraryScriptUri();if(!uri){dj_throw("Nothing returned by getLibraryScriptUri(): "+uri);}}var _31=uri.lastIndexOf("/");this.base_script_uri_=this.base_relative_path_;return this.base_script_uri_;};dojo.hostenv.setBaseScriptUri=function(uri){this.base_script_uri_=uri;};dojo.hostenv.loadPath=function(_32,_33,cb){if(!_32){dj_throw("Missing relpath argument");}if((_32.charAt(0)=="/")||(_32.match(/^\w+:/))){dj_throw("relpath '"+_32+"'; must be relative");}var uri=this.getBaseScriptUri()+_32;try{return ((!_33)?this.loadUri(uri):this.loadUriAndCheck(uri,_33));}catch(e){if(dojo.hostenv.is_debug_){dj_debug(e);}return false;}};dojo.hostenv.loadUri=function(uri,cb){if(dojo.hostenv.loadedUris[uri]){return;}var _35=this.getText(uri,null,true);if(_35==null){return 0;}var _36=dj_eval(_35);return 1;};dojo.hostenv.getDepsForEval=function(_37){if(!_37){_37="";}var _38=[];var tmp=_37.match(/dojo.hostenv.loadModule\(.*?\)/mg);if(tmp){for(var x=0;x<tmp.length;x++){_38.push(tmp[x]);}}tmp=_37.match(/dojo.hostenv.require\(.*?\)/mg);if(tmp){for(var x=0;x<tmp.length;x++){_38.push(tmp[x]);}}tmp=_37.match(/dojo.hostenv.conditionalLoadModule\([\w\W]*?\)/gm);if(tmp){for(var x=0;x<tmp.length;x++){_38.push(tmp[x]);}}return _38;};dojo.hostenv.loadUriAndCheck=function(uri,_41,cb){var ok=true;try{ok=this.loadUri(uri,cb);}catch(e){dj_debug("failed loading ",uri," with error: ",e);}return ((ok)&&(this.findModule(_41,false)))?true:false;};dojo.hostenv.loaded=function(){this.modulesLoadedFired=true;var mll=this.modulesLoadedListeners;for(var x=0;x<mll.length;x++){mll[x]();}};dojo.hostenv.modulesLoaded=function(){if(this.modulesLoadedFired){return;}if((this.loadUriStack.length==0)&&(this.getTextStack.length==0)){if(this.inFlightCount>0){dj_debug("couldn't initialize, there are files still in flight");return;}this.loaded();}};dojo.hostenv.loadModule=function(_44,_45,_46){var _47=this.findModule(_44,false);if(_47){return _47;}if(!dj_undef(_44,this.loading_modules_)){dj_debug("recursive attempt to load module '"+_44+"'");}else{this.addedToLoadingCount.push(_44);}this.loading_modules_[_44]=1;var _48=_44.replace(/\./g,"/")+".js";var _49=_44.split(".");var _50=_44.split(".");_49[0]=this.getModulePrefix(_49[0]);var _51=_49.pop();_49.push(_51);if(_51=="*"){_44=(_50.slice(0,-1)).join(".");var _47=this.findModule(_44,0);if(_47){return _47;}while(_49.length){_49.pop();_49.push("__package__");_48=_49.join("/")+".js";if(_48.charAt(0)=="/"){_48=_48.slice(1);}ok=this.loadPath(_48,((!_46)?_44:null));if(ok){break;}_49.pop();}}else{_48=_49.join("/")+".js";_44=_50.join(".");var ok=this.loadPath(_48,((!_46)?_44:null));if((!ok)&&(!_45)){_49.pop();while(_49.length){_48=_49.join("/")+".js";ok=this.loadPath(_48,((!_46)?_44:null));if(ok){break;}_49.pop();_48=_49.join("/")+"/__package__.js";if(_48.charAt(0)=="/"){_48=_48.slice(1);}ok=this.loadPath(_48,((!_46)?_44:null));if(ok){break;}}}if((!ok)&&(!_46)){dj_throw("Could not load '"+_44+"'; last tried '"+_48+"'");}}if(!_46){_47=this.findModule(_44,false);if(!_47){dj_throw("symbol '"+_44+"' is not defined after loading '"+_48+"'");}}return _47;};function dj_load(_52,_53){return dojo.hostenv.loadModule(_52,_53);}dojo.hostenv.startPackage=function(_54){var _55=_54.split(/\./);if(_55[_55.length-1]=="*"){_55.pop();}return dj_eval_object_path(_55.join("."),true);};dojo.hostenv.findModule=function(_56,_57){if(!dj_undef(_56,this.modules_)){return this.modules_[_56];}var _58=dj_eval_object_path(_56);if((typeof _58!=="undefined")&&(_58)){return this.modules_[_56]=_58;}if(_57){dj_throw("no loaded module named '"+_56+"'");}return null;};if(typeof window=="undefined"){dj_throw("no window object");}(function(){if((dojo.hostenv["base_script_uri_"]==""||dojo.hostenv["base_relative_path_"]=="")&&document&&document.getElementsByTagName){var _59=document.getElementsByTagName("script");var _60=/__package__\.js$/i;for(var i=0;i<_59.length;i++){var src=_59[i].getAttribute("src");if(_60.test(src)){var _62=src.replace(_60,"");if(dojo.hostenv["base_script_uri_"]==""){dojo.hostenv["base_script_uri_"]=_62;}if(dojo.hostenv["base_relative_path_"]==""){dojo.hostenv["base_relative_path_"]=_62;}break;}}}})();with(dojo.render){html.UA=navigator.userAgent;html.AV=navigator.appVersion;html.capable=true;html.support.builtin=true;ver=parseFloat(html.AV);os.mac=html.AV.indexOf("Macintosh")==-1?false:true;os.win=html.AV.indexOf("Windows")==-1?false:true;html.opera=html.UA.indexOf("Opera")==-1?false:true;html.khtml=((html.AV.indexOf("Konqueror")>=0)||(html.AV.indexOf("Safari")>=0))?true:false;html.safari=(html.AV.indexOf("Safari")>=0)?true:false;html.moz=((html.UA.indexOf("Gecko")>=0)&&(!html.khtml))?true:false;html.ie=((document.all)&&(!html.opera))?true:false;html.ie50=html.ie&&html.AV.indexOf("MSIE 5.0")>=0;html.ie55=html.ie&&html.AV.indexOf("MSIE 5.5")>=0;html.ie60=html.ie&&html.AV.indexOf("MSIE 6.0")>=0;}dojo.hostenv.startPackage("dojo.hostenv");dojo.hostenv.name_="browser";var DJ_XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];dojo.hostenv.getXmlhttpObject=function(){var _63=null;var _64=null;try{_63=new XMLHttpRequest();}catch(e){}if(!_63){for(var i=0;i<3;++i){var _65=DJ_XMLHTTP_PROGIDS[i];try{_63=new ActiveXObject(_65);}catch(e){_64=e;}if(_63){DJ_XMLHTTP_PROGIDS=[_65];break;}else{}}}if((_64)&&(!_63)){dj_rethrow("Could not create a new ActiveXObject using any of the progids "+DJ_XMLHTTP_PROGIDS.join(", "),_64);}else{if(!_63){return dj_throw("No XMLHTTP implementation available, for uri "+uri);}}return _63;};dojo.hostenv.getText=function(uri,_66,_67){var _68=this.getXmlhttpObject();if(_66){_68.onreadystatechange=function(){if((4==_68.readyState)&&(_68["status"])){if(_68.status==200){dj_debug("LOADED URI: "+uri);_66(_68.responseText);}}};}_68.open("GET",uri,_66?true:false);_68.send(null);if(_66){return null;}return _68.responseText;};function dj_last_script_src(){var _69=window.document.getElementsByTagName("script");if(_69.length<1){dj_throw("No script elements in window.document, so can't figure out my script src");}var _70=_69[_69.length-1];var src=_70.src;if(!src){dj_throw("Last script element (out of "+_69.length+") has no src");}return src;}if(!dojo.hostenv["library_script_uri_"]){dojo.hostenv.library_script_uri_=dj_last_script_src();}dojo.hostenv.println=function(s){var ti=null;var dis="<div>"+s+"</div>";try{ti=document.createElement("div");document.body.appendChild(ti);ti.innerHTML=s;}catch(e){try{document.write(dis);}catch(e2){window.status=s;}}delete ti;delete dis;delete s;};window.onload=function(evt){dojo.hostenv.modulesLoaded();};dojo.hostenv.modulesLoadedListeners.push(function(){if(dojo.hostenv.auto_build_widgets_){if(dj_eval_object_path("dojo.webui.widgets.Parse")){try{var _74=new dojo.xml.Parse();var _75=_74.parseElement(document.body,null,true);dojo.webui.widgets.getParser().createComponents(_75);}catch(e){dj_debug("auto-build-widgets error: "+e);}}}});if((!window["djConfig"])||(!window["djConfig"]["preventBackButtonFix"])){document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='"+(dojo.hostenv.getBaseScriptUri()+"/blank.html")+"'></iframe>");}dojo.hostenv.conditionalLoadModule=function(_76){var _77=_76["common"]||[];var _78=(_76[dojo.hostenv.name_])?_77.concat(_76[dojo.hostenv.name_]||[]):_77.concat(_76["default"]||[]);for(var x=0;x<_78.length;x++){var _79=_78[x];if(_79.constructor==Array){dojo.hostenv.loadModule.apply(dojo.hostenv,_79);}else{dojo.hostenv.loadModule(_79);}}};dojo.hostenv.require=dojo.hostenv.loadModule;dojo.hostenv.provide=dojo.hostenv.startPackage;dj_debug("Using host environment: ",dojo.hostenv.name_);dj_debug("getBaseScriptUri()=",dojo.hostenv.getBaseScriptUri());dojo.hostenv.startPackage("dojo.io.IO");dojo.io.transports=[];dojo.io.hdlrFuncNames=["load","error"];dojo.io.Request=function(url,mt,_82,_83){this.url=url;this.mimetype=mt;this.transport=_82;this.changeUrl=_83;this.formNode=null;this.events_={};var _84=this;this.error=function(_85,_86){switch(_85){case "io":var _87=dojo.io.IOEvent.IO_ERROR;var _88="IOError: error during IO";break;case "parse":var _87=dojo.io.IOEvent.PARSE_ERROR;var _88="IOError: error during parsing";default:var _87=dojo.io.IOEvent.UNKOWN_ERROR;var _88="IOError: cause unkown";}var _89=new dojo.io.IOEvent("error",null,_84,_88,this.url,_87);_84.dispatchEvent(_89);if(_84.onerror){_84.onerror(_88,_84.url,_89);}};this.load=function(_90,_91,evt){var _92=new dojo.io.IOEvent("load",_91,_84,null,null,null);_84.dispatchEvent(_92);if(_84.onload){_84.onload(_92);}};this.backButton=function(){var _93=new dojo.io.IOEvent("backbutton",null,_84,null,null,null);_84.dispatchEvent(_93);if(_84.onbackbutton){_84.onbackbutton(_93);}};this.forwardButton=function(){var _94=new dojo.io.IOEvent("forwardbutton",null,_84,null,null,null);_84.dispatchEvent(_94);if(_84.onforwardbutton){_84.onforwardbutton(_94);}};};dojo.io.Request.prototype.addEventListener=function(_95,_96){if(!this.events_[_95]){this.events_[_95]=[];}for(var i=0;i<this.events_[_95].length;i++){if(this.events_[_95][i]==_96){return;}}this.events_[_95].push(_96);};dojo.io.Request.prototype.removeEventListener=function(_97,_98){if(!this.events_[_97]){return;}for(var i=0;i<this.events_[_97].length;i++){if(this.events_[_97][i]==_98){this.events_[_97].splice(i,1);}}};dojo.io.Request.prototype.dispatchEvent=function(evt){if(!this.events_[evt.type]){return;}for(var i=0;i<this.events_[evt.type].length;i++){this.events_[evt.type][i](evt);}return false;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -