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

📄 coreui.js

📁 Sun的高速缓存CachedRowSet方案资料档
💻 JS
📖 第 1 页 / 共 3 页
字号:
{if(null==m_state.owner)
return;var el=m_state.owner.getContents();if(!el||el.currentStyle.display=="none"||m_state.owner.getOpacity()==0)
{m_state.shadow.style.display="none";return;}
m_state.shadow.style.display=el.style.display;m_state.shadow.style.clip=el.style.clip;var zIndex=el.currentStyle.zIndex;if(zIndex=="auto")zIndex=0;m_state.shadow.style.zIndex=zIndex-1;m_this.setOpacity(m_state.owner.getOpacity());m_this.setBounds(m_state.owner.getBounds());}
this.setOpacity=function(opacity)
{if(null==opacity)
opacity=100;opacity=m_state.opacity*opacity*opacity/10000;if(!m_state.useBlur)
Web.UI.ShadowPopup.getBaseMethod(m_this,"setOpacity","Web.UI.Control").call(m_this,opacity);else 
m_state.shadow.style.filter="progid:DXImageTransform.Microsoft.Blur(pixelradius="+Math.round(m_state.offset*1.5)+",MakeShadow=True,shadowOpacity="+(opacity/100)+")";}
}
Web.UI.ShadowPopup.registerClass("Web.UI.ShadowPopup","Web.UI.Control");Web.UI.Popup=function()
{Web.UI.Popup.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;Web.UI.Popup.getBaseMethod(m_this,"initialize","Web.UI.Control").call(this);m_hlpr=new Web.UI.Utilities.CleanupHelper();m_state={};m_state.relocateStyle={top:0,right:0,bottom:0,left:0,enableX:true,enableY:true};m_state.hdock=Web.UI.Popup.HDock.Screen;m_state.vdock=Web.UI.Popup.VDock.Screen;m_state.hanchor=Web.UI.Popup.HAnchor.Center;m_state.vanchor=Web.UI.Popup.VAnchor.Middle;m_state.padding=new Web.UI.Point(0,0);}
this.dispose=function(p_blnDispose)
{Web.UI.Popup.getBaseMethod(m_this,"dispose","Web.UI.Control").call(this,p_blnDispose);if(m_hlpr)
{m_hlpr.dispose();m_state=null;m_hlpr=null;}
}
this.setRelocateStyle=function(p_borderStyle)
{m_state.relocateStyle=p_borderStyle;}
this.setPadding=function(p_vpadding,p_hpadding)
{if('number'===typeof p_hpadding)m_state.padding.x=p_hpadding;if('number'===typeof p_vpadding)m_state.padding.y=p_vpadding;m_this.recalc();}
this.setDock=function(p_vdock,p_hdock)
{m_state.vdock=p_vdock||m_state.vdock;m_state.hdock=p_hdock||m_state.hdock;m_this.recalc();}
this.setAnchor=function(p_vanchor,p_hanchor)
{m_state.vanchor=p_vanchor||m_state.vanchor;m_state.hanchor=p_hanchor||m_state.hanchor;m_this.recalc();}
this.dockTo=function(p_owner,p_elOffset,p_blnRelocate)
{if(p_owner.getElementsByTagName)
{m_state.ctrlOwner=new Web.UI.Control(p_owner);m_hlpr.initializeProperty(m_state.ctrlOwner);}
else if(Web.UI.Control.isInstanceOfType(p_owner))
m_ctrlOwner=p_owner;m_state.elOffset=p_elOffset;m_state.blnRelocate=p_blnRelocate;m_this.recalc();}
this.getDockElement=function()
{return m_state.ctrlOwner.getContents();}
this.getDockPosition=function()
{if(!m_state.ctrlOwner&&m_state.hdock!=Web.UI.Popup.HDock.Screen&&m_state.vdock!=Web.UI.Popup.VDock.Screen)
return Web.UI.Rect.Empty;var rtl=Web.UI.Utilities.isRightToLeftMarket();var pos;var el=m_this.getContents();var size=m_this.getSize();var e=window.event||window.e;if(m_state.hdock!=Web.UI.Popup.HDock.Screen||m_state.vdock!=Web.UI.Popup.VDock.Screen)
{pos=m_state.ctrlOwner.getBounds();}
var dock=new Web.UI.Point();var anchor=new Web.UI.Point();var root=Web.UI.getLayoutRoot();switch(m_state.hdock)
{case Web.UI.Popup.HDock.Left:
dock.x=pos.left;break;case Web.UI.Popup.HDock.Center:
dock.x=(pos.left+pos.right)/2 
break;case Web.UI.Popup.HDock.Right:
dock.x=pos.right;break;case Web.UI.Popup.HDock.Screen:
dock.x=Web.UI.getLayoutRoot().scrollLeft+(Web.UI.getLayoutRoot().clientWidth/2);break;case Web.UI.Popup.HDock.Cursor:
/*@if (4 < @_jscript_version) // if ie6-
                if( rtl )
                    dock.x = root.scrollLeft + e.clientX - (root.scrollWidth - root.clientWidth) - 19; // -19 to accomidate for the width of left scroll bar .
                else
                @end@*/
dock.x=root.scrollLeft+e.clientX;break;}
switch(m_state.vdock)
{case Web.UI.Popup.VDock.Top:
dock.y=pos.top;break;case Web.UI.Popup.VDock.Middle:
dock.y=(pos.top+pos.bottom)/2 
break;case Web.UI.Popup.VDock.Bottom:
dock.y=pos.bottom;break;case Web.UI.Popup.VDock.Screen:
dock.y=Web.UI.getLayoutRoot().scrollTop+(Web.UI.getLayoutRoot().clientHeight/2);break;case Web.UI.Popup.VDock.Cursor:
dock.y=Web.UI.getLayoutRoot().scrollTop+e.clientY;break;}
switch(m_state.hanchor)
{case Web.UI.Popup.HAnchor.Left:
anchor.x=dock.x;break;case Web.UI.Popup.HAnchor.Center:
anchor.x=dock.x-(size.width/2);break;case Web.UI.Popup.HAnchor.Right:
anchor.x=dock.x-(size.width);break;}
switch(m_state.vanchor)
{case Web.UI.Popup.VAnchor.Top:
anchor.y=dock.y;break;case Web.UI.Popup.VAnchor.Middle:
anchor.y=dock.y-(size.height/2)
break;case Web.UI.Popup.VAnchor.Bottom:
anchor.y=dock.y-size.height;break;}
anchor.y+=m_state.padding.y;anchor.x+=m_state.padding.x;if(m_state.blnRelocate)
{var root=Web.UI.getLayoutRoot();if(m_state.relocateStyle.enableX&&(anchor.x+size.width+m_state.relocateStyle.right
>root.scrollLeft+root.clientWidth))
{anchor.x=root.scrollLeft+root.clientWidth-size.width-m_state.relocateStyle.right;}
if(m_state.relocateStyle.enableY&&anchor.y+size.height+m_state.relocateStyle.bottom
>root.scrollTop+root.clientHeight)
anchor.y=root.scrollTop+root.clientHeight-size.height-m_state.relocateStyle.bottom;if(!rtl&&m_state.relocateStyle.enableX&&anchor.x-m_state.relocateStyle.left<root.scrollLeft)
{anchor.x=root.scrollLeft+m_state.relocateStyle.left;}
if(m_state.relocateStyle.enableY&&anchor.y-m_state.relocateStyle.top
<root.scrollTop)
anchor.y=root.scrollTop+m_state.relocateStyle.top;}
if(m_state.elOffset)
{var offset=Web.UI.getLocation(m_state.elOffset);anchor.x-=offset.x;anchor.y-=offset.y;}
anchor.left=anchor.x;anchor.top=anchor.y;return anchor;}
this.setContents=function(p_content,p_blnText,p_htParams)
{m_hlpr.removeNodeGroup(null);if(typeof(p_content)=='string')
{m_state.contents=document.createElement("div");if(p_blnText)
m_state.contents.innerText=p_content;else 
m_state.contents.innerHTML=p_content;}
else
{m_state.contents=p_content;}
if(null==m_state.contents.parentNode||null==m_state.contents.parentNode.tagName)
{if(Web.Browser.isMozilla()&&document.domain!=location.host)
document.body.appendChild(m_state.contents);else 
Web.UI.getContainer().appendChild(m_state.contents);m_hlpr.registerNode(m_state.contents);}
if(this.shadow&&m_state.contents.parentNode)
{if(m_state.contents.parentNode.className.indexOf("Web_UI_Shadow")==-1)
{m_state.contents=createShadow(m_state.contents);}
else
{m_state.contents=m_state.contents.parentNode;}
}
if(m_state.contents.className.indexOf("Web_UI_Popup")==-1)
{m_state.contents.className+=" Msn_UI_Popup Web_UI_Popup";}
m_state.contents.style.position="absolute";if(!p_htParams||p_htParams.hidden)
m_state.contents.style.display="none";m_state.contents=Web.UI.Popup.getBaseMethod(m_this,"setContents","Web.UI.Control").call(m_this,m_state.contents);m_state.frame=new Web.UI.FramePopup(m_this);m_hlpr.initializeProperty(m_state.frame);wire("int");return m_state.contents;}
this.shadow=false;this.shadowElement=null;function createShadow(contents)
{var styles={backgroundColor:"#BBB",position:"absolute",padding:0,marginTop:"3px",marginLeft:"3px",display:contents.style.display};m_this.shadowElement=m_hlpr.createNode("div",{className:" Web_UI_Shadow"},styles);replaceElement(contents,m_this.shadowElement);var contentsStyle={position:"relative",display:"block",top:"-3px",left:"-3px"};for(var o in contentsStyle)
contents.style[o]=contentsStyle[o];m_this.shadowElement.appendChild(contents);return m_this.shadowElement;}
this.destroyShadow=function()
{}
/*@cc_on@*/
/*@if (4 < @_jscript_version)

    function swapElement(e, eWith)  { return e.swapNode(eWith); }


    function containsElement (e, eChild) { return e.contains(eChild); }
    function addElementBefore(e, eAdd)   { e.insertAdjacentElement('beforeBegin', eAdd); }
    function addElementAfter (e, eAdd)   { e.insertAdjacentElement('afterEnd',    eAdd); }
    function replaceElement  (e, eWith)  { e.replaceNode(eWith); }
    function swapElement     (e, eWith)  { return e.swapNode(eWith); }

    @else@*/
function swapElement(e,eWith)
{var eNext=e.nextSibling;if(eNext===eWith)
addElementBefore(e,eNext);else
{replaceElement(eWith,e);addElementBefore(eNext,eWith);}
}
function containsElement(e,eChild){try{while(eChild&&eChild!==e)eChild=eChild.parentNode;return eChild===e;}catch(exception){}}
function addElementBefore(e,eAdd){e.parentNode.insertBefore(eAdd,e);}
function addElementAfter(e,eAdd){e.parentNode.insertBefore(eAdd,e.nextSibling);}
function replaceElement(e,eWith){e.parentNode.replaceChild(eWith,e);}
/*@end@*/
this.display=function(p_elOwner,p_blnRelocate,p_elOffset)
{m_this.initialize();m_this.dockTo(p_elOwner,p_elOffset,p_blnRelocate);wire("ext");m_this.show();return m_state.contents;}
function wire(type)
{if(type=="int")
{m_hlpr.attachEvent("int",m_this,"onresize",keepPositionInternal);}
else
{m_hlpr.attachEvent("ext",window,"onresize",keepPositionExternal);if(m_state.vdock==Web.UI.Popup.VDock.Screen||m_state.hdock==Web.UI.Popup.HDock.Screen)
{m_hlpr.attachEvent("ext",window,"onscroll",keepPositionExternal);}
}
}
function keepPosition(type)
{m_hlpr.detachEventGroup(type);m_this.recalc();wire(type);}
function keepPositionInternal()
{keepPosition("int");}
function keepPositionExternal()
{keepPosition("ext");}
this.autoCalc=true;this.recalc=function(p_blnForce)
{var needsCalc=(p_blnForce||m_this.autoCalc);needsCalc=needsCalc&&!(!m_state.ctrlOwner&&m_state.hdock!=Web.UI.Popup.HDock.Screen&&m_state.vdock!=Web.UI.Popup.VDock.Screen);if(needsCalc)
m_this.setPosition(m_this.getDockPosition());}
Web.UI.registerAllBaseMethods(Web.UI.Popup,this);}
Web.UI.Popup.registerClass("Web.UI.Popup","Web.UI.Control");Web.UI.Popup.VAnchor=Web.Enum.create("Top","Middle","Bottom","None");Web.UI.Popup.HAnchor=Web.Enum.create("Left","Center","Right","None");Web.UI.Popup.VDock=Web.Enum.create("Top","Middle","Bottom","Cursor","Screen");Web.UI.Popup.HDock=Web.Enum.create("Left","Center","Right","Cursor","Screen");Web.UI.Dialog=function()
{Web.UI.Dialog.initializeBase(this,arguments);var m_this=this;var m_hlpr=null;var m_state=null;var m_modal=false;initialize();m_this.initialize=initialize;function initialize()
{if(null!=m_hlpr)return;Web.UI.Dialog.getBaseMethod(m_this,"initialize","Web.UI.Popup").call(this);m_hlpr=new Web.UI.Utilities.CleanupHelper();m_state={};m_state.aKillList=["onclick","onmousedown","onkeydown","onkeypress","ondblclick"];}
this.dispose=function(p_blnDispose)
{Web.UI.Dialog.getBaseMethod(m_this,"dispose","Web.UI.Popup").call(this,p_blnDispose);if(m_hlpr)
{m_hlpr.dispose();m_state=null;m_hlpr=null;}
}
this.setModal=function(p_Modal)
{m_modal=p_Modal;}
this.setContents=function(p_Contents)
{m_state.elDisplay=Web.UI.Dialog.getBaseMethod(m_this,"setContents","Web.UI.Popup").call(this,p_Contents);m_state.elStatusBefore=document.createElement("a");m_state.elStatusBefore.className="__before__";m_state.elStatusAfter=m_state.elStatusBefore.cloneNode(true);m_state.elStatusAfter.className="__elStatusAfter__";m_state.elStatusAfter.href=m_state.elStatusBefore.href="#";m_state.elStatusAfter.innerText="";m_state.elStatusBefore.innerText="";m_state.elDisplay.insertAdjacentElement("afterBegin",m_state.elStatusBefore);m_state.elDisplay.insertAdjacentElement("beforeEnd",m_state.elStatusAfter);m_state.elStatusBefore.style.position=m_state.elStatusAfter.style.position="absolute";m_state.elStatusBefore.style.pixelLeft=m_state.elStatusAfter.style.pixelLeft=m_state.elDisplay.offsetLeft 
m_state.elStatusBefore.style.pixelTop=m_state.elDisplay.offsetTop;m_state.elStatusAfter.style.pixelTop=m_state.elDisplay.offsetTop+m_state.elDisplay.offsetHeight;m_hlpr.registerNode(m_state.elStatusBefore);m_hlpr.registerNode(m_state.elStatusAfter);return m_state.elDisplay;}
this.setFocus=function()
{ProcessTab();}
this.show=function()
{m_this.initialize();Web.UI.Dialog.getBaseMethod(m_this,"show","Web.UI.Popup").call(this);m_this.setFocus();m_state.shown=true;setTimeout(WireUp,0);}
this.hide=function()
{m_hlpr.detachEventGroup("show");Web.UI.Dialog.getBaseMethod(m_this,"hide","Web.UI.Popup").call(m_this);if(m_state)
m_state.shown=false;}
var checkAndHide=function()
{if(m_modal&&event.returnValue==false)
{return;}
else
{m_this.hide();}
}
function WireUp()
{if(!m_state.shown)return;if(!m_modal)
m_hlpr.attachEvent("show",document,"onclick",checkAndHide);if(m_state.elStatusAfter)
{m_hlpr.attachEvent("show",m_state.elDisplay,"onclick",Function.CancelBubble);m_hlpr.attachEvent("show",m_state.elStatusBefore,"onclick",Function.KillEvent);m_hlpr.attachEvent("show",m_state.elStatusAfter,"onclick",Function.KillEvent);if(m_modal)
{m_hlpr.attachEvent("show",m_state.elStatusBefore,"onfocus",ProcessTab);m_hlpr.attachEvent("show",m_state.elStatusAfter,"onfocus",ProcessTab);}
}
}
function ProcessTab()
{var elNext;if(null!=window["event"]&&event.srcElement==m_state.elStatusBefore)
elNext=Web.UI.findFocusableElement(m_state.elDisplay,m_state.elStatusAfter,false);else 
elNext=Web.UI.findFocusableElement(m_state.elDisplay,m_state.elStatusBefore,true);if(elNext)
setTimeout(function(){try{elNext.focus();}catch(ex){}},0);}
function KillNavigate()
{event.returnValue=m_state.strPrevent;}
Web.UI.registerAllBaseMethods(Web.UI.Dialog,this);}
Web.UI.Dialog.registerClass("Web.UI.Dialog","Web.UI.Popup");Web.UI.Dialog.Modal=function()
{Web.UI.Dialog.Modal.initializeBase(this,arguments);var m_elRegion;var m_elStatusBefore;var m_elStatusAfter;var m_strPrevent="";var m_this=this;var m_aKillList=["onclick","onmousedown","onkeydown","onkeypress","ondblclick"];Web.UI.Dialog.Modal.getBaseMethod(m_this,"setModal","Web.UI.Dialog").call(m_this,true);this.dispose=function()
{Web.UI.Dialog.Modal.getBaseMethod(m_this,"dispose","Web.UI.Dialog").call(m_this);Cleanup();m_elRegion=m_elStatusBefore=m_elStatusAfter=null;}
this.show=function(p_strPrevent)
{var m_elDialog=Web.UI.Dialog.Modal.getBaseMethod(m_this,"show","Web.UI.Dialog").call(this);m_elRegion=document.createElement("div");m_elRegion.className=m_elRegion.id="Web_UI_Popup_Modal_Background";m_elRegion.style.position="absolute";Web.UI.getContainer().appendChild(m_elRegion);LocateModality();WireUp(p_strPrevent);}
this.hide=function(p_strPrevent)
{var m_elDialog=Web.UI.Dialog.Modal.getBaseMethod(m_this,"hide","Web.UI.Dialog").call(this);Cleanup();}
function WireUp(p_strPrevent)
{m_elRegion.attachEvent("onfocus",m_this.setFocus);window.attachEvent("onresize",LocateModality);window.attachEvent("onfocus",Function.KillEvent);Web.UI.wireEvents(m_elRegion,m_aKillList,Function.KillEvent,true);if(p_strPrevent)
{window.attachEvent("onbeforeunload",KillNavigate);m_strPrevent=p_strPrevent;}
}
function Cleanup()
{window.detachEvent("onresize",LocateModality);window.detachEvent("onfocus",Function.KillEvent);window.detachEvent("onbeforeunload",KillNavigate);if(m_elRegion)
{Web.UI.wireEvents(m_elRegion,m_aKillList,Function.KillEvent,false);m_elRegion.detachEvent("onfocus",m_this.setFocus);m_elRegion.removeNode(true);m_elRegion=null;}
}
function LocateModality()
{m_elRegion.style.pixelTop=0;m_elRegion.style.pixelLeft=0;m_elRegion.style.pixelWidth=Math.max(Web.UI.getLayoutRoot().scrollWidth,Web.UI.getLayoutRoot().clientWidth);m_elRegion.style.pixelHeight=Math.max(Web.UI.getLayoutRoot().scrollHeight,Web.UI.getLayoutRoot().clientHeight);}
function KillNavigate()
{event.returnValue=m_strPrevent;}
return this;}
Web.UI.Dialog.Modal.registerClass("Web.UI.Dialog.Modal","Web.UI.Dialog");Web.UI.registerEvents(Web.UI.Dialog.Modal,"onshow","onhide","onmove","onresize","onclip","onopacitychanged","oncontentschanged","oninvalidate");Web.UI.Menu=function()
{Web.UI.Menu.initializeBase(this,arguments);var m_this=this;var m_hlpr=null;var m_state=null;initialize();m_this.initialize=initialize;function initialize()
{if(null!=m_hlpr)return;Web.UI.Dialog.getBaseMethod(m_this,"initialize","Web.UI.Dialog").call(this);m_hlpr=new Web.UI.Utilities.CleanupHelper();m_state={};m_state.list=m_hlpr.createNode("ul",{className:m_this.constructor.applyClass(true)},{},Web.UI.getContainer());m_hlpr.attachEvent(null,m_state.list,"onkeydown",doArrows);m_hlpr.attachEvent(null,m_state.list,"onmouseenter",fireEnter);m_hlpr.attachEvent(null,m_state.list,"onmouseleave",fireLeave);m_hlpr.attachEvent(null,m_state.list,"onkeypress",ProcessKey);m_this.setContents(m_state.list);m_state.items=[];}
this.dispose=function(p_blnDispose)
{Web.UI.Dialog.getBaseMethod(m_this,"dispose","Web.UI.Dialog").call(this,p_blnDispose);if(m_hlpr)
{m_hlpr.dispose();m_state=null;m_hlpr=null;}
}
this.addItems=function(p_items)
{for(var i=0;i<p_items.length;i++)
{m_hlpr.initializeProperty(p_items[i],"items");m_state.items.push(p_items[i]);var elChild=m_hlpr.createNode("li",{},{position:"relative"},m_state.list,"items");var elItem=m_state.items[i].render(m_this);m_hlpr.registerNode(elItem,"items");elChild.appendChild(elItem);m_hlpr.attachEvent("items",m_state.items[i],"onmouseleave",CacheItem);m_hlpr.attachEvent("items",m_state.items[i],"onmouseenter",ResetItem);m_hlpr.attachEvent("items",m_state.items[i],"onclick",HideNow);}
}
this.clearItems=function()
{m_hlpr.disposeGroup("items");m_state.items=[];m_this.render();}
this.hide=function()
{if(m_hlpr)
{m_this.fire("onclose",m_this);if(m_hlpr)
{m_hlpr.disposeGroup("show");if(m_state.last)
m_state.last.hideSubMenu();clearTimeout(m_state.timeoutHide);clearTimeout(m_state.timeoutShow);Web.UI.Menu.getBaseMethod(m_this,"hide","Web.UI.Dialog").call(m_this);}
}
}
this.show=function()
{Web.UI.Menu.getBaseMethod(m_this,"show","Web.UI.Dialog").call(m_this);setTimeout(delayWireUp,0);}
this.render=function(p_elOwner)
{}
function delayWireUp()
{if(m_hlpr)
m_hlpr.attachEvent("show",document.body,"oncontextmenu",m_this.hide);}
function doArrows()
{switch(event.keyCode)
{case 37:
if(m_this.parentMenu)
{m_this.hide();}
}
}
function fireEnter()
{m_this.fire("onmouseenter",m_this);}
function fireLeave()
{clearTimeout(m_state.timeoutHide);clearTimeout(m_state.timeoutShow);m_this.fire("onmouseleave",m_this);}
function ShowItem()
{HideItem();if(m_state.current&&m_state.current.isParentMenu())
{m_state.current.showSubMenu();m_state.last=m_state.current;}
}
function CacheItem(ev)
{if(ev.Package&&ev.Package.isParentMenu()&&ev.Package!=m_state.last)
{if(m_state.last==ev.Package)

⌨️ 快捷键说明

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