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

📄 core.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
📖 第 1 页 / 共 5 页
字号:
e=this._window.event
var el=e.target||e.srcElement;if(BiBrowserCheck.moz)
this._mozActiveElement=el;while(el!=null&&el._biComponent==null)
el=el.parentNode;if(el==null)return;var target=el._biComponent;while(target!=null&&!target.getCanFocus())
target=target._parent;if(target==null)return;this._setFocusedComponent(target);};_p._onbeforeactivateevent=function(){var e=this._window.event
var c,el,d,w,em;d=this._window.document;if(e.srcElement==d.body){el=d.activeElement;do{if(el){c=el._biComponent;el=el.parentNode;}}while(el&&!c);if(c.getFocused()){e.returnValue=false;}else if((em=(w=d.body._biComponent)._eventManager)._lastFocused&&!d.body.contains(em._lastFocused._element)&&c.getCanFocus()){c.setFocused(true);w._activeComponent=c;e.returnValue=false;}}};_p._setFocusedComponent=function(oComponent)
{if(this._lastFocused==oComponent)
return;var blurComp=this._lastFocused;var focusComp=oComponent;while(blurComp&&blurComp._anonymous)
blurComp=blurComp.getParent();while(focusComp&&focusComp._anonymous)
focusComp=focusComp.getParent();if(blurComp==focusComp)
return;var fr;if(oComponent)
{fr=oComponent.getFocusRoot();fr._activeComponent=oComponent;}
else if(this._lastFocused)
{fr=this._lastFocused.getFocusRoot();fr._activeComponent=null;}
this._lastFocused=oComponent;(new BiPopupManager).hideAutoHiding(focusComp);var e;if(blurComp)
{blurComp._focused=false;e=new BiFocusEvent("focusout");e._relatedTarget=focusComp;blurComp.dispatchEvent(e);}
if(focusComp)
{focusComp._focused=true;e=new BiFocusEvent("focusin");e._relatedTarget=blurComp;focusComp.dispatchEvent(e);}
if(blurComp)
{e=new BiFocusEvent("blur");e._relatedTarget=focusComp;blurComp.dispatchEvent(e);(new BiToolTipManager).handleBlur(e);}
if(focusComp)
{e=new BiFocusEvent("focus");e._relatedTarget=blurComp;focusComp.dispatchEvent(e);(new BiToolTipManager).handleFocus(e);}
if(BiBrowserCheck.moz&&blurComp)
blurComp._blurComponent();application.flushLayoutQueue();};_p._onwindowblur=function(e)
{if(!BiBrowserCheck.moz)
(new BiPopupManager).hideAutoHiding();};_p._onresizeevent=function(e)
{var c=this._window.document.body._biComponent;if(c&&typeof c._onresize=="function")
c._onresize();application.flushLayoutQueue();};_p._onselectevent=function(e){if(!e)
e=this._window.event;var el=e.target||e.srcElement;while(el!=null&&el._biComponent==null)
el=el.parentNode;if(el==null)return;var target=el._biComponent;if(!target.getCanSelect())
{if(BiBrowserCheck.moz)
e.preventDefault();e.returnValue=false;}};_p._ondragevent=function(e){if(!e)
e=this._window.event;if((e.target||e.srcElement).tagName=="IMG")
this._onselectevent();};BiEventManager.prototype.getCaptureComponent=function(){return this._captureComponent;};BiEventManager.prototype.setCaptureComponent=function(v){this._captureComponent=v;};_p.dispose=function(){if(this._disposed)return;BiObject.prototype.dispose.call(this);if(this._window){this.detachMouseEvents();this.detachKeyboardEvents();var doc=this._window.document;if(doc){if(doc.body){doc.body.onselect=doc.body.onactivate=null;}
doc.onselectstart=doc.onselectionchange=doc.ondragstart=null;}
this._window.onblur=null;if(BiBrowserCheck.moz)
{window.removeEventListener("resize",this.__onresizeevent,false);}}
this.__onmouseevent=this.__onkeyevent=this.__onselectevent=this.__onwindowblur=this.__ondragevent=this.__onactivateevent=this.__onbeforeactivateevent=this.__onresizeevent=null;this._mozActiveElement=null;};_p._mozOnFocus=function(e,c,el)
{var old=this._mozActiveElement;this._mozActiveElement=el;this._mozUpdateFocusVisuals(el);if(old&&old!=el)
this._mozUpdateFocusVisuals(old);this._setFocusedComponent(c);if(e)
e.stopPropagation();};_p._mozOnBlur=function(e,c,el)
{if(this._mozActiveElement==el)
this._mozActiveElement=null;this._mozUpdateFocusVisuals(el);};_p._mozUpdateFocusVisuals=function(el)
{if(el==this._mozActiveElement)
el.setAttribute("bi-moz-focused","true");else el.removeAttribute("bi-moz-focused");};function BiBorder(nWidth,sStyle,sColor)
{if(_biInPrototype)return;BiObject.call(this);this._props={};this._set("border",(nWidth!=null?nWidth+"px ":"")+(sStyle?sStyle+" ":"")+(sColor?sColor:""));this._leftWidth=this._rightWidth=this._topWidth=this._bottomWidth=nWidth;this._leftStyle=this._rightStyle=this._topStyle=this._bottomStyle=sStyle;this._leftColor=this._rightColor=this._topColor=this._bottomColor=sColor;if(BiBrowserCheck.moz)
{this._mozSyncLeftColors();this._mozSyncRightColors();this._mozSyncTopColors();this._mozSyncBottomColors();}}
_p=_biExtend(BiBorder,BiObject,"BiBorder");BiBorder.prototype.getLeftWidth=function(){return this._leftWidth;};BiBorder.prototype.getLeftStyle=function(){return this._leftStyle;};BiBorder.prototype.getLeftColor=function(){return this._leftColor;};BiBorder.prototype.getRightWidth=function(){return this._rightWidth;};BiBorder.prototype.getRightStyle=function(){return this._rightStyle;};BiBorder.prototype.getRightColor=function(){return this._rightColor;};BiBorder.prototype.getTopWidth=function(){return this._topWidth;};BiBorder.prototype.getTopStyle=function(){return this._topStyle;};BiBorder.prototype.getTopColor=function(){return this._topColor;};BiBorder.prototype.getBottomWidth=function(){return this._bottomWidth;};BiBorder.prototype.setBottomWidth=function(v){this._bottomWidth=v;};BiBorder.prototype.getBottomStyle=function(){return this._bottomStyle;};BiBorder.prototype.setBottomStyle=function(v){this._bottomStyle=v;};BiBorder.prototype.getBottomColor=function(){return this._bottomColor;};BiBorder.prototype.setBottomColor=function(v){this._bottomColor=v;};_p.setLeft=function(nWidth,sStyle,sColor)
{this._set("borderLeft",(nWidth!=null?nWidth+"px ":"")+(sStyle?sStyle+" ":"")+(sColor?sColor:""));this._leftWidth=nWidth;this._leftStyle=sStyle;this._leftColor=sColor;if(BiBrowserCheck.moz)
this._mozSyncLeftColors();};_p.setRight=function(nWidth,sStyle,sColor)
{this._set("borderRight",(nWidth!=null?nWidth+"px ":"")+(sStyle?sStyle+" ":"")+(sColor?sColor:""));this._rightWidth=nWidth;this._rightStyle=sStyle;this._rightColor=sColor;if(BiBrowserCheck.moz)
this._mozSyncRightColors();};_p.setTop=function(nWidth,sStyle,sColor)
{this._set("borderTop",(nWidth!=null?nWidth+"px ":"")+(sStyle?sStyle+" ":"")+(sColor?sColor:""));this._topWidth=nWidth;this._topStyle=sStyle;this._topColor=sColor;if(BiBrowserCheck.moz)
this._mozSyncTopColors();};_p.setBottom=function(nWidth,sStyle,sColor)
{this._set("borderBottom",(nWidth!=null?nWidth+"px ":"")+(sStyle?sStyle+" ":"")+(sColor?sColor:""));this._bottomWidth=nWidth;this._bottomStyle=sStyle;this._bottomColor=sColor;if(BiBrowserCheck.moz)
this._mozSyncBottomColors();};_p.setWidth=function(nWidth){this._set("borderWidth",nWidth+"px");this._leftWidth=this._rightWidth=this._topWidth=this._bottomWidth=nWidth;};_p.setStyle=function(sStyle){this._set("borderStyle",sStyle);this._leftStyle=this._rightStyle=this._topStyle=this._bottomStyle=sStyle;if(BiBrowserCheck.moz)
{this._mozSyncLeftColors();this._mozSyncRightColors();this._mozSyncTopColors();this._mozSyncBottomColors();}};_p.setColor=function(sColor){this._set("borderColor",sColor);this._leftColor=this._rightColor=this._topColor=this._bottomColor=sColor;if(BiBrowserCheck.moz)
{this._mozSyncLeftColors();this._mozSyncRightColors();this._mozSyncTopColors();this._mozSyncBottomColors();}};_p.setLeftWidth=function(nWidth){this.setLeft(nWidth,this._leftStyle,this._leftColor);};_p.setRightWidth=function(nWidth){this.setRight(nWidth,this._rightStyle,this._rightColor);};_p.setTopWidth=function(nWidth){this.setTop(nWidth,this._topStyle,this._topColor);};_p.setBottomWidth=function(nWidth){this.setBottom(nWidth,this._bottomStyle,this._bottomColor);};_p.setLeftStyle=function(sStyle)
{this.setLeft(this._leftWidth,sStyle,this._leftColor);if(BiBrowserCheck.moz)
this._mozSyncLeftColors();};_p.setRightStyle=function(sStyle)
{this.setRight(this._rightWidth,sStyle,this._rightColor);if(BiBrowserCheck.moz)
this._mozSyncRightColors();};_p.setTopStyle=function(sStyle)
{this.setTop(this._topWidth,sStyle,this._topColor);if(BiBrowserCheck.moz)
this._mozSyncTopColors();};_p.setBottomStyle=function(sStyle)
{this.setBottom(this._bottomWidth,sStyle,this._bottomColor);if(BiBrowserCheck.moz)
this._mozSyncBottomColors();};_p.setLeftColor=function(sColor)
{this.setLeft(this._leftWidth,this._leftStyle,sColor);if(BiBrowserCheck.moz)
this._mozSyncLeftColors();};_p.setRightColor=function(sColor)
{this.setRight(this._rightWidth,this._rightStyle,sColor);if(BiBrowserCheck.moz)
this._mozSyncRightColors();};_p.setTopColor=function(sColor)
{this.setTop(this._topWidth,this._topStyle,sColor);if(BiBrowserCheck.moz)
this._mozSyncTopColors();};_p.setBottomColor=function(sColor)
{this.setBottom(this._bottomWidth,this._bottomStyle,sColor);if(BiBrowserCheck.moz)
this._mozSyncBottomColors();};_p._setLeftColors=function(sColors){this._set("MozBorderLeftColors",sColors);};_p._setRightColors=function(sColors){this._set("MozBorderRightColors",sColors);};_p._setTopColors=function(sColors){this._set("MozBorderTopColors",sColors);};_p._setBottomColors=function(sColors){this._set("MozBorderBottomColors",sColors);};_p.paintBorder=function(oComponent){for(var p in this._props){oComponent.setStyleProperty(p,this._props[p]);}};_p.removeBorder=function(oComponent){for(var p in this._props){oComponent.removeStyleProperty(p);}};_p._set=function(sName,sValue){if(sValue==""||sValue==null)
delete this._props[sName];else this._props[sName]=sValue;};_p._mozSyncLeftColors=function()
{if(this._leftColor)
this._setLeftColors("");else {switch(this._leftStyle)
{case"groove":this._setLeftColors("ThreeDShadow ThreeDHighlight");break;case"ridge":this._setLeftColors("ThreeDHighlight ThreeDShadow");break;case"inset":this._setLeftColors("ThreeDShadow ThreeDDarkShadow");break;case"outset":this._setLeftColors("ThreeDLightShadow ThreeDHighlight");break;default:this._setLeftColors("");}}};_p._mozSyncRightColors=function()
{if(this._rightColor)
this._setRightColors("");else {switch(this._rightStyle)
{case"groove":this._setRightColors("ThreeDHighlight ThreeDShadow");break;case"ridge":this._setRightColors("ThreeDShadow ThreeDHighlight");break;case"inset":this._setRightColors("ThreeDHighlight ThreeDLightShadow");break;case"outset":this._setRightColors("ThreeDDarkShadow ThreeDShadow");break;default:this._setRightColors("");}}};_p._mozSyncTopColors=function()
{if(this._topColor)
this._setTopColors("");else {switch(this._topStyle)
{case"groove":this._setTopColors("ThreeDShadow ThreeDHighlight");break;case"ridge":this._setTopColors("ThreeDHighlight ThreeDShadow");break;case"inset":this._setTopColors("ThreeDShadow ThreeDDarkShadow");break;case"outset":this._setTopColors("ThreeDLightShadow ThreeDHighlight");break;default:this._setTopColors("");}}};_p._mozSyncBottomColors=function()
{if(this._bottomColor)
this._setBottomColors("");else {switch(this._bottomStyle)
{case"groove":this._setBottomColors("ThreeDHighlight ThreeDShadow");break;case"ridge":this._setBottomColors("ThreeDShadow ThreeDHighlight");break;case"inset":this._setBottomColors("ThreeDHighlight ThreeDLightShadow");break;case"outset":this._setBottomColors("ThreeDDarkShadow ThreeDShadow");break;default:this._setBottomColors("");}}};BiBorder.THIN_INSET_BORDER=new BiBorder(1,"solid","ThreeDShadow");BiBorder.THIN_INSET_BORDER.setRightColor("ThreeDHighlight");BiBorder.THIN_INSET_BORDER.setBottomColor("ThreeDHighlight");BiBorder.THIN_OUTSET_BORDER=new BiBorder(1,"solid","ThreeDShadow");BiBorder.THIN_OUTSET_BORDER.setLeftColor("ThreeDHighlight");BiBorder.THIN_OUTSET_BORDER.setTopColor("ThreeDHighlight");BiBorder.INSET_BORDER=new BiBorder(2,"inset");BiBorder.OUTSET_BORDER=new BiBorder(2,"outset");BiBorder.GROOVE_BORDER=new BiBorder(2,"groove");BiBorder.RIDGE_BORDER=new BiBorder(2,"ridge");BiBorder.fromString=function(s)
{var b=new BiBorder;var part;var parts=s.split(/\s+/);for(var i=0;i<parts.length;i++)
{part=parts[i];switch(part)
{case"groove":case"ridge":case"inset":case"outset":case"solid":case"dotted":case"dashed":case"double":case"none":b.setStyle(part);break;default:var n=parseFloat(part);if(n==part||part.indexOf("px")!= -1)
b.setWidth(n);else b.setColor(part);break;}}
return b;};function BiComponent(sName){if(_biInPrototype)return;BiEventTarget.call(this);if(sName)this._name=sName;this._children=[];this._style={};this._htmlProperties={id:"bi-component-"+ ++BiComponent._componentCount,className:this._cssClassName,unselectable:"on"};this._htmlAttributes={};}
_p=_biExtend(BiComponent,BiEventTarget,"BiComponent");BiComponent._componentCount=0;BiComponent.__oninlineevent=function(e){return this._biComponent._oninlineevent(e);};_p._parent=null;_p._name="";_p._enabled=true;_p._capture=false;_p._canSelect=false;_p._focused=false;_p._created=false;_p._tabIndex= -1;_p._hideFocus=false;_p._tagName="DIV";_p._cssClassName="bi-component";_p._toolTip=null;_p._toolTipText=null;_p._opacity=1;_p._visible=true;_p._left=_p._right=_p._top=_p._bottom=_p._width=_p._height=null;_p._measuredWidth=null;_p._measuredHeight=null;_p._minimumWidth=_p._maximumWidth=_p._minimumHeight=_p._maximumHeight=null;_p._acceptsEnter=false;_p._acceptsEsc=false;_p._focusManager=null;_p._lazyCreate=false;_p.add=function(oChild,oBefore,bAnonymous)
{var p=oChild._parent;if(oBefore==null){if(p!=null)
p.remove(oChild);this._children.push(oChild);}
else{if(oBefore._parent!=this)
throw new Error("Can only add components before siblings");if(p!=null)
p.remove(oChild);this._children.insertBefore(oChild,oBefore);}
oChild._anonymous=Boolean(bAnonymous);oChild._parent=this;if(this._created)
oChild._addHtmlElementToParent(this,oBefore);};_p.remove=function(oChild){if(oChild._parent!=this)
throw new Error("Can only remove children");this._children.remove(oChild);oChild._parent=null;oChild._anonymous=false;if(this._created)
this._removeHtmlElement(oChild);return oChild;};_p.removeAll=function()
{var cs=this.getChildren();var l=cs.length;for(var i=0;i<l;i++)
{this.remove(cs[i]);cs[i].dispose();}};_p.getParent=function()
{if(this._parent==null||!this._parent._anonymous)
return this._parent;return this._parent.getParent();};_p.setParent=function(p){if(p!=null&&p!=this._parent){p.add(this);}else if(this._parent!=null){this._parent.remove(this);}};_p.getChildren=function()
{var res=[];var cs=this._children;var l=cs.length;for(var i=0;i<l;i++)
{if(!cs[i]._anonymous)
res.push(cs[i]);}
return res;};_p.setChildren=function(cs){this.removeAll();if(cs!=null){for(var i=0;i<cs.length;i++){this.add(cs[i]);}}};_p.hasChildren=function(){var cs=this._children;var l=cs.length;for(var i=0;i<l;i++)
{if(!cs[i]._anonymous)
return true;}
return false;};_p.getTopLevelComponent=function(){if(this._parent==null)return null;return this._parent.getTopLevelComponent();};_p.contains=function(oDescendant){if(oDescendant==null)return false;if(oDescendant==this)return true;var p=oDescendant._parent;return this.contains(p);};_p.getFirstChild=function()
{var cs=this._children;var l=cs.length;for(var i=0;i<l;i++)
{if(!cs[i]._anonymous)
return cs[i];}
return null;};_p.getLastChild=function()
{var cs=this._children;var l=cs.length;for(var i=l-1;i>=0;i--)
{if(!cs[i]._anonymous)
return cs[i];}
return null;};_p.getPreviousSibling=function()
{var p=this._parent;if(p==null)return null;var cs=p._children;for(var i=cs.indexOf(this)-1;i>=0;i--)
{if(!cs[i]._anonymous)
return cs[i];}
return null;};_p.getNextSibling=function()
{var p=this._parent;if(p==null)return null;var cs=p._children;var l=cs.length;for(var i=cs.indexOf(this)+1;i<l;i++)
{if(!cs[i]._anonymous)
return cs[i];}
return null;};BiComponent.prototype.getAnonymous=function(){return this._anonymous;};_p.setStyleProperty=function(sProp,sValue)
{this._style[sProp]=sValue;if(this._created)
this._element.style[sProp]=sValue;};_p.getStyleProperty=function(sProp){if(this._created)
{if(BiBrowserCheck.ie)
return this._element.currentStyle[sProp];else return this._document.defaultView.getComputedStyle(this._element,"")[sProp];}
else return this._style[sProp];};_p.removeStyleProperty=function(sProp){delete this._style[sProp];if(this._created)
this._element.style[sProp]="";};_p.getHtmlProperty=function(sProp)
{if(this._created)
return this._element[sProp];return this._htmlProperties[sProp];};_p.setHtmlProperty=function(sProp,oValue)
{this._htmlProperties[sProp]=oValue;if(this._created)
this._element[sProp]=oValue;};_p.removeHtmlProperty=function(sProp){delete this._htmlProperties[sProp];if(this._created)
{if(BiBrowserCheck.ie)
this._element.removeAttribute(sProp);else delete this._element[sProp];}};_p._getHtmlAttribute=function(sName){if(this._created)
return this._element.getAttribute(sName);else return this._htmlAttributes[sName];};_p._setHtmlAttribute=function(sName,sValue)
{this._htmlAttributes[sName]=sValue;if(this._created)
this._element.setAttribute(sName,sValue);};_p._removeHtmlAttribute=function(sName){delete this._htmlAttributes[sName];if(this._created)
this._element.removeAttribute(sName);};_p.setForeColor=function(sForeColor){this.setStyleProperty("color",sForeColor);};_p.getForeColor=function(){return this.getStyleProperty("color");};_p.setBackColor=function(sBackColor){this.setStyleProperty("backgroundColor",sBackColor);};_p.getBackColor=function(){return this.getStyleProperty("backgroundColor");};_p.setZIndex=function(nZIndex)
{this.setStyleProperty("zIndex",nZIndex);};_p.getZIndex=function()
{if(BiBrowserCheck.moz&&this._created)
return Number(this._element.style.zIndex);else return Number(this.getStyleProperty("zIndex"));};_p.setVisible=function(bVisible)

⌨️ 快捷键说明

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