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

📄 application.js

📁 在流览器上仿CS界面的JAVASCRIPT脚本
💻 JS
📖 第 1 页 / 共 4 页
字号:
{res.srcText=this.getElementsByTagName("sourcetext")[0].firstChild.data;res.srcText=res.srcText.replace(/\n\-\^$/,"");}
catch(ex)
{res.srcText="";}
try
{var s=this.documentElement.firstChild.data;var re= /XML Parsing Error\:(.+)\nLocation\:(.+)\nLine Number(\d+)\,Column(\d+)/;var a=re.exec(s);res.reason=a[1];res.url=a[2];res.line=a[3];res.linepos=a[4];}
catch(ex)
{res.reason="Uknown";}}
return res;});Node.prototype.__defineGetter__("xml",function()
{return(new XMLSerializer).serializeToString(this);});Attr.prototype.__defineGetter__("xml",function()
{var nv=(new XMLSerializer).serializeToString(this);return this.nodeName+"=\""+nv.replace(/\"/g,""")+"\"";});Text.prototype.__defineGetter__("text",function()
{return this.nodeValue;});Node.prototype.__defineGetter__("text",function()
{var cs=this.childNodes;var l=cs.length;var sb=new Array(l);for(var i=0;i<l;i++)
sb[i]=cs[i].text;return sb.join("");});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.push(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;};Node.prototype.transformNode=function(oXsltNode)
{var doc=this.nodeType==9?this:this.ownerDocument;var processor=new XSLTProcessor();processor.importStylesheet(oXsltNode);var df=processor.transformToFragment(this,doc);return df.xml;};Node.prototype.transformNodeToObject=function(oXsltNode,oOutputDocument)
{var doc=this.nodeType==9?this:this.ownerDocument;var outDoc=oOutputDocument.nodeType==9?oOutputDocument:oOutputDocument.ownerDocument;var processor=new XSLTProcessor();processor.importStylesheet(oXsltNode);var df=processor.transformToFragment(this,doc);while(oOutputDocument.hasChildNodes())
oOutputDocument.removeChild(oOutputDocument.lastChild);var cs=df.childNodes;var l=cs.length;for(var i=0;i<l;i++)
oOutputDocument.appendChild(outDoc.importNode(cs[i],true));};}
function biExec(sRootPath,sAdfRelPath,bUseCurrentWindow)
{var left,top,width,height,centered,resizable,fullScreen;var adfPath,adfName;function _toPixel(s,sAxis)
{if(String(s).indexOf("%")!= -1)
{var n=Number(s.replace(/\%/g,""));return n/100*(sAxis=="x"?screen.availWidth:screen.availHeight);}
return s;}
function _getAttr(el,name,def,tp)
{var res;if(!el||!el.getAttribute(name))
res=def;else res=el.getAttribute(name);if(tp)
return _toPixel(res,tp);return res;}
sRootPath=String(sRootPath);sAdfRelPath=String(sAdfRelPath);if(sRootPath.charAt(sRootPath.length-1)!="/")
sRootPath=sRootPath+"/";var re= /([^\/]+\/)?(\w+)(\.[^\/]*)?$/;var ok=re.test(sAdfRelPath);if(ok)
adfName=RegExp.$2;else errorMessage="The ADF argument cannot be parsed";if(/(^http\:)|(^https\:)|(^file\:)|(^\/)/.test(sAdfRelPath)){adfPath=sAdfRelPath;}
else{var curPath=document.location.href;slashIndex=curPath.lastIndexOf("/");curPath=curPath.substring(0,slashIndex);adfPath=curPath+"/"+sAdfRelPath;}
var uri=sRootPath+"bimain.html?Adf="+encodeURIComponent(adfPath)+";AdfName="+adfName+";Params="+Math.max(0,(arguments.length-3));for(var i=3;i<arguments.length;i++){uri+=";Param"+(i-3)+"="+encodeURIComponent(arguments[i]);}
var fs= /^file\:/.test(adfPath);var error=false;var errorMessage="";var xmlHttp=new BiXmlHttp();xmlHttp.open("GET",adfPath,false);try{xmlHttp.send(null);}
catch(ex){error=true;errorMessage="File not found"}
if(!error)
{if(fs)
{var s=String(xmlHttp.responseText).replace(/<\?xml[^\?]*\?>/,"");xmlHttp.responseXML.loadXML(s);}
else if(xmlHttp.status!=200)
{error=true;errorMessage=xmlHttp.status+": "+xmlHttp.statusText;}}
if(!error)
{if(xmlHttp.responseXML.parseError.errorCode!=0){error=true;errorMessage=xmlHttp.responseXML.parseError.reason;}}
if(!error)
{var doc=xmlHttp.responseXML;var n=doc.selectSingleNode("/application/window | /Application/Window");left=_getAttr(n,"left","","x");right=_getAttr(n,"right","","x");top=_getAttr(n,"top","","y");bottom=_getAttr(n,"bottom","","y");width=_getAttr(n,"width","","x");height=_getAttr(n,"height","","y");centered=_getAttr(n,"centered","false")=="true";resizable=_getAttr(n,"resizable","true")!="false";fullScreen=_getAttr(n,"fullScreen","false")=="true";var sw=screen.width;var sh=screen.height;if(right!=""&&width!="")
left=sw-width-right;else if(left!=""&&right!="")
width=sw-left-right;if(bottom!=""&&height!="")
top=sh-height-bottom;else if(top!=""&&bottom!="")
height=sh-top-bottom;if(left==""&&right==""&&centered)
left=(sw-width)/2;if(top==""&&bottom==""&&centered)
top=(sh-height)/2;if(!bUseCurrentWindow)
{var w=window.open(uri,adfName,"menubar=0,location=0,status=0,toolbar=0,scrollbars=1"+(left?",left="+left:"")+(top?",top="+top:"")+(width?",width="+(width-8):"")+(height?",height="+(height-32):"")+(fullScreen?",fullscreen=1":"")+(resizable?",resizable=1":""),false);w.focus();}
else {document.location.href=uri;window.focus();}}
else alert(errorMessage);return!error;}
function BiTextLoader(){BiEventTarget.call(this);this._xmlHttp=new BiXmlHttp();var oThis=this;this.__onreadystatechange=function(){oThis._onreadystatechange();};}
var _p=BiTextLoader.prototype=new BiEventTarget;_p._className="BiTextLoader";_p._method="GET";_p._async=false;_p._uri=null;_p._user="";_p._password="";_p._loadCount=0;BiTextLoader.load=function(oUri){var tl=new BiTextLoader;tl.load(oUri);var s=tl.getText();tl.dispose();return s;};BiTextLoader.prototype.getMethod=function(){return this._method;};BiTextLoader.prototype.setMethod=function(v){this._method=v;};BiTextLoader.prototype.getUri=function(){return this._uri;};BiTextLoader.prototype.getAsync=function(){return this._async;};BiTextLoader.prototype.setAsync=function(v){this._async=v;};BiTextLoader.prototype.getUser=function(){return this._user;};BiTextLoader.prototype.setUser=function(v){this._user=v;};BiTextLoader.prototype.getPassword=function(){return this._password;};BiTextLoader.prototype.setPassword=function(v){this._password=v;};_p.setUri=function(oUri)
{if(oUri instanceof BiUri)
this._uri=oUri;else this._uri=new BiUri(application.getAdfPath(),oUri);};_p.load=function(oUri){this.open("GET",oUri||this._uri,this._async);this.send();};_p.post=function(oUri,oXmlDocument){this.open("POST",oUri||this._uri,this._async);this.send(oXmlDocument);};_p.open=function(sMethod,oUri,bAsync,sUser,sPassword){this._method=sMethod;this.setUri(oUri);this._async=bAsync!=null?bAsync:true;this._user=sUser;this._password=sPassword;this._xmlHttp.abort();this._xmlHttp.onreadystatechange=this.__onreadystatechange;this._xmlHttp.open(this._method,String(this._uri),this._async,this._user,this._password);};_p.send=function(oObject){this._loadCount=0;this._xmlHttp.send(oObject);};_p.abort=function(){this._xmlHttp.abort();};_p.getLoaded=function(){return this._xmlHttp.readyState==4;};_p.getLoading=function(){return this._xmlHttp.readyState<4;};_p.getText=function(){return String(this._xmlHttp.responseText);};_p.getXmlHttp=function(){return this._xmlHttp;};_p.getError=function(){if(this.getUri().getScheme()=="file"){return this._xmlHttp.status!=0;}
return this._xmlHttp.status!=200;};_p.dispose=function(){if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);this.__onreadystatechange=null;this._xmlHttp.onreadystatechange=function(){};this._xmlHttp=null;};_p._onreadystatechange=function(){if(this._xmlHttp.readyState==4)
{if(this._loadCount==0)
{this._loadCount++;this.dispatchEvent(new BiEvent("load"));}}};function BiXmlLoader(){BiTextLoader.call(this);this.addEventListener("load",BiXmlLoader._onLoad);}
_p=BiXmlLoader.prototype=new BiTextLoader;_p._className="BiXmlLoader";_p.dispose();_p._disposed=false;BiXmlLoader.load=function(oUri){var xl=new BiXmlLoader();xl.load(oUri);var doc=xl.getDocument();xl.dispose();return doc;};_p.getDocument=function(){return this.getXmlHttp().responseXML;};_p.getError=function(){return BiTextLoader.prototype.getError.call(this)||this.getDocument().parseError.errorCode!=0;};BiXmlLoader._onLoad=function(e)
{var xl=e.getTarget();if(BiBrowserCheck.ie&&xl.getUri().getScheme()=="file"&&!xl.getError())
{var s=xl.getText();s=s.replace(/<\?xml[^\?]*\?>/,"");var d=xl.getXmlHttp().responseXML;d.loadXML(s);}};function BiScriptLoaderQueue(){BiEventTarget.call(this);this._items=[];};_p=BiScriptLoaderQueue.prototype=new BiEventTarget;_p._className="BiScriptLoaderQueue";_p._async=true;BiScriptLoaderQueue.prototype.getAsync=function(){return this._async;};BiScriptLoaderQueue.prototype.setAsync=function(v){this._async=v;};_p._allExecuted=true;_p.add=function(oUri){this._allExecuted=false;var tl=new BiTextLoader();tl.setUri(oUri);tl.addEventListener("load",this._onProgress,this);this._items.push({src:oUri,textLoader:tl});};_p.addInline=function(sText){this._allExecuted=false;this._items.push({text:sText});};_p.load=function()
{if(this._getAllLoaded())
this._onAllLoaded();else {for(var i=0;i<this._items.length;i++)
{if(this._items[i].textLoader)
{this._items[i].textLoader.setAsync(this._async);this._items[i].textLoader.load();}}
if(this._getAllLoaded())
this._onAllLoaded();}};_p.abort=function(){for(var i=0;i<this._items.length;i++){if(this._items[i].textLoader)
this._items[i].textLoader.abort();}};_p.getLoaded=function()
{if(this._allExecuted)
return true;return this._allExecuted&&this._getAllLoaded()};_p._getAllLoaded=function(){var items=this._items;var tl;for(var i=0;i<items.length;i++){tl=items[i].textLoader;if(tl&&!tl.getLoaded())
return false;}
return true;};_p.getLoadedCount=function(){if(this.getLoaded())
return this.getScriptCount();var n=0;var items=this._items;var tl;for(var i=0;i<items.length;i++){tl=items[i].textLoader;if(!tl||tl.getLoaded())
n++}
return n;};_p.getScriptCount=function(){return this._items.length;};_p._onProgress=function(e){if(e.getTarget().getError()){alert("Error loading file \""+e.getTarget().getUri()+"\"");throw new Error("Error loading file \""+e.getTarget().getUri()+"\"");}
if(this._getAllLoaded())
this._onAllLoaded();else this.dispatchEvent(new BiEvent("progress"));};_p._onAllLoaded=function(){if(this._allExecuted)return;this.dispatchEvent(new BiEvent("progress"));var ok=true;var items=this._items;for(var i=0;i<items.length;i++){try{if(items[i].textLoader){try{if(window.execScript)
window.execScript(items[i].textLoader.getText());else window.eval(items[i].textLoader.getText());}
catch(ex){ok=false;alert("Error in script\n"+"Name: "+ex.name+"\n"+"Number: "+ex.number+"\n"+"Decription: "+ex.description+"\n"+"URI: "+items[i].textLoader.getUri());}}
else{try{if(window.execScript)
window.execScript(items[i].text);else window.eval(items[i].text);}
catch(ex){ok=false;alert("Error in script\n"+"Name: "+ex.name+"\n"+"Number: "+ex.number+"\n"+"Decription: "+ex.description+"\n"+"Text: "+items[i].text);}}}
catch(ex){ok=false;break;}}
if(ok)
{this._allExecuted=true;this.dispatchEvent(new BiEvent("load"));}};_p.dispose=function(){if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);if(this._items){for(var i=0;i<this._items.length;i++){if(this._items[i].textLoader)
this._items[i].textLoader.dispose();this._items[i].textLoader=null;this._items[i].text=null;this._items[i]=null;}}};function BiXmlResourceParser()
{BiXmlLoader.call(this);this._componentsById={};}
_p=BiXmlResourceParser.prototype=new BiXmlLoader;_p.dispose();_p._disposed=false;_p._className="BiXmlResourceParser";_p._rootNode=null;BiXmlResourceParser.getClassFromUri=function(oUri)
{return BiXmlResourceParser.getClassFromDocument(BiXmlLoader.load(oUri));};BiXmlResourceParser.getClassFromDocument=function(oDoc)
{return BiXmlResourceParser.getClassFromNode(oDoc.documentElement);};BiXmlResourceParser.getClassFromNode=function(oNode)
{if(oNode==null||oNode.nodeType!=1)
return null;var tagName=oNode.tagName;var constr=window["Bi"+tagName]||window[tagName];if(typeof constr=="function")
{var newConstr=function(){constr.call(this);this._xmlResourceParser=new BiXmlResourceParser;this._xmlResourceParser.setRootNode(this._rootXmlNode);this._xmlResourceParser.processAttributes(this,this._rootXmlNode);this._xmlResourceParser.processChildNodes(this,this._rootXmlNode);};var p=newConstr.prototype=new constr;p._rootXmlNode=oNode;p.dispose();p._disposed=false;p.dispose=function()
{if(this.getDisposed())return;constr.prototype.dispose.call(this);this._xmlResourceParser.dispose();this._rootXmlNode=null;};p.getComponentById=function(sId)
{return this._xmlResourceParser.getComponentById(sId);};p.getXmlResourceParser=function()
{return this._xmlResourceParser;};application.addEventListener("dispose",function(){newConstr.prototype._rootXmlNode=null;newConstr=null;});return newConstr;}
throw new Error("BiXmlResourceParser getClassFromNode. Cannot create object from \""+oNode.tagName+"\"");};_p.fromNode=function(oNode)
{if(oNode==null||oNode.nodeType!=1)
return null;var id=oNode.getAttribute("id");if(id&&this._componentsById[id])
return this._componentsById[id];var tagName=oNode.tagName;var o;var constr=window["Bi"+tagName]||window[tagName];if(typeof constr=="function")
{var o=new constr;this.processAttributes(o,oNode);this.processChildNodes(o,oNode);if(id)
this._componentsById[id]=o;return o;}
throw new Error("BiXmlResourceParser fromNode. Cannot create object from \""+oNode.tagName+"\"");};_p.processAttributes=function(o,oNode)
{var attrs=oNode.attributes;var l=attrs.length;var name,value;for(var i=0;i<l;i++)
{name=attrs[i].nodeName;value=attrs[i].nodeValue;o.setAttribute(name,value,this);}};_p.processChildNodes=function(obj,oNode)
{var tagName=oNode.tagName;var re=new RegExp("^"+tagName+"\\.(.+)$");var cs=oNode.childNodes;var l=cs.length;var fc,s;var emptyRe= /^\s*$/;for(var i=0;i<l;i++)
{if(re.test(cs[i].tagName))
{var propertyName=RegExp.$1;var cs2=cs[i].childNodes;var l2=cs2.length;for(var j=0;j<l2;j++)
{if(cs2[j].nodeType==3)
{s=cs2[j].data;if(emptyRe.test(s))
continue;obj.setAttribute(propertyName,s,this);break;}
else {obj.setProperty(propertyName,this.fromNode(cs2[j]));break;}}}
else obj.addXmlNode(cs[i],this);}};_p.getComponentById=function(sId)
{var o=this._componentsById[sId];if(o)
return o;if(this.getLoaded())
{var rn=this.getRootNode();var n=rn.selectSingleNode("//*[@id='"+sId+"']");if(!n)
return null;o=this.fromNode(n);if(o)
return o;}
return null;};BiXmlResourceParser.prototype.setRootNode=function(v){this._rootNode=v;};_p.getRootNode=function()
{if(this._rootNode)
return this._rootNode;else {if(this.getLoaded())
return this.getDocument();return null;}};_p.getLoaded=function()
{return this._rootNode!=null||BiXmlLoader.prototype.getLoaded.call(this);};_p.dispose=function()
{if(this.getDisposed())return;BiXmlLoader.prototype.dispose.call(this);for(var id in this._componentsById)
{this._componentsById[id].dispose();this._componentsById[id]=null;}
this._rootNode=null;};function BiResourceLoader()
{BiEventTarget.call(this);this._resources=[];this._resourcesById=[];}
_p=BiResourceLoader.prototype=new BiEventTarget;_p._className="BiResourceLoader";_p._lastLoaded= -1;_p._lastStarted= -1;_p._count=0;_p._loaded=false;_p.getResourceById=function(sId)
{if(sId in this._resourcesById)
return this._resourcesById[sId].object;return null;};_p.addResource=function(sType,oData,sId)
{var lastRes=this._resources[this._resources.length-1];if((sType=="script"||sType=="inlinescript")&&!(lastRes instanceof BiScriptLoaderQueue))
{lastRes=new BiScriptLoaderQueue;lastRes.addEventListener("load",this.load,this);lastRes.addEventListener("progress",this._onprogress,this);lastRes.addEventListener("error",this._onerror,this);this._resources.push(lastRes);}

⌨️ 快捷键说明

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