/sites/all/libraries/ckeditor/_source/plugins/dialog/dialogDefinition.js

https://github.com/Arsen/travelmozo · JavaScript · 1166 lines · 0 code · 107 blank · 1059 comment · 0 complexity · ea27e102037de9e7e8272178ddb9fea6 MD5 · raw file

  1. /*
  2. Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.html or http://ckeditor.com/license
  4. */
  5. /**
  6. * @fileOverview Defines the "virtual" dialog, dialog content and dialog button
  7. * definition classes.
  8. */
  9. /**
  10. * The definition of a dialog window.
  11. * <div class="notapi">
  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. * </div>
  15. * @name CKEDITOR.dialog.definition
  16. * @constructor
  17. * @example
  18. * // There is no constructor for this class, the user just has to define an
  19. * // object with the appropriate properties.
  20. *
  21. * CKEDITOR.dialog.add( 'testOnly', function( editor )
  22. * {
  23. * return {
  24. * title : 'Test Dialog',
  25. * resizable : CKEDITOR.DIALOG_RESIZE_BOTH,
  26. * minWidth : 500,
  27. * minHeight : 400,
  28. * contents : [
  29. * {
  30. * id : 'tab1',
  31. * label : 'First Tab',
  32. * title : 'First Tab Title',
  33. * accessKey : 'Q',
  34. * elements : [
  35. * {
  36. * type : 'text',
  37. * label : 'Test Text 1',
  38. * id : 'testText1',
  39. * 'default' : 'hello world!'
  40. * }
  41. * ]
  42. * }
  43. * ]
  44. * };
  45. * });
  46. */
  47. /**
  48. * The dialog title, displayed in the dialog's header. Required.
  49. * @name CKEDITOR.dialog.definition.prototype.title
  50. * @field
  51. * @type String
  52. * @example
  53. */
  54. /**
  55. * How the dialog can be resized, must be one of the four contents defined below.
  56. * <br /><br />
  57. * <strong>CKEDITOR.DIALOG_RESIZE_NONE</strong><br />
  58. * <strong>CKEDITOR.DIALOG_RESIZE_WIDTH</strong><br />
  59. * <strong>CKEDITOR.DIALOG_RESIZE_HEIGHT</strong><br />
  60. * <strong>CKEDITOR.DIALOG_RESIZE_BOTH</strong><br />
  61. * @name CKEDITOR.dialog.definition.prototype.resizable
  62. * @field
  63. * @type Number
  64. * @default CKEDITOR.DIALOG_RESIZE_NONE
  65. * @example
  66. */
  67. /**
  68. * The minimum width of the dialog, in pixels.
  69. * @name CKEDITOR.dialog.definition.prototype.minWidth
  70. * @field
  71. * @type Number
  72. * @default 600
  73. * @example
  74. */
  75. /**
  76. * The minimum height of the dialog, in pixels.
  77. * @name CKEDITOR.dialog.definition.prototype.minHeight
  78. * @field
  79. * @type Number
  80. * @default 400
  81. * @example
  82. */
  83. /**
  84. * The initial width of the dialog, in pixels.
  85. * @name CKEDITOR.dialog.definition.prototype.width
  86. * @field
  87. * @type Number
  88. * @default @CKEDITOR.dialog.definition.prototype.minWidth
  89. * @since 3.5.3
  90. * @example
  91. */
  92. /**
  93. * The initial height of the dialog, in pixels.
  94. * @name CKEDITOR.dialog.definition.prototype.height
  95. * @field
  96. * @type Number
  97. * @default @CKEDITOR.dialog.definition.prototype.minHeight
  98. * @since 3.5.3
  99. * @example
  100. */
  101. /**
  102. * The buttons in the dialog, defined as an array of
  103. * {@link CKEDITOR.dialog.definition.button} objects.
  104. * @name CKEDITOR.dialog.definition.prototype.buttons
  105. * @field
  106. * @type Array
  107. * @default [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
  108. * @example
  109. */
  110. /**
  111. * The contents in the dialog, defined as an array of
  112. * {@link CKEDITOR.dialog.definition.content} objects. Required.
  113. * @name CKEDITOR.dialog.definition.prototype.contents
  114. * @field
  115. * @type Array
  116. * @example
  117. */
  118. /**
  119. * The function to execute when OK is pressed.
  120. * @name CKEDITOR.dialog.definition.prototype.onOk
  121. * @field
  122. * @type Function
  123. * @example
  124. */
  125. /**
  126. * The function to execute when Cancel is pressed.
  127. * @name CKEDITOR.dialog.definition.prototype.onCancel
  128. * @field
  129. * @type Function
  130. * @example
  131. */
  132. /**
  133. * The function to execute when the dialog is displayed for the first time.
  134. * @name CKEDITOR.dialog.definition.prototype.onLoad
  135. * @field
  136. * @type Function
  137. * @example
  138. */
  139. /**
  140. * The function to execute when the dialog is loaded (executed every time the dialog is opened).
  141. * @name CKEDITOR.dialog.definition.prototype.onShow
  142. * @field
  143. * @type Function
  144. * @example
  145. */
  146. /**
  147. * <div class="notapi">This class is not really part of the API. It just illustrates the properties
  148. * that developers can use to define and create dialog content pages.</div>
  149. * @name CKEDITOR.dialog.definition.content
  150. * @constructor
  151. * @example
  152. * // There is no constructor for this class, the user just has to define an
  153. * // object with the appropriate properties.
  154. */
  155. /**
  156. * The id of the content page.
  157. * @name CKEDITOR.dialog.definition.content.prototype.id
  158. * @field
  159. * @type String
  160. * @example
  161. */
  162. /**
  163. * The tab label of the content page.
  164. * @name CKEDITOR.dialog.definition.content.prototype.label
  165. * @field
  166. * @type String
  167. * @example
  168. */
  169. /**
  170. * The popup message of the tab label.
  171. * @name CKEDITOR.dialog.definition.content.prototype.title
  172. * @field
  173. * @type String
  174. * @example
  175. */
  176. /**
  177. * The CTRL hotkey for switching to the tab.
  178. * @name CKEDITOR.dialog.definition.content.prototype.accessKey
  179. * @field
  180. * @type String
  181. * @example
  182. * contentDefinition.accessKey = 'Q'; // Switch to this page when CTRL-Q is pressed.
  183. */
  184. /**
  185. * The UI elements contained in this content page, defined as an array of
  186. * {@link CKEDITOR.dialog.definition.uiElement} objects.
  187. * @name CKEDITOR.dialog.definition.content.prototype.elements
  188. * @field
  189. * @type Array
  190. * @example
  191. */
  192. /**
  193. * The definition of user interface element (textarea, radio etc).
  194. * <div class="notapi">This class is not really part of the API. It just illustrates the properties
  195. * that developers can use to define and create dialog UI elements.</div>
  196. * @name CKEDITOR.dialog.definition.uiElement
  197. * @constructor
  198. * @see CKEDITOR.ui.dialog.uiElement
  199. * @example
  200. * // There is no constructor for this class, the user just has to define an
  201. * // object with the appropriate properties.
  202. */
  203. /**
  204. * The id of the UI element.
  205. * @name CKEDITOR.dialog.definition.uiElement.prototype.id
  206. * @field
  207. * @type String
  208. * @example
  209. */
  210. /**
  211. * The type of the UI element. Required.
  212. * @name CKEDITOR.dialog.definition.uiElement.prototype.type
  213. * @field
  214. * @type String
  215. * @example
  216. */
  217. /**
  218. * The popup label of the UI element.
  219. * @name CKEDITOR.dialog.definition.uiElement.prototype.title
  220. * @field
  221. * @type String
  222. * @example
  223. */
  224. /**
  225. * CSS class names to append to the UI element.
  226. * @name CKEDITOR.dialog.definition.uiElement.prototype.className
  227. * @field
  228. * @type String
  229. * @example
  230. */
  231. /**
  232. * Inline CSS classes to append to the UI element.
  233. * @name CKEDITOR.dialog.definition.uiElement.prototype.style
  234. * @field
  235. * @type String
  236. * @example
  237. */
  238. /**
  239. * Horizontal alignment (in container) of the UI element.
  240. * @name CKEDITOR.dialog.definition.uiElement.prototype.align
  241. * @field
  242. * @type String
  243. * @example
  244. */
  245. /**
  246. * Function to execute the first time the UI element is displayed.
  247. * @name CKEDITOR.dialog.definition.uiElement.prototype.onLoad
  248. * @field
  249. * @type Function
  250. * @example
  251. */
  252. /**
  253. * Function to execute whenever the UI element's parent dialog is displayed.
  254. * @name CKEDITOR.dialog.definition.uiElement.prototype.onShow
  255. * @field
  256. * @type Function
  257. * @example
  258. */
  259. /**
  260. * Function to execute whenever the UI element's parent dialog is closed.
  261. * @name CKEDITOR.dialog.definition.uiElement.prototype.onHide
  262. * @field
  263. * @type Function
  264. * @example
  265. */
  266. /**
  267. * Function to execute whenever the UI element's parent dialog's {@link CKEDITOR.dialog.definition.setupContent} method is executed.
  268. * It usually takes care of the respective UI element as a standalone element.
  269. * @name CKEDITOR.dialog.definition.uiElement.prototype.setup
  270. * @field
  271. * @type Function
  272. * @example
  273. */
  274. /**
  275. * Function to execute whenever the UI element's parent dialog's {@link CKEDITOR.dialog.definition.commitContent} method is executed.
  276. * It usually takes care of the respective UI element as a standalone element.
  277. * @name CKEDITOR.dialog.definition.uiElement.prototype.commit
  278. * @field
  279. * @type Function
  280. * @example
  281. */
  282. // ----- hbox -----
  283. /**
  284. * Horizontal layout box for dialog UI elements, auto-expends to available width of container.
  285. * <div class="notapi">
  286. * This class is not really part of the API. It just illustrates the properties
  287. * that developers can use to define and create horizontal layouts.
  288. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.hbox} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  289. * </div>
  290. * @name CKEDITOR.dialog.definition.hbox
  291. * @extends CKEDITOR.dialog.definition.uiElement
  292. * @constructor
  293. * @example
  294. * // There is no constructor for this class, the user just has to define an
  295. * // object with the appropriate properties.
  296. *
  297. * // Example:
  298. * {
  299. * <b>type : 'hbox',</b>
  300. * widths : [ '25%', '25%', '50%' ],
  301. * children :
  302. * [
  303. * {
  304. * type : 'text',
  305. * id : 'id1',
  306. * width : '40px',
  307. * },
  308. * {
  309. * type : 'text',
  310. * id : 'id2',
  311. * width : '40px',
  312. * },
  313. * {
  314. * type : 'text',
  315. * id : 'id3'
  316. * }
  317. * ]
  318. * }
  319. */
  320. /**
  321. * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this container.
  322. * @name CKEDITOR.dialog.definition.hbox.prototype.children
  323. * @field
  324. * @type Array
  325. * @example
  326. */
  327. /**
  328. * (Optional) The widths of child cells.
  329. * @name CKEDITOR.dialog.definition.hbox.prototype.widths
  330. * @field
  331. * @type Array
  332. * @example
  333. */
  334. /**
  335. * (Optional) The height of the layout.
  336. * @name CKEDITOR.dialog.definition.hbox.prototype.height
  337. * @field
  338. * @type Number
  339. * @example
  340. */
  341. /**
  342. * The CSS styles to apply to this element.
  343. * @name CKEDITOR.dialog.definition.hbox.prototype.styles
  344. * @field
  345. * @type String
  346. * @example
  347. */
  348. /**
  349. * (Optional) The padding width inside child cells. Example: 0, 1.
  350. * @name CKEDITOR.dialog.definition.hbox.prototype.padding
  351. * @field
  352. * @type Number
  353. * @example
  354. */
  355. /**
  356. * (Optional) The alignment of the whole layout. Example: center, top.
  357. * @name CKEDITOR.dialog.definition.hbox.prototype.align
  358. * @field
  359. * @type String
  360. * @example
  361. */
  362. // ----- vbox -----
  363. /**
  364. * Vertical layout box for dialog UI elements.
  365. * <div class="notapi">
  366. * This class is not really part of the API. It just illustrates the properties
  367. * that developers can use to define and create vertical layouts.
  368. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.vbox} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  369. * </div>
  370. * <style type="text/css">.details .detailList {display:none;} </style>
  371. * @name CKEDITOR.dialog.definition.vbox
  372. * @extends CKEDITOR.dialog.definition.uiElement
  373. * @constructor
  374. * @example
  375. * // There is no constructor for this class, the user just has to define an
  376. * // object with the appropriate properties.
  377. *
  378. * // Example:
  379. * {
  380. * <b>type : 'vbox',</b>
  381. * align : 'right',
  382. * width : '200px',
  383. * children :
  384. * [
  385. * {
  386. * type : 'text',
  387. * id : 'age',
  388. * label : 'Age'
  389. * },
  390. * {
  391. * type : 'text',
  392. * id : 'sex',
  393. * label : 'Sex'
  394. * },
  395. * {
  396. * type : 'text',
  397. * id : 'nationality',
  398. * label : 'Nationality'
  399. * }
  400. * ]
  401. * }
  402. */
  403. /**
  404. * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this container.
  405. * @name CKEDITOR.dialog.definition.vbox.prototype.children
  406. * @field
  407. * @type Array
  408. * @example
  409. */
  410. /**
  411. * (Optional) The width of the layout.
  412. * @name CKEDITOR.dialog.definition.vbox.prototype.width
  413. * @field
  414. * @type Array
  415. * @example
  416. */
  417. /**
  418. * (Optional) The heights of individual cells.
  419. * @name CKEDITOR.dialog.definition.vbox.prototype.heights
  420. * @field
  421. * @type Number
  422. * @example
  423. */
  424. /**
  425. * The CSS styles to apply to this element.
  426. * @name CKEDITOR.dialog.definition.vbox.prototype.styles
  427. * @field
  428. * @type String
  429. * @example
  430. */
  431. /**
  432. * (Optional) The padding width inside child cells. Example: 0, 1.
  433. * @name CKEDITOR.dialog.definition.vbox.prototype.padding
  434. * @field
  435. * @type Number
  436. * @example
  437. */
  438. /**
  439. * (Optional) The alignment of the whole layout. Example: center, top.
  440. * @name CKEDITOR.dialog.definition.vbox.prototype.align
  441. * @field
  442. * @type String
  443. * @example
  444. */
  445. /**
  446. * (Optional) Whether the layout should expand vertically to fill its container.
  447. * @name CKEDITOR.dialog.definition.vbox.prototype.expand
  448. * @field
  449. * @type Boolean
  450. * @example
  451. */
  452. // ----- labeled element ------
  453. /**
  454. * The definition of labeled user interface element (textarea, textInput etc).
  455. * <div class="notapi">This class is not really part of the API. It just illustrates the properties
  456. * that developers can use to define and create dialog UI elements.</div>
  457. * @name CKEDITOR.dialog.definition.labeledElement
  458. * @extends CKEDITOR.dialog.definition.uiElement
  459. * @constructor
  460. * @see CKEDITOR.ui.dialog.labeledElement
  461. * @example
  462. * // There is no constructor for this class, the user just has to define an
  463. * // object with the appropriate properties.
  464. */
  465. /**
  466. * The label of the UI element.
  467. * @name CKEDITOR.dialog.definition.labeledElement.prototype.label
  468. * @type String
  469. * @field
  470. * @example
  471. * {
  472. * type : 'text',
  473. * label : 'My Label '
  474. * }
  475. */
  476. /**
  477. * (Optional) Specify the layout of the label. Set to 'horizontal' for horizontal layout.
  478. * The default layout is vertical.
  479. * @name CKEDITOR.dialog.definition.labeledElement.prototype.labelLayout
  480. * @type String
  481. * @field
  482. * @example
  483. * {
  484. * type : 'text',
  485. * label : 'My Label ',
  486. * <strong> labelLayout : 'horizontal',</strong>
  487. * }
  488. */
  489. /**
  490. * (Optional) Applies only to horizontal layouts: a two elements array of lengths to specify the widths of the
  491. * label and the content element. See also {@link CKEDITOR.dialog.definition.labeledElement#labelLayout}.
  492. * @name CKEDITOR.dialog.definition.labeledElement.prototype.widths
  493. * @type Array
  494. * @field
  495. * @example
  496. * {
  497. * type : 'text',
  498. * label : 'My Label ',
  499. * labelLayout : 'horizontal',
  500. * <strong> widths : [100, 200],</strong>
  501. * }
  502. */
  503. /**
  504. * Specify the inline style of the uiElement label.
  505. * @name CKEDITOR.dialog.definition.labeledElement.prototype.labelStyle
  506. * @type String
  507. * @field
  508. * @example
  509. * {
  510. * type : 'text',
  511. * label : 'My Label ',
  512. * <strong> labelStyle : 'color: red',</strong>
  513. * }
  514. */
  515. /**
  516. * Specify the inline style of the input element.
  517. * @name CKEDITOR.dialog.definition.labeledElement.prototype.inputStyle
  518. * @type String
  519. * @since 3.6.1
  520. * @field
  521. * @example
  522. * {
  523. * type : 'text',
  524. * label : 'My Label ',
  525. * <strong> inputStyle : 'text-align:center',</strong>
  526. * }
  527. */
  528. /**
  529. * Specify the inline style of the input element container .
  530. * @name CKEDITOR.dialog.definition.labeledElement.prototype.controlStyle
  531. * @type String
  532. * @since 3.6.1
  533. * @field
  534. * @example
  535. * {
  536. * type : 'text',
  537. * label : 'My Label ',
  538. * <strong> controlStyle : 'width:3em',</strong>
  539. * }
  540. */
  541. // ----- button ------
  542. /**
  543. * The definition of a button.
  544. * <div class="notapi">
  545. * This class is not really part of the API. It just illustrates the properties
  546. * that developers can use to define and create buttons.
  547. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.button} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  548. * </div>
  549. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  550. * @name CKEDITOR.dialog.definition.button
  551. * @extends CKEDITOR.dialog.definition.uiElement
  552. * @constructor
  553. * @example
  554. * // There is no constructor for this class, the user just has to define an
  555. * // object with the appropriate properties.
  556. *
  557. * // Example:
  558. * {
  559. * <b>type : 'button',</b>
  560. * id : 'buttonId',
  561. * label : 'Click me',
  562. * title : 'My title',
  563. * onClick : function() {
  564. * // this = CKEDITOR.ui.dialog.button
  565. * alert( 'Clicked: ' + this.id );
  566. * }
  567. * }
  568. */
  569. /**
  570. * Whether the button is disabled.
  571. * @name CKEDITOR.dialog.definition.button.prototype.disabled
  572. * @type Boolean
  573. * @field
  574. * @example
  575. */
  576. /**
  577. * The label of the UI element.
  578. * @name CKEDITOR.dialog.definition.button.prototype.label
  579. * @type String
  580. * @field
  581. * @example
  582. */
  583. // ----- checkbox ------
  584. /**
  585. * The definition of a checkbox element.
  586. * <div class="notapi">
  587. * This class is not really part of the API. It just illustrates the properties
  588. * that developers can use to define and create groups of checkbox buttons.
  589. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.checkbox} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  590. * </div>
  591. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  592. * @name CKEDITOR.dialog.definition.checkbox
  593. * @extends CKEDITOR.dialog.definition.uiElement
  594. * @constructor
  595. * @example
  596. * // There is no constructor for this class, the user just has to define an
  597. * // object with the appropriate properties.
  598. *
  599. * // Example:
  600. * {
  601. * <b>type : 'checkbox',</b>
  602. * id : 'agree',
  603. * label : 'I agree',
  604. * 'default' : 'checked',
  605. * onClick : function() {
  606. * // this = CKEDITOR.ui.dialog.checkbox
  607. * alert( 'Checked: ' + this.getValue() );
  608. * }
  609. * }
  610. */
  611. /**
  612. * (Optional) The validation function.
  613. * @name CKEDITOR.dialog.definition.checkbox.prototype.validate
  614. * @field
  615. * @type Function
  616. * @example
  617. */
  618. /**
  619. * The label of the UI element.
  620. * @name CKEDITOR.dialog.definition.checkbox.prototype.label
  621. * @type String
  622. * @field
  623. * @example
  624. */
  625. /**
  626. * The default state.
  627. * @name CKEDITOR.dialog.definition.checkbox.prototype.default
  628. * @type String
  629. * @field
  630. * @default
  631. * '' (unchecked)
  632. * @example
  633. */
  634. // ----- file -----
  635. /**
  636. * The definition of a file upload input.
  637. * <div class="notapi">
  638. * This class is not really part of the API. It just illustrates the properties
  639. * that developers can use to define and create file upload elements.
  640. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.file} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  641. * </div>
  642. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  643. * @name CKEDITOR.dialog.definition.file
  644. * @extends CKEDITOR.dialog.definition.labeledElement
  645. * @constructor
  646. * @example
  647. * // There is no constructor for this class, the user just has to define an
  648. * // object with the appropriate properties.
  649. *
  650. * // Example:
  651. * {
  652. * <b>type : 'file'</b>,
  653. * id : 'upload',
  654. * label : 'Select file from your computer',
  655. * size : 38
  656. * },
  657. * {
  658. * type : 'fileButton',
  659. * id : 'fileId',
  660. * label : 'Upload file',
  661. * 'for' : [ 'tab1', 'upload' ]
  662. * filebrowser : {
  663. * onSelect : function( fileUrl, data ) {
  664. * alert( 'Successfully uploaded: ' + fileUrl );
  665. * }
  666. * }
  667. * }
  668. */
  669. /**
  670. * (Optional) The validation function.
  671. * @name CKEDITOR.dialog.definition.file.prototype.validate
  672. * @field
  673. * @type Function
  674. * @example
  675. */
  676. /**
  677. * (Optional) The action attribute of the form element associated with this file upload input.
  678. * If empty, CKEditor will use path to server connector for currently opened folder.
  679. * @name CKEDITOR.dialog.definition.file.prototype.action
  680. * @type String
  681. * @field
  682. * @example
  683. */
  684. /**
  685. * The size of the UI element.
  686. * @name CKEDITOR.dialog.definition.file.prototype.size
  687. * @type Number
  688. * @field
  689. * @example
  690. */
  691. // ----- fileButton -----
  692. /**
  693. * The definition of a button for submitting the file in a file upload input.
  694. * <div class="notapi">
  695. * This class is not really part of the API. It just illustrates the properties
  696. * that developers can use to define and create a button for submitting the file in a file upload input.
  697. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.fileButton} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  698. * </div>
  699. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  700. * @name CKEDITOR.dialog.definition.fileButton
  701. * @extends CKEDITOR.dialog.definition.uiElement
  702. * @constructor
  703. * @example
  704. * // There is no constructor for this class, the user just has to define an
  705. * // object with the appropriate properties.
  706. *
  707. * // Example:
  708. * {
  709. * type : 'file',
  710. * id : 'upload',
  711. * label : 'Select file from your computer',
  712. * size : 38
  713. * },
  714. * {
  715. * <b>type : 'fileButton'</b>,
  716. * id : 'fileId',
  717. * label : 'Upload file',
  718. * 'for' : [ 'tab1', 'upload' ]
  719. * filebrowser : {
  720. * onSelect : function( fileUrl, data ) {
  721. * alert( 'Successfully uploaded: ' + fileUrl );
  722. * }
  723. * }
  724. * }
  725. */
  726. /**
  727. * (Optional) The validation function.
  728. * @name CKEDITOR.dialog.definition.fileButton.prototype.validate
  729. * @field
  730. * @type Function
  731. * @example
  732. */
  733. /**
  734. * The label of the UI element.
  735. * @name CKEDITOR.dialog.definition.fileButton.prototype.label
  736. * @type String
  737. * @field
  738. * @example
  739. */
  740. /**
  741. * The instruction for CKEditor how to deal with file upload.
  742. * By default, the file and fileButton elements will not work "as expected" if this attribute is not set.
  743. * @name CKEDITOR.dialog.definition.fileButton.prototype.filebrowser
  744. * @type String|Object
  745. * @field
  746. * @example
  747. * // Update field with id 'txtUrl' in the 'tab1' tab when file is uploaded.
  748. * filebrowser : 'tab1:txtUrl'
  749. *
  750. * // Call custom onSelect function when file is successfully uploaded.
  751. * filebrowser : {
  752. * onSelect : function( fileUrl, data ) {
  753. * alert( 'Successfully uploaded: ' + fileUrl );
  754. * }
  755. * }
  756. */
  757. /**
  758. * An array that contains pageId and elementId of the file upload input element for which this button is created.
  759. * @name CKEDITOR.dialog.definition.fileButton.prototype.for
  760. * @type String
  761. * @field
  762. * @example
  763. * [ pageId, elementId ]
  764. */
  765. // ----- html -----
  766. /**
  767. * The definition of a raw HTML element.
  768. * <div class="notapi">
  769. * This class is not really part of the API. It just illustrates the properties
  770. * that developers can use to define and create elements made from raw HTML code.
  771. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.html} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  772. * </div>
  773. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.<br />
  774. * To access HTML elements use {@link CKEDITOR.dom.document#getById}
  775. * @name CKEDITOR.dialog.definition.html
  776. * @extends CKEDITOR.dialog.definition.uiElement
  777. * @constructor
  778. * @example
  779. * // There is no constructor for this class, the user just has to define an
  780. * // object with the appropriate properties.
  781. *
  782. * // Example 1:
  783. * {
  784. * <b>type : 'html',</b>
  785. * html : '&lt;h3>This is some sample HTML content.&lt;/h3>'
  786. * }
  787. * @example
  788. * // Example 2:
  789. * // Complete sample with document.getById() call when the "Ok" button is clicked.
  790. * var dialogDefinition =
  791. * {
  792. * title : 'Sample dialog',
  793. * minWidth : 300,
  794. * minHeight : 200,
  795. * onOk : function() {
  796. * // "this" is now a CKEDITOR.dialog object.
  797. * var document = this.getElement().getDocument();
  798. * // document = CKEDITOR.dom.document
  799. * var element = <b>document.getById( 'myDiv' );</b>
  800. * if ( element )
  801. * alert( element.getHtml() );
  802. * },
  803. * contents : [
  804. * {
  805. * id : 'tab1',
  806. * label : '',
  807. * title : '',
  808. * elements :
  809. * [
  810. * {
  811. * <b>type : 'html',</b>
  812. * html : '<b>&lt;div id="myDiv">Sample &lt;b>text&lt;/b>.&lt;/div></b>&lt;div id="otherId">Another div.&lt;/div>'
  813. * },
  814. * ]
  815. * }
  816. * ],
  817. * buttons : [ CKEDITOR.dialog.cancelButton, CKEDITOR.dialog.okButton ]
  818. * };
  819. */
  820. /**
  821. * (Required) HTML code of this element.
  822. * @name CKEDITOR.dialog.definition.html.prototype.html
  823. * @type String
  824. * @field
  825. * @example
  826. */
  827. // ----- radio ------
  828. /**
  829. * The definition of a radio group.
  830. * <div class="notapi">
  831. * This class is not really part of the API. It just illustrates the properties
  832. * that developers can use to define and create groups of radio buttons.
  833. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.radio} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  834. * </div>
  835. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  836. * @name CKEDITOR.dialog.definition.radio
  837. * @extends CKEDITOR.dialog.definition.labeledElement
  838. * @constructor
  839. * @example
  840. * // There is no constructor for this class, the user just has to define an
  841. * // object with the appropriate properties.
  842. *
  843. * // Example:
  844. * {
  845. * <b>type : 'radio',</b>
  846. * id : 'country',
  847. * label : 'Which country is bigger',
  848. * items : [ [ 'France', 'FR' ], [ 'Germany', 'DE' ] ] ,
  849. * style : 'color:green',
  850. * 'default' : 'DE',
  851. * onClick : function() {
  852. * // this = CKEDITOR.ui.dialog.radio
  853. * alert( 'Current value: ' + this.getValue() );
  854. * }
  855. * }
  856. */
  857. /**
  858. * The default value.
  859. * @name CKEDITOR.dialog.definition.radio.prototype.default
  860. * @type String
  861. * @field
  862. * @example
  863. */
  864. /**
  865. * (Optional) The validation function.
  866. * @name CKEDITOR.dialog.definition.radio.prototype.validate
  867. * @field
  868. * @type Function
  869. * @example
  870. */
  871. /**
  872. * An array of options. Each option is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value' is missing, then the value would be assumed to be the same as the description.
  873. * @name CKEDITOR.dialog.definition.radio.prototype.items
  874. * @field
  875. * @type Array
  876. * @example
  877. */
  878. // ----- selectElement ------
  879. /**
  880. * The definition of a select element.
  881. * <div class="notapi">
  882. * This class is not really part of the API. It just illustrates the properties
  883. * that developers can use to define and create select elements.
  884. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.select} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  885. * </div>
  886. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  887. * @name CKEDITOR.dialog.definition.select
  888. * @extends CKEDITOR.dialog.definition.labeledElement
  889. * @constructor
  890. * @example
  891. * // There is no constructor for this class, the user just has to define an
  892. * // object with the appropriate properties.
  893. *
  894. * // Example:
  895. * {
  896. * <b>type : 'select',</b>
  897. * id : 'sport',
  898. * label : 'Select your favourite sport',
  899. * items : [ [ 'Basketball' ], [ 'Baseball' ], [ 'Hockey' ], [ 'Football' ] ],
  900. * 'default' : 'Football',
  901. * onChange : function( api ) {
  902. * // this = CKEDITOR.ui.dialog.select
  903. * alert( 'Current value: ' + this.getValue() );
  904. * }
  905. * }
  906. */
  907. /**
  908. * The default value.
  909. * @name CKEDITOR.dialog.definition.select.prototype.default
  910. * @type String
  911. * @field
  912. * @example
  913. */
  914. /**
  915. * (Optional) The validation function.
  916. * @name CKEDITOR.dialog.definition.select.prototype.validate
  917. * @field
  918. * @type Function
  919. * @example
  920. */
  921. /**
  922. * An array of options. Each option is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value' is missing, then the value would be assumed to be the same as the description.
  923. * @name CKEDITOR.dialog.definition.select.prototype.items
  924. * @field
  925. * @type Array
  926. * @example
  927. */
  928. /**
  929. * (Optional) Set this to true if you'd like to have a multiple-choice select box.
  930. * @name CKEDITOR.dialog.definition.select.prototype.multiple
  931. * @type Boolean
  932. * @field
  933. * @example
  934. * @default false
  935. */
  936. /**
  937. * (Optional) The number of items to display in the select box.
  938. * @name CKEDITOR.dialog.definition.select.prototype.size
  939. * @type Number
  940. * @field
  941. * @example
  942. */
  943. // ----- textInput -----
  944. /**
  945. * The definition of a text field (single line).
  946. * <div class="notapi">
  947. * This class is not really part of the API. It just illustrates the properties
  948. * that developers can use to define and create text fields.
  949. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.textInput} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  950. * </div>
  951. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  952. * @name CKEDITOR.dialog.definition.textInput
  953. * @extends CKEDITOR.dialog.definition.labeledElement
  954. * @constructor
  955. * @example
  956. * // There is no constructor for this class, the user just has to define an
  957. * // object with the appropriate properties.
  958. *
  959. * {
  960. * <b>type : 'text',</b>
  961. * id : 'name',
  962. * label : 'Your name',
  963. * 'default' : '',
  964. * validate : function() {
  965. * if ( !this.getValue() )
  966. * {
  967. * api.openMsgDialog( '', 'Name cannot be empty.' );
  968. * return false;
  969. * }
  970. * }
  971. * }
  972. */
  973. /**
  974. * The default value.
  975. * @name CKEDITOR.dialog.definition.textInput.prototype.default
  976. * @type String
  977. * @field
  978. * @example
  979. */
  980. /**
  981. * (Optional) The maximum length.
  982. * @name CKEDITOR.dialog.definition.textInput.prototype.maxLength
  983. * @type Number
  984. * @field
  985. * @example
  986. */
  987. /**
  988. * (Optional) The size of the input field.
  989. * @name CKEDITOR.dialog.definition.textInput.prototype.size
  990. * @type Number
  991. * @field
  992. * @example
  993. */
  994. /**
  995. * (Optional) The validation function.
  996. * @name CKEDITOR.dialog.definition.textInput.prototype.validate
  997. * @field
  998. * @type Function
  999. * @example
  1000. */
  1001. // ----- textarea ------
  1002. /**
  1003. * The definition of a text field (multiple lines).
  1004. * <div class="notapi">
  1005. * This class is not really part of the API. It just illustrates the properties
  1006. * that developers can use to define and create textarea.
  1007. * <br /><br />Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.textarea} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
  1008. * </div>
  1009. * For a complete example of dialog definition, please check {@link CKEDITOR.dialog.add}.
  1010. * @name CKEDITOR.dialog.definition.textarea
  1011. * @extends CKEDITOR.dialog.definition.labeledElement
  1012. * @constructor
  1013. * @example
  1014. * // There is no constructor for this class, the user just has to define an
  1015. * // object with the appropriate properties.
  1016. *
  1017. * // Example:
  1018. * {
  1019. * <b>type : 'textarea',</b>
  1020. * id : 'message',
  1021. * label : 'Your comment',
  1022. * 'default' : '',
  1023. * validate : function() {
  1024. * if ( this.getValue().length < 5 )
  1025. * {
  1026. * api.openMsgDialog( 'The comment is too short.' );
  1027. * return false;
  1028. * }
  1029. * }
  1030. * }
  1031. */
  1032. /**
  1033. * The number of rows.
  1034. * @name CKEDITOR.dialog.definition.textarea.prototype.rows
  1035. * @type Number
  1036. * @field
  1037. * @example
  1038. */
  1039. /**
  1040. * The number of columns.
  1041. * @name CKEDITOR.dialog.definition.textarea.prototype.cols
  1042. * @type Number
  1043. * @field
  1044. * @example
  1045. */
  1046. /**
  1047. * (Optional) The validation function.
  1048. * @name CKEDITOR.dialog.definition.textarea.prototype.validate
  1049. * @field
  1050. * @type Function
  1051. * @example
  1052. */
  1053. /**
  1054. * The default value.
  1055. * @name CKEDITOR.dialog.definition.textarea.prototype.default
  1056. * @type String
  1057. * @field
  1058. * @example
  1059. */