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

📄 core.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
📖 第 1 页 / 共 5 页
字号:
/* * Bindows 1.5 * http://www.bindows.net/ * Copyright (c) 2003-2005 MB Technologies * * Bindows(tm) belongs to MB Technologies (Georgia, USA). All rights reserved. * You are not allowed to copy or modify this code. Commercial use requires * license. */function BiMouseEvent(sType,oEvent)
{if(_biInPrototype)return;BiEvent.call(this,sType);this._event=oEvent;}
_p=_biExtend(BiMouseEvent,BiEvent,"BiMouseEvent");_p._bubbles=true;_p._propagationStopped=false;if(BiBrowserCheck.ie)
{BiMouseEvent.LEFT=1;BiMouseEvent.RIGHT=2;BiMouseEvent.MIDDLE=4;}
else {BiMouseEvent.LEFT=0;BiMouseEvent.MIDDLE=1;BiMouseEvent.RIGHT=2;}
_p.getClientX=function(){return this._event.clientX;};_p.getClientY=function(){return this._event.clientY;};_p.getScreenX=function(){return this._event.screenX;};_p.getScreenY=function(){return this._event.screenY;};_p.getOffsetX=function(){return this.getScreenX()-this.getTarget()._getScreenClientArea().left;};_p.getOffsetY=function(){return this.getScreenY()-this.getTarget()._getScreenClientArea().top;};_p.getCtrlKey=function(){return this._event.ctrlKey;};_p.getShiftKey=function(){return this._event.shiftKey;};_p.getAltKey=function(){return this._event.altKey;};_p.getRelatedTarget=function()
{var relEl;if(BiBrowserCheck.ie)
{if(this._type=="mouseover")
relEl=this._event.fromElement;else if(this._type=="mouseout")
relEl=this._event.toElement;}
else relEl=this._event.relatedTarget;try
{while(relEl!=null&&relEl._biComponent==null)
relEl=relEl.parentNode;}
catch(ex)
{return null;}
if(relEl==null)
return null;return relEl._biComponent;};_p.getButton=function()
{if(BiBrowserCheck.ie&&this._event.type=="click")
return 1;else return this._event.button;};_p.getWheelDelta=function()
{if(BiBrowserCheck.ie)
return this._event.wheelDelta?this._event.wheelDelta/40:0;else {var v=this._event.detail||0;if(v>1000)
v=3;else if(v< -1000)
v= -3
return-v;}};_p.getTarget=function()
{var el=this._event.target||this._event.srcElement;while(el!=null&&el._biComponent==null)
el=el.parentNode;return el==null?this._target:el._biComponent||this._target;};_p.preventDefault=function()
{this._defaultPrevented=true;if(BiBrowserCheck.moz)
this._event.preventDefault();this._event.returnValue=false;};_p.dispose=function(){BiEvent.prototype.dispose.call(this);this._event=null;};BiMouseEvent._storeEventState=function(biEvent)
{BiMouseEvent._screenX=biEvent.getScreenX();BiMouseEvent._screenY=biEvent.getScreenY();BiMouseEvent._clientX=biEvent.getClientX();BiMouseEvent._clientY=biEvent.getClientY();BiMouseEvent._button=biEvent.getButton();};BiMouseEvent.getScreenX=function(){return BiMouseEvent._screenX;};BiMouseEvent.getScreenY=function(){return BiMouseEvent._screenY;};BiMouseEvent.getClientX=function(){return BiMouseEvent._clientX;};BiMouseEvent.getClientY=function(){return BiMouseEvent._clientY;};BiMouseEvent.getButton=function(){return BiMouseEvent._button;};BiMouseEvent._screenX=BiMouseEvent._screenY=BiMouseEvent._clientX=BiMouseEvent._clientY=BiMouseEvent._button=0;if(BiBrowserCheck.moz)
BiMouseEvent._button= -1;function BiKeyboardEvent(sType,oEvent){if(_biInPrototype)return;BiEvent.call(this,sType);this._event=oEvent;this._keyCode=oEvent.keyCode||oEvent.charCode;}
_p=_biExtend(BiKeyboardEvent,BiEvent,"BiKeyboardEvent");_p._bubbles=true;_p._propagationStopped=false;_p.getCtrlKey=function(){return this._event.ctrlKey;};_p.getShiftKey=function(){return this._event.shiftKey;};_p.getAltKey=function(){return this._event.altKey;};_p.getKeyCode=function(){return this._keyCode;};_p.preventDefault=function()
{this._defaultPrevented=true;if(BiBrowserCheck.moz)
this._event.preventDefault();this._event.returnValue=false;if(BiBrowserCheck.ie)
{try
{this._event.keyCode=0;}
catch(ex)
{}}};_p.dispose=function(){BiEvent.prototype.dispose.call(this);this._event=null;};BiKeyboardEvent.ENTER=13;BiKeyboardEvent.TAB=9;BiKeyboardEvent.UP=38;BiKeyboardEvent.DOWN=40;BiKeyboardEvent.LEFT=37;BiKeyboardEvent.RIGHT=39;BiKeyboardEvent.SPACE=32;BiKeyboardEvent.SHIFT=16;BiKeyboardEvent.CTRL=17;BiKeyboardEvent.CONTROL=17;BiKeyboardEvent.ALT=18;BiKeyboardEvent.ESC=27;BiKeyboardEvent.F1=112;BiKeyboardEvent.F2=113;BiKeyboardEvent.F3=114;BiKeyboardEvent.F4=115;BiKeyboardEvent.F5=116;BiKeyboardEvent.F6=117;BiKeyboardEvent.F7=118;BiKeyboardEvent.F8=119;BiKeyboardEvent.F9=120;BiKeyboardEvent.F10=121;BiKeyboardEvent.F11=122;BiKeyboardEvent.F12=123;BiKeyboardEvent.DEL=46;BiKeyboardEvent.DELETE=46;BiKeyboardEvent.BACKSPACE=8;BiKeyboardEvent.INSERT=45;BiKeyboardEvent.HOME=36;BiKeyboardEvent.END=35;BiKeyboardEvent.PAGE_UP=33;BiKeyboardEvent.PAGE_DOWN=34;BiKeyboardEvent.NUM_LOCK=144;BiKeyboardEvent.NUMPAD0=96;BiKeyboardEvent.NUMPAD1=97;BiKeyboardEvent.NUMPAD2=98;BiKeyboardEvent.NUMPAD3=99;BiKeyboardEvent.NUMPAD4=100;BiKeyboardEvent.NUMPAD5=101;BiKeyboardEvent.NUMPAD6=102;BiKeyboardEvent.NUMPAD7=103;BiKeyboardEvent.NUMPAD8=104;BiKeyboardEvent.NUMPAD9=105;BiKeyboardEvent.NUMPAD_DIVIDE=111;BiKeyboardEvent.NUMPAD_MULTIPLY=106;BiKeyboardEvent.NUMPAD_MINUS=109;BiKeyboardEvent.NUMPAD_PLUS=107;function BiFocusEvent(sType)
{if(_biInPrototype)return;BiEvent.call(this,sType);if(sType=="focusin"||sType=="focusout")
{this._bubbles=true;this._propagationStopped=false;}}
_p=_biExtend(BiFocusEvent,BiEvent,"BiFocusEvent");BiFocusEvent._lastFocused=null;BiFocusEvent.prototype.getRelatedTarget=function(){return this._relatedTarget;};function BiEventManager(){if(_biInPrototype)return;BiObject.call(this);var oThis=this;this.__onmouseevent=function(e){return oThis._onmouseevent(e);};this.__onkeyevent=function(e){return oThis._onkeyevent(e);};this.__onselectevent=function(e){return oThis._onselectevent(e);};this.__onwindowblur=function(e){return oThis._onwindowblur(e);};this.__ondragevent=function(e){return oThis._ondragevent(e);};if(BiBrowserCheck.ie){this.__onactivateevent=function(e){return oThis._onactivateevent(e);};this.__onbeforeactivateevent=function(e){return oThis._onbeforeactivateevent(e);};}
this.__onresizeevent=function(e){return oThis._onresizeevent(e);};this._mozActiveElement=null;}
_p=_biExtend(BiEventManager,BiObject,"BiEventManager");_p._lastFocused=null;_p._lastMouseEventType=null;_p._lastMouseDown=false;_p._lastMouseEventDate=0;_p._allowBrowserContextMenu=false;BiEventManager.prototype.getAllowBrowserContextMenu=function(){return this._allowBrowserContextMenu;};BiEventManager.prototype.setAllowBrowserContextMenu=function(v){this._allowBrowserContextMenu=v;};_p.attachToWindow=function(oWindow){this._window=oWindow;this.attachMouseEvents();this.attachKeyboardEvents();var doc=oWindow.document;doc.body.onselect=doc.onselectstart=doc.onselectionchange=this.__onselectevent;doc.ondragstart=this.__ondragevent;oWindow.onblur=this.__onwindowblur;if(BiBrowserCheck.moz)
{oWindow.addEventListener("resize",this.__onresizeevent,false);}
else {doc.body.onactivate=this.__onactivateevent;doc.body.onbeforeactivate=this.__onbeforeactivateevent;oWindow.attachEvent("onresize",this.__onresizeevent);}};BiEventManager._mouseEventTypes=["mouseover","mousemove","mouseout","mousedown","mouseup","click","dblclick","contextmenu",(BiBrowserCheck.ie?"mousewheel":"DOMMouseScroll")];_p.attachMouseEvents=function(){var doc=this._window.document;var types=BiEventManager._mouseEventTypes;if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.attachEvent("on"+types[i],this.__onmouseevent);}
else {for(i=0;i<types.length;i++)
doc.addEventListener(types[i],this.__onmouseevent,false);}};_p.detachMouseEvents=function(){var doc=this._window.document;var types=BiEventManager._mouseEventTypes
if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.detachEvent("on"+types[i],this.__onmouseevent);}
else {if(doc)
for(i=0;i<types.length;i++)
doc.removeEventListener(types[i],this.__onmouseevent,false);}};BiEventManager._keyboardEventTypes=["keydown","keypress","keyup"];_p.attachKeyboardEvents=function(){var doc=this._window.document;var types=BiEventManager._keyboardEventTypes;if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.body.attachEvent("on"+types[i],this.__onkeyevent);}
else {for(i=0;i<types.length;i++)
doc.addEventListener(types[i],this.__onkeyevent,false);}};_p.detachKeyboardEvents=function(){var doc=this._window.document;var types=BiEventManager._keyboardEventTypes;if(BiBrowserCheck.ie)
{for(var i=0;i<types.length;i++)
doc.body.detachEvent("on"+types[i],this.__onkeyevent);}
else {if(doc)
{for(i=0;i<types.length;i++)
doc.removeEventListener(types[i],this.__onkeyevent,false);}}};_p._onmouseevent=function(e)
{if(!e)
e=this._window.event;var type=e.type;if(BiBrowserCheck.ie)
{if(type=="mousedown")
this._mouseIsDown=true;else if(type=="mouseup")
this._mouseIsDown=false;else if(type=="mousemove"&&this._mouseIsDown&&e.button==0)
{this._onmouseevent2(e,"mouseup");this._mouseIsDown=false;}
if(type=="mouseup"&&!this._lastMouseDown&&new Date-this._lastMouseEventDate<250)
{this._onmouseevent2(e,"mousedown");}
else if(type=="dblclick"&&this._lastMouseEventType=="mouseup"&&new Date-this._lastMouseEventDate<250)
{this._onmouseevent2(e,"click");}
switch(type){case"mousedown":case"mouseup":case"click":case"dblclick":case"contextmenu":this._lastMouseEventType=type;this._lastMouseEventDate=(new Date).valueOf();this._lastMouseDown=type=="mousedown";}}
else {switch(type)
{case"DOMMouseScroll":type="mousewheel";break;case"click":case"dblclick":if(e.button!=BiMouseEvent.LEFT)
return;case"mousedown":if(e.target&&e.target.localName=="IMG")
e.preventDefault();break;}}
this._onmouseevent2(e,type);};_p._onmouseevent2=function(e,type)
{if(type=="contextmenu"&&!this._allowBrowserContextMenu)
{if(BiBrowserCheck.moz)
e.preventDefault();e.returnValue=false;}
else if(type=="mousedown"&&BiBrowserCheck.moz)
this._onactivateevent(e);var target;if(this._captureComponent){target=this._captureComponent;}
else{var el=e.target||e.srcElement;while(el!=null&&el._biComponent==null)
el=el.parentNode;if(el==null)return;target=el._biComponent;}
if(target==null)
return;var enabledAncestor=null;var c=target;while(c)
{if(!c.getEnabled())
enabledAncestor=null;else if(enabledAncestor==null)
enabledAncestor=c;c=c._parent;}
target=enabledAncestor;if(target==null)
return;var biEvent=new BiMouseEvent(type,e);BiMouseEvent._storeEventState(biEvent);switch(type)
{case"mousedown":(new BiPopupManager).hideAutoHiding(target);var tmp=target;while(tmp!=null&&!tmp.getCanFocus())
tmp=tmp._parent;if(tmp!=null&&tmp.getCanFocus())
{if(BiBrowserCheck.ie)
{if(tmp._element.tagName!="IFRAME")
tmp._element.setActive();}
else {}}
break;case"mouseover":try
{tmp=e.relatedTarget||e.fromElement;while(tmp!=null&&tmp._biComponent==null)
tmp=tmp.parentNode;if(tmp&&tmp._biComponent==target)
{biEvent.dispose();return;}}
catch(ex)
{biEvent.dispose();return;}
break;case"mouseout":try
{tmp=e.relatedTarget||e.toElement;while(tmp!=null&&tmp._biComponent==null)
tmp=tmp.parentNode;if(tmp&&tmp._biComponent==target)
{biEvent.dispose();return;}}
catch(ex)
{biEvent.dispose();return;}
break;}
var rv=target.dispatchEvent(biEvent);if(type=="mouseup"){application.getThemeManager()._handleMouseUp(biEvent);}
switch(type)
{case"mouseover":(new BiToolTipManager).handleMouseOver(biEvent);break;case"mouseout":(new BiToolTipManager).handleMouseOut(biEvent);break;case"contextmenu":if(!rv)break;var cm;while(target&&!(cm=target.getContextMenu()))
target=target._parent;if(cm)
{if(BiBrowserCheck.moz)
e.preventDefault();e.returnValue=false;cm._component=target;cm.setLocation(biEvent.getScreenX(),biEvent.getScreenY());cm._component=target;cm.setVisible(true);}
break;case"mousewheel":if(!rv)
{e.returnValue=false;if(BiBrowserCheck.moz)
e.preventDefault();}
else {if(BiBrowserCheck.moz&&target instanceof BiComponent)
{this._onMozMouseWheel(target,biEvent);}}
break;}
(new BiDragAndDropManager).handleMouseEvent(biEvent);biEvent.dispose();if(BiBrowserCheck.moz&&target&&!target.getCanSelect()&&!target.getCanFocus())
e.preventDefault();application.flushLayoutQueue();};_p._onMozMouseWheel=function(c,e)
{if(c==null)
return;if(c.getOverflowY()=="hidden")
{this._onMozMouseWheel(c._parent,e);return;}
var st=c.getScrollTop();var delta=20*e.getWheelDelta();if(st==0&&delta>0)
{this._onMozMouseWheel(c._parent,e);return;}
var sh=c.getScrollHeight();var ch=c.getClientHeight();if(st+ch>=sh&&delta<0)
{this._onMozMouseWheel(c._parent,e);return;}
c.setScrollTop(st-delta);e._event.preventDefault();};_p._onkeyevent=function(e)
{if(!e)
e=this._window.event;var el=this._mozActiveElement||e.target||e.srcElement;while(el!=null&&el._biComponent==null)
el=el.parentNode;if(el==null)return;var target=el._biComponent;while(target&&!target.getEnabled())
target=target._parent;if(target==null)
return;var biEvent=new BiKeyboardEvent(e.type,e);target.dispatchEvent(biEvent);(new BiDragAndDropManager).handleKeyboardEvent(biEvent);application.flushLayoutQueue();};_p._onactivateevent=function(e){if(!e)

⌨️ 快捷键说明

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