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

📄 coreui.js

📁 Sun的高速缓存CachedRowSet方案资料档
💻 JS
📖 第 1 页 / 共 3 页
字号:
/* Copyright (C) 2007 Microsoft Corporation */
registerNamespace("Web.UI");/*@cc_on@*/
Web.UI.Version="0.0600615.0";Web.UI.getLayoutRoot=function()
{return(document.compatMode=="CSS1Compat")?(document.documentElement):document.body;}
Web.UI.wireEvents=function(p_el,p_arrEvents,p_cb,p_blnAttach)
{for(var i=0;i<p_arrEvents.length;i++)
if(p_blnAttach)
p_el.attachEvent(p_arrEvents[i],p_cb);else 
p_el.detachEvent(p_arrEvents[i],p_cb);}
Web.UI.registerEvents=function(type)
{type.prototype.attachEvent=Web.Bindings.Base.prototype.attachEvent;type.prototype.detachEvent=Web.Bindings.Base.prototype.detachEvent;type.prototype.fire=Web.Bindings.Base.prototype.fire;var args=[];for(var i=0;i<arguments.length;i++)
args.push(arguments[i]);type.Events=Web.Enum.create.apply(type,args);}
Web.UI.registerAllBaseMethods=function(type,instance){for(var prop in instance)
{if("function"==typeof(instance[prop]))
{type.registerBaseMethod(instance,prop);}
}
}
Web.UI.getLocation=function(p_elSource,p_elScope){if(!p_elSource)return Web.UI.Rect.Empty;var c=new Web.UI.Rect();c.source=p_elSource;var s=p_elSource.currentStyle;var marg=new Array("Top","Left","Right","Bottom");for(var i=0;i<marg.length;i++)
{var m=marg[i];c["margin"+m]=Web.Conversion.coerceInt(s["margin"+m]);c["border"+m]=Web.Conversion.coerceInt(s["border"+m+"Width"]);c["padding"+m]=Web.Conversion.coerceInt(s["padding"+m]);}
c.height=p_elSource.offsetHeight;c.width=p_elSource.offsetWidth;c.left=p_elSource.offsetLeft;c.top=p_elSource.offsetTop;p_elSource=p_elSource.offsetParent;var m_root=Web.UI.getLayoutRoot();while(p_elSource&&(!p_elScope||p_elSource!=p_elScope))
{c.left+=p_elSource.offsetLeft-((m_root!=p_elSource)?Web.Conversion.coerceInt(p_elSource.scrollLeft):0);c.top+=p_elSource.offsetTop-((m_root!=p_elSource)?Web.Conversion.coerceInt(p_elSource.scrollTop):0);p_elSource=p_elSource.offsetParent;}
if(document.compatMode=="CSS1Compat")
{c.contentWidth=c.source.offsetWidth-c.borderLeft-c.borderRight-c.paddingLeft-c.paddingRight-c.marginLeft-c.marginRight;c.contentHeight=c.source.offsetHeight-c.borderTop-c.borderBottom-c.paddingTop-c.paddingBottom-c.marginTop-c.marginBottom;}
else
{c.contentWidth=c.source.offsetWidth;c.contentHeight=c.source.offsetHeight;}
c.x=c.left;c.y=c.top;c.bottom=c.top+c.height-c.marginBottom;c.right=c.left+c.width-c.marginRight;return c;}
Web.UI.getMouseLocation=function(p_ev,p_scope)
{var objScope=Web.UI.getLocation(p_scope||Web.UI.getLayoutRoot());return new Web.UI.Point(p_ev.clientX+Web.UI.getLayoutRoot().scrollLeft-objScope.left,p_ev.clientY+Web.UI.getLayoutRoot().scrollTop-objScope.top);}
Web.UI.getMouseOffset=function(ev)
{if(ev.srcElement.currentStyle.position=="relative")
return new Web.UI.Point(ev.x,ev.y);else 
return new Web.UI.Point(ev.offsetX,ev.offsetY);}
Web.UI.isFocusable=function(p_el)
{var focusList="INPUT|BUTTON|TEXTAREA|FIELDSET|IFRAME|SELECT|"
return(p_el.tagName&&(!p_el.disabled)&&(focusList.indexOf(p_el.tagName+"|")>-1||(p_el.tagName=="A"&&p_el.href)));}
Web.UI.cancelBubble=function()
{event.cancelBubble=true;}
Web.UI.findFocusableElement=function(p_elScope,p_elStart,p_blnDirection)
{function GetNextElement(p_el)
{if(!p_el)return null;var elNext=p_blnDirection?p_el.nextSibling:p_el.previousSibling;while(elNext&&elNext.nodeType!=1)
{elNext=p_blnDirection?elNext.nextSibling:elNext.previousSibling;}
if(!elNext)
return GetNextElement(p_el.parentNode)
else 
return elNext;}
function invoke(p_elScope,p_elStart)
{var elCurrent=p_elStart;if(elCurrent&&p_elScope.contains(elCurrent))
{while(elCurrent!=null)
{if(!Web.UI.isFocusable(elCurrent))
{if(p_blnDirection&&elCurrent.firstChild)
elCurrent=elCurrent.firstChild;else if(!p_blnDirection&&elCurrent.lastChild)
elCurrent=elCurrent.lastChild;else 
elCurrent=GetNextElement(elCurrent);}
else
{return elCurrent;}
}
}
return null;}
if(p_elStart)
p_elStart=GetNextElement(p_elStart);else 
p_elStart=p_elScope;var elMatch=invoke(p_elScope,p_elStart)
if(!elMatch&&p_elStart&&p_elStart!=p_elScope)
return invoke(p_elScope,p_elScope);else 
return elMatch;}
Web.UI.Point=function(x,y)
{return{left:x,
x:x,
top:y,
y:y,
offset:function(x,y)
{this.top+=y;this.y=this.top;this.left+=x;this.x=this.left;return this;},
add:function(x,y)
{return this.offset(x,y);},
subtract:function(x,y)
{return this.offset(-x,-y);}
}
}
Web.UI.Size=function(w,h)
{return{width:w,
height:h,
toString:function()
{return "(width={0},height={1})".format(this.width,this.height);}
}
}
Web.UI.Rect=function(x,y,w,h)
{return{left:x,
x:x,
top:y,
y:y,
width:w,
height:h,
right:x+w,
bottom:y+h,
toString:function()
{return "{x:{0},y:{1},width:{2},height:{3}}".format(this.x,this.y,this.width,this.height);},
equals:function(r)
{return this.x==r.x&&this.y==r.y&&this.width==r.width&&this.height==r.height;},
inflate:function(width,height)
{this.width+=width;this.height+=height;this.right=this.x+this.width;this.bottom=this.y+this.height;},
offset:function(x,y)
{this.x+=x;this.left=this.x;this.y+=y;this.top=this.y;this.right+=x;this.bottom+=y;},
isEmpty:function()
{return this.width<=0||this.height<=0;},
contains:function(p)
{return p.x>=this.left&&
p.x<=this.width+this.left&&
p.y>=this.top&&
p.y<=this.height+this.top;}
};}
Web.UI.Rect.Empty=new Web.UI.Rect(0,0,0,0);Web.UI.Region=function()
{var m_regions=[];for(var i=0;i<arguments.length;i++)
{m_regions.push(arguments[i]);}
this.add=function(region)
{m_regions.push(region);}
this.remove=function(region)
{m_regions.remove(region);}
this.contains=function(p)
{for(var i=0;i<m_regions.length;i++)
{if(m_regions[i].contains(p))
return m_regions[i];}
return null;}
this.clear=function()
{var m_regions=[];}
this.toString=function()
{var s="[";for(var i=0;i<m_regions.length;i++)
{s+=m_regions.toString()+",";}
return s+"]";}
}
Web.UI.Control=function(p_contents)
{var m_this=this;var m_hlpr=null;var m_state=null;Web.Runtime.onunload.attach(dispose);initialize();m_this.initialize=initialize;function initialize()
{if(null!=m_hlpr)return;m_hlpr=new Web.UI.Utilities.CleanupHelper();m_state={};m_state.contents=p_contents;m_state.opacity=100;}
this.dispose=function()
{if(m_hlpr)
{m_hlpr.dispose();m_state=null;m_hlpr=null;}
}
function dispose()
{m_this.dispose();}
this.setBounds=function(rect)
{m_this.setPosition(rect);m_this.setSize(rect);}
this.getBounds=function()
{return getLayoutRect();}
this.setContents=function(contents)
{m_hlpr.detachEventGroup("c");m_state.contents=contents;fire("oncontentschanged");return m_state.contents;}
this.getContents=function(){return m_state.contents;}
this.setOpacity=function(opacity)
{if(!m_state.contents)return;m_state.opacity=opacity;if(opacity!=null)
{if(Web.Browser.isMozilla())
opacity-=.001;m_state.contents.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+Math.round(opacity)+")";}
else
{m_state.contents.style.filter="";}
fire("onopacitychanged");}
this.getOpacity=function()
{return m_state.opacity;}
this.setPosition=function(position)
{if(!m_state.contents)return;var bounds=m_this.getBounds();if(bounds.x==position.x&&bounds.y==position.y)return;var recalc=!m_state.offset||!m_state.bounds||!m_state.bounds.equals(bounds);if(recalc)
{m_state.contents.style.pixelTop=0;m_state.contents.style.pixelLeft=0;m_state.offset=m_this.getBounds();}
m_state.contents.style.pixelTop=position.y-(m_state.offset.y)+(m_state.offset.marginTop||0);m_state.contents.style.pixelLeft=position.x-(m_state.offset.x)+(m_state.offset.marginLeft||0);m_state.bounds=m_this.getBounds();fire("onmove");}
this.getPosition=function()
{return getLayoutRect();}
this.setSize=function(size)
{if(!m_state.contents)return;if(!isNaN(Number.parse(size.width)))
m_state.contents.style.pixelWidth=size.width;else 
m_state.contents.style.width=size.width;if(!isNaN(Number.parse(size.height)))
m_state.contents.style.pixelHeight=size.height;else 
m_state.contents.style.height=size.height;fire("onresize");}
this.getSize=function()
{return getLayoutRect();}
this.setClip=function(x,y,width,height)
{if(!m_state.contents)return;var clip="rect("+y+"px "+width+"px "+height+"px "+x+"px)";if(null==x)
clip="rect(auto auto auto auto)";try{m_state.contents.style.clip=clip;}catch(e){}
fire("onclip");}
this.getClip=function()
{return m_state.contents.style.clip;}
this.contains=function(point)
{var b=getLayoutRect().contains(point);return b;}
this.hide=function()
{if(!m_state.contents)return;m_state.contents.style.display="none";fire("onhide");}
this.show=function()
{if(!m_state.contents)return;m_state.contents.style.display="block";fire("onshow");}
this.invalidate=function()
{fire("oninvalidate");}
this.toString=function()
{return m_this.getBounds().toString();}
function fireResize(){fire("onresize");}
function fireMove(){fire("onresize");}
function fire(p_strEvent,p_arParams)
{if(m_state.moving)
{return;}
if(m_this.constructor!=Web.UI.Control&&(!m_this.constructor.Events||!m_this.constructor.Events[p_strEvent]))
m_this.constructor.applyClass(true);m_this.fire(p_strEvent);if(p_strEvent!="oninvalidate")
fire("oninvalidate");}
function getLayoutRect()
{if(!m_state.contents)
return Web.UI.Rect.Empty;var pos=Web.UI.getLocation(m_state.contents);if(!pos||pos.isEmpty())
{var restore={visibility:(m_state.contents.currentStyle.visibility||m_state.contents.style.visibility||"visible"),
display:(m_state.contents.currentStyle.display||m_state.contents.style.display||"auto")
};m_state.contents.style.visibility="hidden";m_state.contents.style.display="block";pos=Web.UI.getLocation(m_state.contents);m_state.contents.style.display=restore.display;m_state.contents.style.visibility=restore.visibility;}
return pos;}
Web.UI.registerAllBaseMethods(Web.UI.Control,this);}
Web.UI.Control.registerClass("Web.UI.Control");Web.UI.registerEvents(Web.UI.Control,"onshow","onhide","onmove","onresize","onclip","onopacitychanged","oncontentschanged","oninvalidate");Web.UI.getContainer=function()
{if(Web.UI._container==null)
{Web.UI._container=document.createElement("span");document.body.insertAdjacentElement("afterBegin",Web.UI._container);}
return Web.UI._container;}
Web.UI.FramePopup=function(p_obj)
{Web.UI.FramePopup.initializeBase(this);var m_this=this;var m_hlpr=null;var m_state=null;initialize();m_this.initialize=initialize;function initialize()
{if(null!=m_hlpr)return;m_hlpr=new Web.UI.Utilities.CleanupHelper();m_state={};/*@cc_on@*//*@if(@_jscript_version <= 5.6)
@else@*/
return;/*@end@*/
var m_elContainer=Web.UI.getContainer();m_state.initialized=true;m_state.frames=m_elContainer.getElementsByTagName("iframe");if(!isNaN(Number(p_obj)))
{zIndex=Number(p_obj);m_state.parent=m_elContainer;m_state.owner=new Web.UI.Control(m_elContainer);m_hlpr.initializeProperty(m_state.owner);}
else if(p_obj.style&&p_obj.getElementsByTagName)
{m_state.owner=new Web.UI.Control(p_obj);m_state.parent=p_obj.parentNode;m_hlpr.initializeProperty(m_state.owner);}
else if(Web.UI.Control.isInstanceOfType(p_obj))
{m_state.owner=p_obj;m_state.parent=p_obj.getContents().parentNode;}
m_state.container=document.createElement("div");m_state.container=m_hlpr.createNode("div",{},{position:"absolute"},m_state.parent);m_state.attribs={tabIndex:-1};if(location.protocol=="https:"&&Web.UI.FramePopupURL==null)
m_state.attribs.src=Web.Runtime.baseUrl+"empty.htm";else if(Web.UI.FramePopupURL)
m_state.attribs.src=Web.UI.FramePopupURL;m_this.setContents(m_state.container);m_this.setOpacity(0);if(null!=m_state.owner)
{m_hlpr.attachEvent(null,m_state.owner,"oninvalidate",invalidate);var el=m_state.owner.getContents();var zIndex=el.currentStyle.zIndex;if(zIndex=="auto")
zIndex=0;}
m_state.container.style.zIndex=zIndex-1;invalidate();}
this.dispose=function(p_blnDispose)
{Web.UI.FramePopup.getBaseMethod(m_this,"dispose","Web.UI.Control").call(this,p_blnDispose);if(m_hlpr)
{m_hlpr.dispose();m_state=null;m_hlpr=null;}
}
function invalidate()
{if(null==m_state.owner)
return;var el=m_state.owner.getContents();if(!el||el.currentStyle.display=="none")
{m_state.container.style.display="none";if(m_state.frame)
{Web.UI.getContainer().appendChild(m_state.frame);m_state.frame.style.display="none";m_state.frame=null;}
return;}
if(null==m_state.frame)
{if(m_state.frames.length>0)
{m_state.frame=m_state.frames[0];m_state.container.appendChild(m_state.frame);m_state.frame.style.display="block";}
else
{m_state.frame=m_hlpr.createNode("iframe",m_state.attribs,{position:"absolute",left:"0px",top:"0px",display:"block",width:"100%",height:"100%"},m_state.container);}
}
var zIndex=el.currentStyle.zIndex;if(zIndex=="auto")
zIndex=0;m_state.container.style.zIndex=zIndex-1;m_state.container.style.clip=el.style.clip;var b=m_state.owner.getBounds();m_state.container.style.display=el.currentStyle.display;m_this.setBounds(b);}
this.positionAt=function(bounds,zIndex)
{if(!m_state.initialized)
{m_this.initialize();}
m_this.setBounds(bounds);if(m_state&&m_state.container)
m_state.container.style.zIndex=zIndex;}
}
Web.UI.FramePopup.registerClass("Web.UI.FramePopup","Web.UI.Control");Web.UI.ShadowPopup=function(p_ctrlOwner)
{Web.UI.ShadowPopup.initializeBase(this);var m_this=this;var m_hlpr=null;var m_state=null;initialize();m_this.initialize=initialize;function initialize()
{if(null!=m_hlpr)return;var props={className:Web.UI.ShadowPopup.applyClass(true)};var styles={backgroundColor:"#000000",position:"absolute",padding:0,margin:0};Web.UI.ShadowPopup.getBaseMethod(m_this,"initialize","Web.UI.Control").call(this);m_hlpr=new Web.UI.Utilities.CleanupHelper();m_state={};m_state.offset=3;m_state.opacity=25;m_state.useBlur=false;m_state.owner=p_ctrlOwner;p_ctrlOwner=null;if(!m_state.useBlur)
{styles.margin=m_state.offset+"px";}
else
{styles.margin=(-m_state.offset)+"px";styles.marginRight=(m_state.offset*2)+"px";styles.marginBottom=(m_state.offset*2)+"px";}
m_state.shadow=m_hlpr.createNode("div",props,styles,m_state.owner.getContents().parentNode);m_this.setContents(m_state.shadow);invalidate();m_hlpr.attachEvent(null,m_state.owner,"oninvalidate",invalidate);}
this.dispose=function(p_blnDispose)
{Web.UI.ShadowPopup.getBaseMethod(m_this,"dispose","Web.UI.Control").call(this,p_blnDispose);if(m_hlpr)
{m_hlpr.dispose();m_state=null;m_hlpr=null;}
}
function invalidate()

⌨️ 快捷键说明

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