⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 runtime.js

📁 《JavaScript王者归来》examples.rar
💻 JS
📖 第 1 页 / 共 3 页
字号:
_JSVM_Namespace.runtimeEnvironment.loadModule("runtime",function(){var jsre=_JSVM_Namespace.runtimeEnvironment,JSVM=jsre.JSVM;var Exception=_JSVM_Namespace.kernel.Exception,logger=jsre.logger;var imp=function(name,code){JSVM.getContainer().putClassCode(name,code);};imp('js.lang.ArgumentException','$package("js.lang");var Exception=$import("js.lang.Exception");var $class=js.lang.ArgumentException=function(){return $ArgumentException.apply(this,arguments);};var ArgumentException=$class;$class.$extends(Exception);var $ArgumentException=function(){$class.$super.apply(this,arguments.length>0?arguments:["Arguments Illegal."]);}');imp('js.lang.BObject','$package("js.lang");var System=$import("js.lang.System");var NotSupportException=$import("js.lang.NotSupportException");var $class=js.lang.BObject=function(){return $BObject.apply(this,arguments);};var BObject=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $BObject=function(){if(!(System.isIeBrowser()||System.isMozBrowser()||System.isOperaBrowser())){throw new NotSupportException("BObject only support IE5+,Moz or Opera!");};this.uniqueID=BObject.createUniqueId();if(!isCalledByExtends()){this.init();var obj=this;System.addVMDestroyListener(function(){obj.destroy();});}};var $p=BObject.prototype;$p.init=function(){};$p.destroy=function(){};var uidPrefix="_jbo_"+new Date().getTime().toString(16)+"_";var sequence=0;BObject.createUniqueId=function(){return uidPrefix+(sequence++);};$p.getUniqueId=function(){if(!this.hasOwnProperty("uniqueID")){this.uniqueID=BObject.createUniqueId();};return this.uniqueID;};var container={};$p.globalize=function(bool){var uid=this.getUniqueId();container[uid]=this;if(bool==true){window[uid]=this;}};$p.unglobalize=function(){var uid=this.getUniqueId();delete container[uid];window[uid]=null;};BObject.getGlobalObjectByUniqueId=function(sId){return container[sId];};BObject.getAllGlobalObjects=function(){var objs=[],i=0;for(var uid in container){objs[i++]=container[uid];};return objs;};System.addVMDestroyListener(BObject.destroyGlobalVariables=function(){for(var uid in container){window[uid]=null;};container={};});var isCalledByExtends=function(){var caller=arguments.callee.caller;while(caller=caller.caller){if(caller==Class.prototype.$extends){return true;}};return false;}');imp('js.lang.Cloneable','$package("js.lang");var JObject=$import("js.lang.JObject");var ArgumentException=$import("js.lang.ArgumentException");var $class=js.lang.Cloneable=function(){return $Cloneable.apply(this,arguments);};var Cloneable=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $Cloneable=function(){};var $p=Cloneable.prototype;$p.clone=function(){var co=this.getClass().newInstance();for(var p in this){var v=this[p];if(typeof(v)=="function"){continue;};co[p]=v;};return co;};Cloneable.cloneObject=function(o){if(o instanceof Cloneable){return o.clone();};var type=typeof(o);switch(type){case "undefined":case "boolean":case "string":case "number":return o;case "function":return o;case "object":if(o==null){return null;}else if(o instanceof Date){return new Date(o.getTime());}else if(o instanceof Number){return new Number(o.valueOf());}else if(o instanceof Boolean){return new Boolean(o.valueOf());}else if(o instanceof Error){return new Error(o.number,o.message);}else if(o instanceof Array){return o.concat([]);}else if(o instanceof JObject){throw new ArgumentException(Cloneable.getName()+".cloneObject(o) error, coundn\'t clone a \'"+o.getClass().getName()+"\' instance.");}else if(o instanceof Object){var co={};for(var k in o){co[k]=Cloneable.cloneObject(o[k]);};return co;}else{throw new ArgumentException(Cloneable.getName()+".cloneObject(o) error: unknow type.");};default:break;};throw new ArgumentException(Cloneable.getName()+".cloneObject(o) error, [type: "+type+"]");}');imp('js.lang.Exception','$package("js.lang");(js.lang.Exception=function(){_JSVM_Namespace.kernel.Exception.apply(this,arguments);}).$extends(_JSVM_Namespace.kernel.Exception);');imp('js.lang.JObject','$package("js.lang");js.lang.JObject=_JSVM_Namespace.kernel.Object;js.lang.JObject.$super=Object;');imp('js.lang.NotSupportException','$package("js.lang");var Exception=$import("js.lang.Exception");var $class=js.lang.NotSupportException=function(){return $NotSupportException.apply(this,arguments);};var NotSupportException=$class;$class.$extends(Exception);var $NotSupportException=function(){$class.$super.apply(this,arguments.length>0?arguments:["System don\'t support!"]);}');imp('js.lang.RuntimeException','$package("js.lang");var Exception=$import("js.lang.Exception");var $class=js.lang.RuntimeException=function(){return $RuntimeException.apply(this,arguments);};var RuntimeException=$class;$class.$extends(Exception);var $RuntimeException=function(){$class.$super.apply(this,arguments.length>0?arguments:["Runtime Exception."]);}');imp('js.lang.StringBuffer','$package("js.lang");var $class=js.lang.StringBuffer=function(){return $StringBuffer.apply(this,arguments);};var StringBuffer=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $StringBuffer=function(s){var strs=[];var str=null;var curr=0;this.append=function(s){strs[curr++]=String(s);str=null;return this;};this.insert=function(index,s){var v=this.toString();str=v.substring(0,index)+s+v.substring(index);strs=[str];curr=1;return this;};this.indexOf=function(s){return this.toString().indexOf(s);};this.lastIndexOf=function(s){return this.toString().lastIndexOf(s);};this.substring=function(st,ed){return(ed)?this.toString().substring(st):this.toString().substring(st,ed);};this.toString=function(){if(str==null){str=strs.join("");strs=[str];curr=1;};return str;};this.length=function(){return this.toString().length;};this.setLength=function(l){l=(l<0)?0:l;l=(l>this.length())?this.length():l;str=str.substring(0,l);strs=new Array(str);curr=1;};if(s!=null){this.append(s);}}');imp('js.lang.System','$package("js.lang");var ArgumentException=$import("js.lang.ArgumentException");var NotSupportException=$import("js.lang.NotSupportException");var $class=js.lang.System=function(){return $System.apply(this,arguments);};var System=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $System=function(){throw new NotSupportException(System.getName()+" cannot be instantiated.");};System.NS=_JSVM_Namespace;System.RE=System.NS.runtimeEnvironment;System.VM=System.RE.JSVM;System.getRuntimeEnvironment=function(){return System.RE;};var _platform=null;System.getPlatform=function(){if(_platform!=null){return _platform;};if(typeof(navigator)=="undefined"){return "not-browser";};var ua=navigator.userAgent.toLowerCase();if(/gecko/i.test(ua)){_platform="moz";}else if(/opera/i.test(ua)){_platform="opera";}else if(/msie/i.test(ua)){if(/msie 7/i.test(ua)){_platform="ie7";}else if(/msie 6/i.test(ua)){_platform="ie6";}else if(/msie 5\\.5/i.test(ua)){_platform="ie5.5";}else if(/msie 5\\.[^5]/i.test(ua)){_platform="ie5";}else{_platform="ie";}}else{_platform="other";};return _platform;};var isIE=/ie/.test(System.getPlatform());var isMoz=System.getPlatform()=="moz";var isOpera=System.getPlatform()=="opera";System.isIeBrowser=function(){return isIE;};System.isMozBrowser=function(){return isMoz;};System.isOperaBrowser=function(){return isOpera;};System.exit=function(){if(!(System.isMozBrowser()||System.isIeBrowser()||System.isOperaBrowser())){throw new NotSupportException("The Platform Must be IE5+, Moz or Opera Browser!");}else if(System.getPlatform()<"ie6"){var str="<object id=\\"noTipClose\\" "+"classid=\\"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11\\">"+"<param name=\\"Command\\" value=\\"close\\"></object>";document.body.insertAdjacentHTML("beforeEnd",str);document.all.noTipClose.Click();}else{window.opener=null;window.close();}};System.getClassloader=function(){return System.VM.getClassloader();};System.getBaseHome=function(){return System.RE.jsvmHome;};System.getSystemHome=function(){return System.RE.jsvmHome+"/bin";};System.getClassHome=function(){return System.RE.jsvmHome+"/classes";};System.getLibHome=function(){return System.RE.jsvmHome+"/lib";};System.getResourceHome=function(){return System.RE.jsvmHome+"/res";};System.getSystemVariable=function(name){return System.RE.config.getParameter(name);};System.getPlugIn=function(name){return _JSVM_Namespace.plugIn[name];};System.gc=function(){if(System.isIeBrowser()){setTimeout(function(){CollectGarbage();});}};System.getProperty=function(key,def){return System.RE.resource.get("$sys_property_key__"+key)||def;};System.setProperty=function(key,value){System.RE.resource.put("$sys_property_key__"+key,value);};System.out={"print":function(s){System.VM.console.write(s);},"println":function(s){System.VM.console.write(s+"\\r\\n");}};var listeners=[];var oDestroy=System.VM.destroy;System.VM.destroy=function(){try{var i=0,hdl;while(hdl=listeners[i++]){try{hdl();}catch(ex){}}}catch(ex){}finally{oDestroy.call(System.VM);listeners=null;}};System.addVMDestroyListener=function(hdl){listeners.push(hdl);}');imp('js.dom.Window','$package("js.dom");var System=$import("js.lang.System");var BObject=$import("js.lang.BObject");var $class=js.dom.Window=function(){return $Window.apply(this,arguments);};var Window=$class;$class.$extends(BObject);var $Window=function(src){$class.$super.call(this);this.sourceCode=src;this.width=null;this.height=null;this.top=null;this.left=null;this.toolbar=null;this.location=null;this.directories=null;this.menubar=null;this.scrollbars=null;this.resizable=null;this.status="yes";this.name="window_"+new Date().getTime();this.handle=null;};var $p=Window.prototype;$p.getWindowStyle=function(){return(((this.width!=null)?("width="+this.width+","):"")+((this.height!=null)?("height="+this.height+","):"")+((this.top!=null)?("top="+this.top+","):"")+((this.left!=null)?("left="+this.left+","):"")+((this.toolbar!=null)?("toolbar="+this.toolbar+","):"")+((this.location!=null)?("location="+this.location+","):"")+((this.directories!=null)?("directories="+this.directories+","):"")+((this.menubar!=null)?("menubar="+this.menubar+","):"")+((this.scrollbars!=null)?("scrollbars="+this.scrollbars+","):"")+((this.resizable!=null)?("resizable="+this.resizable+","):"")+((this.status!=null)?("status="+this.status+","):"")).replace(/,$/,"");};$p.show=function(arg){if(this.isActive()){this.focus();}else{this.open(arg);}};$p.open=function(arg){if(this.isActive()){this.close();};var handle=this.handle=window.open((/HTTPS:/i.test(document.URL)?Window.getCommonWebURL():"about:blank"),this.name,this.getWindowStyle());handle.document.open();handle.document.write(this.sourceCode);handle.window.windowArguments={"arguments":arg,"window":window};handle.window.owner=this;handle.window.setInterval("try{if(!owner.isAlive())window.close();}"+"catch(e){window.close();}",1000);handle.document.close();return handle;};$p.hide=function(){if(this.isActive()){window.focus();}};$p.close=function(){if(this.isActive()){this.handle.close();};this.handle=null;};$p.focus=function(){if(this.isActive()){this.handle.focus();}};$p.isActive=function(){try{return(this.handle!=null&&this.handle.closed==false);}catch(ex){return false;}};$p.valueOf=function(){return this.handle;};Window.getCommonWebURL=function(){return(System.getSystemHome()+"/res/__web.htm");}');imp('js.dom.StyleSheet','$package("js.dom");var System=$import("js.lang.System");var BObject=$import("js.lang.BObject");var NotSupportException=$import("js.lang.NotSupportException");var $class=js.dom.StyleSheet=function(){return $StyleSheet.apply(this,arguments);};var StyleSheet=$class;$class.$extends(BObject);var $StyleSheet=function(cs){if(!(System.isIeBrowser()||System.isMozBrowser())){throw new NotSupportException(StyleSheet.getName()+"() error: does not support \'"+System.getPlatform()+"\'");};this.__sst=cs;};var $p=StyleSheet.prototype;$p.addRule=function(sSelector,sStyle,iIndex){if(iIndex==null){iIndex=(js.lang.System.isIeBrowser())?this.__sst.rules.length:this.__sst.cssRules.length;};if(js.lang.System.isIeBrowser()){this.__sst.addRule(sSelector,sStyle,iIndex);};if(js.lang.System.isMozBrowser()){this.__sst.insertRule(sSelector+" { "+sStyle+"} ",iIndex);}};$p.removeRule=function(iIndex){if(js.lang.System.isIeBrowser()){this.__sst.removeRule(iIndex);};if(js.lang.System.isMozBrowser()){this.__sst.deleteRule(iIndex);}};StyleSheet.create=function(doc){if(!(System.isIeBrowser()||System.isMozBrowser())){throw new NotSupportException(StyleSheet.getName()+".create() error: does not support \'"+System.getPlatform()+"\'");};doc=doc||document;var elmt=doc.createElement("style");var heads=doc.getElementsByTagName("HEAD");if(heads.length>0){heads[0].appendChild(elmt);}else if(doc.body!=null){doc.body.appendChild(elmt);}else{doc.write("<style/>");};var len=doc.styleSheets.length;return new StyleSheet(doc.styleSheets.item(len-1));};StyleSheet.addCssLink=function(url,doc){doc=doc||document;var elmt=doc.createElement("link");elmt.setAttribute("id",BObject.createUniqueId());var heads=doc.getElementsByTagName("HEAD");if(heads.length>0){heads[0].appendChild(elmt);}else if(doc.body!=null){doc.body.appendChild(elmt);}else{var uid=BObject.createUniqueId();doc.write("<link id=\\""+uid+"\\" rel=\\"stylesheet\\" href=\\""+url+"\\" />");return doc.getElementById(uid);};elmt.setAttribute("rel","stylesheet");elmt.setAttribute("href",url);return elmt;}');imp('js.dom.EventManager','$package("js.dom");var BObject=$import("js.lang.BObject");var NotSupportException=$import("js.lang.NotSupportException");var ArgumentException=$import("js.lang.ArgumentException");var System=$import("js.lang.System");var ArrayList=$import("js.util.ArrayList");var $class=js.dom.EventManager=function(){return $EventManager.apply(this,arguments);};var EventManager=$class;$class.$extends(BObject);var $EventManager=function(){throw new NotSupportException(EventManager.getName()+" cannot be instantiated.");};var listenerList=new ArrayList();var registerListener=function(target,type,handler,scope,useCapture){var listener=createEventListenerByHanlder(handler,scope||target);listenerList.add({"target":target,"type":type,"handler":handler,"scope":scope,"useCapture":useCapture,"listener":listener});return listener;};var unregisterListener=function(target,type,handler,scope,useCapture){var i=0,l=listenerList.size();for(;i<l;i++){var o=listenerList.get(i);if(o.target==target&&o.type==type&&o.handler==handler&&o.scope==scope&&o.useCapture==useCapture){listenerList.remove(o);return o.listener;}}};var createEventListenerByHanlder=function(handler,scope){return function(evt){return handler.call(scope,(evt||window.event));}};System.addVMDestroyListener(function(){var o,i=0,objs=listenerList.toArray();while(o=objs[i++]){EventManager.detachEvent(o.target,o.type,o.handler,o.scope,o.useCapture);}});EventManager.addEventListener=function(target,type,handler,scope,useCapture){try{useCapture=(useCapture==true);var fpNotify=registerListener(target,type,handler,scope,useCapture);if(target.addEventListener){target.addEventListener(type,fpNotify,useCapture);}else if(target.attachEvent){target.attachEvent("on"+type,fpNotify);if(useCapture&&target.setCapture){target.setCapture();}}}catch(ex){throw new ArgumentException(EventManager.getName()+".attachEvent() arguments error.",ex);}};EventManager.removeEventListener=function(target,type,handler,scope,useCapture){try{useCapture=(useCapture==true);var fpNotify=unregisterListener(target,type,handler,scope,useCapture);if(fpNotify==null){return;};if(target.removeEventListener){target.removeEventListener(type,fpNotify,useCapture);}else if(target.detachEvent){target.detachEvent("on"+type,fpNotify);if(useCapture&&target.releaseCapture){target.releaseCapture();}}}catch(ex){throw new ArgumentException(EventManager.getName()+".detachEvent() arguments error.",ex);}};EventManager.attachEvent=EventManager.addEventListener;EventManager.detachEvent=EventManager.removeEventListener;');imp('js.io.Cookie','$package("js.io");var BObject=$import("js.lang.BObject");var $class=js.io.Cookie=function(){return $Cookie.apply(this,arguments);};var Cookie=$class;$class.$extends(BObject);var $Cookie=function(domain,path,expires){this.__subfix="";this.__subfix+=(domain==null)?"":("; domain="+domain);this.__subfix+=(path==null)?"":("; path="+path);this.__subfix+=(expires==null)?"":("; expires="+expires.toGMTString());};var $p=Cookie.prototype;$p.setValue=function(name,value){document.cookie=name+"="+escape(value)+this.__subfix+";";};$p.getValue=function(name){return(new RegExp(" "+name+"=([^;]*)").test(" "+document.cookie))?unescape(RegExp.$1):null;}');imp('js.io.IOException','$package("js.io");var Exception=$import("js.lang.Exception");var $class=js.io.IOException=function(){return $IOException.apply(this,arguments);};var IOException=$class;$class.$extends(Exception);var $IOException=function(){$class.$super.apply(this,arguments.length>0?arguments:["Input/Output Error."]);}');imp('js.io.Serializer','$package("js.io");var StringBuffer=$import("js.lang.StringBuffer");var IOException=$import("js.io.IOException");var HashMap=$import("js.util.HashMap");var $class=js.io.Serializer=function(){return $Serializer.apply(this,arguments);};var Serializer=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $Serializer=function(){};Serializer.serialize=function(obj){var sb=new StringBuffer();switch(typeof obj){case \'object\':if(null==obj){sb.append(\'null\');}else if(typeof obj.serialize==\'function\'){sb.append(obj.serialize());}else if(obj instanceof Array){sb.append(\'[\');var astr=[];for(var i=0;i<obj.length;i++){astr[i]=Serializer.serialize(obj[i]);};sb.append(astr.join(","));sb.append(\']\');}else{sb.append(\'{\');var nc=false;for(var name in obj){if(/^\\$$/.test(name)){continue;};var value=obj[name];var type=typeof(value);if(type!=\'undefined\'&&type!=\'function\'){if(nc){sb.append(\',\');}else{nc=true;};sb.append(Serializer.serialize(name));sb.append(\':\');sb.append(Serializer.serialize(value));}};sb.append(\'}\');};break;case \'boolean\':sb.append(obj.toString());break;case \'number\':sb.append(isFinite(obj)?String(obj):\'null\');break;case \'string\':sb.append(\'"\');var l=obj.length;for(i=0;i<l;i++){var c=obj.charAt(i);if(c>=\' \'){if(c==\'\\\\\' || c == \'"\'){sb.append(\'\\\\\');};sb.append(c);}else{switch(c){case \'\\b\':sb.append(\'\\\\b\');break;case \'\\f\':sb.append(\'\\\\f\');break;case \'\\n\':sb.append(\'\\\\n\');break;case \'\\r\':sb.append(\'\\\\r\');break;case \'\\t\':sb.append(\'\\\\t\');break;default:sb.append(\'\\\\u00\');sb.append(c.charCodeAt().toString(16));}}};sb.append(\'"\');break;default:sb.append(\'null\');break;};return sb.toString();};Serializer.unserialize=function(str){return eval(str);}');imp('js.io.WebPrinter','$package("js.io");var BObject=$import("js.lang.BObject");var System=$import("js.lang.System");var Window=$import("js.dom.Window");var $class=js.io.WebPrinter=function(){return $WebPrinter.apply(this,arguments);};var WebPrinter=$class;$class.$extends(BObject);var $WebPrinter=function(){var ds=WebPrinter.defaultStyle;this.outputWindow=new Window("<html><head><meta http-equiv=\\"Content-Type\\" content=\\"text/html; charset=utf-8\\"><title>"+"Web Printer</title>"+"<script>function write(s){"+(System.isIeBrowser()?"document.body.insertAdjacentHTML(\\"beforeEnd\\", s);":"document.body.innerHTML+=s;")+"setTimeout(\\"document.body.scrollTop=document.body.scrollHeight;\\",10);}"+"function clear(){document.body.innerHTML=\\"\\";}"+"document.onkeydown=function(){if(event.keyCode==116||(event.ctrlKey&&event.keyCode==78))"+"{event.keyCode=0;event.returnValue = false;}}"+"</script></head><body style=\\""+ds.style+"\\""+" scroll=\\"auto\\"></body></html>");this.outputWindow.width=ds.width;this.outputWindow.height=ds.height;this.outputWindow.resizable=ds.resizable;this.outputWindow.scrollbars=ds.scrollbars;this.outputWindow.status=ds.status;};WebPrinter.defaultStyle={style:"background-color:white;color:black;font-family:MS Sans Serif;font-size:12px;",width:640,height:480,resizable:1,status:0,scrollbars:"yes"};var $p=WebPrinter.prototype;$p.prompt="";$p.showOutputWindow=function(){if(!this.outputWindow.isActive()){this.outputWindow.show();if(this.prompt!=""){this.outputWindow.handle.write(this.prompt);}}};$p.closeOutputWindow=function(){this.outputWindow.close();};$p.write=function(s){this.showOutputWindow();this.outputWindow.handle.write(String(s));};$p.print=function(s){s=encodeHTML(String(s));this.write(s);};$p.println=function(s){this.print(s+"\\r\\n");};$p.printError=function(ex){this.write("<XMP style=\\"color:red\\">"+ex+"</XMP>");};$p.printHTML=function(s){this.write(String(s));};$p.clear=function(){if(this.outputWindow.isActive()){this.outputWindow.handle.clear();}};$p.close=function(){this.outputWindow.close();};var encodeHTML=function(s){return s.replace(/&/g,"&amp;").replace(/"/g, "&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\\r\\n/g,"<br />").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;");}');imp('js.net.XmlHttp','$package("js.net");var NotSupportException=$import("js.lang.NotSupportException");var System=$import("js.lang.System");var $class=js.net.XmlHttp=function(){return $XmlHttp.apply(this,arguments);};var XmlHttp=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $XmlHttp=function(){this.init();};var $p=XmlHttp.prototype;$p.getXMLHttpRequest=function(){return this.__request;};$p.init=function(){this.__request=XmlHttp.create();};$p.destroy=function(){this.__request=null;};XmlHttp.create=function(){return System.RE.getXMLHttpRequest();}');imp('js.net.XmlDom','$package("js.net");var NotSupportException=$import("js.lang.NotSupportException");var System=$import("js.lang.System");var XmlHttp=$import("js.net.XmlHttp");var $class=js.net.XmlDom=function(){return $XmlDom.apply(this,arguments);};var XmlDom=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $XmlDom=function(){var __self=this,doc=null;if(!isIE){doc=document.implementation.createDocument("","",null);doc.addEventListener("load",function(){fireLoadEvent(__self);},false);}else{if(progId!=null){doc=new ActiveXObject(progId);};var l=progIds.length;for(var i=0;i<l;i++){try{doc=new ActiveXObject(progIds[i]);progId=progIds[i];break;}catch(ex){}};if(i==l){throw new NotSupportException("Cannot create XmlDom object under \'"+System.getPlatform()+"\'!");};doc.onreadystatechange=function(){if(doc.readyState==4){fireLoadEvent(__self);}}};this.__doc=doc;this.__async=false;syncProperties(this);this.nodeName="#document";this.namespaceURI="";this.prefix="";this.nodeType=9;this.state=0;this.onload=null;this.destroy=function(){for(var p in this){delete this[p];};doc=null;this.__doc=null;}};var isIE=System.isIeBrowser();var isMoz=System.isMozBrowser();var isOpera=System.isOperaBrowser();XmlDom.create=function(){return new XmlDom();};var progIds=["MSXML2.DOMDocument","Microsoft.XMLDOM","MSXML.DOMDocument","MSXML3.DOMDocument"];var progId=null;var properties=["async","nodeValue","parentNode","childNodes","firstChild","lastChild","previousSibling","nextSibling","attributes","ownerDocument","doctype","implementation","documentElement"];var syncProperties=function(o){var doc=o.__doc;var l=properties.length;for(var i=0;i<l;i++){var name=properties[i];eval("o."+name+"=doc."+name);}};var fireLoadEvent=function(o){this.state=4;syncProperties(o);var func=o.onload;if("function"==typeof(func)){func();}};var $p=XmlDom.prototype;$p.insertBefore=function(newElement,targetElement){return this.__doc.insertBefore(newElement,targetElement);};$p.replaceChild=function(newChild,oldChild){return this.__doc.replaceChild(newChild,oldChild);};$p.removeChild=function(child){return this.__doc.removeChild(child);};$p.appendChild=function(child){return this.__doc.appendChild(child);};$p.cloneNode=function(deep){return this.__doc.cloneNode(deep);};$p.createElement=function(tagName){return this.__doc.createElement(tagName);};$p.createDocumentFragment=function(){return this.__doc.createDocumentFragment();};$p.createTextNode=function(data){return this.__doc.createTextNode(data);};$p.createComment=function(data){return this.__doc.createComment(data);};$p.createCDATASection=function(data){return this.__doc.createCDATASection(data);};$p.createProcessingInstruction=function(target,data){return this.__doc.createProcessingInstruction(target,data);};$p.createAttribute=function(name){return this.__doc.createAttribute(name);};$p.getElementsByTagName=function(name){return this.__doc.getElementsByTagName(name);};$p.getDomDocument=function(){return this.__doc;};$p.getDocumentElement=function(){return this.__doc.documentElement;};$p.setAsync=function(b){this.__async=b;this.__doc.async=b;};$p.getAsync=function(b){return this.__async;};$p.selectNodes=function(s){return this.__doc.selectNodes(s);};$p.selectSingleNode=function(s){return this.__doc.selectSingleNode(s);};$p.hasChildNodes=isOpera?function(){return(this.__doc.childNodes.length>0);}:function(){return this.__doc.hasChildNodes();};$p.getXML=isIE?function(){return this.__doc.xml;}:function(){return(isOpera?"<?xml version=\\"1.0\\"?>":"")+(new XMLSerializer()).serializeToString(this.__doc);};$p.load=isOpera?function(url){try{this.state=0;this.__doc=document.implementation.createDocument("","",null);syncProperties(this);var async=this.getAsync();var http=XmlHttp.create();if(async){var _this=this;http.onreadystatechange=function(){if(http.readyState==4){_this.__doc=http.responseXML;fireLoadEvent(_this);}}};http.open("GET",url,async);http.send(null);if(!async){this.__doc=http.responseXML;return(this.__doc.documentElement!=null);}}catch(ex){if(!async){return false;}}finally{if(!async){fireLoadEvent(this);}}}:function(url){this.state=0;return this.__doc.load(url);};$p.loadXML=isIE?function(s){return this.__doc.loadXML(s);}:function(s){try{this.state=0;this.__doc=(new DOMParser()).parseFromString(s,"text/xml");this.__doc.async=this.__async;if(this.__async){return;};return(this.__doc.documentElement!=null)&&(this.__doc.documentElement.localName!="parsererror"||this.__doc.documentElement.getAttribute("xmlns")!="http://www.mozilla.org/newlayout/xml/parsererror.xml");}catch(ex){return false;}finally{fireLoadEvent(this);}};$p.createNode=isIE?function(stype,name,ns){return this.__doc.createNode(stype,name,ns);}:function(stype,name,ns){var doc=this.__doc;switch(stype){case 1:return(ns==null||ns=="")?doc.createElement(name):doc.createElementNS(ns,name);case 2:return(ns==null||ns=="")?doc.createAttribute(name):doc.createAttributeNS(ns,name);case 3:default:return doc.createTextNode("");}};if(isMoz){Node.prototype.selectNodes=function(sExpr){var doc=(this.nodeType==9)?this:this.ownerDocument;var nsRes=doc.createNSResolver(this.nodeType==9?this.documentElement:this);var xpRes=doc.evaluate(sExpr,this,nsRes,5,null);var res=[];var item;while(item=xpRes.iterateNext()){res[res.length]=item;};return res;};Node.prototype.selectSingleNode=function(sExpr){var doc=(this.nodeType==9)?this:this.ownerDocument;var nsRes=doc.createNSResolver((this.nodeType==9)?this.documentElement:this);var xpRes=doc.evaluate(sExpr,this,nsRes,9,null);return xpRes.singleNodeValue;}};if(isOpera){var __re_0001=/^\\/([^\\/])/;var __re_0002=/^\\/\\/([^\\/])/;var __getChildNodes=function(oNode,sExpr,bRec){if(sExpr==""){return [];};var idx=sExpr.indexOf("/");var sPre=(idx==-1)?sExpr:sExpr.substring(0,idx);var sSub=(idx==-1)?null:sExpr.substring(idx+1);var isAll=(sPre=="*");var isFin=(sSub==null);var nodes=oNode.childNodes;var l=nodes.length;var a=[];for(var i=0,j=0;i<l;i++){var node=nodes[i];if(node.nodeType!=1){continue;};if(isAll||node.nodeName==sPre){a=a.concat(isFin?node:__getChildNodes(node,sSub));};if(bRec){a=a.concat(__getChildNodes(node,sExpr,bRec));}};return a;};Node.prototype.selectNodes=function(sExpr){if(sExpr==""||sExpr==null){return [];};if(sExpr=="/"){return [this.ownerDocument];};if(__re_0001.test(sExpr)){return __getChildNodes((this.nodeType==9)?this:this.ownerDocument,sExpr.substring(1),false);};if(__re_0002.test(sExpr)){return __getChildNodes((this.nodeType==9)?this:this.ownerDocument,sExpr.substring(2),true);};return __getChildNodes(this,sExpr,false);};Node.prototype.selectSingleNode=function(sExpr){var nodes=this.selectNodes(sExpr);return(nodes.length>0)?nodes[0]:null;}};XmlDom.prototype.utility=XmlDom.utility=new function(){this.getXML=isIE?function(o){return o.xml;}:function(o){return(new XMLSerializer()).serializeToString(o);};this.getText=isIE?function(o){return o.text;}:function(o){if(o instanceof Text){return o.nodeValue;}else{var cs=o.childNodes;var l=cs.length;var sb=new Array(l);for(var i=0;i<l;i++){sb[i]=this.getText(cs[i]);};return sb.join("");}};this.getBaseName=isIE?function(o){return o.nodeName;}:function(o){var lParts=o.nodeName.split(":");return lParts[lParts.length-1];};this.parseNode=function(s){var doc=new XmlDom();doc.setAsync(false);doc.loadXML(s);var node=doc.documentElement;doc.destroy();return node;};this.selectNodes=function(o,s){return o.selectNodes(s);};this.selectSingleNode=function(o,s){return o.selectSingleNode(s);};}');imp('js.util.ArrayList','$package("js.util");var Cloneable=$import("js.lang.Cloneable");var ArgumentException=$import("js.lang.ArgumentException");var $class=js.util.ArrayList=function(){return $ArrayList.apply(this,arguments);};var ArrayList=$class;$class.$extends(Cloneable);var $ArrayList=function(){this.__array=[];};var $p=ArrayList.prototype;$p.toArray=function(){return this.__array.concat([]);};$p.indexOf=function(o){var l=this.__array.length;for(var i=0;i<l;i++){if(this.__array[i]==o){return i;}};return-1;};$p.lastIndexOf=function(o){var l=this.__array.length-1;for(var i=l;i>=0;i--){if(this.__array[i]==o){return i;}};return-1;};$p.add=function(arg1,arg2){if(arguments.length==1){this.__array.push(arg1);}else{var l1=this.__array.length;var a1=this.__array.slice(0,arg1);var a2=this.__array.slice(arg1,l1);var l2=a1.length;a1[l2]=arg2;this.__array=a1.concat(a2);}};$p.addAll=function(a){if(a instanceof Array){this.__array=this.__array.concat(a);}else if(typeof(a.toArray)=="function"&&((a=a.toArray())instanceof Array)){this.__array=this.__array.concat(a);}else{throw new ArgumentException(this.getClass().getName()+".addAll(): arguments error.");}};$p.removeAt=function(i){var l=this.__array.length;if(i<0||i>=l){return null;};var o=this.__array[i];this.__array=this.__array.slice(0,i).concat(this.__array.slice(i+1,l));return o;};$p.remove=function(o){var i=this.indexOf(o);if(i==-1){return this;};return this.removeAt(i);};$p.contains=function(o){return this.indexOf(o)!=-1;};$p.clear=function(){this.__array.length=0;};$p.size=function(){return this.__array.length;};$p.get=function(i){var size=this.size();if(i>=0&&i<size){return this.__array[i];}else{return null;}};$p.clone=function(){var o=new ArrayList();o.addAll(this.__array);return o;}');imp('js.util.HashMap','$package("js.util");var JObject=$import("js.lang.JObject");var Cloneable=$import("js.lang.Cloneable");var Iterator=$import("js.util.Iterator");var $class=js.util.HashMap=function(){return $HashMap.apply(this,arguments);};var HashMap=$class;$class.$extends(Cloneable);var $HashMap=function(){this.__table={};};var $p=HashMap.prototype;$p.elements=function(){var a=[],i=0;for(var h in this.__table){if(!/^\\$hc_/.test(h)){continue;};var e=this.__table[h];a[i++]=e.__value;};return new Iterator(a);};$p.get=function(key){var h=hash(key);var e=this.__table[h];return(e==null)?null:e.__value;};$p.isEmpty=function(){return(this.size()==0);};$p.keys=function(){var a=[],i=0;for(var h in this.__table){if(!/^\\$hc_/.test(h)){continue;};var e=this.__table[h];a[i++]=e.__key;};return new Iterator(a);};$p.put=function(key,value){var h=hash(key);var oe=this.__table[h];var oldValue=(oe==null)?null:oe.__value;this.__table[h]=new Entry(h,key,value);return oldValue;};$p.remove=function(key){var h=hash(key);var oe=this.__table[h];delete this.__table[h];return(oe==null)?null:oe.__value;};$p.size=function(){var l=0;for(var h in this.__table){l+=/^\\$hc_/.test(h)?1:0;};return l;};$p.clear=function(){this.__table={};};$p.containsValue=function(value){for(var key in this.__table){if(this.__table[key].__value==value){return true;}};return false;};$p.containsKey=function(key){var h=hash(key);return(typeof(this.__table[h])!="undefined");};var NULL_KEY="$hc_NULL";var hash=function(o){if(o==null){return NULL_KEY;};switch(typeof(o)){case "string":return("$hc_s"+o);case "number":return("$hc_n"+o);case "boolean":return("$hc_b"+o);case "object":if(o instanceof String){return("$hc_s"+o.valueOf());};if(o instanceof Number){return("$hc_n"+o.valueOf());};if(o instanceof Boolean){return("$hc_b"+o.valueOf());};if(o instanceof JObject){return("$hc_j"+o.hashCode());};default:return _getObjHashCode(o);}};var _hsObjs=[];var _getObjHashCode=function(o){var l=_hsObjs.length;for(var i=0;i<l;i++){if(_hsObjs[i]==o){return "$hc_o"+i;}};_hsObjs[l]=o;return "$hc_o"+l;};$p.toArray=function(){var entities=[],i=0;for(var h in this.__table){entities[i++]=this.__table[h];};return entities;};$p.clone=function(){var map=new HashMap();map.__table=Cloneable.cloneObject(this.__table);return map;};var Entry=function(h,k,v){this.__hash=h;this.__key=k;this.__value=v;};var $p=Entry.prototype;$p.getKey=function(){return this.__key;};$p.getValue=function(){return this.__value;}');imp('js.util.Iterator','$package("js.util");var $class=js.util.Iterator=function(){return $Iterator.apply(this,arguments);};var Iterator=$class;$class.$extends(_JSVM_Namespace.kernel.Object);var $Iterator=function(aArray){var array=aArray;var index=0;this.hasNext=function(){return(array.length>index);};this.next=function(){return array[index++];};this.toArray=function(){return array.concat([]);}}');imp('js.util.Properties','$package("js.util");var Cloneable=$import("js.lang.Cloneable");var ArgumentException=$import("js.lang.ArgumentException");var IOException=$import("js.io.IOException");var XmlHttp=$import("js.net.XmlHttp");var XmlDom=$import("js.net.XmlDom");var HashMap=$import("js.util.HashMap");var $class=js.util.Properties=function(){return $Properties.apply(this,arguments);};var Properties=$class;$class.$extends(Cloneable);var $Properties=function(){this.__ctx=new HashMap();};var $p=Properties.prototype;$p.getProperty=function(key,defaultValue){var val=this.__ctx.get(key);return(val==null)?defaultValue:val;};$p.setProperty=function(key,value){if(key==null||key==""){throw new ArgumentException(this.getClass().getName()+".setProperty(key, value) error: key can\'t be null and empty.");};this.__ctx.put(key,String(value));};$p.clear=function(){return this.__ctx.clear();};$p.propertyNames=function(){return this.__ctx.keys();};$p.load=function(sURL){var xmlHttp=XmlHttp.create();try{xmlHttp.open("GET",sURL,false);xmlHttp.send(null);}catch(ex){throw new IOException(this.getClass().getName()+".load(sURL) Fail. Cound not access the resource [sURL:"+sURL+"].",ex);};if(xmlHttp.status!=200&&xmlHttp.status!=0){throw new IOException(this.getClass().getName()+".load() Fail. Cound not access the resource [url:"+sURL+", HTTP-STATUS: "+xmlHttp.status+"].",ex);};var text=xmlHttp.responseText;var ps=text.replace(/#([^"\\n\\r]*)((\\r\\n)|$)/g, "").replace(/\\[([^"\\n\\r]*)\\]/g,"").replace(/\\r\\n(\\s)*\\r\\n/g,"\\r\\n").split("\\r\\n");for(var i=0;i<ps.length;i++){var p=ps[i];var x=p.indexOf("=");if(x!=-1){var n=p.substring(0,x).replace(/(^\\s+)|\\s+$/g,"");var v=p.substring(x+1).replace(/(^\\s+)|\\s+$/g,"");this.setProperty(n,v);}}};$p.loadFromXML=function(sURL){var doc=XmlDom.create();doc.setAsync(false);if(!doc.load(sURL)){throw new IOException(this.getClass().getName()+".loadFromXML(sURL) Fail. Cound not load from the resource [sURL:"+sURL+"].",ex);};var root=doc.getDocumentElement();var ptNodes=XmlDom.utility.selectNodes(root,"entity");var l=ptNodes.length;for(var i=0;i<l;i++){var node=ptNodes[i];this.setProperty(node.getAttribute("key"),XmlDom.utility.getText(node));}};$p.list=function(out){out=out||System.out;var iterator=this.propertyNames();while(iterator.hasNext()){var pn=iterator.next();out.println(pn+"="+this.getProperty(pn));}};$p.clone=function(){var ps=new Properties();ps.__ctx=this.__ctx.clone();return ps;}');imp('js.util.Stack','$package("js.util");var Cloneable=$import("js.lang.Cloneable");var ArrayList=$import("js.util.ArrayList");var $class=js.util.Stack=function(){return $Stack.apply(this,arguments);};var Stack=$class;$class.$extends(Cloneable);var $Stack=function(){this.__list=new js.util.ArrayList();};var $p=Stack.prototype;$p.empty=function(){return(this.__list.size()==0);};$p.peek=function(){if(this.empty()){return null;};var o=this.__list.get(0);return o;};$p.pop=function(){if(this.empty()){return null;};var o=this.__list.get(0);this.__list.removeAt(0);return o;};$p.push=function(o){this.__list.add(0,o);};$p.search=function(o){return this.__list.indexOf(o);};$p.clone=function(){var o=new Stack();o.__list=this.__list.clone();return o;}');JSVM.getCompiler().setParser("jsvm2",(function(){var regExp_package=/(^|\s|;|})(\s*)(package)(\s+)((\w+)(\.\w+)*)(\s*)/;var regExp_import=/(^|\s|;|})(\s*)(import)(\s+)((\w+\.)*(\w+))(\s*)/g;var regExp_class=/(^|\s|;|})(\s*)(class)(\s+)(\w*(\.\w*)*)((\s+)extends(\s+)(\w*(\.\w*)*))?(\s*)\(/;var regExp_super=/([^A-Za-z0-9_\$]+)super([^A-Za-z0-9_\$]+)/g;var regExps_strings=[/("(\\"|[^"\n\r]|(\\\r\n))*")/g,/('(\\'|[^'\n\r]|(\\\r\n))*')/g];var strings_prefix="${10b7bd2c-d345-eb59-6268-206460fc8dde",strings_suffix="}";return{"parse":function(code){var constStrs=(code.match(regExps_strings[0])||[]).concat((code.match(regExps_strings[1])||[]));for(var i=0;i<constStrs.length;i++){code=code.replace(constStrs[i],strings_prefix+i+strings_suffix);};code=code.replace(regExp_package,"$1\r\n$package(\"$5\")");var packageName=RegExp.$5;code=code.replace(regExp_import,"$1\r\nvar $7 = $import(\"$5\")");code=code.replace(regExp_super,"$1$class.$super$2");if(regExp_class.test(code)){var className=RegExp.$5;var superName=RegExp.$7.replace(/(\s*)extends(\s+)/,"");var shortClassName=className;if(className.indexOf(".")==-1){className=packageName+"."+className;}else{shortClassName=className.replace(/\w*\./g,"");};var str="\r\nvar $class = "+className+" = function(){return $"+shortClassName+".apply(this,arguments);};\r\nvar "+shortClassName+" = $class;\r\n";if(superName==""){str+="$class.$extends(_JSVM_Namespace.kernel.Object);";}else{str+="$class.$extends("+superName+");";};str+="\r\nvar $"+shortClassName+" = function(";code=code.replace(regExp_class,"$1\r\n"+str);}else{throw new Exception("JSVM/compiler/jsvm2-parser.parse() "+"error: can't found keyword 'class'.");};for(var i=constStrs.length-1;i>=0;i--){code=code.replace(strings_prefix+i+strings_suffix,constStrs[i]);};return code;}};})());JSVM.setConsole((function(){var printer;return{"write":function(msg){if(!printer){printer=jsre.JSVM.loadClass("js.io.WebPrinter").newInstance();printer.prompt="JSVM Console Output Window [Version "+jsre.currentVersion+"]<br>(C) All Copyright"+" 2004-2007 Homolo Co., Ltd.<br/><br/>";};printer.print(msg);},"read":function(){return window.prompt("JSVM Console; Input: ");}};})());});

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -