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