📄 element.js
字号:
function uiHtml_Element(domElement, inline) { this._super(); this.__domElement = domElement; this.__supporter = uiHtml_ElementWrapper.getInstance();}uiHtml_Element = uiUtil_Object.declareClass(uiHtml_Element, uiUtil_Object);uiHtml_Element.prototype.setStyleAttribute = function(name, value) { this.__supporter.setStyleAttribute(this.__domElement, name, value);};uiHtml_Element.prototype.getCascadedStyleAttribute = function(name) { return this.__supporter.getCascadedStyleAttribute(this.__domElement, name);};uiHtml_Element.prototype.isShowing = function() { return this.__supporter.isShowing(this.__domElement);};uiHtml_Element.prototype.show = function() { this.__supporter.show(this.__domElement);};uiHtml_Element.prototype.hide = function() { this.__supporter.hide(this.__domElement);};uiHtml_Element.prototype.isAppearing = function() { return this.__supporter.isAppearing(this.__domElement);};uiHtml_Element.prototype.appear = function() { this.__supporter.appear(this.__domElement);};uiHtml_Element.prototype.disappear = function() { this.__supporter.disappear(this.__domElement);};uiHtml_Element.prototype.setDepth = function(depth) { this.__supporter.setDepth(this.__domElement, depth);};uiHtml_Element.prototype.getDepth = function() { return this.__supporter.getDepth(this.__domElement);};uiHtml_Element.prototype.setDimension = function(x, y, width, height) { this.__supporter.setDimension(this.__domElement, x, y, width, height);};uiHtml_Element.prototype.setDimensionObject = function(dimension) { this.__supporter.setDimensionObject(this.__domElement, dimension);};uiHtml_Element.prototype.prependEventHandler = function(eventName, eventHandler) { return this.__supporter.prependEventHandler( this.__domElement, eventName, eventHandler);};uiHtml_Element.prototype.appendEventHandler = function(eventName, eventHandler) { return this.__supporter.appendEventHandler( this.__domElement, eventName, eventHandler);};uiHtml_Element.prototype._initializeEventProperty = function(eventName, actualHandler) { this.__supporter._initializeEventProperty(this.__domElement, eventName, actualHandler);};uiHtml_Element.prototype._getActualHandler = function(eventName) { return this.__supporter._getActualHandler(this.__domElement, eventName);};uiHtml_Element.prototype.removeEventHandler = function( eventName, startIndex) { this.__supporter.removeEventHandler( this.__domElement, eventName, startIndex);};uiHtml_Element.prototype.clearEventHandlerExtension = function(eventName) { this.__supporter.clearEventHandlerExtension(this.__domElement, eventName);};uiHtml_Element.prototype.executeAggregateEventHandler = function( eventName, optDomEvent) { this.__supporter.executeAggregateEventHandler( this.__domElement, eventName, optDomEvent);};uiHtml_Element.prototype.appendMousePressHandler = function(eventHandler) { this.__supporter.appendMousePressHandler(this.__domElement, eventHandler);};uiHtml_Element.prototype.enableDragSupport = function(optTrigger) { var element = this; this.__supporter.enableDragSupport(this.__domElement, optTrigger, function(x, y) { element.setDimension(x, y, null, null); });};uiHtml_Element.prototype.restrictDragging = function( optLeft, optTop, optMaxWidth, optMaxHeight) { this.__supporter.restrictDragging( this.__domElement, optLeft, optTop, optMaxWidth, optMaxHeight);};uiHtml_Element.prototype.getWidth = function() { return this.__supporter.getWidth(this.__domElement);};uiHtml_Element.prototype.getHeight = function() { return this.__supporter.getHeight(this.__domElement);};uiHtml_Element.prototype.getImmediateRelativeDimension = function() { var element = this; return this.__supporter._getDimension(this.__domElement, this.__supporter._obtainImmediateRelativeDimension, function() { return element.getWidth(); }, function() { return element.getHeight(); });};uiHtml_Element.prototype.getRelativeDimension = function() { var element = this; return this.__supporter._getDimension(this.__domElement, this.__supporter._obtainRelativeDimension, function() { return element.getWidth(); }, function() { return element.getHeight(); });};uiHtml_Element.prototype.setDisabled = function(value) { this.__supporter.setDisabled(this.__domElement, value);};uiHtml_Element.prototype.getDomObject = function() { return this.__domElement;};uiHtml_Element.createByEither = function(id, name, optTypeClass) { var uiDocument = uiHtml_Document.getInstance(); var domObject = null; try { domObject = uiDocument.getDomObjectById(id, true); } catch (e) { if (name == null || name == '') { throw e; } domObject = uiDocument.getDomObjectsByName(name, true)[0]; } var extProps = uiHtml_Element.__getExtProps(domObject); if (extProps.__elementWrapper == null) { extProps.__elementWrapper = uiHtml_Element.__createElement( domObject, optTypeClass); uiHtml_Element.__logger.debug("Created new element " + extProps.__elementWrapper); uiHtml_Element.__logger.debug("ID/name: " + id + "/" + name); } return extProps.__elementWrapper;};uiHtml_Element.__createElement = function(domObject, optTypeClass) { if (optTypeClass != null && uiUtil_Object.isAssignableFrom(uiHtml_Element, optTypeClass)) { return new optTypeClass(domObject); } return uiHtml_Element.createElementByType(domObject);};uiHtml_Element.__getExtProps = function(domElement) { var supporter = uiHtml_ElementWrapper.getInstance(); var extProps = supporter._getClassProperty(domElement, uiHtml_Element); if (extProps == null) { extProps = new uiHtml_Element.DomExtProps(); supporter._setClassProperty(domElement, uiHtml_Element, extProps); } return extProps;}uiHtml_Element.createElementByType = function(domElement) { if (domElement == null) { return null; } switch(uiHtml_Element.getWidgetType(domElement)) { case "select" : return new uiHtml_Select(domElement); default : return new uiHtml_Element(domElement); }};uiHtml_Element.getWidgetType = function(domElement) { var tagName = uiHtml_Element.getTagName(domElement); switch (tagName) { case "label" : case "select" : case "option" : case "textarea": return tagName; case "input" : return domElement.type.toLowerCase(); default : return "undefined"; }};uiHtml_Element.getTagName = function(domElement) { var tagName = domElement.tagName; if (tagName == null) { return "undefined"; } return tagName.toLowerCase();};uiHtml_Element._initializeDomObject = function(domElement, optAppear) { var supporter = uiHtml_ElementWrapper.getInstance(); if (uiUtil_Type.getBoolean(optAppear, true)) { supporter.appear(domElement); } else { supporter.disappear(domElement); }};function uiHtml_Element$DomExtProps() { this.__elementWrapper = null;}uiHtml_Element.DomExtProps = uiUtil_Object.declareClass( uiHtml_Element$DomExtProps, uiUtil_Object);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -