ckeditor 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (634) hide show
  1. data/CHANGELOG +15 -0
  2. data/README.textile +225 -0
  3. data/Rakefile +44 -0
  4. data/TODO +3 -0
  5. data/app/controllers/ckeditor_controller.rb +87 -0
  6. data/app/helpers/ckeditor_helper.rb +37 -0
  7. data/app/views/ckeditor/_file.html.erb +15 -0
  8. data/app/views/ckeditor/_image.html.erb +15 -0
  9. data/app/views/ckeditor/_swfupload.html.erb +51 -0
  10. data/app/views/ckeditor/files.html.erb +91 -0
  11. data/app/views/ckeditor/images.html.erb +91 -0
  12. data/app/views/layouts/ckeditor.html.erb +30 -0
  13. data/config/routes.rb +5 -0
  14. data/examples/migrations/attachment_fu/create_assets.rb +30 -0
  15. data/examples/migrations/paperclip/create_assets.rb +25 -0
  16. data/examples/models/attachment_fu/asset.rb +45 -0
  17. data/examples/models/attachment_fu/attachment_file.rb +46 -0
  18. data/examples/models/attachment_fu/picture.rb +46 -0
  19. data/examples/models/paperclip/asset.rb +65 -0
  20. data/examples/models/paperclip/attachment_file.rb +22 -0
  21. data/examples/models/paperclip/picture.rb +39 -0
  22. data/examples/s3/attachment_file.rb +23 -0
  23. data/examples/s3/picture.rb +41 -0
  24. data/lib/ckeditor.rb +57 -0
  25. data/lib/ckeditor/engine.rb +10 -0
  26. data/lib/ckeditor/file_storage.rb +178 -0
  27. data/lib/ckeditor/form_builder.rb +22 -0
  28. data/lib/ckeditor/utils.rb +15 -0
  29. data/lib/ckeditor/version.rb +11 -0
  30. data/lib/ckeditor/view_helper.rb +119 -0
  31. data/lib/generators/ckeditor_generator.rb +23 -0
  32. data/lib/generators/templates/ckeditor.rb +51 -0
  33. data/lib/generators/templates/ckeditor.yml +28 -0
  34. data/lib/generators/templates/ckeditor/CHANGES.html +642 -0
  35. data/lib/generators/templates/ckeditor/INSTALL.html +92 -0
  36. data/lib/generators/templates/ckeditor/LICENSE.html +1334 -0
  37. data/lib/generators/templates/ckeditor/_samples/ajax.html +87 -0
  38. data/lib/generators/templates/ckeditor/_samples/api.html +152 -0
  39. data/lib/generators/templates/ckeditor/_samples/api_dialog.html +181 -0
  40. data/lib/generators/templates/ckeditor/_samples/api_dialog/my_dialog.js +28 -0
  41. data/lib/generators/templates/ckeditor/_samples/assets/output_xhtml.css +204 -0
  42. data/lib/generators/templates/ckeditor/_samples/divreplace.html +137 -0
  43. data/lib/generators/templates/ckeditor/_samples/enterkey.html +88 -0
  44. data/lib/generators/templates/ckeditor/_samples/fullpage.html +62 -0
  45. data/lib/generators/templates/ckeditor/_samples/index.html +54 -0
  46. data/lib/generators/templates/ckeditor/_samples/jqueryadapter.html +73 -0
  47. data/lib/generators/templates/ckeditor/_samples/output_xhtml.html +159 -0
  48. data/lib/generators/templates/ckeditor/_samples/php/advanced.php +93 -0
  49. data/lib/generators/templates/ckeditor/_samples/php/events.php +130 -0
  50. data/lib/generators/templates/ckeditor/_samples/php/replace.php +63 -0
  51. data/lib/generators/templates/ckeditor/_samples/php/replaceall.php +68 -0
  52. data/lib/generators/templates/ckeditor/_samples/php/standalone.php +64 -0
  53. data/lib/generators/templates/ckeditor/_samples/replacebyclass.html +49 -0
  54. data/lib/generators/templates/ckeditor/_samples/replacebycode.html +80 -0
  55. data/lib/generators/templates/ckeditor/_samples/sample.css +81 -0
  56. data/lib/generators/templates/ckeditor/_samples/sample.js +65 -0
  57. data/lib/generators/templates/ckeditor/_samples/sample_posteddata.php +59 -0
  58. data/lib/generators/templates/ckeditor/_samples/sharedspaces.html +131 -0
  59. data/lib/generators/templates/ckeditor/_samples/skins.html +83 -0
  60. data/lib/generators/templates/ckeditor/_samples/ui_color.html +87 -0
  61. data/lib/generators/templates/ckeditor/_samples/ui_languages.html +103 -0
  62. data/lib/generators/templates/ckeditor/_source/adapters/jquery.js +297 -0
  63. data/lib/generators/templates/ckeditor/_source/core/_bootstrap.js +91 -0
  64. data/lib/generators/templates/ckeditor/_source/core/ajax.js +143 -0
  65. data/lib/generators/templates/ckeditor/_source/core/ckeditor.js +103 -0
  66. data/lib/generators/templates/ckeditor/_source/core/ckeditor_base.js +193 -0
  67. data/lib/generators/templates/ckeditor/_source/core/ckeditor_basic.js +242 -0
  68. data/lib/generators/templates/ckeditor/_source/core/command.js +73 -0
  69. data/lib/generators/templates/ckeditor/_source/core/commanddefinition.js +102 -0
  70. data/lib/generators/templates/ckeditor/_source/core/config.js +319 -0
  71. data/lib/generators/templates/ckeditor/_source/core/dataprocessor.js +66 -0
  72. data/lib/generators/templates/ckeditor/_source/core/dom.js +21 -0
  73. data/lib/generators/templates/ckeditor/_source/core/dom/comment.js +32 -0
  74. data/lib/generators/templates/ckeditor/_source/core/dom/document.js +224 -0
  75. data/lib/generators/templates/ckeditor/_source/core/dom/documentfragment.js +49 -0
  76. data/lib/generators/templates/ckeditor/_source/core/dom/domobject.js +246 -0
  77. data/lib/generators/templates/ckeditor/_source/core/dom/element.js +1441 -0
  78. data/lib/generators/templates/ckeditor/_source/core/dom/elementpath.js +104 -0
  79. data/lib/generators/templates/ckeditor/_source/core/dom/event.js +142 -0
  80. data/lib/generators/templates/ckeditor/_source/core/dom/node.js +662 -0
  81. data/lib/generators/templates/ckeditor/_source/core/dom/nodelist.js +23 -0
  82. data/lib/generators/templates/ckeditor/_source/core/dom/range.js +1836 -0
  83. data/lib/generators/templates/ckeditor/_source/core/dom/text.js +123 -0
  84. data/lib/generators/templates/ckeditor/_source/core/dom/walker.js +451 -0
  85. data/lib/generators/templates/ckeditor/_source/core/dom/window.js +96 -0
  86. data/lib/generators/templates/ckeditor/_source/core/dtd.js +233 -0
  87. data/lib/generators/templates/ckeditor/_source/core/editor.js +756 -0
  88. data/lib/generators/templates/ckeditor/_source/core/editor_basic.js +182 -0
  89. data/lib/generators/templates/ckeditor/_source/core/env.js +222 -0
  90. data/lib/generators/templates/ckeditor/_source/core/event.js +336 -0
  91. data/lib/generators/templates/ckeditor/_source/core/eventInfo.js +120 -0
  92. data/lib/generators/templates/ckeditor/_source/core/focusmanager.js +137 -0
  93. data/lib/generators/templates/ckeditor/_source/core/htmlparser.js +212 -0
  94. data/lib/generators/templates/ckeditor/_source/core/htmlparser/basicwriter.js +145 -0
  95. data/lib/generators/templates/ckeditor/_source/core/htmlparser/cdata.js +43 -0
  96. data/lib/generators/templates/ckeditor/_source/core/htmlparser/comment.js +60 -0
  97. data/lib/generators/templates/ckeditor/_source/core/htmlparser/element.js +240 -0
  98. data/lib/generators/templates/ckeditor/_source/core/htmlparser/filter.js +262 -0
  99. data/lib/generators/templates/ckeditor/_source/core/htmlparser/fragment.js +496 -0
  100. data/lib/generators/templates/ckeditor/_source/core/htmlparser/text.js +55 -0
  101. data/lib/generators/templates/ckeditor/_source/core/imagecacher.js +59 -0
  102. data/lib/generators/templates/ckeditor/_source/core/lang.js +152 -0
  103. data/lib/generators/templates/ckeditor/_source/core/loader.js +242 -0
  104. data/lib/generators/templates/ckeditor/_source/core/plugindefinition.js +66 -0
  105. data/lib/generators/templates/ckeditor/_source/core/plugins.js +85 -0
  106. data/lib/generators/templates/ckeditor/_source/core/resourcemanager.js +238 -0
  107. data/lib/generators/templates/ckeditor/_source/core/scriptloader.js +198 -0
  108. data/lib/generators/templates/ckeditor/_source/core/skins.js +204 -0
  109. data/lib/generators/templates/ckeditor/_source/core/themes.js +19 -0
  110. data/lib/generators/templates/ckeditor/_source/core/tools.js +698 -0
  111. data/lib/generators/templates/ckeditor/_source/core/ui.js +116 -0
  112. data/lib/generators/templates/ckeditor/_source/core/xml.js +165 -0
  113. data/lib/generators/templates/ckeditor/_source/lang/_languages.js +83 -0
  114. data/lib/generators/templates/ckeditor/_source/lang/_translationstatus.txt +60 -0
  115. data/lib/generators/templates/ckeditor/_source/lang/af.js +708 -0
  116. data/lib/generators/templates/ckeditor/_source/lang/ar.js +708 -0
  117. data/lib/generators/templates/ckeditor/_source/lang/bg.js +708 -0
  118. data/lib/generators/templates/ckeditor/_source/lang/bn.js +708 -0
  119. data/lib/generators/templates/ckeditor/_source/lang/bs.js +708 -0
  120. data/lib/generators/templates/ckeditor/_source/lang/ca.js +708 -0
  121. data/lib/generators/templates/ckeditor/_source/lang/cs.js +708 -0
  122. data/lib/generators/templates/ckeditor/_source/lang/cy.js +708 -0
  123. data/lib/generators/templates/ckeditor/_source/lang/da.js +708 -0
  124. data/lib/generators/templates/ckeditor/_source/lang/de.js +708 -0
  125. data/lib/generators/templates/ckeditor/_source/lang/el.js +708 -0
  126. data/lib/generators/templates/ckeditor/_source/lang/en-au.js +708 -0
  127. data/lib/generators/templates/ckeditor/_source/lang/en-ca.js +708 -0
  128. data/lib/generators/templates/ckeditor/_source/lang/en-gb.js +708 -0
  129. data/lib/generators/templates/ckeditor/_source/lang/en.js +708 -0
  130. data/lib/generators/templates/ckeditor/_source/lang/eo.js +708 -0
  131. data/lib/generators/templates/ckeditor/_source/lang/es.js +708 -0
  132. data/lib/generators/templates/ckeditor/_source/lang/et.js +708 -0
  133. data/lib/generators/templates/ckeditor/_source/lang/eu.js +708 -0
  134. data/lib/generators/templates/ckeditor/_source/lang/fa.js +708 -0
  135. data/lib/generators/templates/ckeditor/_source/lang/fi.js +708 -0
  136. data/lib/generators/templates/ckeditor/_source/lang/fo.js +708 -0
  137. data/lib/generators/templates/ckeditor/_source/lang/fr-ca.js +708 -0
  138. data/lib/generators/templates/ckeditor/_source/lang/fr.js +708 -0
  139. data/lib/generators/templates/ckeditor/_source/lang/gl.js +708 -0
  140. data/lib/generators/templates/ckeditor/_source/lang/gu.js +708 -0
  141. data/lib/generators/templates/ckeditor/_source/lang/he.js +708 -0
  142. data/lib/generators/templates/ckeditor/_source/lang/hi.js +708 -0
  143. data/lib/generators/templates/ckeditor/_source/lang/hr.js +708 -0
  144. data/lib/generators/templates/ckeditor/_source/lang/hu.js +708 -0
  145. data/lib/generators/templates/ckeditor/_source/lang/is.js +708 -0
  146. data/lib/generators/templates/ckeditor/_source/lang/it.js +708 -0
  147. data/lib/generators/templates/ckeditor/_source/lang/ja.js +708 -0
  148. data/lib/generators/templates/ckeditor/_source/lang/km.js +708 -0
  149. data/lib/generators/templates/ckeditor/_source/lang/ko.js +708 -0
  150. data/lib/generators/templates/ckeditor/_source/lang/lt.js +708 -0
  151. data/lib/generators/templates/ckeditor/_source/lang/lv.js +708 -0
  152. data/lib/generators/templates/ckeditor/_source/lang/mn.js +708 -0
  153. data/lib/generators/templates/ckeditor/_source/lang/ms.js +708 -0
  154. data/lib/generators/templates/ckeditor/_source/lang/nb.js +708 -0
  155. data/lib/generators/templates/ckeditor/_source/lang/nl.js +708 -0
  156. data/lib/generators/templates/ckeditor/_source/lang/no.js +708 -0
  157. data/lib/generators/templates/ckeditor/_source/lang/pl.js +708 -0
  158. data/lib/generators/templates/ckeditor/_source/lang/pt-br.js +708 -0
  159. data/lib/generators/templates/ckeditor/_source/lang/pt.js +708 -0
  160. data/lib/generators/templates/ckeditor/_source/lang/ro.js +708 -0
  161. data/lib/generators/templates/ckeditor/_source/lang/ru.js +708 -0
  162. data/lib/generators/templates/ckeditor/_source/lang/sk.js +708 -0
  163. data/lib/generators/templates/ckeditor/_source/lang/sl.js +708 -0
  164. data/lib/generators/templates/ckeditor/_source/lang/sr-latn.js +708 -0
  165. data/lib/generators/templates/ckeditor/_source/lang/sr.js +708 -0
  166. data/lib/generators/templates/ckeditor/_source/lang/sv.js +708 -0
  167. data/lib/generators/templates/ckeditor/_source/lang/th.js +708 -0
  168. data/lib/generators/templates/ckeditor/_source/lang/tr.js +708 -0
  169. data/lib/generators/templates/ckeditor/_source/lang/uk.js +708 -0
  170. data/lib/generators/templates/ckeditor/_source/lang/vi.js +708 -0
  171. data/lib/generators/templates/ckeditor/_source/lang/zh-cn.js +708 -0
  172. data/lib/generators/templates/ckeditor/_source/lang/zh.js +708 -0
  173. data/lib/generators/templates/ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js +211 -0
  174. data/lib/generators/templates/ckeditor/_source/plugins/a11yhelp/lang/en.js +108 -0
  175. data/lib/generators/templates/ckeditor/_source/plugins/a11yhelp/plugin.js +46 -0
  176. data/lib/generators/templates/ckeditor/_source/plugins/about/dialogs/about.js +73 -0
  177. data/lib/generators/templates/ckeditor/_source/plugins/about/dialogs/logo_ckeditor.png +0 -0
  178. data/lib/generators/templates/ckeditor/_source/plugins/about/plugin.js +23 -0
  179. data/lib/generators/templates/ckeditor/_source/plugins/attachment/dialogs/attachment.js +384 -0
  180. data/lib/generators/templates/ckeditor/_source/plugins/attachment/images/attachment.png +0 -0
  181. data/lib/generators/templates/ckeditor/_source/plugins/attachment/lang/en.js +10 -0
  182. data/lib/generators/templates/ckeditor/_source/plugins/attachment/lang/ru.js +10 -0
  183. data/lib/generators/templates/ckeditor/_source/plugins/attachment/lang/uk.js +10 -0
  184. data/lib/generators/templates/ckeditor/_source/plugins/attachment/plugin.js +44 -0
  185. data/lib/generators/templates/ckeditor/_source/plugins/basicstyles/plugin.js +101 -0
  186. data/lib/generators/templates/ckeditor/_source/plugins/blockquote/plugin.js +301 -0
  187. data/lib/generators/templates/ckeditor/_source/plugins/button/plugin.js +272 -0
  188. data/lib/generators/templates/ckeditor/_source/plugins/clipboard/dialogs/paste.js +186 -0
  189. data/lib/generators/templates/ckeditor/_source/plugins/clipboard/plugin.js +379 -0
  190. data/lib/generators/templates/ckeditor/_source/plugins/colorbutton/plugin.js +247 -0
  191. data/lib/generators/templates/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js +191 -0
  192. data/lib/generators/templates/ckeditor/_source/plugins/colordialog/plugin.js +13 -0
  193. data/lib/generators/templates/ckeditor/_source/plugins/contextmenu/plugin.js +274 -0
  194. data/lib/generators/templates/ckeditor/_source/plugins/dialog/dialogDefinition.js +315 -0
  195. data/lib/generators/templates/ckeditor/_source/plugins/dialog/plugin.js +2913 -0
  196. data/lib/generators/templates/ckeditor/_source/plugins/dialogui/plugin.js +1408 -0
  197. data/lib/generators/templates/ckeditor/_source/plugins/div/dialogs/div.js +529 -0
  198. data/lib/generators/templates/ckeditor/_source/plugins/div/plugin.js +121 -0
  199. data/lib/generators/templates/ckeditor/_source/plugins/domiterator/plugin.js +355 -0
  200. data/lib/generators/templates/ckeditor/_source/plugins/editingblock/plugin.js +224 -0
  201. data/lib/generators/templates/ckeditor/_source/plugins/elementspath/plugin.js +203 -0
  202. data/lib/generators/templates/ckeditor/_source/plugins/embed/dialogs/embed.js +65 -0
  203. data/lib/generators/templates/ckeditor/_source/plugins/embed/images/embed.png +0 -0
  204. data/lib/generators/templates/ckeditor/_source/plugins/embed/lang/en.js +9 -0
  205. data/lib/generators/templates/ckeditor/_source/plugins/embed/lang/ru.js +9 -0
  206. data/lib/generators/templates/ckeditor/_source/plugins/embed/lang/uk.js +9 -0
  207. data/lib/generators/templates/ckeditor/_source/plugins/embed/plugin.js +43 -0
  208. data/lib/generators/templates/ckeditor/_source/plugins/enterkey/plugin.js +339 -0
  209. data/lib/generators/templates/ckeditor/_source/plugins/entities/plugin.js +200 -0
  210. data/lib/generators/templates/ckeditor/_source/plugins/fakeobjects/plugin.js +120 -0
  211. data/lib/generators/templates/ckeditor/_source/plugins/filebrowser/plugin.js +479 -0
  212. data/lib/generators/templates/ckeditor/_source/plugins/find/dialogs/find.js +867 -0
  213. data/lib/generators/templates/ckeditor/_source/plugins/find/plugin.js +46 -0
  214. data/lib/generators/templates/ckeditor/_source/plugins/flash/dialogs/flash.js +698 -0
  215. data/lib/generators/templates/ckeditor/_source/plugins/flash/images/placeholder.png +0 -0
  216. data/lib/generators/templates/ckeditor/_source/plugins/flash/plugin.js +165 -0
  217. data/lib/generators/templates/ckeditor/_source/plugins/floatpanel/plugin.js +376 -0
  218. data/lib/generators/templates/ckeditor/_source/plugins/font/plugin.js +234 -0
  219. data/lib/generators/templates/ckeditor/_source/plugins/format/plugin.js +193 -0
  220. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/button.js +135 -0
  221. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/checkbox.js +155 -0
  222. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/form.js +177 -0
  223. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/hiddenfield.js +91 -0
  224. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/radio.js +135 -0
  225. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/select.js +556 -0
  226. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/textarea.js +114 -0
  227. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/textfield.js +193 -0
  228. data/lib/generators/templates/ckeditor/_source/plugins/forms/plugin.js +217 -0
  229. data/lib/generators/templates/ckeditor/_source/plugins/horizontalrule/plugin.js +36 -0
  230. data/lib/generators/templates/ckeditor/_source/plugins/htmldataprocessor/plugin.js +463 -0
  231. data/lib/generators/templates/ckeditor/_source/plugins/htmlwriter/plugin.js +314 -0
  232. data/lib/generators/templates/ckeditor/_source/plugins/iframedialog/plugin.js +136 -0
  233. data/lib/generators/templates/ckeditor/_source/plugins/image/dialogs/image.js +1380 -0
  234. data/lib/generators/templates/ckeditor/_source/plugins/image/plugin.js +73 -0
  235. data/lib/generators/templates/ckeditor/_source/plugins/indent/plugin.js +381 -0
  236. data/lib/generators/templates/ckeditor/_source/plugins/justify/plugin.js +168 -0
  237. data/lib/generators/templates/ckeditor/_source/plugins/keystrokes/plugin.js +229 -0
  238. data/lib/generators/templates/ckeditor/_source/plugins/link/dialogs/anchor.js +99 -0
  239. data/lib/generators/templates/ckeditor/_source/plugins/link/dialogs/link.js +1413 -0
  240. data/lib/generators/templates/ckeditor/_source/plugins/link/images/anchor.gif +0 -0
  241. data/lib/generators/templates/ckeditor/_source/plugins/link/plugin.js +219 -0
  242. data/lib/generators/templates/ckeditor/_source/plugins/list/plugin.js +645 -0
  243. data/lib/generators/templates/ckeditor/_source/plugins/listblock/plugin.js +257 -0
  244. data/lib/generators/templates/ckeditor/_source/plugins/maximize/plugin.js +305 -0
  245. data/lib/generators/templates/ckeditor/_source/plugins/menu/plugin.js +406 -0
  246. data/lib/generators/templates/ckeditor/_source/plugins/menubutton/plugin.js +94 -0
  247. data/lib/generators/templates/ckeditor/_source/plugins/newpage/plugin.js +54 -0
  248. data/lib/generators/templates/ckeditor/_source/plugins/pagebreak/images/pagebreak.gif +0 -0
  249. data/lib/generators/templates/ckeditor/_source/plugins/pagebreak/plugin.js +103 -0
  250. data/lib/generators/templates/ckeditor/_source/plugins/panel/plugin.js +397 -0
  251. data/lib/generators/templates/ckeditor/_source/plugins/panelbutton/plugin.js +147 -0
  252. data/lib/generators/templates/ckeditor/_source/plugins/pastefromword/filter/default.js +1179 -0
  253. data/lib/generators/templates/ckeditor/_source/plugins/pastefromword/plugin.js +120 -0
  254. data/lib/generators/templates/ckeditor/_source/plugins/pastetext/dialogs/pastetext.js +77 -0
  255. data/lib/generators/templates/ckeditor/_source/plugins/pastetext/plugin.js +162 -0
  256. data/lib/generators/templates/ckeditor/_source/plugins/popup/plugin.js +62 -0
  257. data/lib/generators/templates/ckeditor/_source/plugins/preview/plugin.js +108 -0
  258. data/lib/generators/templates/ckeditor/_source/plugins/print/plugin.js +41 -0
  259. data/lib/generators/templates/ckeditor/_source/plugins/removeformat/plugin.js +132 -0
  260. data/lib/generators/templates/ckeditor/_source/plugins/resize/plugin.js +117 -0
  261. data/lib/generators/templates/ckeditor/_source/plugins/richcombo/plugin.js +370 -0
  262. data/lib/generators/templates/ckeditor/_source/plugins/save/plugin.js +55 -0
  263. data/lib/generators/templates/ckeditor/_source/plugins/scayt/dialogs/options.js +533 -0
  264. data/lib/generators/templates/ckeditor/_source/plugins/scayt/dialogs/toolbar.css +71 -0
  265. data/lib/generators/templates/ckeditor/_source/plugins/scayt/plugin.js +767 -0
  266. data/lib/generators/templates/ckeditor/_source/plugins/selection/plugin.js +1145 -0
  267. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_address.png +0 -0
  268. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_blockquote.png +0 -0
  269. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_div.png +0 -0
  270. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h1.png +0 -0
  271. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h2.png +0 -0
  272. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h3.png +0 -0
  273. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h4.png +0 -0
  274. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h5.png +0 -0
  275. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h6.png +0 -0
  276. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_p.png +0 -0
  277. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_pre.png +0 -0
  278. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/plugin.js +154 -0
  279. data/lib/generators/templates/ckeditor/_source/plugins/showborders/plugin.js +167 -0
  280. data/lib/generators/templates/ckeditor/_source/plugins/smiley/dialogs/smiley.js +216 -0
  281. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/angel_smile.gif +0 -0
  282. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/angry_smile.gif +0 -0
  283. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/broken_heart.gif +0 -0
  284. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/confused_smile.gif +0 -0
  285. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/cry_smile.gif +0 -0
  286. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/devil_smile.gif +0 -0
  287. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/embaressed_smile.gif +0 -0
  288. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/envelope.gif +0 -0
  289. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/heart.gif +0 -0
  290. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/kiss.gif +0 -0
  291. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/lightbulb.gif +0 -0
  292. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/omg_smile.gif +0 -0
  293. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/regular_smile.gif +0 -0
  294. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/sad_smile.gif +0 -0
  295. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/shades_smile.gif +0 -0
  296. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/teeth_smile.gif +0 -0
  297. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/thumbs_down.gif +0 -0
  298. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/thumbs_up.gif +0 -0
  299. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/tounge_smile.gif +0 -0
  300. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  301. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/wink_smile.gif +0 -0
  302. data/lib/generators/templates/ckeditor/_source/plugins/smiley/plugin.js +84 -0
  303. data/lib/generators/templates/ckeditor/_source/plugins/sourcearea/plugin.js +206 -0
  304. data/lib/generators/templates/ckeditor/_source/plugins/specialchar/dialogs/specialchar.js +403 -0
  305. data/lib/generators/templates/ckeditor/_source/plugins/specialchar/plugin.js +29 -0
  306. data/lib/generators/templates/ckeditor/_source/plugins/styles/plugin.js +1442 -0
  307. data/lib/generators/templates/ckeditor/_source/plugins/styles/styles/default.js +88 -0
  308. data/lib/generators/templates/ckeditor/_source/plugins/stylescombo/plugin.js +204 -0
  309. data/lib/generators/templates/ckeditor/_source/plugins/tab/plugin.js +261 -0
  310. data/lib/generators/templates/ckeditor/_source/plugins/table/dialogs/table.js +591 -0
  311. data/lib/generators/templates/ckeditor/_source/plugins/table/plugin.js +70 -0
  312. data/lib/generators/templates/ckeditor/_source/plugins/tabletools/dialogs/tableCell.js +528 -0
  313. data/lib/generators/templates/ckeditor/_source/plugins/tabletools/plugin.js +1068 -0
  314. data/lib/generators/templates/ckeditor/_source/plugins/templates/dialogs/templates.js +230 -0
  315. data/lib/generators/templates/ckeditor/_source/plugins/templates/plugin.js +100 -0
  316. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/default.js +94 -0
  317. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/images/template1.gif +0 -0
  318. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/images/template2.gif +0 -0
  319. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/images/template3.gif +0 -0
  320. data/lib/generators/templates/ckeditor/_source/plugins/toolbar/plugin.js +479 -0
  321. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/dialogs/uicolor.js +204 -0
  322. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/lang/en.js +15 -0
  323. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/plugin.js +37 -0
  324. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/uicolor.gif +0 -0
  325. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  326. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  327. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  328. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  329. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/yui.css +15 -0
  330. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/yui.js +71 -0
  331. data/lib/generators/templates/ckeditor/_source/plugins/undo/plugin.js +519 -0
  332. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/ciframe.html +49 -0
  333. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  334. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/wsc.css +83 -0
  335. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/wsc.js +176 -0
  336. data/lib/generators/templates/ckeditor/_source/plugins/wsc/plugin.js +33 -0
  337. data/lib/generators/templates/ckeditor/_source/plugins/wysiwygarea/plugin.js +882 -0
  338. data/lib/generators/templates/ckeditor/_source/skins/kama/dialog.css +835 -0
  339. data/lib/generators/templates/ckeditor/_source/skins/kama/editor.css +25 -0
  340. data/lib/generators/templates/ckeditor/_source/skins/kama/elementspath.css +72 -0
  341. data/lib/generators/templates/ckeditor/_source/skins/kama/icons.css +326 -0
  342. data/lib/generators/templates/ckeditor/_source/skins/kama/icons.png +0 -0
  343. data/lib/generators/templates/ckeditor/_source/skins/kama/images/dialog_sides.gif +0 -0
  344. data/lib/generators/templates/ckeditor/_source/skins/kama/images/dialog_sides.png +0 -0
  345. data/lib/generators/templates/ckeditor/_source/skins/kama/images/dialog_sides_rtl.png +0 -0
  346. data/lib/generators/templates/ckeditor/_source/skins/kama/images/mini.gif +0 -0
  347. data/lib/generators/templates/ckeditor/_source/skins/kama/images/noimage.png +0 -0
  348. data/lib/generators/templates/ckeditor/_source/skins/kama/images/sprites.png +0 -0
  349. data/lib/generators/templates/ckeditor/_source/skins/kama/images/sprites_ie6.png +0 -0
  350. data/lib/generators/templates/ckeditor/_source/skins/kama/images/toolbar_start.gif +0 -0
  351. data/lib/generators/templates/ckeditor/_source/skins/kama/mainui.css +183 -0
  352. data/lib/generators/templates/ckeditor/_source/skins/kama/menu.css +197 -0
  353. data/lib/generators/templates/ckeditor/_source/skins/kama/panel.css +216 -0
  354. data/lib/generators/templates/ckeditor/_source/skins/kama/presets.css +49 -0
  355. data/lib/generators/templates/ckeditor/_source/skins/kama/reset.css +78 -0
  356. data/lib/generators/templates/ckeditor/_source/skins/kama/richcombo.css +270 -0
  357. data/lib/generators/templates/ckeditor/_source/skins/kama/skin.js +268 -0
  358. data/lib/generators/templates/ckeditor/_source/skins/kama/templates.css +84 -0
  359. data/lib/generators/templates/ckeditor/_source/skins/kama/toolbar.css +409 -0
  360. data/lib/generators/templates/ckeditor/_source/skins/office2003/dialog.css +738 -0
  361. data/lib/generators/templates/ckeditor/_source/skins/office2003/editor.css +25 -0
  362. data/lib/generators/templates/ckeditor/_source/skins/office2003/elementspath.css +73 -0
  363. data/lib/generators/templates/ckeditor/_source/skins/office2003/icons.css +324 -0
  364. data/lib/generators/templates/ckeditor/_source/skins/office2003/icons.png +0 -0
  365. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/dialog_sides.gif +0 -0
  366. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/dialog_sides.png +0 -0
  367. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/dialog_sides_rtl.png +0 -0
  368. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/mini.gif +0 -0
  369. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/noimage.png +0 -0
  370. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/sprites.png +0 -0
  371. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/sprites_ie6.png +0 -0
  372. data/lib/generators/templates/ckeditor/_source/skins/office2003/mainui.css +133 -0
  373. data/lib/generators/templates/ckeditor/_source/skins/office2003/menu.css +194 -0
  374. data/lib/generators/templates/ckeditor/_source/skins/office2003/panel.css +211 -0
  375. data/lib/generators/templates/ckeditor/_source/skins/office2003/presets.css +49 -0
  376. data/lib/generators/templates/ckeditor/_source/skins/office2003/reset.css +78 -0
  377. data/lib/generators/templates/ckeditor/_source/skins/office2003/richcombo.css +289 -0
  378. data/lib/generators/templates/ckeditor/_source/skins/office2003/skin.js +81 -0
  379. data/lib/generators/templates/ckeditor/_source/skins/office2003/templates.css +81 -0
  380. data/lib/generators/templates/ckeditor/_source/skins/office2003/toolbar.css +463 -0
  381. data/lib/generators/templates/ckeditor/_source/skins/v2/dialog.css +753 -0
  382. data/lib/generators/templates/ckeditor/_source/skins/v2/editor.css +25 -0
  383. data/lib/generators/templates/ckeditor/_source/skins/v2/elementspath.css +73 -0
  384. data/lib/generators/templates/ckeditor/_source/skins/v2/icons.css +324 -0
  385. data/lib/generators/templates/ckeditor/_source/skins/v2/icons.png +0 -0
  386. data/lib/generators/templates/ckeditor/_source/skins/v2/images/dialog_sides.gif +0 -0
  387. data/lib/generators/templates/ckeditor/_source/skins/v2/images/dialog_sides.png +0 -0
  388. data/lib/generators/templates/ckeditor/_source/skins/v2/images/dialog_sides_rtl.png +0 -0
  389. data/lib/generators/templates/ckeditor/_source/skins/v2/images/mini.gif +0 -0
  390. data/lib/generators/templates/ckeditor/_source/skins/v2/images/noimage.png +0 -0
  391. data/lib/generators/templates/ckeditor/_source/skins/v2/images/sprites.png +0 -0
  392. data/lib/generators/templates/ckeditor/_source/skins/v2/images/sprites_ie6.png +0 -0
  393. data/lib/generators/templates/ckeditor/_source/skins/v2/images/toolbar_start.gif +0 -0
  394. data/lib/generators/templates/ckeditor/_source/skins/v2/mainui.css +142 -0
  395. data/lib/generators/templates/ckeditor/_source/skins/v2/menu.css +196 -0
  396. data/lib/generators/templates/ckeditor/_source/skins/v2/panel.css +211 -0
  397. data/lib/generators/templates/ckeditor/_source/skins/v2/presets.css +50 -0
  398. data/lib/generators/templates/ckeditor/_source/skins/v2/reset.css +78 -0
  399. data/lib/generators/templates/ckeditor/_source/skins/v2/richcombo.css +289 -0
  400. data/lib/generators/templates/ckeditor/_source/skins/v2/skin.js +77 -0
  401. data/lib/generators/templates/ckeditor/_source/skins/v2/templates.css +81 -0
  402. data/lib/generators/templates/ckeditor/_source/skins/v2/toolbar.css +415 -0
  403. data/lib/generators/templates/ckeditor/_source/themes/default/theme.js +335 -0
  404. data/lib/generators/templates/ckeditor/adapters/jquery.js +6 -0
  405. data/lib/generators/templates/ckeditor/ckeditor.js +124 -0
  406. data/lib/generators/templates/ckeditor/ckeditor.pack +205 -0
  407. data/lib/generators/templates/ckeditor/ckeditor_basic.js +8 -0
  408. data/lib/generators/templates/ckeditor/ckeditor_basic_source.js +20 -0
  409. data/lib/generators/templates/ckeditor/ckeditor_source.js +25 -0
  410. data/lib/generators/templates/ckeditor/config.js +42 -0
  411. data/lib/generators/templates/ckeditor/contents.css +35 -0
  412. data/lib/generators/templates/ckeditor/css/ckfinder.css +299 -0
  413. data/lib/generators/templates/ckeditor/css/fck_dialog.css +119 -0
  414. data/lib/generators/templates/ckeditor/css/fck_editor.css +448 -0
  415. data/lib/generators/templates/ckeditor/css/swfupload.css +94 -0
  416. data/lib/generators/templates/ckeditor/images/add.gif +0 -0
  417. data/lib/generators/templates/ckeditor/images/cancelbutton.gif +0 -0
  418. data/lib/generators/templates/ckeditor/images/ckfnothumb.gif +0 -0
  419. data/lib/generators/templates/ckeditor/images/doc.gif +0 -0
  420. data/lib/generators/templates/ckeditor/images/mp3.gif +0 -0
  421. data/lib/generators/templates/ckeditor/images/pdf.gif +0 -0
  422. data/lib/generators/templates/ckeditor/images/rar.gif +0 -0
  423. data/lib/generators/templates/ckeditor/images/refresh.gif +0 -0
  424. data/lib/generators/templates/ckeditor/images/select_files.png +0 -0
  425. data/lib/generators/templates/ckeditor/images/spacer.gif +0 -0
  426. data/lib/generators/templates/ckeditor/images/swf.gif +0 -0
  427. data/lib/generators/templates/ckeditor/images/toolbar.start.gif +0 -0
  428. data/lib/generators/templates/ckeditor/images/xls.gif +0 -0
  429. data/lib/generators/templates/ckeditor/lang/_languages.js +6 -0
  430. data/lib/generators/templates/ckeditor/lang/_translationstatus.txt +60 -0
  431. data/lib/generators/templates/ckeditor/lang/af.js +6 -0
  432. data/lib/generators/templates/ckeditor/lang/ar.js +6 -0
  433. data/lib/generators/templates/ckeditor/lang/bg.js +6 -0
  434. data/lib/generators/templates/ckeditor/lang/bn.js +6 -0
  435. data/lib/generators/templates/ckeditor/lang/bs.js +6 -0
  436. data/lib/generators/templates/ckeditor/lang/ca.js +6 -0
  437. data/lib/generators/templates/ckeditor/lang/cs.js +6 -0
  438. data/lib/generators/templates/ckeditor/lang/cy.js +6 -0
  439. data/lib/generators/templates/ckeditor/lang/da.js +6 -0
  440. data/lib/generators/templates/ckeditor/lang/de.js +6 -0
  441. data/lib/generators/templates/ckeditor/lang/el.js +6 -0
  442. data/lib/generators/templates/ckeditor/lang/en-au.js +6 -0
  443. data/lib/generators/templates/ckeditor/lang/en-ca.js +6 -0
  444. data/lib/generators/templates/ckeditor/lang/en-gb.js +6 -0
  445. data/lib/generators/templates/ckeditor/lang/en.js +6 -0
  446. data/lib/generators/templates/ckeditor/lang/eo.js +6 -0
  447. data/lib/generators/templates/ckeditor/lang/es.js +6 -0
  448. data/lib/generators/templates/ckeditor/lang/et.js +6 -0
  449. data/lib/generators/templates/ckeditor/lang/eu.js +6 -0
  450. data/lib/generators/templates/ckeditor/lang/fa.js +6 -0
  451. data/lib/generators/templates/ckeditor/lang/fi.js +6 -0
  452. data/lib/generators/templates/ckeditor/lang/fo.js +6 -0
  453. data/lib/generators/templates/ckeditor/lang/fr-ca.js +6 -0
  454. data/lib/generators/templates/ckeditor/lang/fr.js +6 -0
  455. data/lib/generators/templates/ckeditor/lang/gl.js +6 -0
  456. data/lib/generators/templates/ckeditor/lang/gu.js +6 -0
  457. data/lib/generators/templates/ckeditor/lang/he.js +6 -0
  458. data/lib/generators/templates/ckeditor/lang/hi.js +6 -0
  459. data/lib/generators/templates/ckeditor/lang/hr.js +6 -0
  460. data/lib/generators/templates/ckeditor/lang/hu.js +6 -0
  461. data/lib/generators/templates/ckeditor/lang/is.js +6 -0
  462. data/lib/generators/templates/ckeditor/lang/it.js +6 -0
  463. data/lib/generators/templates/ckeditor/lang/ja.js +6 -0
  464. data/lib/generators/templates/ckeditor/lang/km.js +6 -0
  465. data/lib/generators/templates/ckeditor/lang/ko.js +6 -0
  466. data/lib/generators/templates/ckeditor/lang/lt.js +6 -0
  467. data/lib/generators/templates/ckeditor/lang/lv.js +6 -0
  468. data/lib/generators/templates/ckeditor/lang/mn.js +6 -0
  469. data/lib/generators/templates/ckeditor/lang/ms.js +6 -0
  470. data/lib/generators/templates/ckeditor/lang/nb.js +6 -0
  471. data/lib/generators/templates/ckeditor/lang/nl.js +6 -0
  472. data/lib/generators/templates/ckeditor/lang/no.js +6 -0
  473. data/lib/generators/templates/ckeditor/lang/pl.js +6 -0
  474. data/lib/generators/templates/ckeditor/lang/pt-br.js +6 -0
  475. data/lib/generators/templates/ckeditor/lang/pt.js +6 -0
  476. data/lib/generators/templates/ckeditor/lang/ro.js +6 -0
  477. data/lib/generators/templates/ckeditor/lang/ru.js +6 -0
  478. data/lib/generators/templates/ckeditor/lang/sk.js +6 -0
  479. data/lib/generators/templates/ckeditor/lang/sl.js +6 -0
  480. data/lib/generators/templates/ckeditor/lang/sr-latn.js +6 -0
  481. data/lib/generators/templates/ckeditor/lang/sr.js +6 -0
  482. data/lib/generators/templates/ckeditor/lang/sv.js +6 -0
  483. data/lib/generators/templates/ckeditor/lang/th.js +6 -0
  484. data/lib/generators/templates/ckeditor/lang/tr.js +6 -0
  485. data/lib/generators/templates/ckeditor/lang/uk.js +6 -0
  486. data/lib/generators/templates/ckeditor/lang/vi.js +6 -0
  487. data/lib/generators/templates/ckeditor/lang/zh-cn.js +6 -0
  488. data/lib/generators/templates/ckeditor/lang/zh.js +6 -0
  489. data/lib/generators/templates/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -0
  490. data/lib/generators/templates/ckeditor/plugins/a11yhelp/lang/en.js +6 -0
  491. data/lib/generators/templates/ckeditor/plugins/about/dialogs/about.js +6 -0
  492. data/lib/generators/templates/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  493. data/lib/generators/templates/ckeditor/plugins/attachment/dialogs/attachment.js +1 -0
  494. data/lib/generators/templates/ckeditor/plugins/attachment/images/attachment.png +0 -0
  495. data/lib/generators/templates/ckeditor/plugins/attachment/lang/en.js +1 -0
  496. data/lib/generators/templates/ckeditor/plugins/attachment/lang/ru.js +1 -0
  497. data/lib/generators/templates/ckeditor/plugins/attachment/lang/uk.js +1 -0
  498. data/lib/generators/templates/ckeditor/plugins/attachment/plugin.js +1 -0
  499. data/lib/generators/templates/ckeditor/plugins/clipboard/dialogs/paste.js +7 -0
  500. data/lib/generators/templates/ckeditor/plugins/colordialog/dialogs/colordialog.js +6 -0
  501. data/lib/generators/templates/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
  502. data/lib/generators/templates/ckeditor/plugins/div/dialogs/div.js +7 -0
  503. data/lib/generators/templates/ckeditor/plugins/embed/dialogs/embed.js +1 -0
  504. data/lib/generators/templates/ckeditor/plugins/embed/images/embed.png +0 -0
  505. data/lib/generators/templates/ckeditor/plugins/embed/lang/en.js +1 -0
  506. data/lib/generators/templates/ckeditor/plugins/embed/lang/ru.js +1 -0
  507. data/lib/generators/templates/ckeditor/plugins/embed/lang/uk.js +1 -0
  508. data/lib/generators/templates/ckeditor/plugins/embed/plugin.js +1 -0
  509. data/lib/generators/templates/ckeditor/plugins/find/dialogs/find.js +9 -0
  510. data/lib/generators/templates/ckeditor/plugins/flash/dialogs/flash.js +9 -0
  511. data/lib/generators/templates/ckeditor/plugins/flash/images/placeholder.png +0 -0
  512. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/button.js +6 -0
  513. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/checkbox.js +6 -0
  514. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/form.js +6 -0
  515. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/hiddenfield.js +6 -0
  516. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/radio.js +6 -0
  517. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/select.js +9 -0
  518. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/textarea.js +6 -0
  519. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/textfield.js +6 -0
  520. data/lib/generators/templates/ckeditor/plugins/iframedialog/plugin.js +6 -0
  521. data/lib/generators/templates/ckeditor/plugins/image/dialogs/image.js +13 -0
  522. data/lib/generators/templates/ckeditor/plugins/link/dialogs/anchor.js +6 -0
  523. data/lib/generators/templates/ckeditor/plugins/link/dialogs/link.js +11 -0
  524. data/lib/generators/templates/ckeditor/plugins/link/images/anchor.gif +0 -0
  525. data/lib/generators/templates/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
  526. data/lib/generators/templates/ckeditor/plugins/pastefromword/filter/default.js +10 -0
  527. data/lib/generators/templates/ckeditor/plugins/pastetext/dialogs/pastetext.js +6 -0
  528. data/lib/generators/templates/ckeditor/plugins/scayt/dialogs/options.js +8 -0
  529. data/lib/generators/templates/ckeditor/plugins/scayt/dialogs/toolbar.css +6 -0
  530. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  531. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  532. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  533. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  534. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  535. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  536. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  537. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  538. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  539. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  540. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  541. data/lib/generators/templates/ckeditor/plugins/smiley/dialogs/smiley.js +7 -0
  542. data/lib/generators/templates/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  543. data/lib/generators/templates/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  544. data/lib/generators/templates/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  545. data/lib/generators/templates/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  546. data/lib/generators/templates/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  547. data/lib/generators/templates/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  548. data/lib/generators/templates/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  549. data/lib/generators/templates/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  550. data/lib/generators/templates/ckeditor/plugins/smiley/images/heart.gif +0 -0
  551. data/lib/generators/templates/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  552. data/lib/generators/templates/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  553. data/lib/generators/templates/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  554. data/lib/generators/templates/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  555. data/lib/generators/templates/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  556. data/lib/generators/templates/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  557. data/lib/generators/templates/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  558. data/lib/generators/templates/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  559. data/lib/generators/templates/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  560. data/lib/generators/templates/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  561. data/lib/generators/templates/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  562. data/lib/generators/templates/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  563. data/lib/generators/templates/ckeditor/plugins/specialchar/dialogs/specialchar.js +7 -0
  564. data/lib/generators/templates/ckeditor/plugins/styles/styles/default.js +6 -0
  565. data/lib/generators/templates/ckeditor/plugins/table/dialogs/table.js +9 -0
  566. data/lib/generators/templates/ckeditor/plugins/tabletools/dialogs/tableCell.js +8 -0
  567. data/lib/generators/templates/ckeditor/plugins/templates/dialogs/templates.js +7 -0
  568. data/lib/generators/templates/ckeditor/plugins/templates/templates/default.js +6 -0
  569. data/lib/generators/templates/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  570. data/lib/generators/templates/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  571. data/lib/generators/templates/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  572. data/lib/generators/templates/ckeditor/plugins/uicolor/dialogs/uicolor.js +7 -0
  573. data/lib/generators/templates/ckeditor/plugins/uicolor/lang/en.js +6 -0
  574. data/lib/generators/templates/ckeditor/plugins/uicolor/plugin.js +6 -0
  575. data/lib/generators/templates/ckeditor/plugins/uicolor/uicolor.gif +0 -0
  576. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  577. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  578. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  579. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  580. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/yui.css +6 -0
  581. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/yui.js +76 -0
  582. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
  583. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  584. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/wsc.css +6 -0
  585. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/wsc.js +7 -0
  586. data/lib/generators/templates/ckeditor/skins/kama/dialog.css +9 -0
  587. data/lib/generators/templates/ckeditor/skins/kama/editor.css +12 -0
  588. data/lib/generators/templates/ckeditor/skins/kama/icons.png +0 -0
  589. data/lib/generators/templates/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
  590. data/lib/generators/templates/ckeditor/skins/kama/images/dialog_sides.png +0 -0
  591. data/lib/generators/templates/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
  592. data/lib/generators/templates/ckeditor/skins/kama/images/mini.gif +0 -0
  593. data/lib/generators/templates/ckeditor/skins/kama/images/noimage.png +0 -0
  594. data/lib/generators/templates/ckeditor/skins/kama/images/sprites.png +0 -0
  595. data/lib/generators/templates/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
  596. data/lib/generators/templates/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
  597. data/lib/generators/templates/ckeditor/skins/kama/skin.js +7 -0
  598. data/lib/generators/templates/ckeditor/skins/kama/templates.css +6 -0
  599. data/lib/generators/templates/ckeditor/skins/office2003/dialog.css +9 -0
  600. data/lib/generators/templates/ckeditor/skins/office2003/editor.css +13 -0
  601. data/lib/generators/templates/ckeditor/skins/office2003/icons.png +0 -0
  602. data/lib/generators/templates/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
  603. data/lib/generators/templates/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
  604. data/lib/generators/templates/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
  605. data/lib/generators/templates/ckeditor/skins/office2003/images/mini.gif +0 -0
  606. data/lib/generators/templates/ckeditor/skins/office2003/images/noimage.png +0 -0
  607. data/lib/generators/templates/ckeditor/skins/office2003/images/sprites.png +0 -0
  608. data/lib/generators/templates/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
  609. data/lib/generators/templates/ckeditor/skins/office2003/skin.js +6 -0
  610. data/lib/generators/templates/ckeditor/skins/office2003/templates.css +6 -0
  611. data/lib/generators/templates/ckeditor/skins/v2/dialog.css +8 -0
  612. data/lib/generators/templates/ckeditor/skins/v2/editor.css +12 -0
  613. data/lib/generators/templates/ckeditor/skins/v2/icons.png +0 -0
  614. data/lib/generators/templates/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
  615. data/lib/generators/templates/ckeditor/skins/v2/images/dialog_sides.png +0 -0
  616. data/lib/generators/templates/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
  617. data/lib/generators/templates/ckeditor/skins/v2/images/mini.gif +0 -0
  618. data/lib/generators/templates/ckeditor/skins/v2/images/noimage.png +0 -0
  619. data/lib/generators/templates/ckeditor/skins/v2/images/sprites.png +0 -0
  620. data/lib/generators/templates/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
  621. data/lib/generators/templates/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
  622. data/lib/generators/templates/ckeditor/skins/v2/skin.js +6 -0
  623. data/lib/generators/templates/ckeditor/skins/v2/templates.css +6 -0
  624. data/lib/generators/templates/ckeditor/swfupload/fileprogress.js +290 -0
  625. data/lib/generators/templates/ckeditor/swfupload/handlers.js +170 -0
  626. data/lib/generators/templates/ckeditor/swfupload/mootools-1.2.3-core-yc.js +356 -0
  627. data/lib/generators/templates/ckeditor/swfupload/querystring.js +40 -0
  628. data/lib/generators/templates/ckeditor/swfupload/swfupload.js +980 -0
  629. data/lib/generators/templates/ckeditor/swfupload/swfupload.queue.js +98 -0
  630. data/lib/generators/templates/ckeditor/swfupload/swfupload.swf +0 -0
  631. data/lib/generators/templates/ckeditor/swfupload/swfupload.swfobject.js +111 -0
  632. data/lib/generators/templates/ckeditor/themes/default/theme.js +8 -0
  633. data/lib/tasks/ckeditor_tasks.rake +3 -0
  634. metadata +694 -0
@@ -0,0 +1,2913 @@
1
+ /*
2
+ Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ /**
7
+ * @fileOverview The floating dialog plugin.
8
+ */
9
+
10
+ /**
11
+ * No resize for this dialog.
12
+ * @constant
13
+ */
14
+ CKEDITOR.DIALOG_RESIZE_NONE = 0;
15
+
16
+ /**
17
+ * Only allow horizontal resizing for this dialog, disable vertical resizing.
18
+ * @constant
19
+ */
20
+ CKEDITOR.DIALOG_RESIZE_WIDTH = 1;
21
+
22
+ /**
23
+ * Only allow vertical resizing for this dialog, disable horizontal resizing.
24
+ * @constant
25
+ */
26
+ CKEDITOR.DIALOG_RESIZE_HEIGHT = 2;
27
+
28
+ /*
29
+ * Allow the dialog to be resized in both directions.
30
+ * @constant
31
+ */
32
+ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
33
+
34
+ (function()
35
+ {
36
+ function isTabVisible( tabId )
37
+ {
38
+ return !!this._.tabs[ tabId ][ 0 ].$.offsetHeight;
39
+ }
40
+
41
+ function getPreviousVisibleTab()
42
+ {
43
+ var tabId = this._.currentTabId,
44
+ length = this._.tabIdList.length,
45
+ tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId ) + length;
46
+
47
+ for ( var i = tabIndex - 1 ; i > tabIndex - length ; i-- )
48
+ {
49
+ if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) )
50
+ return this._.tabIdList[ i % length ];
51
+ }
52
+
53
+ return null;
54
+ }
55
+
56
+ function getNextVisibleTab()
57
+ {
58
+ var tabId = this._.currentTabId,
59
+ length = this._.tabIdList.length,
60
+ tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId );
61
+
62
+ for ( var i = tabIndex + 1 ; i < tabIndex + length ; i++ )
63
+ {
64
+ if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) )
65
+ return this._.tabIdList[ i % length ];
66
+ }
67
+
68
+ return null;
69
+ }
70
+
71
+ /**
72
+ * This is the base class for runtime dialog objects. An instance of this
73
+ * class represents a single named dialog for a single editor instance.
74
+ * @param {Object} editor The editor which created the dialog.
75
+ * @param {String} dialogName The dialog's registered name.
76
+ * @constructor
77
+ * @example
78
+ * var dialogObj = new CKEDITOR.dialog( editor, 'smiley' );
79
+ */
80
+ CKEDITOR.dialog = function( editor, dialogName )
81
+ {
82
+ // Load the dialog definition.
83
+ var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
84
+
85
+ // Completes the definition with the default values.
86
+ definition = CKEDITOR.tools.extend( definition( editor ), defaultDialogDefinition );
87
+
88
+ // Clone a functionally independent copy for this dialog.
89
+ definition = CKEDITOR.tools.clone( definition );
90
+
91
+ // Create a complex definition object, extending it with the API
92
+ // functions.
93
+ definition = new definitionObject( this, definition );
94
+
95
+
96
+ var doc = CKEDITOR.document;
97
+
98
+ var themeBuilt = editor.theme.buildDialog( editor );
99
+
100
+ // Initialize some basic parameters.
101
+ this._ =
102
+ {
103
+ editor : editor,
104
+ element : themeBuilt.element,
105
+ name : dialogName,
106
+ contentSize : { width : 0, height : 0 },
107
+ size : { width : 0, height : 0 },
108
+ updateSize : false,
109
+ contents : {},
110
+ buttons : {},
111
+ accessKeyMap : {},
112
+
113
+ // Initialize the tab and page map.
114
+ tabs : {},
115
+ tabIdList : [],
116
+ currentTabId : null,
117
+ currentTabIndex : null,
118
+ pageCount : 0,
119
+ lastTab : null,
120
+ tabBarMode : false,
121
+
122
+ // Initialize the tab order array for input widgets.
123
+ focusList : [],
124
+ currentFocusIndex : 0,
125
+ hasFocus : false
126
+ };
127
+
128
+ this.parts = themeBuilt.parts;
129
+
130
+ CKEDITOR.tools.setTimeout( function()
131
+ {
132
+ editor.fire( 'ariaWidget', this.parts.contents );
133
+ },
134
+ 0, this );
135
+
136
+ // Set the startup styles for the dialog, avoiding it enlarging the
137
+ // page size on the dialog creation.
138
+ this.parts.dialog.setStyles(
139
+ {
140
+ position : CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed',
141
+ top : 0,
142
+ left: 0,
143
+ visibility : 'hidden'
144
+ });
145
+
146
+ // Call the CKEDITOR.event constructor to initialize this instance.
147
+ CKEDITOR.event.call( this );
148
+
149
+ // Fire the "dialogDefinition" event, making it possible to customize
150
+ // the dialog definition.
151
+ this.definition = definition = CKEDITOR.fire( 'dialogDefinition',
152
+ {
153
+ name : dialogName,
154
+ definition : definition
155
+ }
156
+ , editor ).definition;
157
+ // Initialize load, show, hide, ok and cancel events.
158
+ if ( definition.onLoad )
159
+ this.on( 'load', definition.onLoad );
160
+
161
+ if ( definition.onShow )
162
+ this.on( 'show', definition.onShow );
163
+
164
+ if ( definition.onHide )
165
+ this.on( 'hide', definition.onHide );
166
+
167
+ if ( definition.onOk )
168
+ {
169
+ this.on( 'ok', function( evt )
170
+ {
171
+ if ( definition.onOk.call( this, evt ) === false )
172
+ evt.data.hide = false;
173
+ });
174
+ }
175
+
176
+ if ( definition.onCancel )
177
+ {
178
+ this.on( 'cancel', function( evt )
179
+ {
180
+ if ( definition.onCancel.call( this, evt ) === false )
181
+ evt.data.hide = false;
182
+ });
183
+ }
184
+
185
+ var me = this;
186
+
187
+ // Iterates over all items inside all content in the dialog, calling a
188
+ // function for each of them.
189
+ var iterContents = function( func )
190
+ {
191
+ var contents = me._.contents,
192
+ stop = false;
193
+
194
+ for ( var i in contents )
195
+ {
196
+ for ( var j in contents[i] )
197
+ {
198
+ stop = func.call( this, contents[i][j] );
199
+ if ( stop )
200
+ return;
201
+ }
202
+ }
203
+ };
204
+
205
+ this.on( 'ok', function( evt )
206
+ {
207
+ iterContents( function( item )
208
+ {
209
+ if ( item.validate )
210
+ {
211
+ var isValid = item.validate( this );
212
+
213
+ if ( typeof isValid == 'string' )
214
+ {
215
+ alert( isValid );
216
+ isValid = false;
217
+ }
218
+
219
+ if ( isValid === false )
220
+ {
221
+ if ( item.select )
222
+ item.select();
223
+ else
224
+ item.focus();
225
+
226
+ evt.data.hide = false;
227
+ evt.stop();
228
+ return true;
229
+ }
230
+ }
231
+ });
232
+ }, this, null, 0 );
233
+
234
+ this.on( 'cancel', function( evt )
235
+ {
236
+ iterContents( function( item )
237
+ {
238
+ if ( item.isChanged() )
239
+ {
240
+ if ( !confirm( editor.lang.common.confirmCancel ) )
241
+ evt.data.hide = false;
242
+ return true;
243
+ }
244
+ });
245
+ }, this, null, 0 );
246
+
247
+ this.parts.close.on( 'click', function( evt )
248
+ {
249
+ if ( this.fire( 'cancel', { hide : true } ).hide !== false )
250
+ this.hide();
251
+ }, this );
252
+
253
+ // Sort focus list according to tab order definitions.
254
+ function setupFocus()
255
+ {
256
+ var focusList = me._.focusList;
257
+ focusList.sort( function( a, b )
258
+ {
259
+ // Mimics browser tab order logics;
260
+ if ( a.tabIndex != b.tabIndex )
261
+ return b.tabIndex - a.tabIndex;
262
+ // Sort is not stable in some browsers,
263
+ // fall-back the comparator to 'focusIndex';
264
+ else
265
+ return a.focusIndex - b.focusIndex;
266
+ });
267
+
268
+ var size = focusList.length;
269
+ for ( var i = 0; i < size; i++ )
270
+ focusList[ i ].focusIndex = i;
271
+ }
272
+
273
+ function changeFocus( forward )
274
+ {
275
+ var focusList = me._.focusList,
276
+ offset = forward ? 1 : -1;
277
+ if ( focusList.length < 1 )
278
+ return;
279
+
280
+ var current = me._.currentFocusIndex;
281
+
282
+ // Trigger the 'blur' event of any input element before anything,
283
+ // since certain UI updates may depend on it.
284
+ try
285
+ {
286
+ focusList[ current ].getInputElement().$.blur();
287
+ }
288
+ catch( e ){}
289
+
290
+ var startIndex = ( current + offset + focusList.length ) % focusList.length,
291
+ currentIndex = startIndex;
292
+ while ( !focusList[ currentIndex ].isFocusable() )
293
+ {
294
+ currentIndex = ( currentIndex + offset + focusList.length ) % focusList.length;
295
+ if ( currentIndex == startIndex )
296
+ break;
297
+ }
298
+ focusList[ currentIndex ].focus();
299
+
300
+ // Select whole field content.
301
+ if ( focusList[ currentIndex ].type == 'text' )
302
+ focusList[ currentIndex ].select();
303
+ }
304
+
305
+ this.changeFocus = changeFocus;
306
+
307
+ var processed;
308
+
309
+ function focusKeydownHandler( evt )
310
+ {
311
+ // If I'm not the top dialog, ignore.
312
+ if ( me != CKEDITOR.dialog._.currentTop )
313
+ return;
314
+
315
+ var keystroke = evt.data.getKeystroke();
316
+
317
+ processed = 0;
318
+ if ( keystroke == 9 || keystroke == CKEDITOR.SHIFT + 9 )
319
+ {
320
+ var shiftPressed = ( keystroke == CKEDITOR.SHIFT + 9 );
321
+
322
+ // Handling Tab and Shift-Tab.
323
+ if ( me._.tabBarMode )
324
+ {
325
+ // Change tabs.
326
+ var nextId = shiftPressed ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me );
327
+ me.selectPage( nextId );
328
+ me._.tabs[ nextId ][ 0 ].focus();
329
+ }
330
+ else
331
+ {
332
+ // Change the focus of inputs.
333
+ changeFocus( !shiftPressed );
334
+ }
335
+
336
+ processed = 1;
337
+ }
338
+ else if ( keystroke == CKEDITOR.ALT + 121 && !me._.tabBarMode && me.getPageCount() > 1 )
339
+ {
340
+ // Alt-F10 puts focus into the current tab item in the tab bar.
341
+ me._.tabBarMode = true;
342
+ me._.tabs[ me._.currentTabId ][ 0 ].focus();
343
+ processed = 1;
344
+ }
345
+ else if ( ( keystroke == 37 || keystroke == 39 ) && me._.tabBarMode )
346
+ {
347
+ // Arrow keys - used for changing tabs.
348
+ nextId = ( keystroke == 37 ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me ) );
349
+ me.selectPage( nextId );
350
+ me._.tabs[ nextId ][ 0 ].focus();
351
+ processed = 1;
352
+ }
353
+ else if ( ( keystroke == 13 || keystroke == 32 ) && me._.tabBarMode )
354
+ {
355
+ this.selectPage( this._.currentTabId );
356
+ this._.tabBarMode = false;
357
+ this._.currentFocusIndex = -1;
358
+ changeFocus( true );
359
+ processed = 1;
360
+ }
361
+
362
+ if ( processed )
363
+ {
364
+ evt.stop();
365
+ evt.data.preventDefault();
366
+ }
367
+ }
368
+
369
+ function focusKeyPressHandler( evt )
370
+ {
371
+ processed && evt.data.preventDefault();
372
+ }
373
+
374
+ var dialogElement = this._.element;
375
+ // Add the dialog keyboard handlers.
376
+ this.on( 'show', function()
377
+ {
378
+ dialogElement.on( 'keydown', focusKeydownHandler, this, null, 0 );
379
+ // Some browsers instead, don't cancel key events in the keydown, but in the
380
+ // keypress. So we must do a longer trip in those cases. (#4531)
381
+ if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) )
382
+ dialogElement.on( 'keypress', focusKeyPressHandler, this );
383
+
384
+ if ( CKEDITOR.env.ie6Compat )
385
+ {
386
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
387
+ coverDoc.on( 'keydown', focusKeydownHandler, this, null, 0 );
388
+ }
389
+ } );
390
+ this.on( 'hide', function()
391
+ {
392
+ dialogElement.removeListener( 'keydown', focusKeydownHandler );
393
+ if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) )
394
+ dialogElement.removeListener( 'keypress', focusKeyPressHandler );
395
+ } );
396
+ this.on( 'iframeAdded', function( evt )
397
+ {
398
+ var doc = new CKEDITOR.dom.document( evt.data.iframe.$.contentWindow.document );
399
+ doc.on( 'keydown', focusKeydownHandler, this, null, 0 );
400
+ } );
401
+
402
+ // Auto-focus logic in dialog.
403
+ this.on( 'show', function()
404
+ {
405
+ // Setup tabIndex on showing the dialog instead of on loading
406
+ // to allow dynamic tab order happen in dialog definition.
407
+ setupFocus();
408
+
409
+ if ( editor.config.dialog_startupFocusTab
410
+ && me._.tabIdList.length > 1 )
411
+ {
412
+ me._.tabBarMode = true;
413
+ me._.tabs[ me._.currentTabId ][ 0 ].focus();
414
+ }
415
+ else if ( !this._.hasFocus )
416
+ {
417
+ this._.currentFocusIndex = -1;
418
+
419
+ // Decide where to put the initial focus.
420
+ if ( definition.onFocus )
421
+ {
422
+ var initialFocus = definition.onFocus.call( this );
423
+ // Focus the field that the user specified.
424
+ initialFocus && initialFocus.focus();
425
+ }
426
+ // Focus the first field in layout order.
427
+ else
428
+ changeFocus( true );
429
+
430
+ /*
431
+ * IE BUG: If the initial focus went into a non-text element (e.g. button),
432
+ * then IE would still leave the caret inside the editing area.
433
+ */
434
+ if ( this._.editor.mode == 'wysiwyg' && CKEDITOR.env.ie )
435
+ {
436
+ var $selection = editor.document.$.selection,
437
+ $range = $selection.createRange();
438
+
439
+ if ( $range )
440
+ {
441
+ if ( $range.parentElement && $range.parentElement().ownerDocument == editor.document.$
442
+ || $range.item && $range.item( 0 ).ownerDocument == editor.document.$ )
443
+ {
444
+ var $myRange = document.body.createTextRange();
445
+ $myRange.moveToElementText( this.getElement().getFirst().$ );
446
+ $myRange.collapse( true );
447
+ $myRange.select();
448
+ }
449
+ }
450
+ }
451
+ }
452
+ }, this, null, 0xffffffff );
453
+
454
+ // IE6 BUG: Text fields and text areas are only half-rendered the first time the dialog appears in IE6 (#2661).
455
+ // This is still needed after [2708] and [2709] because text fields in hidden TR tags are still broken.
456
+ if ( CKEDITOR.env.ie6Compat )
457
+ {
458
+ this.on( 'load', function( evt )
459
+ {
460
+ var outer = this.getElement(),
461
+ inner = outer.getFirst();
462
+ inner.remove();
463
+ inner.appendTo( outer );
464
+ }, this );
465
+ }
466
+
467
+ initDragAndDrop( this );
468
+ initResizeHandles( this );
469
+
470
+ // Insert the title.
471
+ ( new CKEDITOR.dom.text( definition.title, CKEDITOR.document ) ).appendTo( this.parts.title );
472
+
473
+ // Insert the tabs and contents.
474
+ for ( var i = 0 ; i < definition.contents.length ; i++ )
475
+ this.addPage( definition.contents[i] );
476
+
477
+ this.parts['tabs'].on( 'click', function( evt )
478
+ {
479
+ var target = evt.data.getTarget();
480
+ // If we aren't inside a tab, bail out.
481
+ if ( target.hasClass( 'cke_dialog_tab' ) )
482
+ {
483
+ var id = target.$.id;
484
+ this.selectPage( id.substr( 0, id.lastIndexOf( '_' ) ) );
485
+ if ( this._.tabBarMode )
486
+ {
487
+ this._.tabBarMode = false;
488
+ this._.currentFocusIndex = -1;
489
+ changeFocus( true );
490
+ }
491
+ evt.data.preventDefault();
492
+ }
493
+ }, this );
494
+
495
+ // Insert buttons.
496
+ var buttonsHtml = [],
497
+ buttons = CKEDITOR.dialog._.uiElementBuilders.hbox.build( this,
498
+ {
499
+ type : 'hbox',
500
+ className : 'cke_dialog_footer_buttons',
501
+ widths : [],
502
+ children : definition.buttons
503
+ }, buttonsHtml ).getChild();
504
+ this.parts.footer.setHtml( buttonsHtml.join( '' ) );
505
+
506
+ for ( i = 0 ; i < buttons.length ; i++ )
507
+ this._.buttons[ buttons[i].id ] = buttons[i];
508
+ };
509
+
510
+ // Focusable interface. Use it via dialog.addFocusable.
511
+ function Focusable( dialog, element, index )
512
+ {
513
+ this.element = element;
514
+ this.focusIndex = index;
515
+ // TODO: support tabIndex for focusables.
516
+ this.tabIndex = 0;
517
+ this.isFocusable = function()
518
+ {
519
+ return !element.getAttribute( 'disabled' ) && element.isVisible();
520
+ };
521
+ this.focus = function()
522
+ {
523
+ dialog._.currentFocusIndex = this.focusIndex;
524
+ this.element.focus();
525
+ };
526
+ // Bind events
527
+ element.on( 'keydown', function( e )
528
+ {
529
+ if ( e.data.getKeystroke() in { 32:1, 13:1 } )
530
+ this.fire( 'click' );
531
+ } );
532
+ element.on( 'focus', function()
533
+ {
534
+ this.fire( 'mouseover' );
535
+ } );
536
+ element.on( 'blur', function()
537
+ {
538
+ this.fire( 'mouseout' );
539
+ } );
540
+ }
541
+
542
+ CKEDITOR.dialog.prototype =
543
+ {
544
+ /**
545
+ * Resizes the dialog.
546
+ * @param {Number} width The width of the dialog in pixels.
547
+ * @param {Number} height The height of the dialog in pixels.
548
+ * @function
549
+ * @example
550
+ * dialogObj.resize( 800, 640 );
551
+ */
552
+ resize : (function()
553
+ {
554
+ return function( width, height )
555
+ {
556
+ if ( this._.contentSize && this._.contentSize.width == width && this._.contentSize.height == height )
557
+ return;
558
+
559
+ CKEDITOR.dialog.fire( 'resize',
560
+ {
561
+ dialog : this,
562
+ skin : this._.editor.skinName,
563
+ width : width,
564
+ height : height
565
+ }, this._.editor );
566
+
567
+ this._.contentSize = { width : width, height : height };
568
+ this._.updateSize = true;
569
+ };
570
+ })(),
571
+
572
+ /**
573
+ * Gets the current size of the dialog in pixels.
574
+ * @returns {Object} An object with "width" and "height" properties.
575
+ * @example
576
+ * var width = dialogObj.getSize().width;
577
+ */
578
+ getSize : function()
579
+ {
580
+ if ( !this._.updateSize )
581
+ return this._.size;
582
+ var element = this._.element.getFirst();
583
+ var size = this._.size = { width : element.$.offsetWidth || 0, height : element.$.offsetHeight || 0};
584
+
585
+ // If either the offsetWidth or offsetHeight is 0, the element isn't visible.
586
+ this._.updateSize = !size.width || !size.height;
587
+
588
+ return size;
589
+ },
590
+
591
+ /**
592
+ * Moves the dialog to an (x, y) coordinate relative to the window.
593
+ * @function
594
+ * @param {Number} x The target x-coordinate.
595
+ * @param {Number} y The target y-coordinate.
596
+ * @example
597
+ * dialogObj.move( 10, 40 );
598
+ */
599
+ move : (function()
600
+ {
601
+ var isFixed;
602
+ return function( x, y )
603
+ {
604
+ // The dialog may be fixed positioned or absolute positioned. Ask the
605
+ // browser what is the current situation first.
606
+ var element = this._.element.getFirst();
607
+ if ( isFixed === undefined )
608
+ isFixed = element.getComputedStyle( 'position' ) == 'fixed';
609
+
610
+ if ( isFixed && this._.position && this._.position.x == x && this._.position.y == y )
611
+ return;
612
+
613
+ // Save the current position.
614
+ this._.position = { x : x, y : y };
615
+
616
+ // If not fixed positioned, add scroll position to the coordinates.
617
+ if ( !isFixed )
618
+ {
619
+ var scrollPosition = CKEDITOR.document.getWindow().getScrollPosition();
620
+ x += scrollPosition.x;
621
+ y += scrollPosition.y;
622
+ }
623
+
624
+ element.setStyles(
625
+ {
626
+ 'left' : ( x > 0 ? x : 0 ) + 'px',
627
+ 'top' : ( y > 0 ? y : 0 ) + 'px'
628
+ });
629
+ };
630
+ })(),
631
+
632
+ /**
633
+ * Gets the dialog's position in the window.
634
+ * @returns {Object} An object with "x" and "y" properties.
635
+ * @example
636
+ * var dialogX = dialogObj.getPosition().x;
637
+ */
638
+ getPosition : function(){ return CKEDITOR.tools.extend( {}, this._.position ); },
639
+
640
+ /**
641
+ * Shows the dialog box.
642
+ * @example
643
+ * dialogObj.show();
644
+ */
645
+ show : function()
646
+ {
647
+ var editor = this._.editor;
648
+ if ( editor.mode == 'wysiwyg' && CKEDITOR.env.ie )
649
+ {
650
+ var selection = editor.getSelection();
651
+ selection && selection.lock();
652
+ }
653
+
654
+ // Insert the dialog's element to the root document.
655
+ var element = this._.element;
656
+ var definition = this.definition;
657
+ if ( !( element.getParent() && element.getParent().equals( CKEDITOR.document.getBody() ) ) )
658
+ element.appendTo( CKEDITOR.document.getBody() );
659
+ else
660
+ return;
661
+
662
+ // FIREFOX BUG: Fix vanishing caret for Firefox 2 or Gecko 1.8.
663
+ if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 )
664
+ {
665
+ var dialogElement = this.parts.dialog;
666
+ dialogElement.setStyle( 'position', 'absolute' );
667
+ setTimeout( function()
668
+ {
669
+ dialogElement.setStyle( 'position', 'fixed' );
670
+ }, 0 );
671
+ }
672
+
673
+
674
+ // First, set the dialog to an appropriate size.
675
+ this.resize( definition.minWidth, definition.minHeight );
676
+
677
+ // Select the first tab by default.
678
+ this.selectPage( this.definition.contents[0].id );
679
+
680
+ // Reset all inputs back to their default value.
681
+ this.reset();
682
+
683
+ // Set z-index.
684
+ if ( CKEDITOR.dialog._.currentZIndex === null )
685
+ CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
686
+ this._.element.getFirst().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex += 10 );
687
+
688
+ // Maintain the dialog ordering and dialog cover.
689
+ // Also register key handlers if first dialog.
690
+ if ( CKEDITOR.dialog._.currentTop === null )
691
+ {
692
+ CKEDITOR.dialog._.currentTop = this;
693
+ this._.parentDialog = null;
694
+ addCover( this._.editor );
695
+
696
+ element.on( 'keydown', accessKeyDownHandler );
697
+ element.on( CKEDITOR.env.opera ? 'keypress' : 'keyup', accessKeyUpHandler );
698
+
699
+ // Prevent some keys from bubbling up. (#4269)
700
+ for ( var event in { keyup :1, keydown :1, keypress :1 } )
701
+ element.on( event, preventKeyBubbling );
702
+ }
703
+ else
704
+ {
705
+ this._.parentDialog = CKEDITOR.dialog._.currentTop;
706
+ var parentElement = this._.parentDialog.getElement().getFirst();
707
+ parentElement.$.style.zIndex -= Math.floor( this._.editor.config.baseFloatZIndex / 2 );
708
+ CKEDITOR.dialog._.currentTop = this;
709
+ }
710
+
711
+ // Register the Esc hotkeys.
712
+ registerAccessKey( this, this, '\x1b', null, function()
713
+ {
714
+ this.getButton( 'cancel' ) && this.getButton( 'cancel' ).click();
715
+ } );
716
+
717
+ // Reset the hasFocus state.
718
+ this._.hasFocus = false;
719
+
720
+ // Rearrange the dialog to the middle of the window.
721
+ CKEDITOR.tools.setTimeout( function()
722
+ {
723
+ var viewSize = CKEDITOR.document.getWindow().getViewPaneSize();
724
+ var dialogSize = this.getSize();
725
+
726
+ // We're using definition size for initial position because of
727
+ // offten corrupted data in offsetWidth at this point. (#4084)
728
+ this.move( ( viewSize.width - definition.minWidth ) / 2, ( viewSize.height - dialogSize.height ) / 2 );
729
+
730
+ this.parts.dialog.setStyle( 'visibility', '' );
731
+
732
+ // Execute onLoad for the first show.
733
+ this.fireOnce( 'load', {} );
734
+ this.fire( 'show', {} );
735
+ this._.editor.fire( 'dialogShow', this );
736
+
737
+ // Save the initial values of the dialog.
738
+ this.foreach( function( contentObj ) { contentObj.setInitValue && contentObj.setInitValue(); } );
739
+
740
+ },
741
+ 100, this );
742
+ },
743
+
744
+ /**
745
+ * Executes a function for each UI element.
746
+ * @param {Function} fn Function to execute for each UI element.
747
+ * @returns {CKEDITOR.dialog} The current dialog object.
748
+ */
749
+ foreach : function( fn )
750
+ {
751
+ for ( var i in this._.contents )
752
+ {
753
+ for ( var j in this._.contents[i] )
754
+ fn( this._.contents[i][j]);
755
+ }
756
+ return this;
757
+ },
758
+
759
+ /**
760
+ * Resets all input values in the dialog.
761
+ * @example
762
+ * dialogObj.reset();
763
+ * @returns {CKEDITOR.dialog} The current dialog object.
764
+ */
765
+ reset : (function()
766
+ {
767
+ var fn = function( widget ){ if ( widget.reset ) widget.reset(); };
768
+ return function(){ this.foreach( fn ); return this; };
769
+ })(),
770
+
771
+ setupContent : function()
772
+ {
773
+ var args = arguments;
774
+ this.foreach( function( widget )
775
+ {
776
+ if ( widget.setup )
777
+ widget.setup.apply( widget, args );
778
+ });
779
+ },
780
+
781
+ commitContent : function()
782
+ {
783
+ var args = arguments;
784
+ this.foreach( function( widget )
785
+ {
786
+ if ( widget.commit )
787
+ widget.commit.apply( widget, args );
788
+ });
789
+ },
790
+
791
+ /**
792
+ * Hides the dialog box.
793
+ * @example
794
+ * dialogObj.hide();
795
+ */
796
+ hide : function()
797
+ {
798
+ this.fire( 'hide', {} );
799
+ this._.editor.fire( 'dialogHide', this );
800
+
801
+ // Remove the dialog's element from the root document.
802
+ var element = this._.element;
803
+ if ( !element.getParent() )
804
+ return;
805
+
806
+ element.remove();
807
+ this.parts.dialog.setStyle( 'visibility', 'hidden' );
808
+
809
+ // Unregister all access keys associated with this dialog.
810
+ unregisterAccessKey( this );
811
+
812
+ // Maintain dialog ordering and remove cover if needed.
813
+ if ( !this._.parentDialog )
814
+ removeCover();
815
+ else
816
+ {
817
+ var parentElement = this._.parentDialog.getElement().getFirst();
818
+ parentElement.setStyle( 'z-index', parseInt( parentElement.$.style.zIndex, 10 ) + Math.floor( this._.editor.config.baseFloatZIndex / 2 ) );
819
+ }
820
+ CKEDITOR.dialog._.currentTop = this._.parentDialog;
821
+
822
+ // Deduct or clear the z-index.
823
+ if ( !this._.parentDialog )
824
+ {
825
+ CKEDITOR.dialog._.currentZIndex = null;
826
+
827
+ // Remove access key handlers.
828
+ element.removeListener( 'keydown', accessKeyDownHandler );
829
+ element.removeListener( CKEDITOR.env.opera ? 'keypress' : 'keyup', accessKeyUpHandler );
830
+
831
+ // Remove bubbling-prevention handler. (#4269)
832
+ for ( var event in { keyup :1, keydown :1, keypress :1 } )
833
+ element.removeListener( event, preventKeyBubbling );
834
+
835
+ var editor = this._.editor;
836
+ editor.focus();
837
+
838
+ if ( editor.mode == 'wysiwyg' && CKEDITOR.env.ie )
839
+ {
840
+ var selection = editor.getSelection();
841
+ selection && selection.unlock( true );
842
+ }
843
+ }
844
+ else
845
+ CKEDITOR.dialog._.currentZIndex -= 10;
846
+
847
+
848
+ // Reset the initial values of the dialog.
849
+ this.foreach( function( contentObj ) { contentObj.resetInitValue && contentObj.resetInitValue(); } );
850
+ },
851
+
852
+ /**
853
+ * Adds a tabbed page into the dialog.
854
+ * @param {Object} contents Content definition.
855
+ * @example
856
+ */
857
+ addPage : function( contents )
858
+ {
859
+ var pageHtml = [],
860
+ titleHtml = contents.label ? ' title="' + CKEDITOR.tools.htmlEncode( contents.label ) + '"' : '',
861
+ elements = contents.elements,
862
+ vbox = CKEDITOR.dialog._.uiElementBuilders.vbox.build( this,
863
+ {
864
+ type : 'vbox',
865
+ className : 'cke_dialog_page_contents',
866
+ children : contents.elements,
867
+ expand : !!contents.expand,
868
+ padding : contents.padding,
869
+ style : contents.style || 'width: 100%; height: 100%;'
870
+ }, pageHtml );
871
+
872
+ // Create the HTML for the tab and the content block.
873
+ var page = CKEDITOR.dom.element.createFromHtml( pageHtml.join( '' ) );
874
+ page.setAttribute( 'role', 'tabpanel' );
875
+
876
+ var env = CKEDITOR.env;
877
+ var tabId = contents.id + '_' + CKEDITOR.tools.getNextNumber(),
878
+ tab = CKEDITOR.dom.element.createFromHtml( [
879
+ '<a class="cke_dialog_tab"',
880
+ ( this._.pageCount > 0 ? ' cke_last' : 'cke_first' ),
881
+ titleHtml,
882
+ ( !!contents.hidden ? ' style="display:none"' : '' ),
883
+ ' id="', tabId, '"',
884
+ env.gecko && env.version >= 10900 && !env.hc ? '' : ' href="javascript:void(0)"',
885
+ ' tabIndex="-1"',
886
+ ' hidefocus="true"',
887
+ ' role="tab">',
888
+ contents.label,
889
+ '</a>'
890
+ ].join( '' ) );
891
+
892
+ page.setAttribute( 'aria-labelledby', tabId );
893
+
894
+ // Take records for the tabs and elements created.
895
+ this._.tabs[ contents.id ] = [ tab, page ];
896
+ this._.tabIdList.push( contents.id );
897
+ !contents.hidden && this._.pageCount++;
898
+ this._.lastTab = tab;
899
+ this.updateStyle();
900
+
901
+ var contentMap = this._.contents[ contents.id ] = {},
902
+ cursor,
903
+ children = vbox.getChild();
904
+
905
+ while ( ( cursor = children.shift() ) )
906
+ {
907
+ contentMap[ cursor.id ] = cursor;
908
+ if ( typeof( cursor.getChild ) == 'function' )
909
+ children.push.apply( children, cursor.getChild() );
910
+ }
911
+
912
+ // Attach the DOM nodes.
913
+
914
+ page.setAttribute( 'name', contents.id );
915
+ page.appendTo( this.parts.contents );
916
+
917
+ tab.unselectable();
918
+ this.parts.tabs.append( tab );
919
+
920
+ // Add access key handlers if access key is defined.
921
+ if ( contents.accessKey )
922
+ {
923
+ registerAccessKey( this, this, 'CTRL+' + contents.accessKey,
924
+ tabAccessKeyDown, tabAccessKeyUp );
925
+ this._.accessKeyMap[ 'CTRL+' + contents.accessKey ] = contents.id;
926
+ }
927
+ },
928
+
929
+ /**
930
+ * Activates a tab page in the dialog by its id.
931
+ * @param {String} id The id of the dialog tab to be activated.
932
+ * @example
933
+ * dialogObj.selectPage( 'tab_1' );
934
+ */
935
+ selectPage : function( id )
936
+ {
937
+ // Hide the non-selected tabs and pages.
938
+ for ( var i in this._.tabs )
939
+ {
940
+ var tab = this._.tabs[i][0],
941
+ page = this._.tabs[i][1];
942
+ if ( i != id )
943
+ {
944
+ tab.removeClass( 'cke_dialog_tab_selected' );
945
+ page.hide();
946
+ }
947
+ page.setAttribute( 'aria-hidden', i != id );
948
+ }
949
+
950
+ var selected = this._.tabs[id];
951
+ selected[0].addClass( 'cke_dialog_tab_selected' );
952
+ selected[1].show();
953
+ this._.currentTabId = id;
954
+ this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id );
955
+ },
956
+
957
+ // Dialog state-specific style updates.
958
+ updateStyle : function()
959
+ {
960
+ // If only a single page shown, a different style is used in the central pane.
961
+ this.parts.dialog[ ( this._.pageCount === 1 ? 'add' : 'remove' ) + 'Class' ]( 'cke_single_page' );
962
+ },
963
+
964
+ /**
965
+ * Hides a page's tab away from the dialog.
966
+ * @param {String} id The page's Id.
967
+ * @example
968
+ * dialog.hidePage( 'tab_3' );
969
+ */
970
+ hidePage : function( id )
971
+ {
972
+ var tab = this._.tabs[id] && this._.tabs[id][0];
973
+ if ( !tab || this._.pageCount == 1 )
974
+ return;
975
+ // Switch to other tab first when we're hiding the active tab.
976
+ else if ( id == this._.currentTabId )
977
+ this.selectPage( getPreviousVisibleTab.call( this ) );
978
+
979
+ tab.hide();
980
+ this._.pageCount--;
981
+ this.updateStyle();
982
+ },
983
+
984
+ /**
985
+ * Unhides a page's tab.
986
+ * @param {String} id The page's Id.
987
+ * @example
988
+ * dialog.showPage( 'tab_2' );
989
+ */
990
+ showPage : function( id )
991
+ {
992
+ var tab = this._.tabs[id] && this._.tabs[id][0];
993
+ if ( !tab )
994
+ return;
995
+ tab.show();
996
+ this._.pageCount++;
997
+ this.updateStyle();
998
+ },
999
+
1000
+ /**
1001
+ * Gets the root DOM element of the dialog.
1002
+ * @returns {CKEDITOR.dom.element} The &lt;span&gt; element containing this dialog.
1003
+ * @example
1004
+ * var dialogElement = dialogObj.getElement().getFirst();
1005
+ * dialogElement.setStyle( 'padding', '5px' );
1006
+ */
1007
+ getElement : function()
1008
+ {
1009
+ return this._.element;
1010
+ },
1011
+
1012
+ /**
1013
+ * Gets the name of the dialog.
1014
+ * @returns {String} The name of this dialog.
1015
+ * @example
1016
+ * var dialogName = dialogObj.getName();
1017
+ */
1018
+ getName : function()
1019
+ {
1020
+ return this._.name;
1021
+ },
1022
+
1023
+ /**
1024
+ * Gets a dialog UI element object from a dialog page.
1025
+ * @param {String} pageId id of dialog page.
1026
+ * @param {String} elementId id of UI element.
1027
+ * @example
1028
+ * @returns {CKEDITOR.ui.dialog.uiElement} The dialog UI element.
1029
+ */
1030
+ getContentElement : function( pageId, elementId )
1031
+ {
1032
+ var page = this._.contents[ pageId ];
1033
+ return page && page[ elementId ];
1034
+ },
1035
+
1036
+ /**
1037
+ * Gets the value of a dialog UI element.
1038
+ * @param {String} pageId id of dialog page.
1039
+ * @param {String} elementId id of UI element.
1040
+ * @example
1041
+ * @returns {Object} The value of the UI element.
1042
+ */
1043
+ getValueOf : function( pageId, elementId )
1044
+ {
1045
+ return this.getContentElement( pageId, elementId ).getValue();
1046
+ },
1047
+
1048
+ /**
1049
+ * Sets the value of a dialog UI element.
1050
+ * @param {String} pageId id of the dialog page.
1051
+ * @param {String} elementId id of the UI element.
1052
+ * @param {Object} value The new value of the UI element.
1053
+ * @example
1054
+ */
1055
+ setValueOf : function( pageId, elementId, value )
1056
+ {
1057
+ return this.getContentElement( pageId, elementId ).setValue( value );
1058
+ },
1059
+
1060
+ /**
1061
+ * Gets the UI element of a button in the dialog's button row.
1062
+ * @param {String} id The id of the button.
1063
+ * @example
1064
+ * @returns {CKEDITOR.ui.dialog.button} The button object.
1065
+ */
1066
+ getButton : function( id )
1067
+ {
1068
+ return this._.buttons[ id ];
1069
+ },
1070
+
1071
+ /**
1072
+ * Simulates a click to a dialog button in the dialog's button row.
1073
+ * @param {String} id The id of the button.
1074
+ * @example
1075
+ * @returns The return value of the dialog's "click" event.
1076
+ */
1077
+ click : function( id )
1078
+ {
1079
+ return this._.buttons[ id ].click();
1080
+ },
1081
+
1082
+ /**
1083
+ * Disables a dialog button.
1084
+ * @param {String} id The id of the button.
1085
+ * @example
1086
+ */
1087
+ disableButton : function( id )
1088
+ {
1089
+ return this._.buttons[ id ].disable();
1090
+ },
1091
+
1092
+ /**
1093
+ * Enables a dialog button.
1094
+ * @param {String} id The id of the button.
1095
+ * @example
1096
+ */
1097
+ enableButton : function( id )
1098
+ {
1099
+ return this._.buttons[ id ].enable();
1100
+ },
1101
+
1102
+ /**
1103
+ * Gets the number of pages in the dialog.
1104
+ * @returns {Number} Page count.
1105
+ */
1106
+ getPageCount : function()
1107
+ {
1108
+ return this._.pageCount;
1109
+ },
1110
+
1111
+ /**
1112
+ * Gets the editor instance which opened this dialog.
1113
+ * @returns {CKEDITOR.editor} Parent editor instances.
1114
+ */
1115
+ getParentEditor : function()
1116
+ {
1117
+ return this._.editor;
1118
+ },
1119
+
1120
+ /**
1121
+ * Gets the element that was selected when opening the dialog, if any.
1122
+ * @returns {CKEDITOR.dom.element} The element that was selected, or null.
1123
+ */
1124
+ getSelectedElement : function()
1125
+ {
1126
+ return this.getParentEditor().getSelection().getSelectedElement();
1127
+ },
1128
+
1129
+ /**
1130
+ * Adds element to dialog's focusable list.
1131
+ *
1132
+ * @param {CKEDITOR.dom.element} element
1133
+ * @param {Number} [index]
1134
+ */
1135
+ addFocusable: function( element, index ) {
1136
+ if ( typeof index == 'undefined' )
1137
+ {
1138
+ index = this._.focusList.length;
1139
+ this._.focusList.push( new Focusable( this, element, index ) );
1140
+ }
1141
+ else
1142
+ {
1143
+ this._.focusList.splice( index, 0, new Focusable( this, element, index ) );
1144
+ for ( var i = index + 1 ; i < this._.focusList.length ; i++ )
1145
+ this._.focusList[ i ].focusIndex++;
1146
+ }
1147
+ }
1148
+ };
1149
+
1150
+ CKEDITOR.tools.extend( CKEDITOR.dialog,
1151
+ /**
1152
+ * @lends CKEDITOR.dialog
1153
+ */
1154
+ {
1155
+ /**
1156
+ * Registers a dialog.
1157
+ * @param {String} name The dialog's name.
1158
+ * @param {Function|String} dialogDefinition
1159
+ * A function returning the dialog's definition, or the URL to the .js file holding the function.
1160
+ * The function should accept an argument "editor" which is the current editor instance, and
1161
+ * return an object conforming to {@link CKEDITOR.dialog.dialogDefinition}.
1162
+ * @example
1163
+ * @see CKEDITOR.dialog.dialogDefinition
1164
+ */
1165
+ add : function( name, dialogDefinition )
1166
+ {
1167
+ // Avoid path registration from multiple instances override definition.
1168
+ if ( !this._.dialogDefinitions[name]
1169
+ || typeof dialogDefinition == 'function' )
1170
+ this._.dialogDefinitions[name] = dialogDefinition;
1171
+ },
1172
+
1173
+ exists : function( name )
1174
+ {
1175
+ return !!this._.dialogDefinitions[ name ];
1176
+ },
1177
+
1178
+ getCurrent : function()
1179
+ {
1180
+ return CKEDITOR.dialog._.currentTop;
1181
+ },
1182
+
1183
+ /**
1184
+ * The default OK button for dialogs. Fires the "ok" event and closes the dialog if the event succeeds.
1185
+ * @static
1186
+ * @field
1187
+ * @example
1188
+ * @type Function
1189
+ */
1190
+ okButton : (function()
1191
+ {
1192
+ var retval = function( editor, override )
1193
+ {
1194
+ override = override || {};
1195
+ return CKEDITOR.tools.extend( {
1196
+ id : 'ok',
1197
+ type : 'button',
1198
+ label : editor.lang.common.ok,
1199
+ 'class' : 'cke_dialog_ui_button_ok',
1200
+ onClick : function( evt )
1201
+ {
1202
+ var dialog = evt.data.dialog;
1203
+ if ( dialog.fire( 'ok', { hide : true } ).hide !== false )
1204
+ dialog.hide();
1205
+ }
1206
+ }, override, true );
1207
+ };
1208
+ retval.type = 'button';
1209
+ retval.override = function( override )
1210
+ {
1211
+ return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); },
1212
+ { type : 'button' }, true );
1213
+ };
1214
+ return retval;
1215
+ })(),
1216
+
1217
+ /**
1218
+ * The default cancel button for dialogs. Fires the "cancel" event and closes the dialog if no UI element value changed.
1219
+ * @static
1220
+ * @field
1221
+ * @example
1222
+ * @type Function
1223
+ */
1224
+ cancelButton : (function()
1225
+ {
1226
+ var retval = function( editor, override )
1227
+ {
1228
+ override = override || {};
1229
+ return CKEDITOR.tools.extend( {
1230
+ id : 'cancel',
1231
+ type : 'button',
1232
+ label : editor.lang.common.cancel,
1233
+ 'class' : 'cke_dialog_ui_button_cancel',
1234
+ onClick : function( evt )
1235
+ {
1236
+ var dialog = evt.data.dialog;
1237
+ if ( dialog.fire( 'cancel', { hide : true } ).hide !== false )
1238
+ dialog.hide();
1239
+ }
1240
+ }, override, true );
1241
+ };
1242
+ retval.type = 'button';
1243
+ retval.override = function( override )
1244
+ {
1245
+ return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); },
1246
+ { type : 'button' }, true );
1247
+ };
1248
+ return retval;
1249
+ })(),
1250
+
1251
+ /**
1252
+ * Registers a dialog UI element.
1253
+ * @param {String} typeName The name of the UI element.
1254
+ * @param {Function} builder The function to build the UI element.
1255
+ * @example
1256
+ */
1257
+ addUIElement : function( typeName, builder )
1258
+ {
1259
+ this._.uiElementBuilders[ typeName ] = builder;
1260
+ }
1261
+ });
1262
+
1263
+ CKEDITOR.dialog._ =
1264
+ {
1265
+ uiElementBuilders : {},
1266
+
1267
+ dialogDefinitions : {},
1268
+
1269
+ currentTop : null,
1270
+
1271
+ currentZIndex : null
1272
+ };
1273
+
1274
+ // "Inherit" (copy actually) from CKEDITOR.event.
1275
+ CKEDITOR.event.implementOn( CKEDITOR.dialog );
1276
+ CKEDITOR.event.implementOn( CKEDITOR.dialog.prototype, true );
1277
+
1278
+ var defaultDialogDefinition =
1279
+ {
1280
+ resizable : CKEDITOR.DIALOG_RESIZE_BOTH,
1281
+ minWidth : 600,
1282
+ minHeight : 400,
1283
+ buttons : [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
1284
+ };
1285
+
1286
+ // The buttons in MacOS Apps are in reverse order #4750
1287
+ CKEDITOR.env.mac && defaultDialogDefinition.buttons.reverse();
1288
+
1289
+ // Tool function used to return an item from an array based on its id
1290
+ // property.
1291
+ var getById = function( array, id, recurse )
1292
+ {
1293
+ for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
1294
+ {
1295
+ if ( item.id == id )
1296
+ return item;
1297
+ if ( recurse && item[ recurse ] )
1298
+ {
1299
+ var retval = getById( item[ recurse ], id, recurse ) ;
1300
+ if ( retval )
1301
+ return retval;
1302
+ }
1303
+ }
1304
+ return null;
1305
+ };
1306
+
1307
+ // Tool function used to add an item into an array.
1308
+ var addById = function( array, newItem, nextSiblingId, recurse, nullIfNotFound )
1309
+ {
1310
+ if ( nextSiblingId )
1311
+ {
1312
+ for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
1313
+ {
1314
+ if ( item.id == nextSiblingId )
1315
+ {
1316
+ array.splice( i, 0, newItem );
1317
+ return newItem;
1318
+ }
1319
+
1320
+ if ( recurse && item[ recurse ] )
1321
+ {
1322
+ var retval = addById( item[ recurse ], newItem, nextSiblingId, recurse, true );
1323
+ if ( retval )
1324
+ return retval;
1325
+ }
1326
+ }
1327
+
1328
+ if ( nullIfNotFound )
1329
+ return null;
1330
+ }
1331
+
1332
+ array.push( newItem );
1333
+ return newItem;
1334
+ };
1335
+
1336
+ // Tool function used to remove an item from an array based on its id.
1337
+ var removeById = function( array, id, recurse )
1338
+ {
1339
+ for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
1340
+ {
1341
+ if ( item.id == id )
1342
+ return array.splice( i, 1 );
1343
+ if ( recurse && item[ recurse ] )
1344
+ {
1345
+ var retval = removeById( item[ recurse ], id, recurse );
1346
+ if ( retval )
1347
+ return retval;
1348
+ }
1349
+ }
1350
+ return null;
1351
+ };
1352
+
1353
+ /**
1354
+ * This class is not really part of the API. It is the "definition" property value
1355
+ * passed to "dialogDefinition" event handlers.
1356
+ * @constructor
1357
+ * @name CKEDITOR.dialog.dialogDefinitionObject
1358
+ * @extends CKEDITOR.dialog.dialogDefinition
1359
+ * @example
1360
+ * CKEDITOR.on( 'dialogDefinition', function( evt )
1361
+ * {
1362
+ * var definition = evt.data.definition;
1363
+ * var content = definition.getContents( 'page1' );
1364
+ * ...
1365
+ * } );
1366
+ */
1367
+ var definitionObject = function( dialog, dialogDefinition )
1368
+ {
1369
+ // TODO : Check if needed.
1370
+ this.dialog = dialog;
1371
+
1372
+ // Transform the contents entries in contentObjects.
1373
+ var contents = dialogDefinition.contents;
1374
+ for ( var i = 0, content ; ( content = contents[i] ) ; i++ )
1375
+ contents[ i ] = new contentObject( dialog, content );
1376
+
1377
+ CKEDITOR.tools.extend( this, dialogDefinition );
1378
+ };
1379
+
1380
+ definitionObject.prototype =
1381
+ /** @lends CKEDITOR.dialog.dialogDefinitionObject.prototype */
1382
+ {
1383
+ /**
1384
+ * Gets a content definition.
1385
+ * @param {String} id The id of the content definition.
1386
+ * @returns {CKEDITOR.dialog.contentDefinition} The content definition
1387
+ * matching id.
1388
+ */
1389
+ getContents : function( id )
1390
+ {
1391
+ return getById( this.contents, id );
1392
+ },
1393
+
1394
+ /**
1395
+ * Gets a button definition.
1396
+ * @param {String} id The id of the button definition.
1397
+ * @returns {CKEDITOR.dialog.buttonDefinition} The button definition
1398
+ * matching id.
1399
+ */
1400
+ getButton : function( id )
1401
+ {
1402
+ return getById( this.buttons, id );
1403
+ },
1404
+
1405
+ /**
1406
+ * Adds a content definition object under this dialog definition.
1407
+ * @param {CKEDITOR.dialog.contentDefinition} contentDefinition The
1408
+ * content definition.
1409
+ * @param {String} [nextSiblingId] The id of an existing content
1410
+ * definition which the new content definition will be inserted
1411
+ * before. Omit if the new content definition is to be inserted as
1412
+ * the last item.
1413
+ * @returns {CKEDITOR.dialog.contentDefinition} The inserted content
1414
+ * definition.
1415
+ */
1416
+ addContents : function( contentDefinition, nextSiblingId )
1417
+ {
1418
+ return addById( this.contents, contentDefinition, nextSiblingId );
1419
+ },
1420
+
1421
+ /**
1422
+ * Adds a button definition object under this dialog definition.
1423
+ * @param {CKEDITOR.dialog.buttonDefinition} buttonDefinition The
1424
+ * button definition.
1425
+ * @param {String} [nextSiblingId] The id of an existing button
1426
+ * definition which the new button definition will be inserted
1427
+ * before. Omit if the new button definition is to be inserted as
1428
+ * the last item.
1429
+ * @returns {CKEDITOR.dialog.buttonDefinition} The inserted button
1430
+ * definition.
1431
+ */
1432
+ addButton : function( buttonDefinition, nextSiblingId )
1433
+ {
1434
+ return addById( this.buttons, buttonDefinition, nextSiblingId );
1435
+ },
1436
+
1437
+ /**
1438
+ * Removes a content definition from this dialog definition.
1439
+ * @param {String} id The id of the content definition to be removed.
1440
+ * @returns {CKEDITOR.dialog.contentDefinition} The removed content
1441
+ * definition.
1442
+ */
1443
+ removeContents : function( id )
1444
+ {
1445
+ removeById( this.contents, id );
1446
+ },
1447
+
1448
+ /**
1449
+ * Removes a button definition from the dialog definition.
1450
+ * @param {String} id The id of the button definition to be removed.
1451
+ * @returns {CKEDITOR.dialog.buttonDefinition} The removed button
1452
+ * definition.
1453
+ */
1454
+ removeButton : function( id )
1455
+ {
1456
+ removeById( this.buttons, id );
1457
+ }
1458
+ };
1459
+
1460
+ /**
1461
+ * This class is not really part of the API. It is the template of the
1462
+ * objects representing content pages inside the
1463
+ * CKEDITOR.dialog.dialogDefinitionObject.
1464
+ * @constructor
1465
+ * @name CKEDITOR.dialog.contentDefinitionObject
1466
+ * @example
1467
+ * CKEDITOR.on( 'dialogDefinition', function( evt )
1468
+ * {
1469
+ * var definition = evt.data.definition;
1470
+ * var content = definition.getContents( 'page1' );
1471
+ * content.remove( 'textInput1' );
1472
+ * ...
1473
+ * } );
1474
+ */
1475
+ function contentObject( dialog, contentDefinition )
1476
+ {
1477
+ this._ =
1478
+ {
1479
+ dialog : dialog
1480
+ };
1481
+
1482
+ CKEDITOR.tools.extend( this, contentDefinition );
1483
+ }
1484
+
1485
+ contentObject.prototype =
1486
+ /** @lends CKEDITOR.dialog.contentDefinitionObject.prototype */
1487
+ {
1488
+ /**
1489
+ * Gets a UI element definition under the content definition.
1490
+ * @param {String} id The id of the UI element definition.
1491
+ * @returns {CKEDITOR.dialog.uiElementDefinition}
1492
+ */
1493
+ get : function( id )
1494
+ {
1495
+ return getById( this.elements, id, 'children' );
1496
+ },
1497
+
1498
+ /**
1499
+ * Adds a UI element definition to the content definition.
1500
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition The
1501
+ * UI elemnet definition to be added.
1502
+ * @param {String} nextSiblingId The id of an existing UI element
1503
+ * definition which the new UI element definition will be inserted
1504
+ * before. Omit if the new button definition is to be inserted as
1505
+ * the last item.
1506
+ * @returns {CKEDITOR.dialog.uiElementDefinition} The element
1507
+ * definition inserted.
1508
+ */
1509
+ add : function( elementDefinition, nextSiblingId )
1510
+ {
1511
+ return addById( this.elements, elementDefinition, nextSiblingId, 'children' );
1512
+ },
1513
+
1514
+ /**
1515
+ * Removes a UI element definition from the content definition.
1516
+ * @param {String} id The id of the UI element definition to be
1517
+ * removed.
1518
+ * @returns {CKEDITOR.dialog.uiElementDefinition} The element
1519
+ * definition removed.
1520
+ * @example
1521
+ */
1522
+ remove : function( id )
1523
+ {
1524
+ removeById( this.elements, id, 'children' );
1525
+ }
1526
+ };
1527
+
1528
+ function initDragAndDrop( dialog )
1529
+ {
1530
+ var lastCoords = null,
1531
+ abstractDialogCoords = null,
1532
+ element = dialog.getElement().getFirst(),
1533
+ editor = dialog.getParentEditor(),
1534
+ magnetDistance = editor.config.dialog_magnetDistance,
1535
+ margins = editor.skin.margins || [ 0, 0, 0, 0 ];
1536
+
1537
+ if ( typeof magnetDistance == 'undefined' )
1538
+ magnetDistance = 20;
1539
+
1540
+ function mouseMoveHandler( evt )
1541
+ {
1542
+ var dialogSize = dialog.getSize(),
1543
+ viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
1544
+ x = evt.data.$.screenX,
1545
+ y = evt.data.$.screenY,
1546
+ dx = x - lastCoords.x,
1547
+ dy = y - lastCoords.y,
1548
+ realX, realY;
1549
+
1550
+ lastCoords = { x : x, y : y };
1551
+ abstractDialogCoords.x += dx;
1552
+ abstractDialogCoords.y += dy;
1553
+
1554
+ if ( abstractDialogCoords.x + margins[3] < magnetDistance )
1555
+ realX = - margins[3];
1556
+ else if ( abstractDialogCoords.x - margins[1] > viewPaneSize.width - dialogSize.width - magnetDistance )
1557
+ realX = viewPaneSize.width - dialogSize.width + margins[1];
1558
+ else
1559
+ realX = abstractDialogCoords.x;
1560
+
1561
+ if ( abstractDialogCoords.y + margins[0] < magnetDistance )
1562
+ realY = - margins[0];
1563
+ else if ( abstractDialogCoords.y - margins[2] > viewPaneSize.height - dialogSize.height - magnetDistance )
1564
+ realY = viewPaneSize.height - dialogSize.height + margins[2];
1565
+ else
1566
+ realY = abstractDialogCoords.y;
1567
+
1568
+ dialog.move( realX, realY );
1569
+
1570
+ evt.data.preventDefault();
1571
+ }
1572
+
1573
+ function mouseUpHandler( evt )
1574
+ {
1575
+ CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
1576
+ CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
1577
+
1578
+ if ( CKEDITOR.env.ie6Compat )
1579
+ {
1580
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1581
+ coverDoc.removeListener( 'mousemove', mouseMoveHandler );
1582
+ coverDoc.removeListener( 'mouseup', mouseUpHandler );
1583
+ }
1584
+ }
1585
+
1586
+ dialog.parts.title.on( 'mousedown', function( evt )
1587
+ {
1588
+ dialog._.updateSize = true;
1589
+
1590
+ lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
1591
+
1592
+ CKEDITOR.document.on( 'mousemove', mouseMoveHandler );
1593
+ CKEDITOR.document.on( 'mouseup', mouseUpHandler );
1594
+ abstractDialogCoords = dialog.getPosition();
1595
+
1596
+ if ( CKEDITOR.env.ie6Compat )
1597
+ {
1598
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1599
+ coverDoc.on( 'mousemove', mouseMoveHandler );
1600
+ coverDoc.on( 'mouseup', mouseUpHandler );
1601
+ }
1602
+
1603
+ evt.data.preventDefault();
1604
+ }, dialog );
1605
+ }
1606
+
1607
+ function initResizeHandles( dialog )
1608
+ {
1609
+ var definition = dialog.definition,
1610
+ minWidth = definition.minWidth || 0,
1611
+ minHeight = definition.minHeight || 0,
1612
+ resizable = definition.resizable,
1613
+ margins = dialog.getParentEditor().skin.margins || [ 0, 0, 0, 0 ];
1614
+
1615
+ function topSizer( coords, dy )
1616
+ {
1617
+ coords.y += dy;
1618
+ }
1619
+
1620
+ function rightSizer( coords, dx )
1621
+ {
1622
+ coords.x2 += dx;
1623
+ }
1624
+
1625
+ function bottomSizer( coords, dy )
1626
+ {
1627
+ coords.y2 += dy;
1628
+ }
1629
+
1630
+ function leftSizer( coords, dx )
1631
+ {
1632
+ coords.x += dx;
1633
+ }
1634
+
1635
+ var lastCoords = null,
1636
+ abstractDialogCoords = null,
1637
+ magnetDistance = dialog._.editor.config.magnetDistance,
1638
+ parts = [ 'tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br' ];
1639
+
1640
+ function mouseDownHandler( evt )
1641
+ {
1642
+ var partName = evt.listenerData.part, size = dialog.getSize();
1643
+ abstractDialogCoords = dialog.getPosition();
1644
+ CKEDITOR.tools.extend( abstractDialogCoords,
1645
+ {
1646
+ x2 : abstractDialogCoords.x + size.width,
1647
+ y2 : abstractDialogCoords.y + size.height
1648
+ } );
1649
+ lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
1650
+
1651
+ CKEDITOR.document.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
1652
+ CKEDITOR.document.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
1653
+
1654
+ if ( CKEDITOR.env.ie6Compat )
1655
+ {
1656
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1657
+ coverDoc.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
1658
+ coverDoc.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
1659
+ }
1660
+
1661
+ evt.data.preventDefault();
1662
+ }
1663
+
1664
+ function mouseMoveHandler( evt )
1665
+ {
1666
+ var x = evt.data.$.screenX,
1667
+ y = evt.data.$.screenY,
1668
+ dx = x - lastCoords.x,
1669
+ dy = y - lastCoords.y,
1670
+ viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
1671
+ partName = evt.listenerData.part;
1672
+
1673
+ if ( partName.search( 't' ) != -1 )
1674
+ topSizer( abstractDialogCoords, dy );
1675
+ if ( partName.search( 'l' ) != -1 )
1676
+ leftSizer( abstractDialogCoords, dx );
1677
+ if ( partName.search( 'b' ) != -1 )
1678
+ bottomSizer( abstractDialogCoords, dy );
1679
+ if ( partName.search( 'r' ) != -1 )
1680
+ rightSizer( abstractDialogCoords, dx );
1681
+
1682
+ lastCoords = { x : x, y : y };
1683
+
1684
+ var realX, realY, realX2, realY2;
1685
+
1686
+ if ( abstractDialogCoords.x + margins[3] < magnetDistance )
1687
+ realX = - margins[3];
1688
+ else if ( partName.search( 'l' ) != -1 && abstractDialogCoords.x2 - abstractDialogCoords.x < minWidth + magnetDistance )
1689
+ realX = abstractDialogCoords.x2 - minWidth;
1690
+ else
1691
+ realX = abstractDialogCoords.x;
1692
+
1693
+ if ( abstractDialogCoords.y + margins[0] < magnetDistance )
1694
+ realY = - margins[0];
1695
+ else if ( partName.search( 't' ) != -1 && abstractDialogCoords.y2 - abstractDialogCoords.y < minHeight + magnetDistance )
1696
+ realY = abstractDialogCoords.y2 - minHeight;
1697
+ else
1698
+ realY = abstractDialogCoords.y;
1699
+
1700
+ if ( abstractDialogCoords.x2 - margins[1] > viewPaneSize.width - magnetDistance )
1701
+ realX2 = viewPaneSize.width + margins[1] ;
1702
+ else if ( partName.search( 'r' ) != -1 && abstractDialogCoords.x2 - abstractDialogCoords.x < minWidth + magnetDistance )
1703
+ realX2 = abstractDialogCoords.x + minWidth;
1704
+ else
1705
+ realX2 = abstractDialogCoords.x2;
1706
+
1707
+ if ( abstractDialogCoords.y2 - margins[2] > viewPaneSize.height - magnetDistance )
1708
+ realY2= viewPaneSize.height + margins[2] ;
1709
+ else if ( partName.search( 'b' ) != -1 && abstractDialogCoords.y2 - abstractDialogCoords.y < minHeight + magnetDistance )
1710
+ realY2 = abstractDialogCoords.y + minHeight;
1711
+ else
1712
+ realY2 = abstractDialogCoords.y2 ;
1713
+
1714
+ dialog.move( realX, realY );
1715
+ dialog.resize( realX2 - realX, realY2 - realY );
1716
+
1717
+ evt.data.preventDefault();
1718
+ }
1719
+
1720
+ function mouseUpHandler( evt )
1721
+ {
1722
+ CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
1723
+ CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
1724
+
1725
+ if ( CKEDITOR.env.ie6Compat )
1726
+ {
1727
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1728
+ coverDoc.removeListener( 'mouseup', mouseUpHandler );
1729
+ coverDoc.removeListener( 'mousemove', mouseMoveHandler );
1730
+ }
1731
+ }
1732
+
1733
+ // TODO : Simplify the resize logic, having just a single resize grip <div>.
1734
+ // var widthTest = /[lr]/,
1735
+ // heightTest = /[tb]/;
1736
+ // for ( var i = 0 ; i < parts.length ; i++ )
1737
+ // {
1738
+ // var element = dialog.parts[ parts[i] + '_resize' ];
1739
+ // if ( resizable == CKEDITOR.DIALOG_RESIZE_NONE ||
1740
+ // resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT && widthTest.test( parts[i] ) ||
1741
+ // resizable == CKEDITOR.DIALOG_RESIZE_WIDTH && heightTest.test( parts[i] ) )
1742
+ // {
1743
+ // element.hide();
1744
+ // continue;
1745
+ // }
1746
+ // element.on( 'mousedown', mouseDownHandler, dialog, { part : parts[i] } );
1747
+ // }
1748
+ }
1749
+
1750
+ var resizeCover;
1751
+ var coverElement;
1752
+
1753
+ var addCover = function( editor )
1754
+ {
1755
+ var win = CKEDITOR.document.getWindow();
1756
+
1757
+ if ( !coverElement )
1758
+ {
1759
+ var backgroundColorStyle = editor.config.dialog_backgroundCoverColor || 'white';
1760
+
1761
+ var html = [
1762
+ '<div style="position: ', ( CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed' ),
1763
+ '; z-index: ', editor.config.baseFloatZIndex,
1764
+ '; top: 0px; left: 0px; ',
1765
+ ( !CKEDITOR.env.ie6Compat ? 'background-color: ' + backgroundColorStyle : '' ),
1766
+ '" id="cke_dialog_background_cover">'
1767
+ ];
1768
+
1769
+
1770
+ if ( CKEDITOR.env.ie6Compat )
1771
+ {
1772
+ // Support for custom document.domain in IE.
1773
+ var isCustomDomain = CKEDITOR.env.isCustomDomain(),
1774
+ iframeHtml = '<html><body style=\\\'background-color:' + backgroundColorStyle + ';\\\'></body></html>';
1775
+
1776
+ html.push(
1777
+ '<iframe' +
1778
+ ' hidefocus="true"' +
1779
+ ' frameborder="0"' +
1780
+ ' id="cke_dialog_background_iframe"' +
1781
+ ' src="javascript:' );
1782
+
1783
+ html.push( 'void((function(){' +
1784
+ 'document.open();' +
1785
+ ( isCustomDomain ? 'document.domain=\'' + document.domain + '\';' : '' ) +
1786
+ 'document.write( \'' + iframeHtml + '\' );' +
1787
+ 'document.close();' +
1788
+ '})())' );
1789
+
1790
+ html.push(
1791
+ '"' +
1792
+ ' style="' +
1793
+ 'position:absolute;' +
1794
+ 'left:0;' +
1795
+ 'top:0;' +
1796
+ 'width:100%;' +
1797
+ 'height: 100%;' +
1798
+ 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)">' +
1799
+ '</iframe>' );
1800
+ }
1801
+
1802
+ html.push( '</div>' );
1803
+
1804
+ coverElement = CKEDITOR.dom.element.createFromHtml( html.join( '' ) );
1805
+ }
1806
+
1807
+ var element = coverElement;
1808
+
1809
+ var resizeFunc = function()
1810
+ {
1811
+ var size = win.getViewPaneSize();
1812
+ element.setStyles(
1813
+ {
1814
+ width : size.width + 'px',
1815
+ height : size.height + 'px'
1816
+ } );
1817
+ };
1818
+
1819
+ var scrollFunc = function()
1820
+ {
1821
+ var pos = win.getScrollPosition(),
1822
+ cursor = CKEDITOR.dialog._.currentTop;
1823
+ element.setStyles(
1824
+ {
1825
+ left : pos.x + 'px',
1826
+ top : pos.y + 'px'
1827
+ });
1828
+
1829
+ do
1830
+ {
1831
+ var dialogPos = cursor.getPosition();
1832
+ cursor.move( dialogPos.x, dialogPos.y );
1833
+ } while ( ( cursor = cursor._.parentDialog ) );
1834
+ };
1835
+
1836
+ resizeCover = resizeFunc;
1837
+ win.on( 'resize', resizeFunc );
1838
+ resizeFunc();
1839
+ if ( CKEDITOR.env.ie6Compat )
1840
+ {
1841
+ // IE BUG: win.$.onscroll assignment doesn't work.. it must be window.onscroll.
1842
+ // So we need to invent a really funny way to make it work.
1843
+ var myScrollHandler = function()
1844
+ {
1845
+ scrollFunc();
1846
+ arguments.callee.prevScrollHandler.apply( this, arguments );
1847
+ };
1848
+ win.$.setTimeout( function()
1849
+ {
1850
+ myScrollHandler.prevScrollHandler = window.onscroll || function(){};
1851
+ window.onscroll = myScrollHandler;
1852
+ }, 0 );
1853
+ scrollFunc();
1854
+ }
1855
+
1856
+ var opacity = editor.config.dialog_backgroundCoverOpacity;
1857
+ element.setOpacity( typeof opacity != 'undefined' ? opacity : 0.5 );
1858
+
1859
+ element.appendTo( CKEDITOR.document.getBody() );
1860
+ };
1861
+
1862
+ var removeCover = function()
1863
+ {
1864
+ if ( !coverElement )
1865
+ return;
1866
+
1867
+ var win = CKEDITOR.document.getWindow();
1868
+ coverElement.remove();
1869
+ win.removeListener( 'resize', resizeCover );
1870
+
1871
+ if ( CKEDITOR.env.ie6Compat )
1872
+ {
1873
+ win.$.setTimeout( function()
1874
+ {
1875
+ var prevScrollHandler = window.onscroll && window.onscroll.prevScrollHandler;
1876
+ window.onscroll = prevScrollHandler || null;
1877
+ }, 0 );
1878
+ }
1879
+ resizeCover = null;
1880
+ };
1881
+
1882
+ var accessKeyProcessors = {};
1883
+
1884
+ var accessKeyDownHandler = function( evt )
1885
+ {
1886
+ var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey,
1887
+ alt = evt.data.$.altKey,
1888
+ shift = evt.data.$.shiftKey,
1889
+ key = String.fromCharCode( evt.data.$.keyCode ),
1890
+ keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key];
1891
+
1892
+ if ( !keyProcessor || !keyProcessor.length )
1893
+ return;
1894
+
1895
+ keyProcessor = keyProcessor[keyProcessor.length - 1];
1896
+ keyProcessor.keydown && keyProcessor.keydown.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key );
1897
+ evt.data.preventDefault();
1898
+ };
1899
+
1900
+ var accessKeyUpHandler = function( evt )
1901
+ {
1902
+ var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey,
1903
+ alt = evt.data.$.altKey,
1904
+ shift = evt.data.$.shiftKey,
1905
+ key = String.fromCharCode( evt.data.$.keyCode ),
1906
+ keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key];
1907
+
1908
+ if ( !keyProcessor || !keyProcessor.length )
1909
+ return;
1910
+
1911
+ keyProcessor = keyProcessor[keyProcessor.length - 1];
1912
+ if ( keyProcessor.keyup )
1913
+ {
1914
+ keyProcessor.keyup.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key );
1915
+ evt.data.preventDefault();
1916
+ }
1917
+ };
1918
+
1919
+ var registerAccessKey = function( uiElement, dialog, key, downFunc, upFunc )
1920
+ {
1921
+ var procList = accessKeyProcessors[key] || ( accessKeyProcessors[key] = [] );
1922
+ procList.push( {
1923
+ uiElement : uiElement,
1924
+ dialog : dialog,
1925
+ key : key,
1926
+ keyup : upFunc || uiElement.accessKeyUp,
1927
+ keydown : downFunc || uiElement.accessKeyDown
1928
+ } );
1929
+ };
1930
+
1931
+ var unregisterAccessKey = function( obj )
1932
+ {
1933
+ for ( var i in accessKeyProcessors )
1934
+ {
1935
+ var list = accessKeyProcessors[i];
1936
+ for ( var j = list.length - 1 ; j >= 0 ; j-- )
1937
+ {
1938
+ if ( list[j].dialog == obj || list[j].uiElement == obj )
1939
+ list.splice( j, 1 );
1940
+ }
1941
+ if ( list.length === 0 )
1942
+ delete accessKeyProcessors[i];
1943
+ }
1944
+ };
1945
+
1946
+ var tabAccessKeyUp = function( dialog, key )
1947
+ {
1948
+ if ( dialog._.accessKeyMap[key] )
1949
+ dialog.selectPage( dialog._.accessKeyMap[key] );
1950
+ };
1951
+
1952
+ var tabAccessKeyDown = function( dialog, key )
1953
+ {
1954
+ };
1955
+
1956
+ // ESC, ENTER
1957
+ var preventKeyBubblingKeys = { 27 :1, 13 :1 };
1958
+ var preventKeyBubbling = function( e )
1959
+ {
1960
+ if ( e.data.getKeystroke() in preventKeyBubblingKeys )
1961
+ e.data.stopPropagation();
1962
+ };
1963
+
1964
+ (function()
1965
+ {
1966
+ CKEDITOR.ui.dialog =
1967
+ {
1968
+ /**
1969
+ * The base class of all dialog UI elements.
1970
+ * @constructor
1971
+ * @param {CKEDITOR.dialog} dialog Parent dialog object.
1972
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element
1973
+ * definition. Accepted fields:
1974
+ * <ul>
1975
+ * <li><strong>id</strong> (Required) The id of the UI element. See {@link
1976
+ * CKEDITOR.dialog#getContentElement}</li>
1977
+ * <li><strong>type</strong> (Required) The type of the UI element. The
1978
+ * value to this field specifies which UI element class will be used to
1979
+ * generate the final widget.</li>
1980
+ * <li><strong>title</strong> (Optional) The popup tooltip for the UI
1981
+ * element.</li>
1982
+ * <li><strong>hidden</strong> (Optional) A flag that tells if the element
1983
+ * should be initially visible.</li>
1984
+ * <li><strong>className</strong> (Optional) Additional CSS class names
1985
+ * to add to the UI element. Separated by space.</li>
1986
+ * <li><strong>style</strong> (Optional) Additional CSS inline styles
1987
+ * to add to the UI element. A semicolon (;) is required after the last
1988
+ * style declaration.</li>
1989
+ * <li><strong>accessKey</strong> (Optional) The alphanumeric access key
1990
+ * for this element. Access keys are automatically prefixed by CTRL.</li>
1991
+ * <li><strong>on*</strong> (Optional) Any UI element definition field that
1992
+ * starts with <em>on</em> followed immediately by a capital letter and
1993
+ * probably more letters is an event handler. Event handlers may be further
1994
+ * divided into registered event handlers and DOM event handlers. Please
1995
+ * refer to {@link CKEDITOR.ui.dialog.uiElement#registerEvents} and
1996
+ * {@link CKEDITOR.ui.dialog.uiElement#eventProcessors} for more
1997
+ * information.</li>
1998
+ * </ul>
1999
+ * @param {Array} htmlList
2000
+ * List of HTML code to be added to the dialog's content area.
2001
+ * @param {Function|String} nodeNameArg
2002
+ * A function returning a string, or a simple string for the node name for
2003
+ * the root DOM node. Default is 'div'.
2004
+ * @param {Function|Object} stylesArg
2005
+ * A function returning an object, or a simple object for CSS styles applied
2006
+ * to the DOM node. Default is empty object.
2007
+ * @param {Function|Object} attributesArg
2008
+ * A fucntion returning an object, or a simple object for attributes applied
2009
+ * to the DOM node. Default is empty object.
2010
+ * @param {Function|String} contentsArg
2011
+ * A function returning a string, or a simple string for the HTML code inside
2012
+ * the root DOM node. Default is empty string.
2013
+ * @example
2014
+ */
2015
+ uiElement : function( dialog, elementDefinition, htmlList, nodeNameArg, stylesArg, attributesArg, contentsArg )
2016
+ {
2017
+ if ( arguments.length < 4 )
2018
+ return;
2019
+
2020
+ var nodeName = ( nodeNameArg.call ? nodeNameArg( elementDefinition ) : nodeNameArg ) || 'div',
2021
+ html = [ '<', nodeName, ' ' ],
2022
+ styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {},
2023
+ attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {},
2024
+ innerHTML = ( contentsArg && contentsArg.call ? contentsArg.call( this, dialog, elementDefinition ) : contentsArg ) || '',
2025
+ domId = this.domId = attributes.id || CKEDITOR.tools.getNextNumber() + '_uiElement',
2026
+ id = this.id = elementDefinition.id,
2027
+ i;
2028
+
2029
+ // Set the id, a unique id is required for getElement() to work.
2030
+ attributes.id = domId;
2031
+
2032
+ // Set the type and definition CSS class names.
2033
+ var classes = {};
2034
+ if ( elementDefinition.type )
2035
+ classes[ 'cke_dialog_ui_' + elementDefinition.type ] = 1;
2036
+ if ( elementDefinition.className )
2037
+ classes[ elementDefinition.className ] = 1;
2038
+ var attributeClasses = ( attributes['class'] && attributes['class'].split ) ? attributes['class'].split( ' ' ) : [];
2039
+ for ( i = 0 ; i < attributeClasses.length ; i++ )
2040
+ {
2041
+ if ( attributeClasses[i] )
2042
+ classes[ attributeClasses[i] ] = 1;
2043
+ }
2044
+ var finalClasses = [];
2045
+ for ( i in classes )
2046
+ finalClasses.push( i );
2047
+ attributes['class'] = finalClasses.join( ' ' );
2048
+
2049
+ // Set the popup tooltop.
2050
+ if ( elementDefinition.title )
2051
+ attributes.title = elementDefinition.title;
2052
+
2053
+ // Write the inline CSS styles.
2054
+ var styleStr = ( elementDefinition.style || '' ).split( ';' );
2055
+ for ( i in styles )
2056
+ styleStr.push( i + ':' + styles[i] );
2057
+ if ( elementDefinition.hidden )
2058
+ styleStr.push( 'display:none' );
2059
+ for ( i = styleStr.length - 1 ; i >= 0 ; i-- )
2060
+ {
2061
+ if ( styleStr[i] === '' )
2062
+ styleStr.splice( i, 1 );
2063
+ }
2064
+ if ( styleStr.length > 0 )
2065
+ attributes.style = ( attributes.style ? ( attributes.style + '; ' ) : '' ) + styleStr.join( '; ' );
2066
+
2067
+ // Write the attributes.
2068
+ for ( i in attributes )
2069
+ html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" ');
2070
+
2071
+ // Write the content HTML.
2072
+ html.push( '>', innerHTML, '</', nodeName, '>' );
2073
+
2074
+ // Add contents to the parent HTML array.
2075
+ htmlList.push( html.join( '' ) );
2076
+
2077
+ ( this._ || ( this._ = {} ) ).dialog = dialog;
2078
+
2079
+ // Override isChanged if it is defined in element definition.
2080
+ if ( typeof( elementDefinition.isChanged ) == 'boolean' )
2081
+ this.isChanged = function(){ return elementDefinition.isChanged; };
2082
+ if ( typeof( elementDefinition.isChanged ) == 'function' )
2083
+ this.isChanged = elementDefinition.isChanged;
2084
+
2085
+ // Add events.
2086
+ CKEDITOR.event.implementOn( this );
2087
+
2088
+ this.registerEvents( elementDefinition );
2089
+ if ( this.accessKeyUp && this.accessKeyDown && elementDefinition.accessKey )
2090
+ registerAccessKey( this, dialog, 'CTRL+' + elementDefinition.accessKey );
2091
+
2092
+ var me = this;
2093
+ dialog.on( 'load', function()
2094
+ {
2095
+ if ( me.getInputElement() )
2096
+ {
2097
+ me.getInputElement().on( 'focus', function()
2098
+ {
2099
+ dialog._.tabBarMode = false;
2100
+ dialog._.hasFocus = true;
2101
+ me.fire( 'focus' );
2102
+ }, me );
2103
+ }
2104
+ } );
2105
+
2106
+ // Register the object as a tab focus if it can be included.
2107
+ if ( this.keyboardFocusable )
2108
+ {
2109
+ this.tabIndex = elementDefinition.tabIndex || 0;
2110
+
2111
+ this.focusIndex = dialog._.focusList.push( this ) - 1;
2112
+ this.on( 'focus', function()
2113
+ {
2114
+ dialog._.currentFocusIndex = me.focusIndex;
2115
+ } );
2116
+ }
2117
+
2118
+ // Completes this object with everything we have in the
2119
+ // definition.
2120
+ CKEDITOR.tools.extend( this, elementDefinition );
2121
+ },
2122
+
2123
+ /**
2124
+ * Horizontal layout box for dialog UI elements, auto-expends to available width of container.
2125
+ * @constructor
2126
+ * @extends CKEDITOR.ui.dialog.uiElement
2127
+ * @param {CKEDITOR.dialog} dialog
2128
+ * Parent dialog object.
2129
+ * @param {Array} childObjList
2130
+ * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
2131
+ * container.
2132
+ * @param {Array} childHtmlList
2133
+ * Array of HTML code that correspond to the HTML output of all the
2134
+ * objects in childObjList.
2135
+ * @param {Array} htmlList
2136
+ * Array of HTML code that this element will output to.
2137
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
2138
+ * The element definition. Accepted fields:
2139
+ * <ul>
2140
+ * <li><strong>widths</strong> (Optional) The widths of child cells.</li>
2141
+ * <li><strong>height</strong> (Optional) The height of the layout.</li>
2142
+ * <li><strong>padding</strong> (Optional) The padding width inside child
2143
+ * cells.</li>
2144
+ * <li><strong>align</strong> (Optional) The alignment of the whole layout
2145
+ * </li>
2146
+ * </ul>
2147
+ * @example
2148
+ */
2149
+ hbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
2150
+ {
2151
+ if ( arguments.length < 4 )
2152
+ return;
2153
+
2154
+ this._ || ( this._ = {} );
2155
+
2156
+ var children = this._.children = childObjList,
2157
+ widths = elementDefinition && elementDefinition.widths || null,
2158
+ height = elementDefinition && elementDefinition.height || null,
2159
+ styles = {},
2160
+ i;
2161
+ /** @ignore */
2162
+ var innerHTML = function()
2163
+ {
2164
+ var html = [ '<tbody><tr class="cke_dialog_ui_hbox">' ];
2165
+ for ( i = 0 ; i < childHtmlList.length ; i++ )
2166
+ {
2167
+ var className = 'cke_dialog_ui_hbox_child',
2168
+ styles = [];
2169
+ if ( i === 0 )
2170
+ className = 'cke_dialog_ui_hbox_first';
2171
+ if ( i == childHtmlList.length - 1 )
2172
+ className = 'cke_dialog_ui_hbox_last';
2173
+ html.push( '<td class="', className, '" role="presentation" ' );
2174
+ if ( widths )
2175
+ {
2176
+ if ( widths[i] )
2177
+ styles.push( 'width:' + CKEDITOR.tools.cssLength( widths[i] ) );
2178
+ }
2179
+ else
2180
+ styles.push( 'width:' + Math.floor( 100 / childHtmlList.length ) + '%' );
2181
+ if ( height )
2182
+ styles.push( 'height:' + CKEDITOR.tools.cssLength( height ) );
2183
+ if ( elementDefinition && elementDefinition.padding != undefined )
2184
+ styles.push( 'padding:' + CKEDITOR.tools.cssLength( elementDefinition.padding ) );
2185
+ if ( styles.length > 0 )
2186
+ html.push( 'style="' + styles.join('; ') + '" ' );
2187
+ html.push( '>', childHtmlList[i], '</td>' );
2188
+ }
2189
+ html.push( '</tr></tbody>' );
2190
+ return html.join( '' );
2191
+ };
2192
+
2193
+ var attribs = { role : 'presentation' };
2194
+ elementDefinition && elementDefinition.align && ( attribs.align = elementDefinition.align );
2195
+
2196
+ CKEDITOR.ui.dialog.uiElement.call(
2197
+ this,
2198
+ dialog,
2199
+ elementDefinition || { type : 'hbox' },
2200
+ htmlList,
2201
+ 'table',
2202
+ styles,
2203
+ attribs,
2204
+ innerHTML );
2205
+ },
2206
+
2207
+ /**
2208
+ * Vertical layout box for dialog UI elements.
2209
+ * @constructor
2210
+ * @extends CKEDITOR.ui.dialog.hbox
2211
+ * @param {CKEDITOR.dialog} dialog
2212
+ * Parent dialog object.
2213
+ * @param {Array} childObjList
2214
+ * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
2215
+ * container.
2216
+ * @param {Array} childHtmlList
2217
+ * Array of HTML code that correspond to the HTML output of all the
2218
+ * objects in childObjList.
2219
+ * @param {Array} htmlList
2220
+ * Array of HTML code that this element will output to.
2221
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
2222
+ * The element definition. Accepted fields:
2223
+ * <ul>
2224
+ * <li><strong>width</strong> (Optional) The width of the layout.</li>
2225
+ * <li><strong>heights</strong> (Optional) The heights of individual cells.
2226
+ * </li>
2227
+ * <li><strong>align</strong> (Optional) The alignment of the layout.</li>
2228
+ * <li><strong>padding</strong> (Optional) The padding width inside child
2229
+ * cells.</li>
2230
+ * <li><strong>expand</strong> (Optional) Whether the layout should expand
2231
+ * vertically to fill its container.</li>
2232
+ * </ul>
2233
+ * @example
2234
+ */
2235
+ vbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
2236
+ {
2237
+ if (arguments.length < 3 )
2238
+ return;
2239
+
2240
+ this._ || ( this._ = {} );
2241
+
2242
+ var children = this._.children = childObjList,
2243
+ width = elementDefinition && elementDefinition.width || null,
2244
+ heights = elementDefinition && elementDefinition.heights || null;
2245
+ /** @ignore */
2246
+ var innerHTML = function()
2247
+ {
2248
+ var html = [ '<table role="presentation" cellspacing="0" border="0" ' ];
2249
+ html.push( 'style="' );
2250
+ if ( elementDefinition && elementDefinition.expand )
2251
+ html.push( 'height:100%;' );
2252
+ html.push( 'width:' + CKEDITOR.tools.cssLength( width || '100%' ), ';' );
2253
+ html.push( '"' );
2254
+ html.push( 'align="', CKEDITOR.tools.htmlEncode(
2255
+ ( elementDefinition && elementDefinition.align ) || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ), '" ' );
2256
+
2257
+ html.push( '><tbody>' );
2258
+ for ( var i = 0 ; i < childHtmlList.length ; i++ )
2259
+ {
2260
+ var styles = [];
2261
+ html.push( '<tr><td role="presentation" ' );
2262
+ if ( width )
2263
+ styles.push( 'width:' + CKEDITOR.tools.cssLength( width || '100%' ) );
2264
+ if ( heights )
2265
+ styles.push( 'height:' + CKEDITOR.tools.cssLength( heights[i] ) );
2266
+ else if ( elementDefinition && elementDefinition.expand )
2267
+ styles.push( 'height:' + Math.floor( 100 / childHtmlList.length ) + '%' );
2268
+ if ( elementDefinition && elementDefinition.padding != undefined )
2269
+ styles.push( 'padding:' + CKEDITOR.tools.cssLength( elementDefinition.padding ) );
2270
+ if ( styles.length > 0 )
2271
+ html.push( 'style="', styles.join( '; ' ), '" ' );
2272
+ html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[i], '</td></tr>' );
2273
+ }
2274
+ html.push( '</tbody></table>' );
2275
+ return html.join( '' );
2276
+ };
2277
+ CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'vbox' }, htmlList, 'div', null, { role : 'presentation' }, innerHTML );
2278
+ }
2279
+ };
2280
+ })();
2281
+
2282
+ CKEDITOR.ui.dialog.uiElement.prototype =
2283
+ {
2284
+ /**
2285
+ * Gets the root DOM element of this dialog UI object.
2286
+ * @returns {CKEDITOR.dom.element} Root DOM element of UI object.
2287
+ * @example
2288
+ * uiElement.getElement().hide();
2289
+ */
2290
+ getElement : function()
2291
+ {
2292
+ return CKEDITOR.document.getById( this.domId );
2293
+ },
2294
+
2295
+ /**
2296
+ * Gets the DOM element that the user inputs values.
2297
+ * This function is used by setValue(), getValue() and focus(). It should
2298
+ * be overrided in child classes where the input element isn't the root
2299
+ * element.
2300
+ * @returns {CKEDITOR.dom.element} The element where the user input values.
2301
+ * @example
2302
+ * var rawValue = textInput.getInputElement().$.value;
2303
+ */
2304
+ getInputElement : function()
2305
+ {
2306
+ return this.getElement();
2307
+ },
2308
+
2309
+ /**
2310
+ * Gets the parent dialog object containing this UI element.
2311
+ * @returns {CKEDITOR.dialog} Parent dialog object.
2312
+ * @example
2313
+ * var dialog = uiElement.getDialog();
2314
+ */
2315
+ getDialog : function()
2316
+ {
2317
+ return this._.dialog;
2318
+ },
2319
+
2320
+ /**
2321
+ * Sets the value of this dialog UI object.
2322
+ * @param {Object} value The new value.
2323
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2324
+ * @example
2325
+ * uiElement.setValue( 'Dingo' );
2326
+ */
2327
+ setValue : function( value )
2328
+ {
2329
+ this.getInputElement().setValue( value );
2330
+ this.fire( 'change', { value : value } );
2331
+ return this;
2332
+ },
2333
+
2334
+ /**
2335
+ * Gets the current value of this dialog UI object.
2336
+ * @returns {Object} The current value.
2337
+ * @example
2338
+ * var myValue = uiElement.getValue();
2339
+ */
2340
+ getValue : function()
2341
+ {
2342
+ return this.getInputElement().getValue();
2343
+ },
2344
+
2345
+ /**
2346
+ * Tells whether the UI object's value has changed.
2347
+ * @returns {Boolean} true if changed, false if not changed.
2348
+ * @example
2349
+ * if ( uiElement.isChanged() )
2350
+ * &nbsp;&nbsp;confirm( 'Value changed! Continue?' );
2351
+ */
2352
+ isChanged : function()
2353
+ {
2354
+ // Override in input classes.
2355
+ return false;
2356
+ },
2357
+
2358
+ /**
2359
+ * Selects the parent tab of this element. Usually called by focus() or overridden focus() methods.
2360
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2361
+ * @example
2362
+ * focus : function()
2363
+ * {
2364
+ * this.selectParentTab();
2365
+ * // do something else.
2366
+ * }
2367
+ */
2368
+ selectParentTab : function()
2369
+ {
2370
+ var element = this.getInputElement(),
2371
+ cursor = element,
2372
+ tabId;
2373
+ while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 )
2374
+ { /*jsl:pass*/ }
2375
+
2376
+ // Some widgets don't have parent tabs (e.g. OK and Cancel buttons).
2377
+ if ( !cursor )
2378
+ return this;
2379
+
2380
+ tabId = cursor.getAttribute( 'name' );
2381
+ // Avoid duplicate select.
2382
+ if ( this._.dialog._.currentTabId != tabId )
2383
+ this._.dialog.selectPage( tabId );
2384
+ return this;
2385
+ },
2386
+
2387
+ /**
2388
+ * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page.
2389
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2390
+ * @example
2391
+ * uiElement.focus();
2392
+ */
2393
+ focus : function()
2394
+ {
2395
+ this.selectParentTab().getInputElement().focus();
2396
+ return this;
2397
+ },
2398
+
2399
+ /**
2400
+ * Registers the on* event handlers defined in the element definition.
2401
+ * The default behavior of this function is:
2402
+ * <ol>
2403
+ * <li>
2404
+ * If the on* event is defined in the class's eventProcesors list,
2405
+ * then the registration is delegated to the corresponding function
2406
+ * in the eventProcessors list.
2407
+ * </li>
2408
+ * <li>
2409
+ * If the on* event is not defined in the eventProcessors list, then
2410
+ * register the event handler under the corresponding DOM event of
2411
+ * the UI element's input DOM element (as defined by the return value
2412
+ * of {@link CKEDITOR.ui.dialog.uiElement#getInputElement}).
2413
+ * </li>
2414
+ * </ol>
2415
+ * This function is only called at UI element instantiation, but can
2416
+ * be overridded in child classes if they require more flexibility.
2417
+ * @param {CKEDITOR.dialog.uiElementDefinition} definition The UI element
2418
+ * definition.
2419
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2420
+ * @example
2421
+ */
2422
+ registerEvents : function( definition )
2423
+ {
2424
+ var regex = /^on([A-Z]\w+)/,
2425
+ match;
2426
+
2427
+ var registerDomEvent = function( uiElement, dialog, eventName, func )
2428
+ {
2429
+ dialog.on( 'load', function()
2430
+ {
2431
+ uiElement.getInputElement().on( eventName, func, uiElement );
2432
+ });
2433
+ };
2434
+
2435
+ for ( var i in definition )
2436
+ {
2437
+ if ( !( match = i.match( regex ) ) )
2438
+ continue;
2439
+ if ( this.eventProcessors[i] )
2440
+ this.eventProcessors[i].call( this, this._.dialog, definition[i] );
2441
+ else
2442
+ registerDomEvent( this, this._.dialog, match[1].toLowerCase(), definition[i] );
2443
+ }
2444
+
2445
+ return this;
2446
+ },
2447
+
2448
+ /**
2449
+ * The event processor list used by
2450
+ * {@link CKEDITOR.ui.dialog.uiElement#getInputElement} at UI element
2451
+ * instantiation. The default list defines three on* events:
2452
+ * <ol>
2453
+ * <li>onLoad - Called when the element's parent dialog opens for the
2454
+ * first time</li>
2455
+ * <li>onShow - Called whenever the element's parent dialog opens.</li>
2456
+ * <li>onHide - Called whenever the element's parent dialog closes.</li>
2457
+ * </ol>
2458
+ * @field
2459
+ * @type Object
2460
+ * @example
2461
+ * // This connects the 'click' event in CKEDITOR.ui.dialog.button to onClick
2462
+ * // handlers in the UI element's definitions.
2463
+ * CKEDITOR.ui.dialog.button.eventProcessors = CKEDITOR.tools.extend( {},
2464
+ * &nbsp;&nbsp;CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
2465
+ * &nbsp;&nbsp;{ onClick : function( dialog, func ) { this.on( 'click', func ); } },
2466
+ * &nbsp;&nbsp;true );
2467
+ */
2468
+ eventProcessors :
2469
+ {
2470
+ onLoad : function( dialog, func )
2471
+ {
2472
+ dialog.on( 'load', func, this );
2473
+ },
2474
+
2475
+ onShow : function( dialog, func )
2476
+ {
2477
+ dialog.on( 'show', func, this );
2478
+ },
2479
+
2480
+ onHide : function( dialog, func )
2481
+ {
2482
+ dialog.on( 'hide', func, this );
2483
+ }
2484
+ },
2485
+
2486
+ /**
2487
+ * The default handler for a UI element's access key down event, which
2488
+ * tries to put focus to the UI element.<br />
2489
+ * Can be overridded in child classes for more sophisticaed behavior.
2490
+ * @param {CKEDITOR.dialog} dialog The parent dialog object.
2491
+ * @param {String} key The key combination pressed. Since access keys
2492
+ * are defined to always include the CTRL key, its value should always
2493
+ * include a 'CTRL+' prefix.
2494
+ * @example
2495
+ */
2496
+ accessKeyDown : function( dialog, key )
2497
+ {
2498
+ this.focus();
2499
+ },
2500
+
2501
+ /**
2502
+ * The default handler for a UI element's access key up event, which
2503
+ * does nothing.<br />
2504
+ * Can be overridded in child classes for more sophisticated behavior.
2505
+ * @param {CKEDITOR.dialog} dialog The parent dialog object.
2506
+ * @param {String} key The key combination pressed. Since access keys
2507
+ * are defined to always include the CTRL key, its value should always
2508
+ * include a 'CTRL+' prefix.
2509
+ * @example
2510
+ */
2511
+ accessKeyUp : function( dialog, key )
2512
+ {
2513
+ },
2514
+
2515
+ /**
2516
+ * Disables a UI element.
2517
+ * @example
2518
+ */
2519
+ disable : function()
2520
+ {
2521
+ var element = this.getInputElement();
2522
+ element.setAttribute( 'disabled', 'true' );
2523
+ element.addClass( 'cke_disabled' );
2524
+ },
2525
+
2526
+ /**
2527
+ * Enables a UI element.
2528
+ * @example
2529
+ */
2530
+ enable : function()
2531
+ {
2532
+ var element = this.getInputElement();
2533
+ element.removeAttribute( 'disabled' );
2534
+ element.removeClass( 'cke_disabled' );
2535
+ },
2536
+
2537
+ /**
2538
+ * Determines whether an UI element is enabled or not.
2539
+ * @returns {Boolean} Whether the UI element is enabled.
2540
+ * @example
2541
+ */
2542
+ isEnabled : function()
2543
+ {
2544
+ return !this.getInputElement().getAttribute( 'disabled' );
2545
+ },
2546
+
2547
+ /**
2548
+ * Determines whether an UI element is visible or not.
2549
+ * @returns {Boolean} Whether the UI element is visible.
2550
+ * @example
2551
+ */
2552
+ isVisible : function()
2553
+ {
2554
+ return this.getInputElement().isVisible();
2555
+ },
2556
+
2557
+ /**
2558
+ * Determines whether an UI element is focus-able or not.
2559
+ * Focus-able is defined as being both visible and enabled.
2560
+ * @returns {Boolean} Whether the UI element can be focused.
2561
+ * @example
2562
+ */
2563
+ isFocusable : function()
2564
+ {
2565
+ if ( !this.isEnabled() || !this.isVisible() )
2566
+ return false;
2567
+ return true;
2568
+ }
2569
+ };
2570
+
2571
+ CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
2572
+ /**
2573
+ * @lends CKEDITOR.ui.dialog.hbox.prototype
2574
+ */
2575
+ {
2576
+ /**
2577
+ * Gets a child UI element inside this container.
2578
+ * @param {Array|Number} indices An array or a single number to indicate the child's
2579
+ * position in the container's descendant tree. Omit to get all the children in an array.
2580
+ * @returns {Array|CKEDITOR.ui.dialog.uiElement} Array of all UI elements in the container
2581
+ * if no argument given, or the specified UI element if indices is given.
2582
+ * @example
2583
+ * var checkbox = hbox.getChild( [0,1] );
2584
+ * checkbox.setValue( true );
2585
+ */
2586
+ getChild : function( indices )
2587
+ {
2588
+ // If no arguments, return a clone of the children array.
2589
+ if ( arguments.length < 1 )
2590
+ return this._.children.concat();
2591
+
2592
+ // If indices isn't array, make it one.
2593
+ if ( !indices.splice )
2594
+ indices = [ indices ];
2595
+
2596
+ // Retrieve the child element according to tree position.
2597
+ if ( indices.length < 2 )
2598
+ return this._.children[ indices[0] ];
2599
+ else
2600
+ return ( this._.children[ indices[0] ] && this._.children[ indices[0] ].getChild ) ?
2601
+ this._.children[ indices[0] ].getChild( indices.slice( 1, indices.length ) ) :
2602
+ null;
2603
+ }
2604
+ }, true );
2605
+
2606
+ CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox();
2607
+
2608
+
2609
+
2610
+ (function()
2611
+ {
2612
+ var commonBuilder = {
2613
+ build : function( dialog, elementDefinition, output )
2614
+ {
2615
+ var children = elementDefinition.children,
2616
+ child,
2617
+ childHtmlList = [],
2618
+ childObjList = [];
2619
+ for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ )
2620
+ {
2621
+ var childHtml = [];
2622
+ childHtmlList.push( childHtml );
2623
+ childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) );
2624
+ }
2625
+ return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, childObjList, childHtmlList, output, elementDefinition );
2626
+ }
2627
+ };
2628
+
2629
+ CKEDITOR.dialog.addUIElement( 'hbox', commonBuilder );
2630
+ CKEDITOR.dialog.addUIElement( 'vbox', commonBuilder );
2631
+ })();
2632
+
2633
+ /**
2634
+ * Generic dialog command. It opens a specific dialog when executed.
2635
+ * @constructor
2636
+ * @augments CKEDITOR.commandDefinition
2637
+ * @param {string} dialogName The name of the dialog to open when executing
2638
+ * this command.
2639
+ * @example
2640
+ * // Register the "link" command, which opens the "link" dialog.
2641
+ * editor.addCommand( 'link', <b>new CKEDITOR.dialogCommand( 'link' )</b> );
2642
+ */
2643
+ CKEDITOR.dialogCommand = function( dialogName )
2644
+ {
2645
+ this.dialogName = dialogName;
2646
+ };
2647
+
2648
+ CKEDITOR.dialogCommand.prototype =
2649
+ {
2650
+ /** @ignore */
2651
+ exec : function( editor )
2652
+ {
2653
+ editor.openDialog( this.dialogName );
2654
+ },
2655
+
2656
+ // Dialog commands just open a dialog ui, thus require no undo logic,
2657
+ // undo support should dedicate to specific dialog implementation.
2658
+ canUndo: false,
2659
+
2660
+ editorFocus : CKEDITOR.env.ie
2661
+ };
2662
+
2663
+ (function()
2664
+ {
2665
+ var notEmptyRegex = /^([a]|[^a])+$/,
2666
+ integerRegex = /^\d*$/,
2667
+ numberRegex = /^\d*(?:\.\d+)?$/;
2668
+
2669
+ CKEDITOR.VALIDATE_OR = 1;
2670
+ CKEDITOR.VALIDATE_AND = 2;
2671
+
2672
+ CKEDITOR.dialog.validate =
2673
+ {
2674
+ functions : function()
2675
+ {
2676
+ return function()
2677
+ {
2678
+ /**
2679
+ * It's important for validate functions to be able to accept the value
2680
+ * as argument in addition to this.getValue(), so that it is possible to
2681
+ * combine validate functions together to make more sophisticated
2682
+ * validators.
2683
+ */
2684
+ var value = this && this.getValue ? this.getValue() : arguments[0];
2685
+
2686
+ var msg = undefined,
2687
+ relation = CKEDITOR.VALIDATE_AND,
2688
+ functions = [], i;
2689
+
2690
+ for ( i = 0 ; i < arguments.length ; i++ )
2691
+ {
2692
+ if ( typeof( arguments[i] ) == 'function' )
2693
+ functions.push( arguments[i] );
2694
+ else
2695
+ break;
2696
+ }
2697
+
2698
+ if ( i < arguments.length && typeof( arguments[i] ) == 'string' )
2699
+ {
2700
+ msg = arguments[i];
2701
+ i++;
2702
+ }
2703
+
2704
+ if ( i < arguments.length && typeof( arguments[i]) == 'number' )
2705
+ relation = arguments[i];
2706
+
2707
+ var passed = ( relation == CKEDITOR.VALIDATE_AND ? true : false );
2708
+ for ( i = 0 ; i < functions.length ; i++ )
2709
+ {
2710
+ if ( relation == CKEDITOR.VALIDATE_AND )
2711
+ passed = passed && functions[i]( value );
2712
+ else
2713
+ passed = passed || functions[i]( value );
2714
+ }
2715
+
2716
+ if ( !passed )
2717
+ {
2718
+ if ( msg !== undefined )
2719
+ alert( msg );
2720
+ if ( this && ( this.select || this.focus ) )
2721
+ ( this.select || this.focus )();
2722
+ return false;
2723
+ }
2724
+
2725
+ return true;
2726
+ };
2727
+ },
2728
+
2729
+ regex : function( regex, msg )
2730
+ {
2731
+ /*
2732
+ * Can be greatly shortened by deriving from functions validator if code size
2733
+ * turns out to be more important than performance.
2734
+ */
2735
+ return function()
2736
+ {
2737
+ var value = this && this.getValue ? this.getValue() : arguments[0];
2738
+ if ( !regex.test( value ) )
2739
+ {
2740
+ if ( msg !== undefined )
2741
+ alert( msg );
2742
+ if ( this && ( this.select || this.focus ) )
2743
+ {
2744
+ if ( this.select )
2745
+ this.select();
2746
+ else
2747
+ this.focus();
2748
+ }
2749
+ return false;
2750
+ }
2751
+ return true;
2752
+ };
2753
+ },
2754
+
2755
+ notEmpty : function( msg )
2756
+ {
2757
+ return this.regex( notEmptyRegex, msg );
2758
+ },
2759
+
2760
+ integer : function( msg )
2761
+ {
2762
+ return this.regex( integerRegex, msg );
2763
+ },
2764
+
2765
+ 'number' : function( msg )
2766
+ {
2767
+ return this.regex( numberRegex, msg );
2768
+ },
2769
+
2770
+ equals : function( value, msg )
2771
+ {
2772
+ return this.functions( function( val ){ return val == value; }, msg );
2773
+ },
2774
+
2775
+ notEqual : function( value, msg )
2776
+ {
2777
+ return this.functions( function( val ){ return val != value; }, msg );
2778
+ }
2779
+ };
2780
+ })();
2781
+ })();
2782
+
2783
+ // Extend the CKEDITOR.editor class with dialog specific functions.
2784
+ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
2785
+ /** @lends CKEDITOR.editor.prototype */
2786
+ {
2787
+ /**
2788
+ * Loads and opens a registered dialog.
2789
+ * @param {String} dialogName The registered name of the dialog.
2790
+ * @param {Function} callback The function to be invoked after dialog instance created.
2791
+ * @see CKEDITOR.dialog.add
2792
+ * @example
2793
+ * CKEDITOR.instances.editor1.openDialog( 'smiley' );
2794
+ * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed. null if the dialog name is not registered.
2795
+ */
2796
+ openDialog : function( dialogName, callback )
2797
+ {
2798
+ var dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ],
2799
+ dialogSkin = this.skin.dialog;
2800
+
2801
+ // If the dialogDefinition is already loaded, open it immediately.
2802
+ if ( typeof dialogDefinitions == 'function' && dialogSkin._isLoaded )
2803
+ {
2804
+ var storedDialogs = this._.storedDialogs ||
2805
+ ( this._.storedDialogs = {} );
2806
+
2807
+ var dialog = storedDialogs[ dialogName ] ||
2808
+ ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) );
2809
+
2810
+ callback && callback.call( dialog, dialog );
2811
+ dialog.show();
2812
+
2813
+ return dialog;
2814
+ }
2815
+ else if ( dialogDefinitions == 'failed' )
2816
+ throw new Error( '[CKEDITOR.dialog.openDialog] Dialog "' + dialogName + '" failed when loading definition.' );
2817
+
2818
+ // Not loaded? Load the .js file first.
2819
+ var body = CKEDITOR.document.getBody(),
2820
+ cursor = body.$.style.cursor,
2821
+ me = this;
2822
+
2823
+ body.setStyle( 'cursor', 'wait' );
2824
+
2825
+ function onDialogFileLoaded( success )
2826
+ {
2827
+ var dialogDefinition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ],
2828
+ skin = me.skin.dialog;
2829
+
2830
+ // Check if both skin part and definition is loaded.
2831
+ if ( !skin._isLoaded || loadDefinition && typeof success == 'undefined' )
2832
+ return;
2833
+
2834
+ // In case of plugin error, mark it as loading failed.
2835
+ if ( typeof dialogDefinition != 'function' )
2836
+ CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed';
2837
+
2838
+ me.openDialog( dialogName, callback );
2839
+ body.setStyle( 'cursor', cursor );
2840
+ }
2841
+
2842
+ if ( typeof dialogDefinitions == 'string' )
2843
+ {
2844
+ var loadDefinition = 1;
2845
+ CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), onDialogFileLoaded );
2846
+ }
2847
+
2848
+ CKEDITOR.skins.load( this, 'dialog', onDialogFileLoaded );
2849
+
2850
+ return null;
2851
+ }
2852
+ });
2853
+
2854
+ CKEDITOR.plugins.add( 'dialog',
2855
+ {
2856
+ requires : [ 'dialogui' ]
2857
+ });
2858
+
2859
+ // Dialog related configurations.
2860
+
2861
+ /**
2862
+ * The color of the dialog background cover. It should be a valid CSS color
2863
+ * string.
2864
+ * @name CKEDITOR.config.dialog_backgroundCoverColor
2865
+ * @type String
2866
+ * @default 'white'
2867
+ * @example
2868
+ * config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';
2869
+ */
2870
+
2871
+ /**
2872
+ * The opacity of the dialog background cover. It should be a number within the
2873
+ * range [0.0, 1.0].
2874
+ * @name CKEDITOR.config.dialog_backgroundCoverOpacity
2875
+ * @type Number
2876
+ * @default 0.5
2877
+ * @example
2878
+ * config.dialog_backgroundCoverOpacity = 0.7;
2879
+ */
2880
+
2881
+ /**
2882
+ * If the dialog has more than one tab, put focus into the first tab as soon as dialog is opened.
2883
+ * @name CKEDITOR.config.dialog_startupFocusTab
2884
+ * @type Boolean
2885
+ * @default false
2886
+ * @example
2887
+ * config.dialog_startupFocusTab = true;
2888
+ */
2889
+
2890
+ /**
2891
+ * The distance of magnetic borders used in moving and resizing dialogs,
2892
+ * measured in pixels.
2893
+ * @name CKEDITOR.config.dialog_magnetDistance
2894
+ * @type Number
2895
+ * @default 20
2896
+ * @example
2897
+ * config.dialog_magnetDistance = 30;
2898
+ */
2899
+
2900
+ /**
2901
+ * Fired when a dialog definition is about to be used to create a dialog into
2902
+ * an editor instance. This event makes it possible to customize the definition
2903
+ * before creating it.
2904
+ * <p>Note that this event is called only the first time a specific dialog is
2905
+ * opened. Successive openings will use the cached dialog, and this event will
2906
+ * not get fired.</p>
2907
+ * @name CKEDITOR#dialogDefinition
2908
+ * @event
2909
+ * @param {CKEDITOR.dialog.dialogDefinition} data The dialog defination that
2910
+ * is being loaded.
2911
+ * @param {CKEDITOR.editor} editor The editor instance that will use the
2912
+ * dialog.
2913
+ */