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

📄 jsx_opt.js

📁 加密算法,基于MVC模式开发的!希望大家指正
💻 JS
📖 第 1 页 / 共 5 页
字号:
jsx3.Class.defineClass("jsx3.net.Form",null,[jsx3.util.EventDispatcher],function(q,d){var Lc=jsx3.util.Logger.getLogger(q.jsxclass.getName());q.Je=0;q.Uf=250;q.zp=30000;q.METHOD_GET="get";q.METHOD_POST="post";q.xD="application/x-www-form-urlencoded";q.aG="multipart/form-data";q.EVENT_FILE_SELECTED="fileSelected";q.EVENT_ON_RESPONSE="onResponse";q.EVENT_ON_ERROR="onError";q.EVENT_ON_TIMEOUT="onTimeout";d.init=function(i,b,k){this.ge="jsx_httpform_"+q.Je++;if(i==-1){this.YA(b);}else{this.YA();this.setMethod(i!=null?i:q.METHOD_GET);this.setAction(b);this.setMultipart(k);}};q.newFromFragment=function(i){return new q(-1,i);};d.YA=function(e){var Jb=e;if(!Jb)Jb="<form method=\"get\" action=\"\"><input type=\"submit\"/></form>";var qc="<html><body class=\"jsx30form\">"+Jb+"</body></html>";jsx3.html.insertAdjacentHTML(document.body,"beforeEnd","<span id='"+this.ge+"_span' style='border:2px solid black;position:absolute;left:-50px;top:0px;width:10px;height:10px;overflow:hidden;'><iframe id='"+this.ge+"_frame' style='width:100%;height:100%;'></iframe></span>");this._l=document.getElementById(this.ge+"_l");this.io=this.eval(this.ge+"_frame");var X=this.io.document||this.io.contentDocument;if(X==null)throw new jsx3.Exception("No document in IFRAME.");X.open();X.write(qc);X.close();this.xp=X.getElementsByTagName("form")[0];if(e){if(this.xp==null)throw {description:"the HTML fragment did not contain a valid <form> tag: "+e};this.Re=this.xp.action;this.rG=this.xp.method;this.dC=this.xp.encoding&&this.xp.encoding.toLowerCase()==q.aG;}};d.getMethod=function(){return this.rG;};d.setMethod=function(p){p=p!=null?p.toLowerCase():q.METHOD_GET;this.rG=p;this.lD().setAttribute("method",p);};d.getAction=function(){return this.Re;};d.setAction=function(c){this.Re=c;this.lD().setAttribute("action",c);};d.getMultipart=function(){return this.dC;};d.setMultipart=function(s){this.dC=s;this.lD().setAttribute("encoding",s?q.aG:q.xD);};d.Ci=function(){return this._l;};d.fq=function(){return this.io;};d.lD=function(){return this.xp;};d.getField=function(h){var Tb=this.lD().elements[h];return Tb!=null&&typeof(Tb)=="object"?Tb.value:null;};d.getFields=function(){var Mb=[];var H=this.lD().elements;for(var hc in H){Mb[hc]=H[hc].name;}return Mb;};d.setField=function(s,o,c){var Rb=this.lD();var gc=Rb.elements[s];if(gc==null||typeof(gc)!="object"){jsx3.html.insertAdjacentHTML(Rb,"beforeEnd","<div>"+s+": <input type='text' name='"+s+"'/></div>");gc=Rb.elements[s];}if(c&&gc.value){gc.value=gc.value+" "+o;}else{gc.value=o;}};d.removeField=function(l){var M=this.lD();var Ob=M.elements[l];if(Ob!=null&&Ob.parentNode)Ob.parentNode.parentNode.removeChild(Ob.parentNode);};d.addFileUploadField=function(j){var fc=this.lD();var F=fc.elements[j];if(F==null||typeof(F)!="object"){jsx3.html.insertAdjacentHTML(fc,"beforeEnd","<div>"+j+": <input type='file' name='"+j+"'/></div>");F=fc.elements[j];var sc=this;F.onchange=function(){sc.KF(j,F.value);};}else{throw new jsx3.Exception("Form already has field "+j+".");}};d.promptForFile=function(a){var yc=this.lD();var db=yc.elements[a];if(db!=null&&db.type=="file"){db.click();}else{throw new jsx3.Exception("Form does not have file upload field "+a+".");}};d.KF=function(a,r){this.publish({subject:q.EVENT_FILE_SELECTED,field:a,value:r});};d.Kq=function(){this.xp=null;this.publish({subject:q.EVENT_ON_RESPONSE});};d.we=function(p){this.xp=null;this.publish({subject:q.EVENT_ON_ERROR,message:p});};d.abort=function(){window.clearInterval(this.Uj);};d.send=function(c,p){if(c==null)c=q.Uf;if(p==null)p=q.zp;this.xp.submit();var Zb=0;var D=p<=0?Number.MAX_VALUE:Math.ceil(p/c);var jc=this;this.Uj=window.setInterval(function(){jc.jD(++Zb<D);},c);};d.jD=function(a){try{this.io.document.readyState=="";}catch(Kc){window.clearInterval(this.Uj);this.Uj=null;this.we("Form Response Security Error: "+jsx3.NativeError.wrap(Kc));return;}if(this.io.document.readyState=="complete"||this.io.document.readyState=="loaded"){window.clearInterval(this.Uj);this.Uj=null;this.Kq();}else{if(!a){window.clearInterval(this.Uj);this.Uj=null;this.destroy();this.publish({subject:q.EVENT_ON_TIMEOUT});}}};d.getResponseText=function(){var Jc=this.io.document;if(typeof(Jc.mimeType)!="unknown"){if(Jc.mimeType.indexOf("XML")==0){return Jc.XMLDocument.xml;}else{if(Jc.mimeType.indexOf("HTML")==0){return jsx3.html.getOuterHTML(this.io.document.childNodes[0]);}else{if(Jc.mimeType.indexOf("Text")==0){return this.io.document.childNodes[0].innerText;}}}}return this.io.document.body.innerHTML;};d.getResponseXML=function(){var cb=this.io.document;if(typeof(cb.mimeType)=="string"&&cb.mimeType.indexOf("XML")==0||cb.XMLDocument&&cb.XMLDocument.documentElement){var ec=new jsx3.xml.Document();ec.loadXML(cb.XMLDocument.documentElement.xml);return ec;}else{var dc=null;if(cb.mimeType.indexOf("HTML")==0){dc=jsx3.html.getOuterHTML(this.io.document.childNodes[0]);}else{if(cb.mimeType.indexOf("Text")==0){dc=this.io.document.childNodes[0].innerText;}else{dc=this.io.document.body.innerHTML;}}var x=new jsx3.xml.Document();x.loadXML(dc);if(x.hasError()){jsx3.util.Logger.doLog("HTFM06","Result not a valid XML document: "+x.getError().description);return null;}return x;}};d.destroy=function(){var mb=this.Ci();if(mb!=null){mb.parentNode.removeChild(mb);this._l=null;this.io=null;this.xp=null;}else{jsx3.util.Logger.doLog("HTFM01","HttpForm probably already destroyed");}};d.reveal=function(o,g,f,s){if(o==null)o=10;if(g==null)g=10;if(f==null)f=Math.round(this._l.parentNode.offsetWidth/3);if(s==null)s=Math.round(this._l.parentNode.offsetHeight/3);var Bb=this._l.style;Bb.left=o+"px";Bb.top=g+"px";Bb.width=f+"px";Bb.height=s+"px";Bb.zIndex=30000;};d.conceal=function(){var cb=this._l.style;cb.left="-50px";cb.top="0px";cb.width="10px";cb.height="10px";cb.zIndex=0;};});jsx3.HttpForm=jsx3.net.Form;jsx3.Class.defineInterface("jsx3.xml.Cacheable",null,function(k,n){var E=jsx3.xml.Document;var Ob=jsx3.xml.CDF;var bc=jsx3.util.Logger.getLogger(k.jsxclass.getName());k.DEFAULTSTYLESHEET=jsx3.resolveURI("jsx:///xsl/xml.xsl");k.DEFAULTXSLCACHEID="JSX_XML_XSL";k.CLEANUPRESOURCES=0;k.SHARERESOURCES=1;n.doTransform=function(m,i){var gb=this.getNodeSet()!=null?this.getNodeSet():this.getXML();if(m==null&&this.jsxxslparams!=null)m=this.jsxxslparams;var Eb=0;var sb="";if(gb!=null){Eb=1;var cc=this.getXSL();if(cc!=null){Eb=2;sb=gb.transformNode(cc,m);if(sb!="")Eb=3;}}if(Eb==2){}else{if(Eb==1){if(i!=true)bc.error("XML02","Transformation Failed: When attempting to load the XSL for the control, "+this.getId()+", it resulted in a null object.",3);}else{if(Eb==0){}}}return sb;};n.getXSLParams=function(){if(this.jsxxslparams==null)this.jsxxslparams={};return this.jsxxslparams;};n.setXSLParam=function(p,r){if(r!=null)this.getXSLParams()[p]=r;else delete this.getXSLParams()[p];return this;};n.removeXSLParam=function(o){delete this.getXSLParams()[o];return this;};n.removeXSLParams=function(){delete this.jsxxslparams;return this;};n.getNodeSet=function(){return this._jsxft;};n.setNodeSet=function(f){this._jsxft=f;};n.onDestroyCached=function(q){if(this.getShareResources()==k.CLEANUPRESOURCES)this.resetCacheData(q.getServer());delete this._jsxft;};n.resetCacheData=function(a){var oc=(a||this.getServer()).getCache();oc.clearById(this.getXSLId());oc.clearById(this.getXMLId());};n.resetXmlCacheData=function(e){var lc=(e||this.getServer()).getCache();lc.clearById(this.getXMLId());};n.resetXslCacheData=function(b){var Lb=(b||this.getServer()).getCache();Lb.clearById(this.getXSLId());};n.clearXmlData=function(){this.getServer().getCache().setDocument(this.getXMLId(),Ob.newDocument());};n.getShareResources=function(){return this.jsxshare==null?k.CLEANUPRESOURCES:this.jsxshare;};n.setShareResources=function(h){this.jsxshare=h;return this;};n.getXML=function(){var lc=this.getServer();if(lc==null)return Ob.newDocument();var bb=lc.getCache().getDocument(this.getXMLId());if(bb==null){var eb=this.getXMLString();if(!jsx3.util.strEmpty(eb)){bb=new E();bb.loadXML(eb);}else{var Wb=this.getXMLURL();if(!jsx3.util.strEmpty(Wb)){bb=new E();bb.load(this.getUriResolver().resolveURI(Wb));}else{bb=Ob.newDocument();}}if(bb.hasError()){bc.error("Error parsing or loading the XML file for "+this+": "+bb.getError().description);return bb;}bb=this.setSourceXML(bb);}return bb;};n.setSourceXML=function(a){a=this.Tt(a);this.getServer().getCache().setDocument(this.getXMLId(),a);if(this.instanceOf(Ob)){if(a.getNodeName()=="data"&&a.getAttribute("jsxassignids")=="1")this.assignIds();this.convertProperties(this.getServer().getProperties());}return a;};n.getXMLId=function(){return this.jsxxmlid||this.getId()+"_XML";};n.setXMLId=function(s){this.jsxxmlid=s;return this;};n.getXMLString=function(){return this.jsxxml;};n.setXMLString=function(b){this.jsxxml=b;return this;};n.getXMLURL=function(){return this.jsxxmlurl;};n.setXMLURL=function(b){this.jsxxmlurl=b;return this;};n.getXSL=function(m){var hb=this.getXSLId();var Bc=this.getServer().getCache().getDocument(hb);if(Bc==null){Bc=new E();if(this.getXSLString()!=null){Bc.loadXML(this.getXSLString());}else{if(this.getXSLURL()!=null){Bc.load(this.getUriResolver().resolveURI(this.getXSLURL()));}else{if(m!=true){Bc.load(k.DEFAULTSTYLESHEET);hb=k.DEFAULTXSLCACHEID;}else{return null;}}}if(Bc.hasError()){bc.error("Error parsing or loading the XSL file for "+this+": "+Bc.getError().description);return Bc;}this.getServer().getCache().setDocument(hb,Bc);}return Bc;};n.getXSLId=function(){return this.jsxxslid||this.getId()+"_XSL";};n.setXSLId=function(a){this.jsxxslid=a;return this;};n.getXSLString=function(){return this.jsxxsl;};n.setXSLString=function(c){this.jsxxsl=c;return this;};n.getXSLURL=function(){return this.jsxxslurl;};n.setXSLURL=function(p){this.jsxxslurl=p;return this;};n.getXMLTransformers=function(){return this.jsxxmltrans!=null?this.jsxxmltrans.split(/\s*,\s*/g):[];};n.setXMLTransformers=function(a){this.jsxxmltrans=a!=null?a instanceof Array?a.join(","):a:null;};n.Tt=function(d){var Y=this.getXMLTransformers();if(Y.length>0){var v=this.getServer();var nc=v.getCache();var ib=d;for(var wb=0;wb<Y.length;wb++){var Q=Y[wb];var Fb=nc.getDocument(Q);if(Fb==null){Q=v.resolveURI(Q);Fb=nc.openDocument(Q,Q);}if(Fb==null||Fb.hasError()){bc.warn("Bad XML transformer for "+this+": "+Q+" ("+Fb.getError().description+")");nc.clearById(Q);continue;}var ub=new jsx3.xml.Processor(ib,Fb,this.getXSLParams());ib=ub.transformToObject();if(ib.hasError()){throw new jsx3.Exception("Error transforming XML for object "+this+": "+ib.getError().description);}}return ib;}else{return d;}};k.getVersion=function(){return "3.00.00";};});jsx3.xml.Cacheable.prototype.resetData=jsx3.xml.Cacheable.prototype.clearXmlData;jsx3.Class.defineClass("jsx3.app.Monitor",jsx3.util.Logger.FormatHandler,null,function(f,k){var t=jsx3.app.Server;f.ed=false;f.lu=jsx3.net.URIResolver.DEFAULT.resolveURI("jsx:///html/jsx3.app.Monitor.html");f.ideDidLoad=function(){f.ed=true;};k.Vt=false;k.Fz=true;k.mw=null;k.Qx=false;k.jf=null;k.cd=null;k.init=function(p){this.jsxsuper(p);};k.onAfterInit=function(){if(this.mw!=null){var jb=null;if(jsx3.Class.forName("jsx3.lang.System"))jb=jsx3.System.getApp(this.mw);if(jb!=null){this.xC(jb);}else{t.subscribe(t.EVENT_SERVER_INITED,this,"ci");}}else{this.Fz=false;this.Qx=false;this.Vt=true;this.ne();}};k.xC=function(c){this.Vt=true;this.jf=c;if(this.Qx){var nc=this;c.registerHotKey(function(o){nc.pB();},"m",false,true,true);}else{this.ne();}};k.ci=function(r){var sb=r.target;if(sb.getEnv("namespace")==this.mw){if(!f.ed||!this.Fz)this.xC(sb);t.unsubscribe(t.EVENT_SERVER_INITED,this);}};k.handle=function(b){if(this.Vt&&(!f.ed||!this.Fz)){if(this.cd){if(this.cd.closed){if(!this.Qx)this.ne();}if(!this.cd.closed&&this.cd.appendMessage){var sc=this.format(b).escapeHTML();this.cd.appendMessage(sc,jsx3.util.Logger.levelAsString(b.getLevel()));}}}};k.pB=function(){if(this.cd==null||this.cd.closed)this.ne();};k.ne=function(){this.cd=window.open(f.lu,"Monitor_"+this.getName(),"directories=no,location=no,menubar=no,status=yes,personalbar=no,titlebar=yes,toolbar=no,resizable=yes,scrollbars=no,width=500,height=400");if(this.cd){if(this.jf){if(typeof(this.cd.setName)=="function")this.cd.setName(this.jf.getEnv("namespace"));else this.cd._jsxname=this.jf.getEnv("namespace");}window.focus();}};k.getDisableInIDE=function(){return this.Fz;};k.setDisableInIDE=function(n){this.Fz=n;};k.getServerNamespace=function(){return this.mw;};k.setServerNamespace=function(n){this.mw=n;};k.getActivateOnHotKey=function(){return this.Qx;};k.setActivateOnHotKey=function(g){this.Qx=g;};});jsx3.util.Logger.Handler.registerHandlerClass(jsx3.app.Monitor.jsxclass);

⌨️ 快捷键说明

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