📄 application.js
字号:
/* * Bindows 1.5 * http://www.bindows.net/ * Copyright (c) 2003-2005 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. */var _biInPrototype=false;function _biExtend(fConstr,fSuperConstr,sName){_biInPrototype=true;var p=fConstr.prototype=new fSuperConstr;if(sName){p._className=sName;}
p.constructor=fConstr;_biInPrototype=false;return p;}
Object.isEmpty=function(o)
{for(var _ in o)
return false;return true;};Object.getKeys=function(o){var r=[];for(var i in o){r.push(i);}
return r};Object.getValues=function(o){var r=[];for(var i in o){r.push(o[i]);}
return r;};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj,fromIndex){if(fromIndex==null){fromIndex=0;}else if(fromIndex<0){fromIndex=Math.max(0,this.length+fromIndex);}
for(var i=fromIndex;i<this.length;i++){if(this[i]===obj)
return i;}
return-1;};}
if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(obj,fromIndex){if(fromIndex==null){fromIndex=this.length-1;}else if(fromIndex<0){fromIndex=Math.max(0,this.length+fromIndex);}
for(var i=fromIndex;i>=0;i--){if(this[i]===obj)
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);};if(!Array.prototype.forEach){Array.prototype.forEach=function(f,obj){var l=this.length;for(var i=0;i<l;i++){f.call(obj,this[i],i,this);}};}
if(!Array.prototype.filter){Array.prototype.filter=function(f,obj){var l=this.length;var res=[];for(var i=0;i<l;i++){if(f.call(obj,this[i],i,this)){res.push(this[i]);}}
return res;};}
if(!Array.prototype.map){Array.prototype.map=function(f,obj){var l=this.length;var res=[];for(var i=0;i<l;i++){res.push(f.call(obj,this[i],i,this));}
return res;};}
if(!Array.prototype.some){Array.prototype.some=function(f,obj){var l=this.length;for(var i=0;i<l;i++){if(f.call(obj,this[i],i,this)){return true;}}
return false;};}
if(!Array.prototype.every){Array.prototype.every=function(f,obj){var l=this.length;for(var i=0;i<l;i++){if(!f.call(obj,this[i],i,this)){return false;}}
return true;};}
String.prototype.trim=function(){return this.replace(/(^\s+)|\s+$/g,"");};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.substr(1);};Function.READ=1;Function.WRITE=2;Function.READ_WRITE=3;Function.prototype.addProperty=function(sName,nReadWrite){var p=this.prototype;nReadWrite=nReadWrite||Function.READ_WRITE;var capitalized=sName.capitalize();if(nReadWrite&Function.READ)
{p["get"+capitalized]=function()
{return this["_"+sName];};}
if(nReadWrite&Function.WRITE)
{p["set"+capitalized]=function(v)
{this["_"+sName]=v;};}};function BiObject(){if(_biInPrototype)return;this._hashCode=BiObject._hashCodePrefix+Math.round(Math.random()*1000)+BiObject._hashCodePrefix+BiObject._hashCodeCounter++;}
_p=_biExtend(BiObject,Object,"BiObject");_p._disposed=false;_p._id=null;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++;};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.capitalize();if(typeof this[getterName]=="function")
return this[getterName]();throw new Error("No such property, "+sPropertyName);};_p.setProperty=function(sPropertyName,oValue){var setterName="set"+sPropertyName.capitalize();if(typeof this[setterName]=="function")
this[setterName](oValue);else throw new Error("No such property, "+sPropertyName);};_p.setProperties=function(oProperties){for(var p in oProperties){this.setProperty(p,oProperties[p]);}};_p.setAttribute=function(sName,sValue,oParser)
{var v,vv;if(sValue=="true")
v=true;else if(sValue=="false")
v=false;else if((vv=parseFloat(sValue))==sValue)
v=vv;else v=sValue;this.setProperty(sName,v);};_p.getAttribute=function(sName)
{return String(this.getProperty(sName));};_p.addXmlNode=function(oNode,oParser)
{if(oNode.nodeType==1)
oParser.fromNode(oNode);};if(typeof BiObject=="undefined")
BiObject=new Function;function BiBrowserCheck(){if(_biInPrototype)return;if(BiBrowserCheck._singleton)
return BiBrowserCheck._singleton;var ua=navigator.userAgent;this._ie= /msie/i.test(ua);this._moz=navigator.product=="Gecko";this._platform=navigator.platform;if(this._moz)
{/rv\:([^\);]+)(\)|;)/.test(ua);this._version=RegExp.$1;this._ie55=false;this._ie6=false;this._hta=false;}
else {/MSIE\s+([^\);]+)(\)|;)/.test(ua);this._version=RegExp.$1;this._ie55= /msie 5\.5/i.test(ua);this._ie6= /msie 6/i.test(ua);this._hta=!window.external;}
BiBrowserCheck._singleton=this;}
_p=_biExtend(BiBrowserCheck,BiObject,"BiBrowserCheck");_p.getIe=function()
{return this._ie;};_p.getIe55=function()
{return this._ie55;};_p.getIe6=function()
{return this._ie6;};_p.getMoz=function()
{return this._moz;};_p.getVersion=function()
{return this._version;};_p.getPlatform=function()
{return this._platform;};_p.getHta=function(){return this._hta;};(function(){var bc=new BiBrowserCheck;BiBrowserCheck.ie=bc.getIe();BiBrowserCheck.ie55=bc.getIe55();BiBrowserCheck.ie6=bc.getIe6();BiBrowserCheck.moz=bc.getMoz();BiBrowserCheck.version=bc.getVersion();BiBrowserCheck.platform=bc.getPlatform();BiBrowserCheck.hta=bc.getHta();bc=null;})();function BiUri(sBase,sRel)
{if(_biInPrototype)return;this._params={};if(sBase)
{this.setHref(sBase);if(sRel)
this._setRelative(sRel)}}
_p=_biExtend(BiUri,BiObject,"BiUri");_p._scheme="";_p._userInfo="";_p._port="";_p._host="";_p._path="";_p._dirPath="";_p._fragment="";_p._query="";_p._hrefCache=null;_p._generic=true;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.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;this._generic=s.substr(this._scheme.length,3)=="://";if(this._generic)
s=s.substring(this._scheme.length+3);else s=s.substring(this._scheme.length+1);if(this._generic||this._scheme=="mailto"||this._scheme=="news")
{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 i;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(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,name,value;for(i=0;i<pairs.length;i++)
{parts=pairs[i].split("=");name=decodeURIComponent(parts[0]);value=parts.length==2?decodeURIComponent(parts[1]):null;if(name in this._params)
this._params[name].push(value);else this._params[name]=[value];}}};_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._generic?"://":":")+this._userInfo+(this._userInfo==""?"":"@")+this._host+(this._port!=null?":"+this._port:"")+this._path;return this._hrefCache=s+this.getQuery()+this._fragment;};_p.getParam=function(sName)
{if(sName in this._params)
return this._params[sName][this._params[sName].length-1];return undefined;};_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.hasParam=function(sName)
{return sName in this._params;};_p.getParams=function(sName)
{if(sName in this._params)
return this._params[sName].concat();return[];};_p.addParam=function(sName,sValue)
{this._hrefCache=null;var v=sValue==null?null:String(sValue);if(sName in this._params)
this._params[sName].push(v);else this._params[sName]=[v];};_p.getQuery=function()
{var sb=[];var sb2,v;for(var name in this._params)
{sb2=[];for(var i=0;i<this._params[name].length;i++)
{v=this._params[name][i];if(v==null)
sb2.push(encodeURIComponent(name));else sb2.push(encodeURIComponent(name)+"="+encodeURIComponent(v));}
sb.push(sb2.join("&"));}
return(sb.length>0?"?"+sb.join("&"):"");};function BiEvent(sType)
{if(_biInPrototype)return;BiObject.call(this);this._type=sType;}
_p=_biExtend(BiEvent,BiObject,"BiEvent");_p._bubbles=false;_p._propagationStopped=true;_p._defaultPrevented=false;BiEvent.prototype.getType=function(){return this._type;};BiEvent.prototype.getTarget=function(){return this._target;};BiEvent.prototype.getCurrentTarget=function(){return this._currentTarget;};BiEvent.prototype.getBubbles=function(){return this._bubbles;};_p.stopPropagation=function()
{this._propagationStopped=true;};BiEvent.prototype.getPropagationStopped=function(){return this._propagationStopped;};_p.preventDefault=function()
{this._defaultPrevented=true;};BiEvent.prototype.getDefaultPrevented=function(){return this._defaultPrevented;};_p.dispose=function()
{this._target=null;this._currentTarget=null;};_p.getDefaultPrevented=function()
{return this._defaultPrevented;};function BiMouseEvent(){};function BiKeyboardEvent(){};function BiEventTarget(){if(_biInPrototype)return;BiObject.call(this);this._listeners={};}
_p=_biExtend(BiEventTarget,BiObject,"BiEventTarget");_p.addEventListener=function(sType,fHandler,oObject)
{if(typeof fHandler!="function")
throw new Error(this+" addEventListener: "+fHandler+" is not a function");if(!(sType in this._listeners))
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||!(sType in this._listeners))
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;this._dispatchEvent(oEvent);return!oEvent._defaultPrevented;};_p._dispatchEvent=function(oEvent)
{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;if(typeof f=="function")
{o=fs[hc].object;if(typeof o=="object")
{f.call(o,oEvent);}
else {f.call(this,oEvent);}}}}}
if(oEvent._bubbles&&!oEvent._propagationStopped&&this._parent&&!this._parent._disposed)
{this._parent._dispatchEvent(oEvent);}};_p.setAttribute=function(sName,sValue,oParser)
{if(sName.substring(0,2)=="on")
{var type=sName.substring(2);this.addEventListener(type,new Function("event",sValue),oParser);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -