JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.2
[ckeditor.git] / _source / core / commanddefinition.js
index c451274..e8a172d 100644 (file)
@@ -11,15 +11,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 /**\r
  * (Virtual Class) Do not call this constructor. This class is not really part\r
- *             of the API. It just illustrates the features of command objects to be\r
- *             passed to the {@link CKEDITOR.editor.prototype.addCommand} function.\r
+ * of the API.\r
  * @name CKEDITOR.commandDefinition\r
- * @constructor\r
+ * @class Virtual class that illustrates the features of command objects to be\r
+ *             passed to the {@link CKEDITOR.editor.prototype.addCommand} function.\r
  * @example\r
  */\r
 \r
  /**\r
- * Executes the command.\r
+ * The function to be fired when the commend is executed.\r
  * @name CKEDITOR.commandDefinition.prototype.exec\r
  * @function\r
  * @param {CKEDITOR.editor} editor The editor within which run the command.\r
@@ -38,9 +38,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 /**\r
  * Whether the command need to be hooked into the redo/undo system.\r
- * @name  CKEDITOR.commandDefinition.canUndo\r
- * @type {Boolean} If not defined or 'true' both hook into undo system, set it\r
- *             to 'false' explicitly  keep it out.\r
+ * @name  CKEDITOR.commandDefinition.prototype.canUndo\r
+ * @type {Boolean}\r
+ * @default true\r
  * @field\r
  * @example\r
  * editorInstance.addCommand( 'alertName',\r
@@ -54,18 +54,23 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
  */\r
 \r
 /**\r
- * Whether the command is asynchronous, which means the 'afterCommandExec' event\r
- * will be fired by the command itself manually, and the 'exec' function return value\r
- * of this command is not to be returned.\r
- * @name  CKEDITOR.commandDefinition.async\r
- * @type {Boolean} If defined as 'true', the command is asynchronous.\r
+ * Whether the command is asynchronous, which means that the\r
+ * {@link CKEDITOR.editor#event:afterCommandExec} event will be fired by the\r
+ * command itself manually, and that the return value of this command is not to\r
+ * be returned by the {@link CKEDITOR.command#exec} function.\r
+ * @name  CKEDITOR.commandDefinition.prototype.async\r
+ * @default false\r
+ * @type {Boolean}\r
  * @example\r
- * editorInstance.addCommand( 'alertName',\r
+ * editorInstance.addCommand( 'loadOptions',\r
  * {\r
  *     exec : function( editor )\r
  *     {\r
  *         // Asynchronous operation below.\r
- *         CKEDITOR.ajax.loadXml( 'data.xml' );\r
+ *         CKEDITOR.ajax.loadXml( 'data.xml', function()\r
+ *             {\r
+ *                 editor.fire( 'afterCommandExec' );\r
+ *             ));\r
  *     },\r
  *     async : true    // The command need some time to complete after exec function returns.\r
  * });\r
@@ -73,13 +78,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 /**\r
  * Whether the command should give focus to the editor before execution.\r
- * @name  CKEDITOR.commandDefinition.editorFocus\r
+ * @name  CKEDITOR.commandDefinition.prototype.editorFocus\r
  * @type {Boolean}\r
+ * @default true\r
+ * @see CKEDITOR.command#editorFocus\r
  * @example\r
  * editorInstance.addCommand( 'maximize',\r
  * {\r
  *     exec : function( editor )\r
  *     {\r
+ *         // ...\r
  *     },\r
  *     editorFocus : false    // The command doesn't require focusing the editing document.\r
  * });\r
@@ -88,7 +96,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 /**\r
  * Whether the command state should be set to {@link CKEDITOR.TRISTATE_DISABLED} on startup.\r
- * @name  CKEDITOR.commandDefinition.startDisabled\r
+ * @name  CKEDITOR.commandDefinition.prototype.startDisabled\r
  * @type {Boolean}\r
  * @default false\r
  * @example\r
@@ -96,7 +104,26 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
  * {\r
  *     exec : function( editor )\r
  *     {\r
+ *         // ...\r
  *     },\r
  *     startDisabled : true    // Command is unavailable until selection is inside a link.\r
  * });\r
  */\r
+\r
+/**\r
+ * The editor modes within which the command can be executed. The execution\r
+ * will have no action if the current mode is not listed in this property.\r
+ * @name  CKEDITOR.commandDefinition.prototype.modes\r
+ * @type Object\r
+ * @default { wysiwyg : 1 }\r
+ * @see CKEDITOR.command#modes\r
+ * @example\r
+ * editorInstance.addCommand( 'link',\r
+ * {\r
+ *     exec : function( editor )\r
+ *     {\r
+ *         // ...\r
+ *     },\r
+ *     modes : { wysiwyg : 1 }    // Command is available in wysiwyg mode only.\r
+ * });\r
+ */\r