?? grid_format.js
字號:
/*****************************************************************/
if(!window.Active)
{
var Active=
{
}
}
if(!Active.System)
{
Active.System=
{
}
}
if(!Active.HTML)
{
Active.HTML=
{
}
}
if(!Active.Templates)
{
Active.Templates=
{
}
}
if(!Active.Formats)
{
Active.Formats=
{
}
}
if(!Active.HTTP)
{
Active.HTTP=
{
}
}
if(!Active.Text)
{
Active.Text=
{
}
}
if(!Active.XML)
{
Active.XML=
{
}
}
if(!Active.Controls)
{
Active.Controls=
{
}
}
(function()
{
if(!window.HTMLElement)
{
return
}
var element=HTMLElement.prototype;
element.__proto__=
{
__proto__:element.__proto__
};
element=element.__proto__;
var capture=["click","mousedown","mouseup","mousemove","mouseover","mouseout" ];
element.setCapture=function()
{
var self=this;
var flag=false;
this._capture=function(e)
{
if(flag)
{
return
}
flag=true;
var event=document.createEvent("MouseEvents");
event.initMouseEvent(e.type,e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget);
self.dispatchEvent(event);
flag=false
};
for(var i=0;i<capture.length;i++)
{
window.addEventListener(capture[i],this._capture,true)
}
};
element.releaseCapture=function()
{
for(var i=0;i<capture.length;i++)
{
window.removeEventListener(capture[i],this._capture,true)
}
this._capture=null
};
element.attachEvent=function(name,handler)
{
if(typeof handler !="function")
{
return
}
var nsName=name.replace(/^on/,"");
var nsHandler=function(event)
{
window.event=event;
handler();
window.event=null
};
handler[name]=nsHandler;
this.addEventListener(nsName,nsHandler,false)
};
element.detachEvent=function(name,handler)
{
if(typeof handler !="function")
{
return
}
var nsName=name.replace(/^on/,"");
this.removeEventListener(nsName,handler[name],false);
handler[name]=null
};
var getClientWidth=function()
{
return this.offsetWidth - 20
};
var getClientHeight=function()
{
return this.offsetHeight - 20
};
element.__defineGetter__("clientWidth",getClientWidth);
element.__defineGetter__("clientHeight",getClientHeight);
var getRuntimeStyle=function()
{
return this.style
};
element.__defineGetter__("runtimeStyle",getRuntimeStyle);
var cs=ComputedCSSStyleDeclaration.prototype;
cs.__proto__=
{
__proto__:cs.__proto__
};
cs=cs.__proto__;
cs.__defineGetter__("paddingTop",function()
{
return this.getPropertyValue("padding-top")
}
);
var getCurrentStyle=function()
{
return document.defaultView.getComputedStyle(this,"")
};
element.__defineGetter__("currentStyle",getCurrentStyle);
var setOuterHtml=function(s)
{
var range=this.ownerDocument.createRange();
range.setStartBefore(this);
var fragment=range.createContextualFragment(s);
this.parentNode.replaceChild(fragment,this)
};
element.__defineSetter__("outerHTML",setOuterHtml)
}
)();
(function()
{
if(!window.Event)
{
return
}
var event=Event.prototype;
event.__proto__=
{
__proto__:event.__proto__
};
event=event.__proto__;
if(!event)
{
return
}
var getSrcElement=function()
{
return(this.target.nodeType==3)?this.target.parentNode:this.target
};
event.__defineGetter__("srcElement",getSrcElement);
var setReturnValue=function(value)
{
if(!value)
{
this.preventDefault()
}
};
event.__defineSetter__("returnValue",setReturnValue)
}
)();
(function()
{
if(!window.CSSStyleSheet)
{
return
}
var stylesheet=CSSStyleSheet.prototype;
stylesheet.__proto__=
{
__proto__:stylesheet.__proto__
};
stylesheet=stylesheet.__proto__;
stylesheet.addRule=function(selector,rule)
{
this.insertRule(selector+"{"+rule+"}",this.cssRules.length)
};
stylesheet.__defineGetter__("rules",function()
{
return this.cssRules
}
)
}
)();
(function()
{
if(!window.XMLHttpRequest)
{
return
}
var ActiveXObject=function(type)
{
ActiveXObject[type](this)
};
ActiveXObject["MSXML2.DOMDocument"]=function(obj)
{
obj.setProperty=function()
{
};
obj.load=function(url)
{
var xml=this;
var async=this.async?true:false;
var request=new XMLHttpRequest();
request.open("GET",url,async);
request.overrideMimeType("text/xml");
if(async)
{
request.onreadystatechange=function()
{
xml.readyState=request.readyState;
if(request.readyState==4)
{
xml.documentElement=request.responseXML.documentElement;
xml.firstChild=xml.documentElement;
request.onreadystatechange=null
}
if(xml.onreadystatechange)
{
xml.onreadystatechange()
}
}
}
this.parseError=
{
errorCode:0,reason:"Emulation"
};
request.send(null);
this.readyState=request.readyState;
if(request.responseXML && !async)
{
this.documentElement=request.responseXML.documentElement;
this.firstChild=this.documentElement
}
}
};
ActiveXObject["MSXML2.XMLHTTP"]=function(obj)
{
obj.open=function(method,url,async)
{
this.request=new XMLHttpRequest();
this.request.open(method,url,async)
};
obj.send=function(data)
{
this.request.send(data)
};
obj.setRequestHeader=function(name,value)
{
this.request.setRequestHeader(name,value)
};
obj.__defineGetter__("readyState",function()
{
return this.request.readyState
}
);
obj.__defineGetter__("responseXML",function()
{
return this.request.responseXML
}
);
obj.__defineGetter__("responseText",function()
{
return this.request.responseText
}
)
}
}
)();
(function()
{
if(!window.XPathEvaluator)
{
return
}
var xpath=new XPathEvaluator();
var element=Element.prototype;
element.__proto__=
{
__proto__:element.__proto__
};
element=element.__proto__;
var attribute=Attr.prototype;
attribute.__proto__=
{
__proto__:attribute.__proto__
};
attribute=attribute.__proto__;
var txt=Text.prototype;
txt.__proto__=
{
__proto__:txt.__proto__
};
txt=txt.__proto__;
var doc=Document.prototype;
doc.__proto__=
{
__proto__:doc.__proto__
};
doc=doc.__proto__;
doc.loadXML=function(text)
{
var parser=new DOMParser;
var newDoc=parser.parseFromString(text,"text/xml");
this.replaceChild(newDoc.documentElement,this.documentElement)
};
doc.setProperty=function(name,value)
{
if(name=="SelectionNamespaces")
{
namespaces=
{
};
var a=value.split(" xmlns:");
for(var i=1;i<a.length;i++)
{
var s=a[i].split("=");
namespaces[s[0]]=s[1].replace(/\"/g,"");
}
this._ns=
{
lookupNamespaceURI:function(prefix)
{
return namespaces[prefix]
}
}
}
};
doc._ns=
{
lookupNamespaceURI:function()
{
return null
}
};
doc.selectNodes=function(path)
{
var result=xpath.evaluate(path,this,this._ns,7,null);
var i,nodes=[];
for(i=0;i<result.snapshotLength;i++)
{
nodes[i]=result.snapshotItem(i)
}
return nodes
};
doc.selectSingleNode=function(path)
{
return xpath.evaluate(path,this,this._ns,9,null).singleNodeValue
};
element.selectNodes=function(path)
{
var result=xpath.evaluate(path,this,this.ownerDocument._ns,7,null);
var i,nodes=[];
for(i=0;i<result.snapshotLength;i++)
{
nodes[i]=result.snapshotItem(i)
}
return nodes
};
element.selectSingleNode=function(path)
{
return xpath.evaluate(path,this,this.ownerDocument._ns,9,null).singleNodeValue
};
element.__defineGetter__("text",function()
{
var i,a=[],nodes=this.childNodes,length=nodes.length;
for(i=0;i<length;i++)
{
a[i]=nodes[i].text
}
return a.join("")
}
);
attribute.__defineGetter__("text",function()
{
return this.nodeValue
}
);
txt.__defineGetter__("text",function()
{
return this.nodeValue
}
)
}
)();
Active.System.Object=function()
{
};
Active.System.Object.subclass=function()
{
var constructor=function()
{
this.init()
};
for(var i in this)
{
constructor[i]=this[i]
}
constructor.prototype=new this();
constructor.superclass=this;
return constructor
};
Active.System.Object.handle=function(error)
{
throw(error)
};
Active.System.Object.create=function()
{
var obj=this.prototype;
obj.clone=function()
{
if(this._clone.prototype!==this)
{
this._clone=function()
{
this.init()
};
this._clone.prototype=this
}
return new this._clone()
};
obj._clone=function()
{
};
obj.init=function()
{
};
obj.handle=function(error)
{
throw(error)
};
obj.timeout=function(handler,delay)
{
var self=this;
var wrapper=function()
{
handler.call(self)
};
return window.setTimeout(wrapper,delay?delay:0)
};
obj.toString=function()
{
return ""
}
};
Active.System.Object.create();
Active.System.Model=Active.System.Object.subclass();
Active.System.Model.create=function()
{
var obj=this.prototype;
var join=function()
{
var i,s=arguments[0];
for(i=1;i<arguments.length;i++)
{
s+=arguments[i].substr(0,1).toUpperCase()+arguments[i].substr(1)
}
return s
};
obj.defineProperty=function(name,value)
{
var _getProperty=join("get",name);
var _setProperty=join("set",name);
var _property="_"+name;
var getProperty=function()
{
return this[_property]
};
this[_setProperty]=function(value)
{
if(typeof value=="function")
{
this[_getProperty]=value
}
else
{
this[_getProperty]=getProperty;
this[_property]=value
}
};
this[_setProperty](value)
};
var get=
{
};
var set=
{
};
obj.getProperty=function(name,a,b,c)
{
if(!get[name])
{
get[name]=join("get",name)
}
return this[get[name]](a,b,c)
};
obj.setProperty=function(name,value,a,b,c)
{
if(!set[name])
{
set[name]=join("set",name)
}
return this[set[name]](value,a,b,c)
};
obj.isReady=function()
{
return true
}
};
Active.System.Model.create();
Active.System.Format=Active.System.Object.subclass();
Active.System.Format.create=function()
{
var obj=this.prototype;
obj.valueToText=function(value)
{
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -