📄 application.js
字号:
/* * Bindows 1.10 * http://www.bindows.net/ * Copyright (c) 2003-2004 MB Technologies * * Bindows(tm) belongs to MB Technologies (Georgia, USA). All rights reserved. * You are not allowed to copy or modify this code. Commercial use requires * license. */Array.prototype.indexOf=function(o){for(var i=0;i<this.length;i++){if(this[i]==o)
return i;}
return-1;};Array.prototype.lastIndexOf=function(o){for(var i=this.length-1;i>=0;i--){if(this[i]==o)
return i;}
return-1;};Array.prototype.contains=function(o){return this.indexOf(o)!= -1;};Array.prototype.copy=function(o){return this.concat();};Array.prototype.insertAt=function(o,i){this.splice(i,0,o);};Array.prototype.insertBefore=function(o,o2){var i=this.indexOf(o2);if(i== -1)
this.push(o);else this.splice(i,0,o);};Array.prototype.removeAt=function(i){this.splice(i,1);};Array.prototype.remove=function(o){var i=this.indexOf(o);if(i!= -1)
this.splice(i,1);};String.prototype.trim=function(){return this.replace(/(^\s+)|\s+$/g,"");};Function.READ=1;Function.WRITE=2;Function.READ_WRITE=3;Function.prototype.addProperty=function(sName,nReadWrite){nReadWrite=nReadWrite||Function.READ_WRITE;var capitalized=sName.charAt(0).toUpperCase()+sName.substr(1);if(nReadWrite&Function.READ)
this.prototype["get"+capitalized]=new Function("","return this._"+sName+";");if(nReadWrite&Function.WRITE)
this.prototype["set"+capitalized]=new Function(sName,"this._"+sName+" = "+sName+";");};function BiObject(){this._hashCode=BiObject._hashCodePrefix+Math.round(Math.random()*1000)+BiObject._hashCodePrefix+BiObject._hashCodeCounter++;}
BiObject._hashCodeCounter=1;BiObject._hashCodePrefix="hc";BiObject.toHashCode=function(o){if(o._hashCode!=null)
return o._hashCode;return o._hashCode=BiObject._hashCodePrefix+Math.round(Math.random()*1000)+BiObject._hashCodePrefix+BiObject._hashCodeCounter++;};var _p=BiObject.prototype;_p._className="BiObject";_p._disposed=false;_p._id=null;BiObject.prototype.getDisposed=function(){return this._disposed;};BiObject.prototype.getId=function(){return this._id;};BiObject.prototype.setId=function(v){this._id=v;};BiObject.prototype.getUserData=function(){return this._userData;};BiObject.prototype.setUserData=function(v){this._userData=v;};_p.toHashCode=function(){return BiObject.toHashCode(this);};_p.dispose=function(){this._disposed=true;delete this._userData;};_p.toString=function(){if(this._className)
return"[object "+this._className+"]";return"[object Object]";};_p.getProperty=function(sPropertyName){var getterName="get"+sPropertyName.charAt(0).toUpperCase()+sPropertyName.substr(1);if(typeof this[getterName]=="function")
return this[getterName]();throw new Error("No such property, "+sPropertyName);};_p.setProperty=function(sPropertyName,oValue){var setterName="set"+sPropertyName.charAt(0).toUpperCase()+sPropertyName.substr(1);if(typeof this[setterName]=="function")
this[setterName](oValue);else throw new Error("No such property, "+sPropertyName);};_p.setAttribute=function(sName,sValue,oXmlResourceParser)
{var v;if(sValue=="true")
v=true;else if(sValue=="false")
v=false;else if(parseFloat(sValue)==sValue)
v=parseFloat(sValue);else v=sValue;this.setProperty(sName,v);};_p.getAttribute=function(sName)
{return String(this.getProperty(sName));};_p.addXmlNode=function(oNode,oXmlResourceParser)
{if(oNode.nodeType==1)
oXmlResourceParser.fromNode(oNode);};function BiBrowserCheck(){if(BiBrowserCheck._singleton)
return BiBrowserCheck._singleton;var ua=navigator.userAgent;this._ie= /msie/i.test(ua);this._moz=navigator.product=="Gecko";if(this._moz)
{/rv\:([^\);]+)(\)|;)/.test(ua);this._version=RegExp.$1;this._ie55=false;this._ie6=false;}
else {/MSIE([^\);]+)(\)|;)/.test(ua);this._version=RegExp.$1;this._ie55= /msie 5\.5/i.test(ua);this._ie6= /msie 6/i.test(ua);}
BiBrowserCheck._singleton=this;}
BiBrowserCheck.prototype=new BiObject;BiBrowserCheck.prototype.getIe=function(){return this._ie;};BiBrowserCheck.prototype.getIe55=function(){return this._ie55;};BiBrowserCheck.prototype.getIe6=function(){return this._ie6;};BiBrowserCheck.prototype.getMoz=function(){return this._moz;};BiBrowserCheck.prototype.getVersion=function(){return this._version;};var _br=new BiBrowserCheck;BiBrowserCheck.ie=_br.getIe();BiBrowserCheck.ie55=_br.getIe55();BiBrowserCheck.ie6=_br.getIe6();BiBrowserCheck.moz=_br.getMoz();BiBrowserCheck.version=_br.getVersion();_br=null;function BiUri(sBase,sRel)
{this._params={};if(sBase)
{this.setHref(sBase);if(sRel)
this._setRelative(sRel)}}
_p=BiUri.prototype=new BiObject;_p._className="BiUri";_p._scheme="";_p._userInfo="";_p._port="";_p._host="";_p._path="";_p._dirPath="";_p._fragment="";_p._query="";_p._hrefCache=null;BiUri.prototype.getScheme=function(){return this._scheme;};BiUri.prototype.getPath=function(){return this._path;};BiUri.prototype.getDirPath=function(){return this._dirPath;};BiUri.prototype.getHost=function(){return this._host;};BiUri.prototype.getPort=function(){return this._port;};BiUri.prototype.getFragment=function(){return this._fragment;};BiUri.prototype.getQuery=function(){return this._query;};BiUri.prototype.getUserInfo=function(){return this._userInfo;};BiUri.regExps={scheme:/^([^:]+)\:.+$/,user:/^([^@\/]+)@.+$/,host:/^([^:\/\?\#]+).*$/,port:/^:(\d+)/,path:/^([^\?#]*)/,dirPath:/^(.*\/)[^\/]*$/,fragment:/^[^#]*#(.*)$/,absUri:/^\w(\w|\d|\+|\-|\.)*:/i};_p.toString=function()
{return this.getHref();};_p.setHref=function(s)
{this._hrefCache=null;s=String(s);this._scheme="";this._userInfo="";this._host="";this._port=null;this._path="";this._dirPath="";this._query="";this._fragment="";this._params={};var err=new Error("Not a well formatted URI");var ok=BiUri.regExps.scheme.test(s);if(!ok)throw err;this._scheme=RegExp.$1;if(this._scheme=="mailto"||this._scheme=="news"||this._scheme=="view-source")
s=s.substring(this._scheme.length+1);else s=s.substring(this._scheme.length+3);ok=BiUri.regExps.user.test(s);if(ok)
{this._userInfo=RegExp.$1;s=s.substring(this._userInfo.length+1);}
if(this._scheme!="file"||s.charAt(0)!="/")
{ok=BiUri.regExps.host.test(s);if(!ok)
throw err;this._host=RegExp.$1;s=s.substring(this._host.length);}
ok=BiUri.regExps.port.test(s);if(ok)
{this._port=Number(RegExp.$1);s=s.substring(RegExp.$1.length+1);}
this._parsePathAndRest(s);};_p._parsePathAndRest=function(s)
{var err=new Error("Not a well formatted URI");var ok=BiUri.regExps.path.test(s);if(!ok)
throw err;this._path=RegExp.$1;s=s.substring(this._path.length);if(this._path==""&&(this._scheme=="file"||this._scheme=="http"||this._scheme=="https"||this._scheme=="ftp"))
{this._path="/";}
var segments=this._path.split("/");var sb=[];var j=0;for(var i=0;i<segments.length;i++)
{if(segments[i]==".")
continue;if(segments[i]=="..")
{j--;delete sb[j];sb.length=j
continue;}
sb[j++]=segments[i];}
this._path=sb.join("/");if(this._path.length>0)
{ok=BiUri.regExps.dirPath.test(this._path);if(!ok)
throw err;this._dirPath=RegExp.$1;}
ok=BiUri.regExps.fragment.test(s);if(ok)
{this._fragment=RegExp.$1;s=s.substring(0,s.length-this._fragment.length-1);this._fragment="#"+this._fragment.replace("#","%23");}
this._query=s;s=s.substring(1);if(this._query!="")
{var pairs=s.split(/\;|\&/);var parts;for(var i=0;i<pairs.length;i++)
{parts=pairs[i].split("=");if(parts.length==2)
this._params[parts[0]]=decodeURIComponent(parts[1]);else this._params[pairs[i]]=null;}}};_p._setRelative=function(s)
{this._hrefCache=null;s=String(s);var isAbsolute=BiUri.regExps.absUri.test(s);if(isAbsolute)
{this.setHref(s);return;}
var dirPath=this._dirPath;this._path="";this._dirPath="";this._query="";this._fragment="";this._params={};if(s.charAt(0)=="/")
{this._parsePathAndRest(s)}
else this._parsePathAndRest(dirPath+s);};_p.getHref=function()
{if(this._hrefCache!=null)
return this._hrefCache;var s=this._scheme+(this._scheme=="mailto"||this._scheme=="news"||this._scheme=="view-source"?":":"://")+this._userInfo+(this._userInfo==""?"":"@")+this._host+(this._port!=null?":"+this._port:"")+this._path;var sb=[];for(var name in this._params)
{if(this._params[name]!=null)
sb.push(name+"="+encodeURIComponent(this._params[name]));else sb.push(name);}
return this._hrefCache=s+this.getQuery()+this._fragment;};_p.getParam=function(sName)
{return this._params[sName];};_p.setParam=function(sName,sValue)
{this._hrefCache=null;return this._params[sName]=String(sValue);};_p.removeParam=function(sName)
{this._hrefCache=null;delete this._params[sName];};_p.getQuery=function()
{var sb=[];for(var name in this._params)
{if(this._params[name]!=null)
sb.push(name+"="+encodeURIComponent(this._params[name]));else sb.push(name);}
return(sb.length>0?"?"+sb.join("&"):"");};function BiEventTarget(){BiObject.call(this);this._listeners={};}
_p=BiEventTarget.prototype=new BiObject;_p._className="BiEventTarget";_p.addEventListener=function(sType,fHandler,oObject){if(typeof fHandler!="function")
throw new Error(this+" addEventListener: "+fHandler+" is not a function");if(this._listeners[sType]==undefined)
this._listeners[sType]={};var key=BiObject.toHashCode(fHandler)+(oObject?BiObject.toHashCode(oObject):"");this._listeners[sType][key]={handler:fHandler,object:oObject};};_p.removeEventListener=function(sType,fHandler,oObject){if(this._disposed||this._listeners[sType]==undefined)
return;var key=BiObject.toHashCode(fHandler)+(oObject?BiObject.toHashCode(oObject):"");delete this._listeners[sType][key];};_p.dispatchEvent=function(oEvent){if(this._disposed)return;oEvent._target=this;oEvent.initDispatch();this._dispatchEvent(oEvent);return!oEvent._defaultPrevented;};_p._dispatchEvent=function(oEvent){if(this._disposed)return;oEvent._currentTarget=this;if(!(oEvent instanceof BiMouseEvent)&&!(oEvent instanceof BiKeyboardEvent)||this.getIsEnabled())
{var fs=this._listeners[oEvent.getType()];if(fs){var f,o;for(var hc in fs){f=fs[hc].handler;o=fs[hc].object;if(typeof f=="function"){if(typeof o=="object")
{f.call(o,oEvent);}
else f.call(this,oEvent);}}}}
if(oEvent._bubbles&&!oEvent._propagationStopped&&this._parent){this._parent._dispatchEvent(oEvent);}};_p.setAttribute=function(sName,sValue,oXmlResourceParser)
{if(sName.substring(0,2)=="on")
{var type=sName.substring(2);this.addEventListener(type,new Function("event",sValue),oXmlResourceParser);}
else BiObject.prototype.setAttribute.call(this,sName,sValue,oXmlResourceParser);};_p.dispose=function(){if(this._disposed)return;BiObject.prototype.dispose.call(this);for(var sType in this._listeners)
this._listeners[sType]=null;this._listeners=null;};function BiEventManager(){BiObject.call(this);var oThis=this;this.__onmouseevent=function(e){return oThis._onmouseevent(e);};this.__onkeyevent=function(e){return oThis._onkeyevent(e);};this.__onselectevent=function(e){return oThis._onselectevent(e);};this.__onwindowblur=function(e){return oThis._onwindowblur(e);};this.__ondragevent=function(e){return oThis._ondragevent(e);};this.__onactivateevent=function(e){return oThis._onactivateevent(e);};this.__onresizeevent=function(e){return oThis._onresizeevent(e);};this._mozActiveElement=null;}
var _p=BiEventManager.prototype=new BiObject;_p._className="BiEventManager";_p._lastFocused=null;_p._lastMouseEventType=null;_p._lastMouseEventDate=0;_p._allowBrowserContextMenu=false;BiEventManager.prototype.getAllowBrowserContextMenu=function(){return this._allowBrowserContextMenu;};BiEventManager.prototype.setAllowBrowserContextMenu=function(v){this._allowBrowserContextMenu=v;};_p.attachToWindow=function(oWindow){this._window=oWindow;this.attachMouseEvents();this.attachKeyboardEvents();var doc=oWindow.document;doc.body.onselect=doc.onselectstart=doc.onselectionchange=this.__onselectevent;doc.ondragstart=this.__ondragevent;doc.body.onactivate=this.__onactivateevent;oWindow.onblur=this.__onwindowblur;if(BiBrowserCheck.moz)
{oWindow.addEventListener("resize",this.__onresizeevent,false);}};BiEventManager._mouseEventTypes=["mouseover","mousemove","mouseout","mousedown","mouseup","click","dblclick","contextmenu"];if(BiBrowserCheck.ie)
BiEventManager._mouseEventTypes.push("mousewheel");else BiEventManager._mouseEventTypes.push("DOMMouseScroll");_p.attachMouseEvents=function(){var doc=this._window.document;var types=BiEventManager._mouseEventTypes;if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.attachEvent("on"+types[i],this.__onmouseevent);}
else {for(var i=0;i<types.length;i++)
doc.addEventListener(types[i],this.__onmouseevent,false);}};_p.detachMouseEvents=function(){var doc=this._window.document;var types=BiEventManager._mouseEventTypes
if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.detachEvent("on"+types[i],this.__onmouseevent);}
else {if(doc)
for(var i=0;i<types.length;i++)
doc.removeEventListener(types[i],this.__onmouseevent,false);}};BiEventManager._keyboardEventTypes=["keydown","keypress","keyup"];_p.attachKeyboardEvents=function(){var doc=this._window.document;var types=BiEventManager._keyboardEventTypes;if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.body.attachEvent("on"+types[i],this.__onkeyevent);}
else {for(var i=0;i<types.length;i++)
doc.addEventListener(types[i],this.__onkeyevent,false);}};_p.detachKeyboardEvents=function(){var doc=this._window.document;var types=BiEventManager._keyboardEventTypes;if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.body.detachEvent("on"+types[i],this.__onkeyevent);}
else {if(doc)
{for(var i=0;i<types.length;i++)
doc.removeEventListener(types[i],this.__onkeyevent,false);}}};_p._onmouseevent=function(e)
{if(!e)
e=this._window.event;var type=e.type;if(BiBrowserCheck.ie)
{if(type=="mouseup"&&(this._lastMouseEventType=="click"||this._lastMouseEventType=="contextmenu"||this._lastMouseEventType=="mouseup")&&new Date-this._lastMouseEventDate<250)
{this._onmouseevent2(e,"mousedown");}
else if(type=="dblclick"&&this._lastMouseEventType=="mouseup"&&new Date-this._lastMouseEventDate<250)
{this._onmouseevent2(e,"click");}
switch(type){case"mousedown":case"mouseup":case"click":case"dblclick":case"contextmenu":this._lastMouseEventType=type;this._lastMouseEventDate=(new Date).valueOf();}}
else {switch(type)
{case"DOMMouseScroll":type="mousewheel";break;case"click":case"dblclick":if(e.button!=BiMouseEvent.LEFT)
return;}}
this._onmouseevent2(e,type);};_p._onmouseevent2=function(e,type)
{if(type=="contextmenu"&&!this._allowBrowserContextMenu)
{if(BiBrowserCheck.moz)
e.preventDefault();e.returnValue=false;}
else if(type=="mousedown"&&BiBrowserCheck.moz)
this._onactivateevent(e);var target;if(this._captureComponent){target=this._captureComponent;}
else{var el=e.target||e.srcElement;while(el!=null&&el._biComponent==null)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -