📄 ruleset.js
字号:
function uiFormGuide_RuleSet(doAction, undoAction) { this._super(); this.__rules = new Array(); this.__doAction = doAction; this.__undoAction = undoAction; this.__elementHandler = new uiHtml_ElementWrapper(); this.__lifeCycleNotifier = new uiHtml_LifeCycleNotifier();}uiFormGuide_RuleSet = uiUtil_Object.declareClass(uiFormGuide_RuleSet, uiUtil_Object);uiFormGuide_RuleSet.prototype.addRule = function(rule) { this.__rules.push(rule);};uiFormGuide_RuleSet.prototype._allRulesHold = function() { for (var i = 0; i < this.__rules.length; ++i) { if (!this.__rules[i]._holds()) { return false; } } return true;};uiFormGuide_RuleSet.prototype.getRules = function() { return this.__rules;};uiFormGuide_RuleSet.prototype._doAction = function(domEvent) { this.__doAction(domEvent, this);};uiFormGuide_RuleSet.prototype._undoAction = function(domEvent) { this.__undoAction(domEvent, this);};uiFormGuide_RuleSet.prototype.setLifeCycleListener = function(listener) { this.__lifeCycleNotifier.setListener(listener);};uiFormGuide_RuleSet.prototype.__enableEachElement = function( domElement, domEvent) { if (!this.__lifeCycleNotifier.notify("onBeforeEnable", domEvent, domElement)) { return; } this.__elementHandler.setDisabled(domElement, false); this.__lifeCycleNotifier.notify("onAfterEnable", domEvent, domElement);};uiFormGuide_RuleSet.prototype.__disableEachElement = function( domElement, domEvent) { if (!this.__lifeCycleNotifier.notify("onBeforeDisable", domEvent, domElement)) { return; } this.__elementHandler.setDisabled(domElement, true); this.__lifeCycleNotifier.notify("onAfterDisable", domEvent, domElement);};uiFormGuide_RuleSet.prototype.__insertEachElement = function( domElement, domEvent) { if (!this.__lifeCycleNotifier.notify("onBeforeInsert", domEvent, domElement)) { return; } this.__elementHandler.appear(domElement); this.__lifeCycleNotifier.notify("onAfterInsert", domEvent, domElement);};uiFormGuide_RuleSet.prototype.__removeEachElement = function( domElement, domEvent) { if (!this.__lifeCycleNotifier.notify("onBeforeRemove", domEvent, domElement)) { return; } this.__elementHandler.disappear(domElement); this.__lifeCycleNotifier.notify("onAfterRemove", domEvent, domElement);};uiFormGuide_RuleSet.prototype.enableElements = function( domEvent, elementId, elementName) { var group = this.__createGroup(elementId, elementName); group.traverse(this, this.__enableEachElement, domEvent);};uiFormGuide_RuleSet.prototype.disableElements = function( domEvent, elementId, elementName) { var group = this.__createGroup(elementId, elementName); group.traverse(this, this.__disableEachElement, domEvent);};uiFormGuide_RuleSet.prototype.insertElements = function( domEvent, elementId, elementName) { var group = this.__createGroup(elementId, elementName); group.traverse(this, this.__insertEachElement, domEvent);};uiFormGuide_RuleSet.prototype.removeElements = function( domEvent, elementId, elementName) { var group = this.__createGroup(elementId, elementName); group.traverse(this, this.__removeEachElement, domEvent);};uiFormGuide_RuleSet.prototype.__createGroup = function(elementId, elementName) { var domObjects = uiHtml_Group.__getDomObjectsByEither(elementId, elementName); return new uiHtml_Group(domObjects);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -