JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.0
[ckeditor.git] / _source / plugins / dialog / dialogDefinition.js
diff --git a/_source/plugins/dialog/dialogDefinition.js b/_source/plugins/dialog/dialogDefinition.js
new file mode 100644 (file)
index 0000000..992f969
--- /dev/null
@@ -0,0 +1,315 @@
+/*\r
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+For licensing, see LICENSE.html or http://ckeditor.com/license\r
+*/\r
+\r
+/**\r
+ * @fileOverview Defines the "virtual" dialog, dialog content and dialog button\r
+ * definition classes.\r
+ */\r
+\r
+/**\r
+ * This class is not really part of the API. It just illustrates the properties\r
+ * that developers can use to define and create dialogs.\r
+ * @name CKEDITOR.dialog.dialogDefinition\r
+ * @constructor\r
+ * @example\r
+ * // There is no constructor for this class, the user just has to define an\r
+ * // object with the appropriate properties.\r
+ *\r
+ * CKEDITOR.dialog.add( 'testOnly', function( editor )\r
+ *       {\r
+ *           return {\r
+ *               title : 'Test Dialog',\r
+ *               resizable : CKEDITOR.DIALOG_RESIZE_BOTH,\r
+ *               minWidth : 500,\r
+ *               minHeight : 400,\r
+ *               contents : [\r
+ *                   {\r
+ *                       id : 'tab1',\r
+ *                       label : 'First Tab',\r
+ *                       title : 'First Tab Title',\r
+ *                       accessKey : 'Q',\r
+ *                       elements : [\r
+ *                           {\r
+ *                               type : 'text',\r
+ *                               label : 'Test Text 1',\r
+ *                               id : 'testText1',\r
+ *                               'default' : 'hello world!'\r
+ *                           }\r
+ *                       ]\r
+ *                    }\r
+ *               ]\r
+ *           };\r
+ *       });\r
+ */\r
+\r
+/**\r
+ * The dialog title, displayed in the dialog's header. Required.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.title\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * How the dialog can be resized, must be one of the four contents defined below.\r
+ * <br /><br />\r
+ * <strong>CKEDITOR.DIALOG_RESIZE_NONE</strong><br />\r
+ * <strong>CKEDITOR.DIALOG_RESIZE_WIDTH</strong><br />\r
+ * <strong>CKEDITOR.DIALOG_RESIZE_HEIGHT</strong><br />\r
+ * <strong>CKEDITOR.DIALOG_RESIZE_BOTH</strong><br />\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.resizable\r
+ * @field\r
+ * @type Number\r
+ * @default CKEDITOR.DIALOG_RESIZE_NONE\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The minimum width of the dialog, in pixels.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.minWidth\r
+ * @field\r
+ * @type Number\r
+ * @default 600\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The minimum height of the dialog, in pixels.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.minHeight\r
+ * @field\r
+ * @type Number\r
+ * @default 400\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The buttons in the dialog, defined as an array of\r
+ * {@link CKEDITOR.dialog.buttonDefinition} objects.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.buttons\r
+ * @field\r
+ * @type Array\r
+ * @default [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The contents in the dialog, defined as an array of\r
+ * {@link CKEDITOR.dialog.contentDefinition} objects. Required.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.contents\r
+ * @field\r
+ * @type Array\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The function to execute when OK is pressed.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.onOk\r
+ * @field\r
+ * @type Function\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The function to execute when Cancel is pressed.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.onCancel\r
+ * @field\r
+ * @type Function\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The function to execute when the dialog is displayed for the first time.\r
+ * @name CKEDITOR.dialog.dialogDefinition.prototype.onLoad\r
+ * @field\r
+ * @type Function\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * This class is not really part of the API. It just illustrates the properties\r
+ * that developers can use to define and create dialog content pages.\r
+ * @name CKEDITOR.dialog.contentDefinition\r
+ * @constructor\r
+ * @example\r
+ * // There is no constructor for this class, the user just has to define an\r
+ * // object with the appropriate properties.\r
+ */\r
+\r
+/**\r
+ * The id of the content page.\r
+ * @name CKEDITOR.dialog.contentDefinition.prototype.id\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The tab label of the content page.\r
+ * @name CKEDITOR.dialog.contentDefinition.prototype.label\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The popup message of the tab label.\r
+ * @name CKEDITOR.dialog.contentDefinition.prototype.title\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The CTRL hotkey for switching to the tab.\r
+ * @name CKEDITOR.dialog.contentDefinition.prototype.accessKey\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ * contentDefinition.accessKey = 'Q';  // Switch to this page when CTRL-Q is pressed.\r
+ */\r
+\r
+/**\r
+ * The UI elements contained in this content page, defined as an array of\r
+ * {@link CKEDITOR.dialog.uiElementDefinition} objects.\r
+ * @name CKEDITOR.dialog.contentDefinition.prototype.elements\r
+ * @field\r
+ * @type Array\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * This class is not really part of the API. It just illustrates the properties\r
+ * that developers can use to define and create dialog buttons.\r
+ * @name CKEDITOR.dialog.buttonDefinition\r
+ * @constructor\r
+ * @example\r
+ * // There is no constructor for this class, the user just has to define an\r
+ * // object with the appropriate properties.\r
+ */\r
+\r
+/**\r
+ * The id of the dialog button. Required.\r
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.id\r
+ * @type String\r
+ * @field\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The label of the dialog button. Required.\r
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.label\r
+ * @type String\r
+ * @field\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The popup message of the dialog button.\r
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.title\r
+ * @type String\r
+ * @field\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The CTRL hotkey for the button.\r
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.accessKey\r
+ * @type String\r
+ * @field\r
+ * @example\r
+ * exitButton.accessKey = 'X';         // Button will be pressed when user presses CTRL-X\r
+ */\r
+\r
+/**\r
+ * Whether the button is disabled.\r
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.disabled\r
+ * @type Boolean\r
+ * @field\r
+ * @default false\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The function to execute when the button is clicked.\r
+ * @name CKEDITOR.dialog.buttonDefinition.prototype.onClick\r
+ * @type Function\r
+ * @field\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * This class is not really part of the API. It just illustrates the properties\r
+ * that developers can use to define and create dialog UI elements.\r
+ * @name CKEDITOR.dialog.uiElementDefinition\r
+ * @constructor\r
+ * @see CKEDITOR.ui.dialog.uiElement\r
+ * @example\r
+ * // There is no constructor for this class, the user just has to define an\r
+ * // object with the appropriate properties.\r
+ */\r
+\r
+/**\r
+ * The id of the UI element.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.id\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The type of the UI element. Required.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.type\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * The popup label of the UI element.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.title\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * CSS class names to append to the UI element.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.className\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * Inline CSS classes to append to the UI element.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.style\r
+ * @field\r
+ * @type String\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * Function to execute the first time the UI element is displayed.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.onLoad\r
+ * @field\r
+ * @type Function\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * Function to execute whenever the UI element's parent dialog is displayed.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.onShow\r
+ * @field\r
+ * @type Function\r
+ * @example\r
+ */\r
+\r
+/**\r
+ * Function to execute whenever the UI element's parent dialog is closed.\r
+ * @name CKEDITOR.dialog.uiElementDefinition.prototype.onHide\r
+ * @field\r
+ * @type Function\r
+ * @example\r
+ */\r