From 2ab488bfa65c4539f1488032a7194f6de67e7142 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Mon, 17 Mar 2014 00:36:29 -0300 Subject: [PATCH] replacing old .each mootools' method by _.each --- mindplot/src/main/javascript/Designer.js | 10 +++++----- mindplot/src/main/javascript/Events.js | 2 +- mindplot/src/main/javascript/IconGroup.js | 4 ++-- .../src/main/javascript/MultilineTextEditor.js | 2 +- .../src/main/javascript/RelationshipPivot.js | 4 ++-- mindplot/src/main/javascript/ScreenManager.js | 2 +- mindplot/src/main/javascript/Topic.js | 2 +- .../main/javascript/commands/AddTopicCommand.js | 6 +++--- .../main/javascript/commands/DeleteCommand.js | 16 ++++++++-------- .../commands/GenericFunctionCommand.js | 4 ++-- .../javascript/layout/AbstractBasicSorter.js | 2 +- .../src/main/javascript/layout/BalancedSorter.js | 6 +++--- .../src/main/javascript/layout/LayoutManager.js | 4 ++-- .../src/main/javascript/layout/OriginalLayout.js | 12 ++++++------ .../src/main/javascript/layout/RootedTreeSet.js | 4 ++-- .../main/javascript/layout/SymmetricSorter.js | 2 +- mindplot/src/main/javascript/model/IMindmap.js | 2 +- mindplot/src/main/javascript/model/INodeModel.js | 8 ++++---- .../javascript/persistence/Beta2PelaMigrator.js | 4 ++-- mindplot/src/main/javascript/util/FadeEffect.js | 4 ++-- .../main/javascript/widget/ColorPalettePanel.js | 6 +++--- mindplot/src/main/javascript/widget/IMenu.js | 2 +- .../main/javascript/widget/ListToolbarPanel.js | 2 +- mindplot/src/main/javascript/widget/Menu.js | 6 +++--- .../test/javascript/static/test/FreeTestSuite.js | 8 ++++---- wise-editor/src/main/webapp/html/editor.html | 1 + 26 files changed, 63 insertions(+), 62 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index b2210b3f..ba7754b1 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -129,7 +129,7 @@ mindplot.Designer = new Class({ screenManager.addEvent('update', function () { // Topic must be set to his original state. All editors must be closed. var topics = this.getModel().getTopics(); - topics.each(function (object) { + _.each(topics, function(object){ object.closeEditors(); }); @@ -309,13 +309,13 @@ mindplot.Designer = new Class({ onObjectFocusEvent:function (currentObject, event) { // Close node editors .. var topics = this.getModel().getTopics(); - topics.each(function (topic) { + _.each(topics, function(topic) { topic.closeEditors(); }); var model = this.getModel(); var objects = model.getEntities(); - objects.each(function (object) { + _.each(objects, function(object) { // Disable all nodes on focus but not the current if Ctrl key isn't being pressed if (!$defined(event) || (!event.control && !event.meta)) { if (object.isOnFocus() && object != currentObject) { @@ -329,14 +329,14 @@ mindplot.Designer = new Class({ selectAll:function () { var model = this.getModel(); var objects = model.getEntities(); - objects.each(function (object) { + _.each(objects, function(object) { object.setOnFocus(true); }); }, deselectAll:function () { var objects = this.getModel().getEntities(); - objects.each(function (object) { + _.each(objects, function (object) { object.setOnFocus(false); }); }, diff --git a/mindplot/src/main/javascript/Events.js b/mindplot/src/main/javascript/Events.js index 7bbea205..775175d9 100644 --- a/mindplot/src/main/javascript/Events.js +++ b/mindplot/src/main/javascript/Events.js @@ -26,7 +26,7 @@ mindplot.Events = new Class({ var events = this.$events[type]; if (!events) return this; args = Array.from(args); - events.each(function(fn){ + _.each(events, function(fn){ if (delay) fn.delay(delay, this, args); else fn.apply(this, args); }, this); diff --git a/mindplot/src/main/javascript/IconGroup.js b/mindplot/src/main/javascript/IconGroup.js index 7fe7abdc..228ea43f 100644 --- a/mindplot/src/main/javascript/IconGroup.js +++ b/mindplot/src/main/javascript/IconGroup.js @@ -72,7 +72,7 @@ mindplot.IconGroup = new Class({ _findIconFromModel:function (iconModel) { var result = null; - this._icons.each(function (icon) { + _.each(this._icons, function (icon) { var elModel = icon.getModel(); if (elModel.getId() == iconModel.getId()) { result = icon; @@ -103,7 +103,7 @@ mindplot.IconGroup = new Class({ this._resize(this._icons.length); // Add all again ... - this._icons.each(function (elem, i) { + _.each(this._icons, function (elem, i) { this._positionIcon(elem, i); }.bind(this)); }, diff --git a/mindplot/src/main/javascript/MultilineTextEditor.js b/mindplot/src/main/javascript/MultilineTextEditor.js index 87aae092..3684892c 100644 --- a/mindplot/src/main/javascript/MultilineTextEditor.js +++ b/mindplot/src/main/javascript/MultilineTextEditor.js @@ -126,7 +126,7 @@ mindplot.MultilineTextEditor = new Class({ var lines = textElem.value.split('\n'); var maxLineLength = 1; - lines.each(function (line) { + _.each(lines, function (line) { if (maxLineLength < line.length) maxLineLength = line.length; }); diff --git a/mindplot/src/main/javascript/RelationshipPivot.js b/mindplot/src/main/javascript/RelationshipPivot.js index e0b892bc..0d7c1ca7 100644 --- a/mindplot/src/main/javascript/RelationshipPivot.js +++ b/mindplot/src/main/javascript/RelationshipPivot.js @@ -65,7 +65,7 @@ mindplot.RelationshipPivot = new Class({ // Register focus events on all topics ... var model = this._designer.getModel(); var topics = model.getTopics(); - topics.each(function (topic) { + _.each(topics, function (topic) { topic.addEvent('ontfocus', this._onTopicClick); }.bind(this)); } @@ -81,7 +81,7 @@ mindplot.RelationshipPivot = new Class({ var model = this._designer.getModel(); var topics = model.getTopics(); - topics.each(function (topic) { + _.each(topics, function (topic) { topic.removeEvent('ontfocus', this._onTopicClick); }.bind(this)); diff --git a/mindplot/src/main/javascript/ScreenManager.js b/mindplot/src/main/javascript/ScreenManager.js index 58fbf023..830cd19b 100644 --- a/mindplot/src/main/javascript/ScreenManager.js +++ b/mindplot/src/main/javascript/ScreenManager.js @@ -57,7 +57,7 @@ mindplot.ScreenManager = new Class({ fireEvent : function(type, event) { if (type == 'click') { - this._clickEvents.each(function(listener) { + _.each(this._clickEvents, function(listener) { listener(type, event); }); } diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 352bb626..661b439f 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -887,7 +887,7 @@ mindplot.Topic = new Class({ }, _setRelationshipLinesVisibility:function (value) { - this._relationships.each(function (relationship) { + _.each(this._relationships, function (relationship) { var sourceTopic = relationship.getSourceTopic(); var targetTopic = relationship.getTargetTopic(); diff --git a/mindplot/src/main/javascript/commands/AddTopicCommand.js b/mindplot/src/main/javascript/commands/AddTopicCommand.js index ce20a964..aff2c416 100644 --- a/mindplot/src/main/javascript/commands/AddTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddTopicCommand.js @@ -29,7 +29,7 @@ mindplot.commands.AddTopicCommand = new Class({ execute:function (commandContext) { - this._models.each(function (model, index) { + _.each(this._models, function (model, index) { // Add a new topic ... var topic = commandContext.createTopic(model); @@ -59,12 +59,12 @@ mindplot.commands.AddTopicCommand = new Class({ undoExecute:function (commandContext) { // Delete disconnected the nodes. Create a copy of the topics ... var clonedModel = []; - this._models.each(function (model) { + _.each(this._models, function (model) { clonedModel.push(model.clone()); }); // Finally, remove the nodes ... - this._models.each(function (model) { + _.each(this._models, function (model) { var topicId = model.getId(); var topic = commandContext.findTopics(topicId)[0]; diff --git a/mindplot/src/main/javascript/commands/DeleteCommand.js b/mindplot/src/main/javascript/commands/DeleteCommand.js index 31637d2c..54979510 100644 --- a/mindplot/src/main/javascript/commands/DeleteCommand.js +++ b/mindplot/src/main/javascript/commands/DeleteCommand.js @@ -35,7 +35,7 @@ mindplot.commands.DeleteCommand = new Class({ var topics = this._filterChildren(this._topicIds, commandContext); if (topics.length > 0) { - topics.each(function (topic) { + _.each(topics, function (topic) { // In case that it's editing text node, force close without update ... topic.closeEditors(); @@ -47,7 +47,7 @@ mindplot.commands.DeleteCommand = new Class({ return rel.getModel().clone(); })); - relationships.each(function (relationship) { + _.each(relationships, function (relationship) { commandContext.deleteRelationship(relationship); }); @@ -69,7 +69,7 @@ mindplot.commands.DeleteCommand = new Class({ var rels = commandContext.findRelationships(this._relIds); if (rels.length > 0) { - rels.each(function (rel) { + _.each(rels, function (rel) { this._deletedRelModel.push(rel.getModel().clone()); commandContext.deleteRelationship(rel); }, this); @@ -79,12 +79,12 @@ mindplot.commands.DeleteCommand = new Class({ undoExecute:function (commandContext) { // Add all the topics ... - this._deletedTopicModels.each(function (model) { + _.each(this._deletedTopicModels, function (model) { commandContext.createTopic(model); }, this); // Do they need to be connected ? - this._deletedTopicModels.each(function (topicModel, index) { + _.each(this._deletedTopicModels, function (topicModel, index) { var topics = commandContext.findTopics(topicModel.getId()); var parentId = this._parentTopicIds[index]; @@ -95,12 +95,12 @@ mindplot.commands.DeleteCommand = new Class({ }, this); // Add rebuild relationships ... - this._deletedRelModel.each(function (model) { + _.each(this._deletedRelModel, function (model) { commandContext.addRelationship(model); }.bind(this)); // Finally display the topics ... - this._deletedTopicModels.each(function (topicModel) { + _.each(this._deletedTopicModels, function (topicModel) { var topics = commandContext.findTopics(topicModel.getId()); topics[0].setBranchVisibility(true); }, this); @@ -121,7 +121,7 @@ mindplot.commands.DeleteCommand = new Class({ var topics = commandContext.findTopics(topicIds); var result = []; - topics.each(function (topic) { + _.each(topics, function (topic) { var parent = topic.getParent(); var found = false; while (parent != null && !found) { diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js index 28e75605..9bd25704 100644 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js @@ -46,7 +46,7 @@ mindplot.commands.GenericFunctionCommand = new Class({ } if (topics != null) { - topics.each(function (topic) { + _.each(topics, function (topic) { var oldValue = this._commandFunc(topic, this._value); this._oldValues.push(oldValue); }.bind(this)); @@ -62,7 +62,7 @@ mindplot.commands.GenericFunctionCommand = new Class({ undoExecute:function (commandContext) { if (this.applied) { var topics = commandContext.findTopics(this._topicsId); - topics.each(function (topic, index) { + _.each(topics, function (topic, index) { this._commandFunc(topic, this._oldValues[index]); }.bind(this)); diff --git a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js b/mindplot/src/main/javascript/layout/AbstractBasicSorter.js index fbfcad6d..64476a66 100644 --- a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js +++ b/mindplot/src/main/javascript/layout/AbstractBasicSorter.js @@ -38,7 +38,7 @@ mindplot.layout.AbstractBasicSorter = new Class({ result = height; } else { var childrenHeight = 0; - children.each(function(child) { + _.each(children, function(child) { childrenHeight += this._computeChildrenHeight(treeSet, child, heightCache); }, this); diff --git a/mindplot/src/main/javascript/layout/BalancedSorter.js b/mindplot/src/main/javascript/layout/BalancedSorter.js index 1c683616..950a057a 100644 --- a/mindplot/src/main/javascript/layout/BalancedSorter.js +++ b/mindplot/src/main/javascript/layout/BalancedSorter.js @@ -77,7 +77,7 @@ mindplot.layout.BalancedSorter = new Class({ var result = null; var last = children.getLast(); position = position || {x:last.getPosition().x, y:last.getPosition().y + 1}; - children.each(function (child, index) { + _.each(children, function (child, index) { var cpos = child.getPosition(); if (position.y > cpos.y) { yOffset = child == last ? @@ -129,7 +129,7 @@ mindplot.layout.BalancedSorter = new Class({ // Filter nodes on one side.. var children = this._getChildrenForOrder(parent, treeSet, node.getOrder()); - children.each(function (child, index) { + _.each(children, function (child, index) { if (child.getOrder() > node.getOrder()) { child.setOrder(child.getOrder() - 2); } @@ -154,7 +154,7 @@ mindplot.layout.BalancedSorter = new Class({ var totalPHeight = 0; var totalNHeight = 0; - heights.each(function (elem) { + _.each(heights, function (elem) { if (elem.order % 2 == 0) { totalPHeight += elem.height; } else { diff --git a/mindplot/src/main/javascript/layout/LayoutManager.js b/mindplot/src/main/javascript/layout/LayoutManager.js index 49cbacbb..78258de6 100644 --- a/mindplot/src/main/javascript/layout/LayoutManager.js +++ b/mindplot/src/main/javascript/layout/LayoutManager.js @@ -145,7 +145,7 @@ mindplot.layout.LayoutManager = new Class({ }, _flushEvents: function() { - this._events.each(function(event) { + _.each(this._events, function(event) { this.fireEvent('change', event); }, this); this._events = []; @@ -155,7 +155,7 @@ mindplot.layout.LayoutManager = new Class({ if (!nodes) nodes = this._treeSet.getTreeRoots(); - nodes.each(function(node) { + _.each(nodes, function(node) { if (node.hasOrderChanged() || node.hasPositionChanged()) { // Find or create a event ... diff --git a/mindplot/src/main/javascript/layout/OriginalLayout.js b/mindplot/src/main/javascript/layout/OriginalLayout.js index 84d4c3f5..d102d538 100644 --- a/mindplot/src/main/javascript/layout/OriginalLayout.js +++ b/mindplot/src/main/javascript/layout/OriginalLayout.js @@ -70,7 +70,7 @@ mindplot.layout.OriginalLayout = new Class({ layout:function () { var roots = this._treeSet.getTreeRoots(); - roots.each(function (node) { + _.each(roots, function (node) { // Calculate all node heights ... var sorter = node.getSorter(); @@ -108,7 +108,7 @@ mindplot.layout.OriginalLayout = new Class({ var offsetById = sorter.computeOffsets(this._treeSet, node); var parentPosition = node.getPosition(); - children.each(function (child) { + _.each(children, function (child) { var offset = offsetById[child.getId()]; var childFreeDisplacement = child.getFreeDisplacement(); @@ -133,7 +133,7 @@ mindplot.layout.OriginalLayout = new Class({ } // Continue reordering the children nodes ... - children.each(function (child) { + _.each(children, function (child) { this._layoutChildren(child, heightById); }, this); }, @@ -183,7 +183,7 @@ mindplot.layout.OriginalLayout = new Class({ this._shiftBranches(node, heightById); } - children.each(function (child) { + _.each(children, function (child) { this._fixOverlapping(child, heightById); }, this); }, @@ -193,7 +193,7 @@ mindplot.layout.OriginalLayout = new Class({ var siblingsToShift = this._treeSet.getSiblingsInVerticalDirection(node, node.getFreeDisplacement().y); var last = node; - siblingsToShift.each(function (sibling) { + _.each(siblingsToShift, function (sibling) { var overlappingOccurs = shiftedBranches.some(function (shiftedBranch) { return this._branchesOverlap(shiftedBranch, sibling, heightById); }, this); @@ -209,7 +209,7 @@ mindplot.layout.OriginalLayout = new Class({ return !shiftedBranches.contains(branch); }); - branchesToShift.each(function (branch) { + _.each(branchesToShift, function (branch) { var bAmount = node.getFreeDisplacement().y; this._treeSet.shiftBranchPosition(branch, 0, bAmount); shiftedBranches.push(branch); diff --git a/mindplot/src/main/javascript/layout/RootedTreeSet.js b/mindplot/src/main/javascript/layout/RootedTreeSet.js index c51f9e22..5bd4245a 100644 --- a/mindplot/src/main/javascript/layout/RootedTreeSet.js +++ b/mindplot/src/main/javascript/layout/RootedTreeSet.js @@ -240,7 +240,7 @@ mindplot.layout.RootedTreeSet = new Class({ var yOffset = oldPos.y - position.y; var children = this.getChildren(node); - children.each(function (child) { + _.each(children, function (child) { this.shiftBranchPosition(child, xOffset, yOffset); }.bind(this)); @@ -251,7 +251,7 @@ mindplot.layout.RootedTreeSet = new Class({ node.setPosition({x:position.x + xOffset, y:position.y + yOffset}); var children = this.getChildren(node); - children.each(function (child) { + _.each(children, function (child) { this.shiftBranchPosition(child, xOffset, yOffset); }.bind(this)); }, diff --git a/mindplot/src/main/javascript/layout/SymmetricSorter.js b/mindplot/src/main/javascript/layout/SymmetricSorter.js index 10604091..440a9741 100644 --- a/mindplot/src/main/javascript/layout/SymmetricSorter.js +++ b/mindplot/src/main/javascript/layout/SymmetricSorter.js @@ -168,7 +168,7 @@ mindplot.layout.SymmetricSorter = new Class({ // Compute the center of the branch ... var totalHeight = 0; - heights.each(function (elem) { + _.each(heights, function (elem) { totalHeight += elem.height; }); var ysum = totalHeight / 2; diff --git a/mindplot/src/main/javascript/model/IMindmap.js b/mindplot/src/main/javascript/model/IMindmap.js index 32259834..5e8393a5 100644 --- a/mindplot/src/main/javascript/model/IMindmap.js +++ b/mindplot/src/main/javascript/model/IMindmap.js @@ -135,7 +135,7 @@ mindplot.model.IMindmap = new Class({ // Then the rest of the branches ... var sbranchs = source.getBranches(); - sbranchs.each(function(snode) { + _.each(sbranchs, function(snode) { var tnode = target.createNode(snode.getType(), snode.getId()); snode.copyTo(tnode); target.addBranch(tnode); diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index e612655b..fe15f99c 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -213,7 +213,7 @@ mindplot.model.INodeModel = new Class({ var source = this; // Copy properties ... var keys = source.getPropertiesKeys(); - keys.each(function(key) { + _.each(keys, function(key) { var value = source.getProperty(key); target.putProperty(key, value); }); @@ -222,7 +222,7 @@ mindplot.model.INodeModel = new Class({ var children = this.getChildren(); var tmindmap = target.getMindmap(); - children.each(function(snode) { + _.each(function(children, snode) { var tnode = tmindmap.createNode(snode.getType(), snode.getId()); snode.copyTo(tnode); target.append(tnode); @@ -278,10 +278,10 @@ mindplot.model.INodeModel = new Class({ var children = this.getChildren(); if (children.length > 0) { result = result + ", children: {(size:" + children.length; - children.each(function(node) { + _.each(children, function(node) { result = result + "=> ("; var keys = node.getPropertiesKeys(); - keys.each(function(key) { + _.each(keys, function(key) { var value = node.getProperty(key); result = result + key + ":" + value + ","; }); diff --git a/mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js b/mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js index 8c296bb5..614c7e6b 100644 --- a/mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js +++ b/mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js @@ -32,7 +32,7 @@ mindplot.persistence.Beta2PelaMigrator = new Class({ // Beta does not set position on second level nodes ... var branches = mindmap.getBranches(); - branches.each(function (model) { + _.each(branches, function (model) { this._fixPosition(model); }.bind(this)); @@ -42,7 +42,7 @@ mindplot.persistence.Beta2PelaMigrator = new Class({ _fixPosition:function (parentModel) { var parentPos = parentModel.getPosition(); var isRight = parentPos.x > 0; - parentModel.getChildren().each(function (child) { + _.each(parentModel.getChildren(), function (child) { if (!child.getPosition()) { child.setPosition(parentPos.x + (50 * isRight ? 1 : -1), parentPos.y); } diff --git a/mindplot/src/main/javascript/util/FadeEffect.js b/mindplot/src/main/javascript/util/FadeEffect.js index b6018bd1..b17370aa 100644 --- a/mindplot/src/main/javascript/util/FadeEffect.js +++ b/mindplot/src/main/javascript/util/FadeEffect.js @@ -26,7 +26,7 @@ mindplot.util.FadeEffect = new Class({ this.addEvent('complete', function() { - this._element.each(function(elem) { + _.each(this._element, function(elem) { if(elem){ elem.setVisibility(isVisible); } @@ -40,7 +40,7 @@ mindplot.util.FadeEffect = new Class({ }, set: function(now) { - this._element.each(function(elem) { + _.each(this._element, function(elem) { if(elem){ elem.setOpacity(now); } diff --git a/mindplot/src/main/javascript/widget/ColorPalettePanel.js b/mindplot/src/main/javascript/widget/ColorPalettePanel.js index 1ebcf403..0ec25678 100644 --- a/mindplot/src/main/javascript/widget/ColorPalettePanel.js +++ b/mindplot/src/main/javascript/widget/ColorPalettePanel.js @@ -64,7 +64,7 @@ mindplot.widget.ColorPalettePanel = new Class({ // Register on toolbar elements ... var colorCells = content.find('div[class=palette-colorswatch]'); var model = this.getModel(); - colorCells.each(function (elem) { + _.each(colorCells, function (elem) { $(elem).on('click', function () { var color = elem.css("background-color"); model.setValue(color); @@ -80,7 +80,7 @@ mindplot.widget.ColorPalettePanel = new Class({ // Clear selected cell based on the color ... var tdCells = panelElem.find("td[class='palette-cell palette-cell-selected']"); - tdCells.each(function (elem) { + _.each(tdCells, function (elem) { elem.className = 'palette-cell'; }); @@ -88,7 +88,7 @@ mindplot.widget.ColorPalettePanel = new Class({ var colorCells = panelElem.find('div[class=palette-colorswatch]'); var model = this.getModel(); var modelValue = model.getValue(); - colorCells.each(function (elem) { + _.each(colorCells, function (elem) { var color = elem.css("background-color"); if (modelValue != null && modelValue[0] == 'r') { modelValue = modelValue.rgbToHex(); diff --git a/mindplot/src/main/javascript/widget/IMenu.js b/mindplot/src/main/javascript/widget/IMenu.js index 07c60863..685798db 100644 --- a/mindplot/src/main/javascript/widget/IMenu.js +++ b/mindplot/src/main/javascript/widget/IMenu.js @@ -35,7 +35,7 @@ mindplot.widget.IMenu = new Class({ }, clear:function () { - this._toolbarElems.each(function (item) { + _.each(this._toolbarElems, function (item) { item.hide(); }); }, diff --git a/mindplot/src/main/javascript/widget/ListToolbarPanel.js b/mindplot/src/main/javascript/widget/ListToolbarPanel.js index 107652db..13601c16 100644 --- a/mindplot/src/main/javascript/widget/ListToolbarPanel.js +++ b/mindplot/src/main/javascript/widget/ListToolbarPanel.js @@ -37,7 +37,7 @@ mindplot.widget.ListToolbarPanel = new Class({ var panelElem = this.getPanelElem(); var menuElems = panelElem.getElements('div'); var value = this.getModel().getValue(); - menuElems.each(function (elem) { + _.each(menuElems, function (elem) { var elemValue = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id; $assert(elemValue, "elemValue can not be null"); if (elemValue == value) diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index f8f09866..cceebe22 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -452,7 +452,7 @@ mindplot.widget.Menu = new Class({ _registerEvents: function (designer) { // Register on close events ... - this._toolbarElems.each(function (elem) { + _.each(this._toolbarElems, function (elem) { elem.addEvent('show', function () { this.clear() }.bind(this)); @@ -462,7 +462,7 @@ mindplot.widget.Menu = new Class({ var topics = designer.getModel().filterSelectedTopics(); var rels = designer.getModel().filterSelectedRelationships(); - this._toolbarElems.each(function (button) { + _.each(this._toolbarElems, function (button) { var isTopicAction = button.isTopicAction(); var isRelAction = button.isRelAction(); @@ -480,7 +480,7 @@ mindplot.widget.Menu = new Class({ var topics = designer.getModel().filterSelectedTopics(); var rels = designer.getModel().filterSelectedRelationships(); - this._toolbarElems.each(function (button) { + _.each(this._toolbarElems, function (button) { var isTopicAction = button.isTopicAction(); var isRelAction = button.isRelAction(); diff --git a/mindplot/src/test/javascript/static/test/FreeTestSuite.js b/mindplot/src/test/javascript/static/test/FreeTestSuite.js index 17101e13..0f123b86 100644 --- a/mindplot/src/test/javascript/static/test/FreeTestSuite.js +++ b/mindplot/src/test/javascript/static/test/FreeTestSuite.js @@ -443,7 +443,7 @@ mindplot.layout.FreeTestSuite = new Class({ } var treeSet = manager._treeSet; - treeSet._rootNodes.each(function(rootNode) { + _.each(treeSet._rootNodes, function(rootNode) { var heightById = rootNode.getSorter().computeChildrenIdByHeights(treeSet, rootNode); this._assertBranchCollision(treeSet, rootNode, heightById); }, this); @@ -453,7 +453,7 @@ mindplot.layout.FreeTestSuite = new Class({ var children = treeSet.getChildren(node); var childOfRootNode = treeSet._rootNodes.contains(node); - children.each(function(child) { + _.each(children, function(child) { var height = heightById[child.getId()]; var siblings = treeSet.getSiblings(child); if (childOfRootNode) { @@ -461,12 +461,12 @@ mindplot.layout.FreeTestSuite = new Class({ return (child.getOrder() % 2) == (sibling.getOrder() % 2); }) } - siblings.each(function(sibling) { + _.each(siblings, function(sibling) { this._branchesOverlap(child, sibling, heightById); }, this); }, this); - children.each(function(child) { + _.each(children, function(child) { this._assertBranchCollision(treeSet, child, heightById); }, this) }, diff --git a/wise-editor/src/main/webapp/html/editor.html b/wise-editor/src/main/webapp/html/editor.html index 6691af97..a4aab1a6 100644 --- a/wise-editor/src/main/webapp/html/editor.html +++ b/wise-editor/src/main/webapp/html/editor.html @@ -13,6 +13,7 @@ +