diff --git a/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js b/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js index 2b3a556d..e764cee4 100644 --- a/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js @@ -21,18 +21,18 @@ mindplot.commands.AddIconToTopicCommand = new Class({ initialize: function(topicId, iconType) { $assert($defined(topicId), 'topicId can not be null'); $assert(iconType, 'iconType can not be null'); - this._objectsIds = topicId; + this._topicsIds = topicId; this._iconType = iconType; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; var iconImg = topic.addIcon(this._iconType, commandContext._designer); this._iconModel = iconImg.getModel(); }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; topic.removeIcon(this._iconModel); } }); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js index 1d1314f4..ef259057 100644 --- a/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js @@ -20,13 +20,13 @@ mindplot.commands.ChangeLinkToTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId, url) { $assert(topicId, 'topicId can not be null'); - this._objectsIds = topicId; + this._topicsIds = topicId; this._url = url; this._id = mindplot.Command._nextUUID(); }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; if (topic.hasLink()) { var model = topic.getModel(); var link = model.getLinks()[0]; @@ -37,7 +37,7 @@ mindplot.commands.ChangeLinkToTopicCommand = new Class({ }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; if (this._oldtext) { topic.removeLink(); topic.addLink(this._oldUrl); diff --git a/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js index d556a529..6c3ad86c 100644 --- a/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js @@ -20,14 +20,14 @@ mindplot.commands.ChangeNoteToTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId, text) { $assert(topicId, 'topicId can not be null'); - this._objectsIds = topicId; + this._topicsIds = topicId; this._text = text; this._oldtext = null; this._id = mindplot.Command._nextUUID(); }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; if (topic.hasNote()) { var model = topic.getModel(); var notes = model.getNotes()[0]; @@ -38,7 +38,7 @@ mindplot.commands.ChangeNoteToTopicCommand = new Class({ }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; if (this._oldtext) { topic.removeNote(); topic.addNote(this._oldtext); diff --git a/mindplot/src/main/javascript/commands/DeleteCommand.js b/mindplot/src/main/javascript/commands/DeleteCommand.js index f6af98ec..650168f6 100644 --- a/mindplot/src/main/javascript/commands/DeleteCommand.js +++ b/mindplot/src/main/javascript/commands/DeleteCommand.js @@ -19,6 +19,8 @@ mindplot.commands.DeleteCommand = new Class({ Extends:mindplot.Command, initialize: function(topicIds, relIds) { + $assert($defined(topicIds), 'topicIds can not be null'); + this._relIds = relIds; this._topicIds = topicIds; this._deletedTopicModels = []; diff --git a/mindplot/src/main/javascript/commands/DragTopicCommand.js b/mindplot/src/main/javascript/commands/DragTopicCommand.js index e8aee711..95fde129 100644 --- a/mindplot/src/main/javascript/commands/DragTopicCommand.js +++ b/mindplot/src/main/javascript/commands/DragTopicCommand.js @@ -21,7 +21,7 @@ mindplot.commands.DragTopicCommand = new Class({ initialize: function(topicIds, position, order, parentTopic) { $assert(topicIds, "topicIds must be defined"); - this._objectsIds = topicIds; + this._topicsIds = topicIds; if ($defined(parentTopic)) this._parentId = parentTopic.getId(); @@ -32,7 +32,7 @@ mindplot.commands.DragTopicCommand = new Class({ execute: function(commandContext) { - var topic = commandContext.findTopics([this._objectsIds])[0]; + var topic = commandContext.findTopics([this._topicsIds])[0]; // Save old position ... var origParentTopic = topic.getOutgoingConnectedTopic(); diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js index 0dc6f896..b2552103 100644 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js @@ -23,14 +23,14 @@ mindplot.commands.GenericFunctionCommand = new Class({ $assert(topicsIds, "topicsIds must be defined"); this._value = value; - this._objectsIds = topicsIds; + this._topicsIds = topicsIds; this._commandFunc = commandFunc; this._oldValues = []; this._id = mindplot.Command._nextUUID(); }, execute: function(commandContext) { if (!this.applied) { - var topics = commandContext.findTopics(this._objectsIds); + var topics = commandContext.findTopics(this._topicsIds); topics.forEach(function(topic) { var oldValue = this._commandFunc(topic, this._value); this._oldValues.push(oldValue); @@ -43,7 +43,7 @@ mindplot.commands.GenericFunctionCommand = new Class({ }, undoExecute: function(commandContext) { if (this.applied) { - var topics = commandContext.findTopics(this._objectsIds); + var topics = commandContext.findTopics(this._topicsIds); topics.forEach(function(topic, index) { this._commandFunc(topic, this._oldValues[index]); diff --git a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js index 03cd05e5..32717760 100644 --- a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js @@ -19,19 +19,19 @@ mindplot.commands.RemoveIconFromTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicIds, iconModel) { - $assert(topicIds, 'topicIds can not be null'); + $assert($defined(topicIds), 'topicIds can not be null'); $assert(iconModel, 'iconModel can not be null'); - this._objectsIds = topicIds; + this._topicsIds = topicIds; this._iconModel = iconModel; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; topic.removeIcon(this._iconModel); }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; var iconType = this._iconModel.getIconType(); var iconImg = topic.addIcon(iconType, commandContext._designer); this._iconModel = iconImg.getModel(); diff --git a/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js index bb759485..3800c91b 100644 --- a/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js @@ -19,12 +19,12 @@ mindplot.commands.RemoveLinkFromTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId) { - $assert(topicId, 'topicId can not be null'); - this._objectsIds = topicId; + $assert($defined(topicId), 'topicId can not be null'); + this._topicsIds = topicId; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; var model = topic.getModel(); var links = model.getLinks()[0]; this._text = links.getUrl(); @@ -32,7 +32,7 @@ mindplot.commands.RemoveLinkFromTopicCommand = new Class({ }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; topic.addLink(this._url, commandContext._designer); } }); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js index 7c042845..230e191d 100644 --- a/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js @@ -19,18 +19,18 @@ mindplot.commands.RemoveNoteFromTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId) { - $assert(topicId, 'topicId can not be null'); - this._objectsIds = topicId; + $assert($defined(topicId), 'topicId can not be null'); + this._topicsIds = topicId; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; var model = topic.getModel(); var notes = model.getNotes()[0]; this._text = notes.getText(); topic.removeNote(); }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._objectsIds)[0]; + var topic = commandContext.findTopics(this._topicsIds)[0]; topic.addNote(this._text, commandContext._designer); } }); \ No newline at end of file