📄 window.js
字号:
function uiHtml_Window() { this._super(window); this.__isOpera = window.opera ? true : false; this.__isIe = (document.all != null && !this.__isOpera); this.__finalizerId = this.__appendElementFinalizer(); var uiWindow = this; var actualHandler = this._getActualHandler("load"); this._initializeEventProperty("load", function() { try { actualHandler(); } catch (e) { if (e instanceof Error) { throw uiWindow.__handleError(e); } else if (e instanceof uiUtil_Exception) { throw uiWindow.__handleException(e); } } }); this.prependEventHandler("load", function(e) { uiHtml_Window.__isLoaded = true; uiHtml_Window.getInstance().__logger.debug("finish loading"); });}uiHtml_Window = uiUtil_Object.declareSingleton(uiHtml_Window, uiHtml_Element);uiHtml_Window.__isLoaded = false;uiHtml_Window.prototype.isOpera = function() { return this.__isOpera;};uiHtml_Window.prototype.isIe = function() { return this.__isIe;};uiHtml_Window.prototype.getBrowserVersion = function() { if (this.__isOpera) { return this.__extractVersion(navigator.userAgent, "Opera"); } if (this.__isIe) { return this.__extractVersion(navigator.userAgent, "MSIE"); } return -1;};uiHtml_Window.prototype.__extractVersion = function(data, idSubstring) { var index = data.indexOf(idSubstring); if (index >= 0) { return parseFloat(data.substring(index + idSubstring.length + 1)); } return -1;}uiHtml_Window.prototype.__printError = function(error) { var message = error.message; var url = error.fileName; var line = error.lineNumber; this.__logger.info(message + " (Loc: " + url + ":" + line + ")");};uiHtml_Window.prototype.__handleError = function(error) { this.__printError(error); return error;};uiHtml_Window.prototype.__handleException = function(exception) { var error =exception.getError(); if (error != null) { this.__printError(error); return error; } else { this.__logger.info(exception.getMessage()); return exception; }};uiHtml_Window.prototype.getWidth = function() { if (this.__isIe) { return document.documentElement.clientWidth; } else { return window.innerWidth; }};uiHtml_Window.prototype.getHeight = function() { if (this.__isIe) { return document.documentElement.clientHeight; } else { return window.innerHeight; }};uiHtml_Window.prototype.__appendElementFinalizer = function() { return this._callSuper("appendEventHandler", "unload", function(e) { uiHtml_ElementWrapper._finalizeElements(); uiHtml_Window.__isLoaded = false; });}uiHtml_Window.prototype.appendEventHandler = function(eventName, handler) { if (eventName == "unload" && this.__finalizerId != null) { this.removeEventHandler(eventName, this.__finalizerId); var index = this._callSuper("appendEventHandler", eventName, handler); this.__finalizerId = this.__appendElementFinalizer(); return index; } return this._callSuper("appendEventHandler", eventName, handler);};uiHtml_Window.prototype.clearEventHandlerExtension = function(eventName) { this._callSuper("clearEventHandlerExtension", eventName); if (eventName == "unload") { this.__finalizerId = this.__appendElementFinalizer(); }};uiHtml_Window.prototype.getRequestParameters = function() { var parameters = new Object(); var url = window.top.location.href; var queries = url.split("&"); for (var i = 0; i < queries.length; ++i) { var pair = queries[i].split("="); var key = pair[0]; var value = pair[1]; parameters[key] = value; } return parameters;};uiHtml_Window.isLoaded = function() { return uiHtml_Window.__isLoaded;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -