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

📄 application.js

📁 Bindows 1.01 完全版 Bindows 框架提供给你: 基于类的面向对象 API; 一个完整的窗口系统
💻 JS
📖 第 1 页 / 共 5 页
字号:
        ( new BiToolTipManager).handleFocus(e);        }    if (BiBrowserCheck.moz && blurComp)        blurComp._blurComponent();    };_p._onwindowblur = function(e)    {    if (!BiBrowserCheck.moz)        ( new BiPopupManager).hideAutoHiding();    };_p._onresizeevent = function(e)    {    var c = this._window.document.body._biComponent;    c.dispatchEvent(new BiEvent("resize"));    };_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();    };_p.setCaptureComponent = function(oComponent)    {    this._captureComponent = oComponent;    } ;_p.dispose = function()    {    if (this._disposed)        return;    BiObject.prototype.dispose.call(this);    if (this._window)        {        this.detachMouseEvents();        this.detachKeyboardEvents();        var doc = this._window.document;        doc.body.onselect = doc.onselectstart = doc.onselectionchange = doc.ondragstart = doc.body.onactivate = 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.__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 BiEvent(sType)    {    BiObject.call(this);    this._type = sType;    }var _p = BiEvent.prototype = new BiObject;_p._className = "BiEvent";_p._bubbles = false;_p._propagationStopped = true;_p._defaultPrevented = false;BiEvent.prototype.getType = function()    {    return this._type;    } ;BiEvent.prototype.getTarget = function()    {    return this._target;    } ;BiEvent.prototype.getCurrentTarget = function()    {    return this._currentTarget;    } ;BiEvent.prototype.getBubbles = function()    {    return this._bubbles;    } ;_p.initDispatch = function()    {    } ;_p.stopPropagation = function()    {    this._propagationStopped = true;    } ;_p.preventDefault = function()    {    this._defaultPrevented = true;    } ;_p.dispose = function()    {    this._target = null;    this._currentTarget = null;    };_p.getDefaultPrevented = function()    {    return this._defaultPrevented;    } ;function BiErrorEvent(sType, oException)    {    BiEvent.call(this, sType);    this._exception = oException;    }var _p = BiErrorEvent.prototype = new BiEvent;_p._className = "BiErrorEvent";BiErrorEvent.prototype.getException = function()    {    return this._exception;    } ;_p.dispose = function()    {    BiEvent.prototype.dispose.call(this);    this._exception = null;    };function BiMouseEvent(sType, oEvent)    {    BiEvent.call(this, sType);    this._event = oEvent;    }var _p = BiMouseEvent.prototype = new BiEvent;_p._className = "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().getScreenLeft();    } ;_p.getOffsetY = function()    {    return this.getScreenY() - this.getTarget().getScreenTop();    } ;_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()    {    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)    {    BiEvent.call(this, sType);    this._event = oEvent;    this._keyCode = oEvent.keyCode || oEvent.charCode;    }var _p = BiKeyboardEvent.prototype = new BiEvent;_p._className = "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)        this._event.keyCode = 0;    };_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)    {    BiEvent.call(this, sType);    if (sType == "focusin" || sType == "focusout")        {        this._bubbles = true;        this._propagationStopped = false;        }    }var _p = BiFocusEvent.prototype = new BiEvent;_p._className = "BiFocusEvent";BiFocusEvent._lastFocused = null;_p.initDispatch = function()    {    } ;BiFocusEvent.prototype.getRelatedTarget = function()    {    return this._relatedTarget;    } ;function BiXmlHttp()    {    if (window.XMLHttpRequest)        return new XMLHttpRequest();    else if (window.ActiveXObject)        return new ActiveXObject(BiXmlHttp._activeXName);    }BiXmlHttp.create = function()    {    return new BiXmlHttp();    } ;function BiXmlDocument()    {    if (document.implementation && document.implementation.createDocument)        {        var doc = document.implementation.createDocument("", "", null);        doc.addEventListener("load", function(e)            {            this.readyState = 4;            } ,              false);        doc.readyState = 4;        return doc;        }    else if (window.ActiveXObject)        return new ActiveXObject(BiXmlDocument._activeXName);    }BiXmlDocument.create = function()    {    return new BiXmlDocument();    } ;BiXmlDocument._biGetActiveXName = BiXmlHttp._biGetActiveXName = function(sType)    {    var servers = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];    var o;    for (var i = 0; i < servers.length; i++)        {        try            {            o = new ActiveXObject(servers[i] + "." + sType);            return servers[i] + "." + sType;            }        catch (ex)            {            }        ;        }    throw new Error("Could not find an installed XML parser");    };if (window.ActiveXObject)    {    BiXmlDocument._activeXName = BiXmlDocument._biGetActiveXName("DomDocument");    BiXmlHttp._activeXName = BiXmlHttp._biGetActiveXName("XmlHttp");    }

⌨️ 快捷键说明

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