📄 document.js
字号:
function uiHtml_Document() { this._super(document.body); this.__printStream = null; this.__scrollSupporter = new uiHtml_ScrollSupporter(document.documentElement); this.__eventSupporter = uiHtml_Element.createElementByType(document);}uiHtml_Document = uiUtil_Object.declareSingleton(uiHtml_Document, uiHtml_Element);uiHtml_Document.prototype.getDomObjectById = function(id, optAssert) { var domObject = document.getElementById(id); if (uiUtil_Type.getBoolean(optAssert, true) && domObject == null) { throw new uiUtil_IllegalArgumentException("Invalid element ID: " + id); } return domObject;};uiHtml_Document.prototype.getDomObjectsByName = function(name, optAssert) { var domObjects = document.getElementsByName(name); if (uiUtil_Type.getBoolean(optAssert, true) && domObjects[0] == null) { throw new uiUtil_IllegalArgumentException("Invalid element name: " + name); } return domObjects;};uiHtml_Document.prototype.__assertLoaded = function(message) { if (!uiHtml_Window.isLoaded()) { throw new uiUtil_IllegalStateException(message); }};uiHtml_Document.prototype.__assertLoadedWhenAttachingDomObjectOf = function(tagName) { this.__assertLoaded("DOM object " + tagName + " should not be " + "attached to document before the window finishes loading");};uiHtml_Document.prototype.createDomObject = function(tagName, optAppear) { this.__assertLoadedWhenAttachingDomObjectOf(tagName); return uiHtml_Document.createDomObject(tagName, optAppear, document.body);};uiHtml_Document.prototype.prependEventHandler = function(eventName, eventHandler) { return this.__eventSupporter.prependEventHandler(eventName, eventHandler);};uiHtml_Document.prototype.appendEventHandler = function(eventName, eventHandler) { return this.__eventSupporter.appendEventHandler(eventName, eventHandler);};uiHtml_Document.prototype.removeEventHandler = function(eventName, startIndex, optCount) { this.__eventSupporter.removeEventHandler(eventName, startIndex, optCount);};uiHtml_Document.prototype.clearEventHandlerExtension = function(eventName) { this.__eventSupporter.clearEventHandlerExtension(eventName);};uiHtml_Document.prototype.getPrintStream = function() { if (this.__printStream == null) { this.__assertLoaded( "Cannot get print stream before the window finishes loading"); this.__printStream = new uiHtml_PrintSupporter(this.getDomObject()); } return this.__printStream;};uiHtml_Document.prototype.scrollToTop = function() { this.__scrollSupporter.scrollToTop();};uiHtml_Document.prototype.scrollToBottom = function() { this.__scrollSupporter.scrollToBottom();};uiHtml_Document.prototype.getScrollLeft = function() { return this.__scrollSupporter.getScrollLeft();};uiHtml_Document.prototype.getScrollTop = function() { return this.__scrollSupporter.getScrollTop();};uiHtml_Document.createDomObject = function(tagName, optAppear, optParent) { var domObject = document.createElement(tagName); uiHtml_Element._initializeDomObject(domObject, optAppear); if (uiUtil_Type.isDefined(optParent)) { optParent.appendChild(domObject); } return domObject;};uiHtml_Document.createTextNode = function(initialText, optParent) { var domTextNode = document.createTextNode(initialText); if (uiUtil_Type.isDefined(optParent)) { optParent.appendChild(domTextNode); } return domTextNode;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -