JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
992f969833aec9a10403d7a67ded5b82363a2492
[ckeditor.git] / _source / plugins / dialog / dialogDefinition.js
1 /*\r
2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license\r
4 */\r
5 \r
6 /**\r
7  * @fileOverview Defines the "virtual" dialog, dialog content and dialog button\r
8  * definition classes.\r
9  */\r
10 \r
11 /**\r
12  * This class is not really part of the API. It just illustrates the properties\r
13  * that developers can use to define and create dialogs.\r
14  * @name CKEDITOR.dialog.dialogDefinition\r
15  * @constructor\r
16  * @example\r
17  * // There is no constructor for this class, the user just has to define an\r
18  * // object with the appropriate properties.\r
19  *\r
20  * CKEDITOR.dialog.add( 'testOnly', function( editor )\r
21  *       {\r
22  *           return {\r
23  *               title : 'Test Dialog',\r
24  *               resizable : CKEDITOR.DIALOG_RESIZE_BOTH,\r
25  *               minWidth : 500,\r
26  *               minHeight : 400,\r
27  *               contents : [\r
28  *                   {\r
29  *                       id : 'tab1',\r
30  *                       label : 'First Tab',\r
31  *                       title : 'First Tab Title',\r
32  *                       accessKey : 'Q',\r
33  *                       elements : [\r
34  *                           {\r
35  *                               type : 'text',\r
36  *                               label : 'Test Text 1',\r
37  *                               id : 'testText1',\r
38  *                               'default' : 'hello world!'\r
39  *                           }\r
40  *                       ]\r
41  *                    }\r
42  *               ]\r
43  *           };\r
44  *       });\r
45  */\r
46 \r
47 /**\r
48  * The dialog title, displayed in the dialog's header. Required.\r
49  * @name CKEDITOR.dialog.dialogDefinition.prototype.title\r
50  * @field\r
51  * @type String\r
52  * @example\r
53  */\r
54 \r
55 /**\r
56  * How the dialog can be resized, must be one of the four contents defined below.\r
57  * <br /><br />\r
58  * <strong>CKEDITOR.DIALOG_RESIZE_NONE</strong><br />\r
59  * <strong>CKEDITOR.DIALOG_RESIZE_WIDTH</strong><br />\r
60  * <strong>CKEDITOR.DIALOG_RESIZE_HEIGHT</strong><br />\r
61  * <strong>CKEDITOR.DIALOG_RESIZE_BOTH</strong><br />\r
62  * @name CKEDITOR.dialog.dialogDefinition.prototype.resizable\r
63  * @field\r
64  * @type Number\r
65  * @default CKEDITOR.DIALOG_RESIZE_NONE\r
66  * @example\r
67  */\r
68 \r
69 /**\r
70  * The minimum width of the dialog, in pixels.\r
71  * @name CKEDITOR.dialog.dialogDefinition.prototype.minWidth\r
72  * @field\r
73  * @type Number\r
74  * @default 600\r
75  * @example\r
76  */\r
77 \r
78 /**\r
79  * The minimum height of the dialog, in pixels.\r
80  * @name CKEDITOR.dialog.dialogDefinition.prototype.minHeight\r
81  * @field\r
82  * @type Number\r
83  * @default 400\r
84  * @example\r
85  */\r
86 \r
87 /**\r
88  * The buttons in the dialog, defined as an array of\r
89  * {@link CKEDITOR.dialog.buttonDefinition} objects.\r
90  * @name CKEDITOR.dialog.dialogDefinition.prototype.buttons\r
91  * @field\r
92  * @type Array\r
93  * @default [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]\r
94  * @example\r
95  */\r
96 \r
97 /**\r
98  * The contents in the dialog, defined as an array of\r
99  * {@link CKEDITOR.dialog.contentDefinition} objects. Required.\r
100  * @name CKEDITOR.dialog.dialogDefinition.prototype.contents\r
101  * @field\r
102  * @type Array\r
103  * @example\r
104  */\r
105 \r
106 /**\r
107  * The function to execute when OK is pressed.\r
108  * @name CKEDITOR.dialog.dialogDefinition.prototype.onOk\r
109  * @field\r
110  * @type Function\r
111  * @example\r
112  */\r
113 \r
114 /**\r
115  * The function to execute when Cancel is pressed.\r
116  * @name CKEDITOR.dialog.dialogDefinition.prototype.onCancel\r
117  * @field\r
118  * @type Function\r
119  * @example\r
120  */\r
121 \r
122 /**\r
123  * The function to execute when the dialog is displayed for the first time.\r
124  * @name CKEDITOR.dialog.dialogDefinition.prototype.onLoad\r
125  * @field\r
126  * @type Function\r
127  * @example\r
128  */\r
129 \r
130 /**\r
131  * This class is not really part of the API. It just illustrates the properties\r
132  * that developers can use to define and create dialog content pages.\r
133  * @name CKEDITOR.dialog.contentDefinition\r
134  * @constructor\r
135  * @example\r
136  * // There is no constructor for this class, the user just has to define an\r
137  * // object with the appropriate properties.\r
138  */\r
139 \r
140 /**\r
141  * The id of the content page.\r
142  * @name CKEDITOR.dialog.contentDefinition.prototype.id\r
143  * @field\r
144  * @type String\r
145  * @example\r
146  */\r
147 \r
148 /**\r
149  * The tab label of the content page.\r
150  * @name CKEDITOR.dialog.contentDefinition.prototype.label\r
151  * @field\r
152  * @type String\r
153  * @example\r
154  */\r
155 \r
156 /**\r
157  * The popup message of the tab label.\r
158  * @name CKEDITOR.dialog.contentDefinition.prototype.title\r
159  * @field\r
160  * @type String\r
161  * @example\r
162  */\r
163 \r
164 /**\r
165  * The CTRL hotkey for switching to the tab.\r
166  * @name CKEDITOR.dialog.contentDefinition.prototype.accessKey\r
167  * @field\r
168  * @type String\r
169  * @example\r
170  * contentDefinition.accessKey = 'Q';   // Switch to this page when CTRL-Q is pressed.\r
171  */\r
172 \r
173 /**\r
174  * The UI elements contained in this content page, defined as an array of\r
175  * {@link CKEDITOR.dialog.uiElementDefinition} objects.\r
176  * @name CKEDITOR.dialog.contentDefinition.prototype.elements\r
177  * @field\r
178  * @type Array\r
179  * @example\r
180  */\r
181 \r
182 /**\r
183  * This class is not really part of the API. It just illustrates the properties\r
184  * that developers can use to define and create dialog buttons.\r
185  * @name CKEDITOR.dialog.buttonDefinition\r
186  * @constructor\r
187  * @example\r
188  * // There is no constructor for this class, the user just has to define an\r
189  * // object with the appropriate properties.\r
190  */\r
191 \r
192 /**\r
193  * The id of the dialog button. Required.\r
194  * @name CKEDITOR.dialog.buttonDefinition.prototype.id\r
195  * @type String\r
196  * @field\r
197  * @example\r
198  */\r
199 \r
200 /**\r
201  * The label of the dialog button. Required.\r
202  * @name CKEDITOR.dialog.buttonDefinition.prototype.label\r
203  * @type String\r
204  * @field\r
205  * @example\r
206  */\r
207 \r
208 /**\r
209  * The popup message of the dialog button.\r
210  * @name CKEDITOR.dialog.buttonDefinition.prototype.title\r
211  * @type String\r
212  * @field\r
213  * @example\r
214  */\r
215 \r
216 /**\r
217  * The CTRL hotkey for the button.\r
218  * @name CKEDITOR.dialog.buttonDefinition.prototype.accessKey\r
219  * @type String\r
220  * @field\r
221  * @example\r
222  * exitButton.accessKey = 'X';          // Button will be pressed when user presses CTRL-X\r
223  */\r
224 \r
225 /**\r
226  * Whether the button is disabled.\r
227  * @name CKEDITOR.dialog.buttonDefinition.prototype.disabled\r
228  * @type Boolean\r
229  * @field\r
230  * @default false\r
231  * @example\r
232  */\r
233 \r
234 /**\r
235  * The function to execute when the button is clicked.\r
236  * @name CKEDITOR.dialog.buttonDefinition.prototype.onClick\r
237  * @type Function\r
238  * @field\r
239  * @example\r
240  */\r
241 \r
242 /**\r
243  * This class is not really part of the API. It just illustrates the properties\r
244  * that developers can use to define and create dialog UI elements.\r
245  * @name CKEDITOR.dialog.uiElementDefinition\r
246  * @constructor\r
247  * @see CKEDITOR.ui.dialog.uiElement\r
248  * @example\r
249  * // There is no constructor for this class, the user just has to define an\r
250  * // object with the appropriate properties.\r
251  */\r
252 \r
253 /**\r
254  * The id of the UI element.\r
255  * @name CKEDITOR.dialog.uiElementDefinition.prototype.id\r
256  * @field\r
257  * @type String\r
258  * @example\r
259  */\r
260 \r
261 /**\r
262  * The type of the UI element. Required.\r
263  * @name CKEDITOR.dialog.uiElementDefinition.prototype.type\r
264  * @field\r
265  * @type String\r
266  * @example\r
267  */\r
268 \r
269 /**\r
270  * The popup label of the UI element.\r
271  * @name CKEDITOR.dialog.uiElementDefinition.prototype.title\r
272  * @field\r
273  * @type String\r
274  * @example\r
275  */\r
276 \r
277 /**\r
278  * CSS class names to append to the UI element.\r
279  * @name CKEDITOR.dialog.uiElementDefinition.prototype.className\r
280  * @field\r
281  * @type String\r
282  * @example\r
283  */\r
284 \r
285 /**\r
286  * Inline CSS classes to append to the UI element.\r
287  * @name CKEDITOR.dialog.uiElementDefinition.prototype.style\r
288  * @field\r
289  * @type String\r
290  * @example\r
291  */\r
292 \r
293 /**\r
294  * Function to execute the first time the UI element is displayed.\r
295  * @name CKEDITOR.dialog.uiElementDefinition.prototype.onLoad\r
296  * @field\r
297  * @type Function\r
298  * @example\r
299  */\r
300 \r
301 /**\r
302  * Function to execute whenever the UI element's parent dialog is displayed.\r
303  * @name CKEDITOR.dialog.uiElementDefinition.prototype.onShow\r
304  * @field\r
305  * @type Function\r
306  * @example\r
307  */\r
308 \r
309 /**\r
310  * Function to execute whenever the UI element's parent dialog is closed.\r
311  * @name CKEDITOR.dialog.uiElementDefinition.prototype.onHide\r
312  * @field\r
313  * @type Function\r
314  * @example\r
315  */\r