📄 liveframework.js
字号:
/* Copyright (C) 2007 Microsoft Corporation */
var RuntimeVersion="7.061129.1";Function.abstractMethod=function(){throw new Error('Abstract method should be implemented');}
Function.createCallback=function(method,context){return function(){return method(context);}
}
Function.createDelegate=function(instance,method){return function(){return method.apply(instance,arguments);}
}
Function.emptyFunction=Function.emptyMethod=function(){}
Function.parse=function(functionName){var fn;if(!Function._htClasses){Function._htClasses={};}
else
{fn=Function._htClasses[functionName];}
if(!fn&&functionName){try{var strSplit=functionName.split("."),fn=window,iCount=strSplit.length;for(var i=0;i<iCount;i++)
{fn=fn[strSplit[i]];if(!fn)
{fn=null;break;}
}
if(typeof(fn)!='function'){fn=null;}
else{Function._htClasses[functionName]=fn;}
}
catch(ex){fn=null;}
}
return fn;}
var __fp=Function.prototype;__fp.getBaseMethod=function(instance,methodName,baseTypeName){var baseType=Function.parse(baseTypeName?baseTypeName:this._baseType);if(baseType){var directBaseType=baseType,_ibm=instance._baseMethods;if(_ibm){while(baseType){var method=_ibm[baseType._typeName+'.'+methodName];if(method)return method;baseType=baseType.base||Function.parse(baseType._baseType);}
}
return directBaseType.prototype[methodName];}
return null;}
__fp.getBaseType=function(){return this._baseType;}
__fp.getName=function(){return this._typeName;}
__fp._processBaseType=function(p_objRoot){if(p_objRoot._basePrototypePending&&this._baseType){var fncType=this.base||(this._baseType instanceof Function?this._baseType:Function.parse(this._baseType));if(!fncType._parentBase)
fncType._parentBase=[p_objRoot._typeName];else
fncType._parentBase.push(p_objRoot._typeName);if(!p_objRoot._childBase)
{p_objRoot._childBase=[fncType._typeName];}
else
p_objRoot._childBase.push(fncType._typeName);if(fncType&&(this!=fncType)&&(!fncType.inheritsFrom(this))&&!fncType._sealed){this.base=fncType;fncType._processBaseType(p_objRoot);var objProto=fncType.prototype,objSrcProto=this.prototype;for(var memberName in objProto){var memberValue=objProto[memberName];if(!objSrcProto[memberName]){objSrcProto[memberName]=memberValue;}
}
}
delete this._basePrototypePending;}
}
__fp.callBaseMethod=function(instance,methodName,baseArguments){var baseMethod=this.getBaseMethod(instance,methodName);if(baseMethod){if(!baseArguments){return baseMethod.apply(instance);}
else{return baseMethod.apply(instance,baseArguments);}
}
return null;}
__fp.implementsInterface=function(interfaceType){var interfaces=this._interfaces;if(interfaces){for(var i=0;i<interfaces.length;i++)
{if(__Web_Type.compare(interfaces[i],interfaceType))
return true;}
}
if(this.base)
{if(this.base.implementsInterface(interfaceType))
{return true;}
}
else
if(this._baseType)
{this.base=typeof(this._baseType)=="function"?this._baseType:Function.parse(this._baseType);if(this.base.implementsInterface(interfaceType))
return true;}
return false;}
__fp.inheritsFrom=function(parentType){if(parentType==this){return true;}
if(this.base){return(this.base.inheritsFrom(parentType));}
else
{if(this._baseType)
{this.base=typeof(this._baseType)=="function"?this._baseType:Function.parse(this._baseType);return(this.base.inheritsFrom(parentType));}
}
return false;}
__fp.initializeBase=function(instance,baseArguments){if(!this._parentBase)
{this._childBase=[this._typeName];this._parentBase=[this._typeName];this._parentBase.addRange(this._interfaces);this._childBase.addRange(this._interfaces);}
var arrI=this._interfaces;if(arrI){var iCount=arrI.length;for(var i=0;i<iCount;i++){var objI=arrI[i];objI=objI instanceof Function?objI:Function.parse(objI);objI.call(instance);}
}
this._processBaseType(this);if(this.base){if(!baseArguments){this.base.apply(instance);}
else{this.base.apply(instance,baseArguments);}
}
return instance;}
__fp.isImplementedBy=function(instance){if(!instance)return false;var instanceType=Object.getType(instance);if(!instanceType.implementsInterface){return false;}
return instanceType.implementsInterface(this);}
__fp.isInstanceOfType=function(instance){if(typeof(instance)=='undefined'||instance==null){return false;}
if(instance instanceof this){return true;}
var instanceType=Object.getType(instance);if(instanceType==this){return true;}
if(!instanceType.inheritsFrom){return false;}
return instanceType.inheritsFrom(this);}
__fp.registerBaseMethod=function(instance,methodName){if(!instance._baseMethods){instance._baseMethods={};}
var methodKey=this._typeName+'.'+methodName;instance._baseMethods[methodKey]=instance[methodName];}
Function.createInstance=function(type){if(typeof(type)!='function'){type=Function.parse(type);}
return new type();}
__fp.registerClass=function(typeName,baseType,interfaceType){this._typeName=typeName;if(baseType){if(baseType instanceof Array)
throw new Error("Multiple Inheritance is not supported");this._baseType=baseType;this._basePrototypePending=true;}
if(interfaceType){this._interfaces=[];var iCount=arguments.length;for(var i=2;i<iCount;i++){this._interfaces.push(arguments[i]);}
}
return this;}
__fp.registerAbstractClass=function(typeName,baseType){this.registerClass(typeName,baseType);this._abstract=true;return this;}
__fp.registerSealedClass=function(typeName,baseType){this.registerClass(typeName,baseType);this._sealed=true;return this;}
__fp.registerInterface=function(typeName){this._typeName=typeName;this._interface=this._abstract=this._sealed=true;return this;}
__fp.applyClass=function(blnEvents)
{var fnExtend=__Web_Enum.extend;function generateClass(o)
{var str=(o._typeName&&o._typeName.replace(/\./g,"_"))||"";if(o.base)
{str+=" "+generateClass(o.base);if(blnEvents)
o.Events=fnExtend(o.Events,o.base.Events);}
return str;}
if(!this._className)
{this._className=generateClass(this);}
return this._className;}
__fp.removeClass=function(p_strClass)
{if(this._className)
{if(!this._arrClasses)
this._arrClasses=this._className.split(" ");var arrClass=this._arrClasses,iCount=arrClass.length;for(var intApplied=0;intApplied<iCount;intApplied++)
{p_strClass=p_strClass.replace(new RegExp('^'+arrClass[intApplied]+'( |$)| '+arrClass[intApplied]+'(?= |$)'),'');}
return p_strClass;}
else
return p_strClass;}
var registerNamespace=Function.registerNamespace=function(namespacePath){var rootObject=window,namespaceParts=namespacePath.split('.'),iCount=namespaceParts.length;for(var i=0;i<iCount;i++){var currentPart=namespaceParts[i];if(!rootObject[currentPart]){rootObject[currentPart]={};}
rootObject=rootObject[currentPart];}
}
Function._typeName='Function';window.Type=Function;Object.getType=function(instance){var ctor=instance.constructor;if(!ctor||(typeof(ctor)!="function")||!ctor._typeName){return Object;}
return instance.constructor;}
Object.isNull=function(o)
{return(null==o||undefined==o);}
Object.getTypeName=function(instance){return Object.getType(instance)._typeName;}
Object.fromJSON=function(text){try{if((/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(text)))
return eval('('+text+')');}catch(e){}
return null;};Object.toJSON=function(object)
{var _this=Object.toJSON,json="null",_wt=Web.Type;if(!Object.isNull(object))
{if(_wt.isArray(object))
{json=[];for(var i=0;i<object.length;i++)
{json.push(_this(object[i]))
}
json="["+json.join(",")+"]";}
else if(_wt.isObject(object))
{json=[];for(var name in object)
{json.push("\""+name+"\":"+_this(object[name]));}
json="{"+json.join(",")+"}";}
else if(_wt.isString(object))
{json="\""+object.replace(_this._reBackslash,"\\\\").replace(_this._reDoubleQuote,"\\\"").replace(_this._reNewLine,"\\n").replace(_this._reCarriageReturn,"\\r")+"\"";}
else if(!_wt.isFunction(object))
{json=object.toString();}
}
return json;}
Object.toJSON._reBackslash=/\\/g;Object.toJSON._reDoubleQuote=/"/g;Object.toJSON._reNewLine=/\n/g;Object.toJSON._reCarriageReturn=/\r/g;Object._typeName='Object';Boolean.parse=function(value){if(typeof(value)=='string'){return(value.trim().toLowerCase()=='true');}
return value?true:false;}
Boolean._typeName='Boolean';Number.parse=function(value){if(!value||(value.length==0)){return 0;}
return parseFloat(value);}
Number._typeName='Number';var __sp=String.prototype;__sp.endsWith=function(suffix){return(this.substr(this.length-suffix.length)==suffix);}
__sp.startsWith=function(prefix){return(this.substr(0,prefix.length)==prefix);}
__sp.lTrim=__sp.trimStart=function(){return this.replace(/^\s*/,"");}
__sp.rTrim=__sp.trimEnd=function(){return this.replace(/\s*$/,"");}
__sp.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
__sp.format=function()
{var s=this,aRE=__sp.format.aRegExp,iCount=arguments.length;for(var i=0;i<iCount;i++)
{if(!aRE[i])
{aRE[i]=new RegExp("\\{"+i+"\\}","g");}
s=s.replace(aRE[i],arguments[i]);}
return(s);}
__sp.format.aRegExp=[];String.isEmpty=function(string)
{return Object.isNull(string)||""==string;}
String.format=function(format){var result=new Sys.StringBuilder();for(var i=0;;){var next=format.indexOf("{",i);if(next<0){result.append(format.slice(i));break;}
result.append(format.slice(i,next));i=next+1;if(format.charAt(i)=='{'){result.append('{');i++;continue;}
var next=format.indexOf("}",i);var brace=format.slice(i,next).split(':');var argNumber=Number.parse(brace[0])+1;var arg=arguments[argNumber];if(arg==null){arg='';}
if(arg.toFormattedString)
result.append(arg.toFormattedString(brace[1]?brace[1]:''));else
result.append(arg.toString());i=next+1;}
return result.toString();}
String.localeFormat=function(format){for(var i=1;i<arguments.length;i++){var arg=arguments[i];if(arg==null){arg='';}
format=format.replace("{"+(i-1)+"}",arg.toLocaleString());}
return format;}
__sp.removeSpaces=function()
{return this.replace(/ /g,'');}
__sp.removeExtraSpaces=function()
{return(this.replace(__sp.removeExtraSpaces.re," "));}
__sp.removeExtraSpaces.re=/\s+/g;__sp.removeSpaceDelimitedString=function(r)
{var s=" "+this.trim()+" ";return s.replace(" "+r+" "," ").trim();}
__sp.addSpaceDelimitedString=function(r)
{return this.removeSpaceDelimitedString(r)+" "+r;}
__sp.encodeHtmlAttributeURI=__sp.encodeURI=function()
{return encodeURI(this).replace(/'/g,"%27");}
__sp.encodeURIComponent=function()
{return encodeURIComponent(this).replace(/'/g,"%27");}
__sp.encodeHtml=function()
{return this.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""");}
__sp.encodeHtmlAttribute=function()
{return this.encodeHtml().replace(/\r/g," ").replace(/\n/g," ").replace(/ /g," ");}
__sp.decodeURI=function(){return unescape(this)}
String._typeName='String';var __ap=Array.prototype;__ap.add=__ap.queue=function(item){this.push(item);}
__ap.addRange=function(items){if(items)this.push.apply(this,items);return this;}
__ap.clear=function(){if(this.length>0){this.splice(0,this.length);}
}
__ap.clone=function(){return[].addRange(this);}
__ap.contains=__ap.exists=function(item){var index=this.indexOf(item);return(index>=0);}
__ap.dequeue=Array.prototype.shift;if(!__ap.indexOf){__ap.indexOf=function(item,startIndex){var length=this.length;if(length!=0){startIndex=startIndex||0;if(startIndex<0){startIndex=Math.max(0,length+startIndex);}
for(var i=startIndex;i<length;i++){if(this[i]==item){return i;}
}
}
return-1;}
}
if(!__ap.forEach)
{__ap.forEach=function(fnCb,objContext){var length=this.length;for(var i=0;i<length;i++){fnCb.call(objContext,this[i],i,this);}
}
}
__ap.insert=function(index,item){this.splice(index,0,item);}
__ap.remove=function(item){var index=this.indexOf(item);if(index>=0){this.splice(index,1);}
return(index>=0);}
__ap.removeAt=function(index){return this.splice(index,1)[0];}
Array._typeName='Array';Date._typeName='Date';Error.createError=function(message,details,innerError){var e=new Error(message);if(details&&details.length){e.details=details;}
if(innerError){e.innerError=innerError;}
return e;}
Error._typeName='Error';Error.prototype.toString=function()
{return this.message;}
registerNamespace("Web");registerNamespace("Sys");Type.createEnum=function(name){var enumeration={};if(name){eval('enumeration='+name+'={};');}
enumeration.getValues=function(){if(!enumeration._values){var values={};for(var f in enumeration){if(typeof(enumeration[f])!='function'){values[f]=enumeration[f];}
}
enumeration._values=values;}
return enumeration._values;};enumeration.parse=function(s){if(s){for(var f in enumeration){if(f.toLowerCase()===s.toLowerCase()){return enumeration[f];}
}
}
return null;};enumeration.toString=function(value){for(var i in enumeration){if(enumeration[i]===value){return i;}
}
throw Error.createError('Invalid Enumeration Value');};enumeration.getName=function(){return name;}
enumeration.isEnum=function(){return true;}
var iCount=arguments.length;for(var i=1;i<iCount;i+=2){enumeration[arguments[i]]=arguments[i+1];}
return enumeration;}
Type.createFlags=function(name){var flags={};if(name){eval('flags='+name+'={};');}
flags.parse=function(s){var parts=s.split('|'),value=0;for(var i=parts.length-1;i>=0;i--){var part=parts[i].trim(),found=false;for(var f in flags){if(f==part){value|=flags[f];found=true;break;}
}
if(found==false){throw new Error('Invalid Enumeration Value');}
}
return value;};flags.toString=function(value){var sb=new Sys.StringBuilder();for(var i in flags){if((flags[i]&value)!=0){if(sb.isEmpty()==false){sb.append(' | ');}
sb.append(i);}
}
return sb.toString();};flags.getName=function(){return name;}
flags.isFlags=function(){return true;}
var iCount=arguments.length;for(var i=1;i<iCount;i+=2){flags[arguments[i]]=arguments[i+1];}
return flags;}
Sys.IArray=function(){}
Sys.IArray.registerInterface("Sys.IArray");__ap.get_length=function(){return this.length;}
__ap.getItem=function(index){return this[index];}
Array._interfaces=[];Array._interfaces.push(Sys.IArray);Sys.IDisposable=function(){}
Sys.IDisposable.registerInterface('Sys.IDisposable');Sys.StringBuilder=Web.StringBuilder=function(initialText){var _parts=[];if((typeof(initialText)=='string')&&
(initialText.length!=0)){_parts.push(initialText);}
this.append=function(text){if((text==null)||(typeof(text)=='undefined')){return;}
if((typeof(text)=='string')&&(text.length==0)){return;}
_parts.push(text);}
this.appendLine=function(text){this.append(text);_parts.push('\r\n');}
this.clear=function(){_parts.clear();}
this.isEmpty=function(){return(_parts.length==0);}
this.toString=function(delimiter){return _parts.join(delimiter||'');}
}
Sys.StringBuilder.registerSealedClass('Sys.StringBuilder');if(!window.XMLHttpRequest){window.XMLHttpRequest=function(){var progIDs=['Msxml2.XMLHTTP','Microsoft.XMLHTTP'];for(var i=0;i<progIDs.length;i++){try{var xmlHttp=new ActiveXObject(progIDs[i]);return xmlHttp;}
catch(ex){}
}
return null;}
}
function $(s)
{return(typeof s=="object")?s:_ge(s);}
var BindingsVersion="7.061031.0";registerNamespace("Web.Debug.Performance");var __Web_Debug=Web.Debug;if(!__Web_Debug.enabled)
{__Web_Debug.enabled=false;__Web_Debug.initEvents=__Web_Debug.trace=function(){};__Web_Debug.ASSERT=function(){return(__Web_Debug.ASSERT)};__Web_Debug.Performance.start=function()
{this.end=this.End=function(){};return this;}
}
Function.eventHelper=function(p_varCancel,p_boolBubble)
{function Exec()
{if(__Web_Type.isBoolean(p_boolBubble))
event.cancelBubble=p_boolBubble;if(p_varCancel!=null)
{event.returnValue=p_varCancel;if(__Web_Type.isBoolean(p_varCancel))
{return p_varCancel;}
}
}
return Exec;}
Function.KillEvent=Function.eventHelper(false,true);Function.CancelBubble=Function.eventHelper(null,true);Function.CancelDefault=Function.eventHelper(false);registerNamespace("Web.Browser");if(!Web.Browser.isMozilla)
{Web.Browser.isOpera=Web.Browser.isMozilla=function(){return false};Web.Browser.Button={LEFT:1,RIGHT:2,MIDDLE:4};}
Web.Browser.version=parseFloat(window.navigator.appVersion);Web.Browser._isIE=(!Web.Browser.isMozilla()&&!Web.Browser.isOpera());if(Web.Browser._isIE)
{var _ce=document.createElement,_ge=document.getElementById,_get=document.getElementsByTagName;try
{document.execCommand("BackgroundImageCache",false,true);}
catch(ex)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -