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

📄 application.js

📁 在流览器上仿CS界面的JAVASCRIPT脚本
💻 JS
📖 第 1 页 / 共 4 页
字号:
if(sType=="script")
lastRes.add(oData);else if(sType=="inlinescript")
lastRes.addInline(oData);else {var item={name:sType,node:oData,id:sId};this._resources.push(item);if(sId)
this._resourcesById[sId]=item;}
this._count++;};_p._createGeneralObject=function(oItem)
{var node=oItem.node;if(!this._xmlResourceParser)
{this._xmlResourceParser=new BiXmlResourceParser;this._xmlResourceParser.setRootNode(node.parentNode);}
var o=this._xmlResourceParser.fromNode(node);oItem.object=o;oItem.node=null;if(o instanceof BiEventTarget)
{o.addEventListener("load",this.load,this);o.addEventListener("error",this._onerror,this);}
if(typeof o.load=="function")
o.load();};_p.load=function()
{if(this._loaded)return;var allLoaded=true;if(this._lastStarted== -1)
{allLoaded=false;this._lastStarted=0;this._startLoad(this._resources[0]);}
else {for(var i=this._lastStarted;i<this._resources.length;i++)
{var obj=this._resources[i];if(this._isLoaded(obj))
{this._lastLoaded=i;this._removeListeners(obj);this._onprogress();continue;}
else {if(i==this._lastStarted)
{allLoaded=false;break;}
this._lastStarted=i;this._startLoad(obj);if(!this._isLoaded(obj))
{allLoaded=false;break;}
else {this._lastLoaded=i;this._removeListeners(obj);this._onprogress();}}}}
if(allLoaded)
this._onAllLoaded();};_p._startLoad=function(obj)
{if(obj instanceof BiScriptLoaderQueue)
obj.load();else this._createGeneralObject(obj);};_p._isLoaded=function(obj)
{if(obj instanceof BiScriptLoaderQueue)
return obj.getLoaded();else if(obj.object==null)
return false;else if(typeof obj.object.getLoaded=="function")
return obj.object.getLoaded();else return true;};_p._removeListeners=function(obj)
{if(obj instanceof BiScriptLoaderQueue)
{obj.removeEventListener("load",this.load,this);obj.removeEventListener("progress",this._onprogress,this);obj.removeEventListener("error",this._onerror,this);}
else if(obj.object!=null&&obj.object instanceof BiEventTarget)
{obj.object.removeEventListener("load",this.load,this);obj.object.removeEventListener("error",this._onerror,this);}};_p.abort=function()
{var items=this._resources;var l=items.length;for(var i=0;i<l;i++)
{if(items[i]instanceof BiScriptLoaderQueue)
items[i].abort()
else if(items[i].object&&typeof items[i].object.abort=="function")
items[i].object.abort();}};_p.getLoaded=function()
{return this._lastLoaded==this._resources.length-1;};_p.getLoadedCount=function()
{var n=0;var items=this._resources;var l=items.length;for(var i=0;i<l;i++)
{if(items[i]instanceof BiScriptLoaderQueue)
n+=items[i].getLoadedCount();else if(this._isLoaded(items[i]))
n++;}
return n;};_p.getCount=function()
{return this._count;};_p.dispose=function()
{if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);var item;for(var i=this._resources.length-1;i>=0;i--)
{item=this._resources[i];if(item instanceof BiScriptLoaderQueue)
item.dispose();else if(item.object&&typeof item.object.dispose=="function")
item.object.dispose();item.object=null;item.uri=null;item.constr=null;}
this._resources=null;this._resourcesId=null;};_p._onprogress=function()
{if(this._loaded)return;this.dispatchEvent(new BiEvent("progress"));};_p._onerror=function(e)
{var t=e.getTarget();throw new Error("Error loading "+t+"\nURI: "+t.getUri());};_p._onAllLoaded=function()
{if(this._loaded)return;this._loaded=true;this._onprogress();this.dispatchEvent(new BiEvent("load"));};function LoadingStatus()
{this._element=document.createElement("DIV");this._element.className="bi-loading-status";this._htmlElement=document.createElement("DIV");this._htmlElement.className="bi-loading-status-html";this._element.appendChild(this._htmlElement);this._textElement=document.createElement("DIV");this._textElement.className="bi-loading-status-text";this._element.appendChild(this._textElement);this._pbElement=document.createElement("DIV");this._pbElement.className="bi-loading-status-progress-bar";this._element.appendChild(this._pbElement);this._fillElement=document.createElement("DIV");this._pbElement.appendChild(this._fillElement);document.body.appendChild(this._element);var oThis=this;this._onresize=function(){oThis.fixSize();};if(BiBrowserCheck.ie)
window.attachEvent("onresize",this._onresize);else window.addEventListener("resize",this._onresize,false);this.fixSize();this.setHtmlText(LoadingStatus._defaultHtml);}
_p=LoadingStatus.prototype;_p.dispose=function(nValue)
{if(this._disposed)return;if(BiBrowserCheck.ie)
window.detachEvent("onresize",this._onresize);else window.removeEventListener("resize",this._onresize,false);this._element.style.filter="none";if(document.body&&!(application&&application._disposed))
document.body.removeChild(this._element);this._element=this._htmlElement=this._fillElement=this._onresize=null;this._disposed=true;};_p.setValue=function(nValue)
{this._fillElement.style.width=(nValue==null?"10":nValue)+"%";};_p.setText=function(s)
{while(this._textElement.hasChildNodes())
this._textElement.removeChild(this._textElement.lastChild);this._textElement.appendChild(document.createTextNode(s));};_p.fixSize=function()
{this._element.style.left=Math.max(0,(document.body.clientWidth-this._element.offsetWidth)/2)+"px";this._element.style.top=Math.max(0,(document.body.clientHeight-this._element.offsetHeight)/2)+"px";};_p.setHtmlText=function(sHtml,sStyle)
{if(typeof application!="undefined")
{sHtml=sHtml.replace("%VERSION%",application.getVersion());}
this._htmlElement.innerHTML=sHtml;if(sStyle)
this._htmlElement.style.cssText=sStyle;};_p.setStyle=function(sStyle)
{if(!/visibility/i.test(sStyle)&&this._element.style.visibility!="")
{sStyle="visibility:"+this._element.style.visibility+";"+sStyle;}
this._element.style.cssText=sStyle;this.fixSize();};_p.setStatusTextStyle=function(sStyle)
{if(sStyle)
this._textElement.style.cssText=sStyle;};_p.setProgressBarStyle=function(sStyle)
{if(sStyle)
this._pbElement.style.cssText=sStyle;};_p.setVisible=function(b)
{this._element.style.visibility=b?"visible":"hidden";};LoadingStatus._defaultHtml='<div style="position:absolute;top: 5px;left:10px;width:280px;"><h1 style="font-size:350%;margin:0;">Bindows&#8482;</h1><p style="font-size:80%;margin:5px 0;">Bindows&#8482; belongs to MB Technologies (Georgia, USA). All rights reserved. You are not allowed to copy or modify this code. Commercial use requires license.</p></div>'+'<div style="position:absolute;bottom:5px;left:10px">Version %VERSION%</div>'+'<div style="position:absolute;bottom:5px;right:10px">&#x00A9; 2003-2004 MB Technologies Inc.</div>';function BiAdf()
{BiXmlLoader.call(this);this._async=true;this._caption="";this._scripts=[];this._xmlResourceParser=new BiXmlResourceParser;}
_p=BiAdf.prototype=new BiXmlLoader;_p._className="BiAdf";_p.dispose();_p._disposed=false;BiAdf.prototype.getCaption=function(){return this._caption;};BiAdf.prototype.setCaption=function(v){this._caption=v;};BiAdf.prototype.getXmlResourceParser=function(){return this._xmlResourceParser;};_p._interpret=function()
{var doc=this.getDocument();var node=doc.selectSingleNode("/application/window/@caption | /Application/Window/@caption");if(node)
{this._caption=String(node.text);document.title=this._caption;}
this._createSplashScreen();};_p._addResources=function()
{var doc=this.getDocument();var n=doc.selectSingleNode("/application/resources | /Application/Resources");if(n)
{var nl=n.childNodes;var l=nl.length;var uri;var rl=application.getResourceLoader();for(var i=0;i<l;i++)
{if(nl[i].nodeType!=1)
continue;uri=nl[i].getAttribute("uri")||nl[i].getAttribute("src");if(nl[i].tagName=="script"||nl[i].tagName=="Script")
{if(uri)
rl.addResource("script",uri);else if(nl[i].text!="")
{rl.addResource("inlinescript",nl[i].text);}}
else rl.addResource(nl[i].tagName,nl[i],nl[i].getAttribute("id"));}}};_p._createSplashScreen=function()
{var doc=this.getDocument();var el=doc.selectSingleNode("/application/splashScreen | /Application/SplashScreen");application._loadStatus.setVisible(true);if(el&&application._loadStatus&&!application._loadStatus._disposed)
{if(el.getAttribute("style"))
application._loadStatus.setStyle(el.getAttribute("style"));var html=el.selectSingleNode("html | Html");if(html)
{var style=html.getAttribute("style");var cs=html.childNodes;var l=cs.length;var sb=new Array(l);for(var i=0;i<l;i++)
sb.push(cs[i].xml);application._loadStatus.setHtmlText(sb.join(""),style);}
var pb=el.selectSingleNode("progressBar | ProgressBar");if(pb&&pb.getAttribute("style"))
application._loadStatus.setProgressBarStyle(pb.getAttribute("style"));var st=el.selectSingleNode("statusText | StatusText");if(st&&st.getAttribute("style"))
application._loadStatus.setStatusTextStyle(st.getAttribute("style"));}};_p.parseXmlResources=function()
{var doc=this.getDocument();var windowEl=doc.selectSingleNode("/application/window | /Application/Window");if(!windowEl)
return;this._xmlResourceParser.setRootNode(windowEl);var win=application.getWindow();var adfAttrs=["left","right","top","bottom","width","height","centered","resizable","fullScreen"];var adfAttrsSet={};for(var i=0;i<adfAttrs.length;i++)
adfAttrsSet[adfAttrs[i]]=true;var attrs=windowEl.attributes;for(var i=0;i<attrs.length;i++)
{if(!(attrs[i].nodeName in adfAttrsSet))
win.setAttribute(attrs[i].nodeName,attrs[i].nodeValue,this._xmlResourceParser);}
var cs=windowEl.childNodes;var l=cs.length;for(var i=0;i<l;i++)
{win.addXmlNode(cs[i],this._xmlResourceParser);}};function BiApplication(){if(typeof application=="object")
return application;BiEventTarget.call(this);this._progressStatus="";this._coreScriptFiles=[];this._adf=new BiAdf;}
var _p=BiApplication.prototype=new BiEventTarget;_p._className="BiApplication";_p._version=1.10;BiApplication.prototype.getVersion=function(){return this._version;};_p.start=function(){this.addEventListener("progressstatus",this._onprogressstatus);this._loadStatus=new LoadingStatus();this._loadStatus.setValue(2);if(arguments.length!=0)
this._buildArgumentsMapFromArguments(arguments);this._loadAdf();this._onunload=function(){application.dispose();};if(BiBrowserCheck.ie)
window.attachEvent("onunload",this._onunload);else window.addEventListener("unload",this._onunload,false);};_p.getProtocol=function(){throw new Error("Depreciated! Use getUri().getScheme() instead");};_p._uri=new BiUri(document.location.href);_p._uriParams=new BiUri(document.location.href);_p._systemRootPath=new BiUri(document.location.href,"./");_p.getPath=function(){return this._systemRootPath;};_p.getAdfPath=function(){if(this._adfPath)
return this._adfPath;var p=this._uriParams.getParam("Adf");return this._adfPath=new BiUri(p,"./");};BiApplication.prototype.getProgressStatus=function(){return this._progressStatus;};BiApplication.prototype.setProgressStatus=function(v){this._progressStatus=v;};BiApplication.prototype.getWindow=function(){return this._window;};BiApplication.prototype.getAdf=function(){return this._adf;};BiApplication.prototype.getUri=function(){return this._uri;};_p._buildArgumentsMapFromArguments=function(oArguments)
{var adfName="";var adfPath;var a0=oArguments[0];if(a0.charAt(a0.length-1)!="/")
a0+="/";this._systemRootPath=String(new BiUri(this._uri,a0));var re= /([^\/]+\/)?(\w+)(\.[^\/]*)?$/;var ok=re.test(oArguments[1]);if(ok)
adfName=RegExp.$2;else this._reportError("The ADF argument is incorrect");adfPath=String(new BiUri(this._uri,oArguments[1]));var uri=this._uriParams;uri.setParam("AdfName",adfName);uri.setParam("Adf",adfPath);uri.setParam("Params",oArguments.length-1);for(var i=2;i<oArguments.length;i++){uri.setParam("Param"+(i-2),oArguments[i]);}};_p._loadAdf=function(){this._progressStatus="Loading Application Description File";this.dispatchEvent(new BiEvent("progressstatus"));this._resourceLoader=new BiResourceLoader;this._adf.addEventListener("load",this._onAdfLoaded,this);var adf=this._uriParams.getParam("Adf");if(adf!=null)
this._adf.load(adf);else{this._reportError("No ADF specified");}};_p._onAdfLoaded=function(){this._progressStatus="Application Description File Loaded";this.dispatchEvent(new BiEvent("progressstatus"));if(this._adf.getError()){this._reportError("Error loading ADF","Error loading ADF\n"+"URI: "+this._uriParams.getParam("Adf")+"\nStatus: "+this._adf.getXmlHttp().status+", "+this._adf.getXmlHttp().statusText);}
else{this._adf._interpret();window.setTimeout("application._loadResources()",1);}};_p.getResourceLoader=function()
{if(this._resourceLoader==null)
return null;return this._resourceLoader;};_p.getResourceById=function(sId)
{if(this._resourceLoader==null)
return null;return this._resourceLoader.getResourceById(sId);};_p.getComponentById=function(sId)
{if(this._adf&&this._adf.getXmlResourceParser())
return this._adf.getXmlResourceParser().getComponentById(sId);return null;};_p._loadResources=function(){var systemRootPath=this.getPath();for(var i=0;i<this._coreScriptFiles.length;i++)
this._resourceLoader.addResource("script",new BiUri(systemRootPath,this._coreScriptFiles[i]));this._adf._addResources();this._resourceLoader.addEventListener("progress",this._onprogressstatus,this);this._resourceLoader.addEventListener("load",this._onResourcesLoaded,this);this._progressStatus="Loading Resources";this._resourceLoader.load();};_p._onprogressstatus=function(e){if(!this._resourceLoader||this._resourceLoader.getCount()==0)
this._loadStatus.setValue(5);else{this._loadStatus.setValue(Math.max(5,Math.min(95,this._resourceLoader.getLoadedCount()/this._resourceLoader.getCount()*100)));this._progressStatus="Loading Resources ("+this._resourceLoader.getLoadedCount()+"/"+this._resourceLoader.getCount()+")";}
this._loadStatus.setText(this.getProgressStatus());};_p._onResourcesLoaded=function(e){this._loadStatus.setText("Loading completed");this._loadStatus.setValue(100);this._window=new BiApplicationWindow;this._window._create();this._adf.parseXmlResources();var appClassName=this._uriParams.getParam("AdfName");window.setTimeout("application._onResourcesLoaded2(\""+appClassName+"\")",1);};_p._onResourcesLoaded2=function(appClassName)
{var uri=this._uriParams;var argc=Number(uri.getParam("Params"));var argv=new Array(argc);for(var i=0;i<argc;i++)
argv[i]=uri.getParam("Param"+i);if(application._loadStatus){application._loadStatus.dispose();application._loadStatus=null;}
window.focus();if(window[appClassName]&&typeof window[appClassName].main=="function")
{window[appClassName].main.apply(window[appClassName],argv);}
appClassName=null;argv=null;};_p._reportError=function(s,s2){if(this._loadStatus)
this._loadStatus.setText(s);throw new Error(s2||s);};_p.dispose=function(){this.dispatchEvent(new BiEvent("dispose"));if(this._disposed)return;BiEventTarget.prototype.dispose.call(this);if(BiBrowserCheck.ie)
window.detachEvent("onunload",this._onunload);else window.removeEventListener("unload",this._onunload,false);if(this._window)
this._window.dispose();this._window=null;if(this._loadStatus)
this._loadStatus.dispose();this._loadStatus=null;if(this._resourceLoader)
this._resourceLoader.dispose();this._resourceLoader=null;this._adf.dispose();this._adf=null;this._onunload=null;};application=new BiApplication;application._coreScriptFiles_ie=["js/coreclasses.js","js/guicomponents.js","js/gauge.ie.js","js/menu.ie.js","js/window.js","js/grids.js","js/databinding.js","js/chartingbase.js","js/charting.js","js/charting2.js"];application._coreScriptFiles_moz=["js/coreclasses.js","js/guicomponents.js","js/menu.moz.js","js/window.js","js/grids.js","js/databinding.js","js/chartingbase.js","js/charting2.js"];if(BiBrowserCheck.ie)
application._coreScriptFiles=application._coreScriptFiles_ie;else application._coreScriptFiles=application._coreScriptFiles_moz;

⌨️ 快捷键说明

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