Skip to content

Commit

Permalink
more jsdoc and typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
David committed Jun 29, 2011
1 parent 81796a0 commit 8d46aee
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 50 deletions.
6 changes: 5 additions & 1 deletion src/js/Action.js
Expand Up @@ -96,6 +96,7 @@ mindmaps.action.DeleteNodeAction.prototype = new mindmaps.action.Action();
/**
* Creates a new CreateAutoPositionedNodeAction.
*
* @constructor
* @param {mindmaps.Node} parent
* @param {mindmaps.MindMap} mindmap
* @returns {CreateNodeAction}
Expand Down Expand Up @@ -159,6 +160,8 @@ mindmaps.action.CreateNodeAction.prototype = new mindmaps.action.Action();
/**
* Creates a new ToggleNodeFoldAction.
*
*
* @constructor
* @param {mindmaps.Node} node
* @returns {Action}
*/
Expand All @@ -169,7 +172,6 @@ mindmaps.action.ToggleNodeFoldAction = function(node) {
return new mindmaps.action.CloseNodeAction(node);
}
};
mindmaps.action.ToggleNodeFoldAction.prototype = new mindmaps.action.Action();

/**
* Creates a new OpenNodeAction.
Expand Down Expand Up @@ -252,6 +254,7 @@ mindmaps.action.ChangeNodeFontSizeAction = function(node, step) {
mindmaps.action.ChangeNodeFontSizeAction.prototype = new mindmaps.action.Action();

/**
* @constructor
* @param {mindmaps.Node} node
* @returns {ChangeNodeFontSizeAction}
*/
Expand All @@ -260,6 +263,7 @@ mindmaps.action.DecreaseNodeFontSizeAction = function(node) {
};

/**
* @constructor
* @param {mindmaps.Node} node
* @returns {ChangeNodeFontSizeAction}
*/
Expand Down
22 changes: 8 additions & 14 deletions src/js/Command.js
Expand Up @@ -9,13 +9,14 @@ mindmaps.Command = function() {
this.shortcut = null;
/**
* The handler function.
*
* @private
* @function
*/
this.handler = null;
this.label = null;
this.description = null;

/**
* @private
*/
Expand All @@ -24,10 +25,9 @@ mindmaps.Command = function() {

/**
* Events that can be emitted by a command object.
*
* @static
* @namespace
*/
mindmaps.CommandEvent = {
mindmaps.Command.Event = {
HANDLER_REGISTERED : "HandlerRegisteredCommandEvent",
HANDLER_REMOVED : "HandlerRemovedCommandEvent",
ENABLED_CHANGED : "EnabledChangedCommandEvent"
Expand All @@ -52,20 +52,21 @@ mindmaps.Command.prototype = {

/**
* Registers a new handler.
*
* @param {Function} handler
*/
setHandler : function(handler) {
this.removeHandler();
this.handler = handler;
this.publish(mindmaps.CommandEvent.HANDLER_REGISTERED);
this.publish(mindmaps.Command.Event.HANDLER_REGISTERED);
},

/**
* Removes the current handler.
*/
removeHandler : function() {
this.handler = null;
this.publish(mindmaps.CommandEvent.HANDLER_REMOVED);
this.publish(mindmaps.Command.Event.HANDLER_REMOVED);
},

/**
Expand All @@ -75,7 +76,7 @@ mindmaps.Command.prototype = {
*/
setEnabled : function(enabled) {
this.enabled = enabled;
this.publish(mindmaps.CommandEvent.ENABLED_CHANGED, enabled);
this.publish(mindmaps.Command.Event.ENABLED_CHANGED, enabled);
}
};
/**
Expand Down Expand Up @@ -163,7 +164,6 @@ mindmaps.UndoCommand = function() {
};
mindmaps.UndoCommand.prototype = new mindmaps.Command();


/**
* Creates a new RedoCommand.
*
Expand Down Expand Up @@ -198,7 +198,6 @@ mindmaps.CopyNodeCommand = function() {
};
mindmaps.CopyNodeCommand.prototype = new mindmaps.Command();


/**
* Creates a new CutNodeCommand.
*
Expand All @@ -214,7 +213,6 @@ mindmaps.CutNodeCommand = function() {
};
mindmaps.CutNodeCommand.prototype = new mindmaps.Command();


/**
* Creates a new PasteNodeCommand.
*
Expand Down Expand Up @@ -249,7 +247,6 @@ mindmaps.NewDocumentCommand = function() {
};
mindmaps.NewDocumentCommand.prototype = new mindmaps.Command();


/**
* Creates a new OpenDocumentCommand.
*
Expand All @@ -265,7 +262,6 @@ mindmaps.OpenDocumentCommand = function() {
};
mindmaps.OpenDocumentCommand.prototype = new mindmaps.Command();


/**
* Creates a new SaveDocumentCommand.
*
Expand All @@ -281,7 +277,6 @@ mindmaps.SaveDocumentCommand = function() {
};
mindmaps.SaveDocumentCommand.prototype = new mindmaps.Command();


/**
* Creates a new CloseDocumentCommand.
*
Expand All @@ -297,7 +292,6 @@ mindmaps.CloseDocumentCommand = function() {
};
mindmaps.CloseDocumentCommand.prototype = new mindmaps.Command();


/**
* Creates a new HelpCommand.
*
Expand Down
2 changes: 1 addition & 1 deletion src/js/CommandRegistry.js
Expand Up @@ -2,7 +2,7 @@
* Creates a new CommandRegistry.
*
* @constructor
* @param {mindmaps.ShortCutController} [shortcutController]
* @param {mindmaps.ShortcutController} [shortcutController]
*/
mindmaps.CommandRegistry = function(shortcutController) {
this.commands = {};
Expand Down
47 changes: 31 additions & 16 deletions src/js/Event.js
Expand Up @@ -5,76 +5,90 @@
*/
mindmaps.Event = {
/**
* @param {mindmaps.Document} The document
* @event
* @param {mindmaps.Document} document
*/
DOCUMENT_OPENED : "DocumentOpenedEvent",

/**
* @param {mindmaps.Document} The document
* @event
* @param {mindmaps.Document} document
*/
DOCUMENT_SAVED : "DocumentSavedEvent",

/**
* @param {mindmaps.Document} The document
* @event
* @param {mindmaps.Document} document
*/
DOCUMENT_CLOSED : "DocumentClosedEvent",

/**
* @param {mindmaps.Node} The new selected node
* @param {mindmaps.Node} The old selected node (can be null)
* @event
* @param {mindmaps.Node} node
* @param {mindmaps.Node} oldSelectedNode
*/
NODE_SELECTED : "NodeSelectedEvent",

/**
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_DESELECTED : "NodeDeselectedEvent",

/**
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_MOVED : "NodeMovedEvent",

/**
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_TEXT_CAPTION_CHANGED : "NodeTextCaptionChangedEvent",

/**
* Some parameter of the node font attribute has changed.
*
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_FONT_CHANGED : "NodeFontChangedEvent",

/**
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_BRANCH_COLOR_CHANGED : "NodeBranchColorChangedEvent",

/**
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_CREATED : "NodeCreatedEvent",

/**
* @param {mindmaps.Node} The node
* @param {mindmaps.Node} The parent
* @event
* @param {mindmaps.Node} node
* @param {mindmaps.Node} parent
*/
NODE_DELETED : "NodeDeletedEvent",

/**
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_OPENED : "NodeOpenedEvent",

/**
* @param {mindmaps.Node} The node
* @event
* @param {mindmaps.Node} node
*/
NODE_CLOSED : "NodeClosedEvent",

/**
* @param {Number} the new zoom factor
* @event
* @param {Number} zoomFactor
*/
ZOOM_CHANGED : "ZoomChangedEvent"
};
Expand All @@ -83,6 +97,7 @@ mindmaps.Event = {
* Simple Event bus powered by EventEmitter.
*
* @constructor
* @augments EventEmitter
*
*/
mindmaps.EventBus = EventEmitter;
Expand Down

0 comments on commit 8d46aee

Please sign in to comment.