ckeditor-rails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (708) hide show
  1. data/README.md +17 -14
  2. data/lib/ckeditor-rails/version.rb +1 -1
  3. data/vendor/assets/ckeditor/ckeditor/.htaccess +1 -1
  4. data/vendor/assets/ckeditor/ckeditor/CHANGES.html +139 -3
  5. data/vendor/assets/ckeditor/ckeditor/INSTALL.html +92 -92
  6. data/vendor/assets/ckeditor/ckeditor/LICENSE.html +2 -2
  7. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/application.xml +32 -32
  8. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/run.bat +9 -9
  9. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/run.sh +1 -1
  10. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/sample.html +45 -45
  11. data/vendor/assets/ckeditor/ckeditor/_samples/ajax.html +98 -98
  12. data/vendor/assets/ckeditor/ckeditor/_samples/api.html +192 -192
  13. data/vendor/assets/ckeditor/ckeditor/_samples/api_dialog.html +198 -198
  14. data/vendor/assets/ckeditor/ckeditor/_samples/api_dialog/my_dialog.js +28 -28
  15. data/vendor/assets/ckeditor/ckeditor/_samples/asp/advanced.asp +105 -105
  16. data/vendor/assets/ckeditor/ckeditor/_samples/asp/events.asp +136 -136
  17. data/vendor/assets/ckeditor/ckeditor/_samples/asp/index.html +103 -103
  18. data/vendor/assets/ckeditor/ckeditor/_samples/asp/replace.asp +72 -72
  19. data/vendor/assets/ckeditor/ckeditor/_samples/asp/replaceall.asp +77 -77
  20. data/vendor/assets/ckeditor/ckeditor/_samples/asp/sample_posteddata.asp +46 -46
  21. data/vendor/assets/ckeditor/ckeditor/_samples/asp/standalone.asp +72 -72
  22. data/vendor/assets/ckeditor/ckeditor/_samples/assets/_posteddata.php +59 -59
  23. data/vendor/assets/ckeditor/ckeditor/_samples/assets/output_xhtml.css +204 -204
  24. data/vendor/assets/ckeditor/ckeditor/_samples/assets/parsesample.css +70 -70
  25. data/vendor/assets/ckeditor/ckeditor/_samples/assets/swfobject.js +18 -18
  26. data/vendor/assets/ckeditor/ckeditor/_samples/autogrow.html +108 -107
  27. data/vendor/assets/ckeditor/ckeditor/_samples/bbcode.html +125 -125
  28. data/vendor/assets/ckeditor/ckeditor/_samples/devtools.html +94 -94
  29. data/vendor/assets/ckeditor/ckeditor/_samples/divreplace.html +154 -154
  30. data/vendor/assets/ckeditor/ckeditor/_samples/enterkey.html +115 -115
  31. data/vendor/assets/ckeditor/ckeditor/_samples/fullpage.html +82 -82
  32. data/vendor/assets/ckeditor/ckeditor/_samples/index.html +116 -116
  33. data/vendor/assets/ckeditor/ckeditor/_samples/jqueryadapter.html +99 -99
  34. data/vendor/assets/ckeditor/ckeditor/_samples/output_for_flash.html +275 -275
  35. data/vendor/assets/ckeditor/ckeditor/_samples/output_html.html +285 -285
  36. data/vendor/assets/ckeditor/ckeditor/_samples/output_xhtml.html +181 -177
  37. data/vendor/assets/ckeditor/ckeditor/_samples/php/advanced.php +120 -120
  38. data/vendor/assets/ckeditor/ckeditor/_samples/php/events.php +153 -153
  39. data/vendor/assets/ckeditor/ckeditor/_samples/php/index.html +47 -47
  40. data/vendor/assets/ckeditor/ckeditor/_samples/php/replace.php +87 -87
  41. data/vendor/assets/ckeditor/ckeditor/_samples/php/replaceall.php +88 -88
  42. data/vendor/assets/ckeditor/ckeditor/_samples/php/standalone.php +83 -83
  43. data/vendor/assets/ckeditor/ckeditor/_samples/placeholder.html +81 -81
  44. data/vendor/assets/ckeditor/ckeditor/_samples/readonly.html +91 -91
  45. data/vendor/assets/ckeditor/ckeditor/_samples/replacebyclass.html +64 -64
  46. data/vendor/assets/ckeditor/ckeditor/_samples/replacebycode.html +97 -97
  47. data/vendor/assets/ckeditor/ckeditor/_samples/sample.css +163 -163
  48. data/vendor/assets/ckeditor/ckeditor/_samples/sample.js +65 -65
  49. data/vendor/assets/ckeditor/ckeditor/_samples/sample_posteddata.php +21 -21
  50. data/vendor/assets/ckeditor/ckeditor/_samples/sharedspaces.html +153 -153
  51. data/vendor/assets/ckeditor/ckeditor/_samples/skins.html +110 -110
  52. data/vendor/assets/ckeditor/ckeditor/_samples/stylesheetparser.html +93 -93
  53. data/vendor/assets/ckeditor/ckeditor/_samples/tableresize.html +115 -115
  54. data/vendor/assets/ckeditor/ckeditor/_samples/ui_color.html +129 -129
  55. data/vendor/assets/ckeditor/ckeditor/_samples/ui_languages.html +134 -134
  56. data/vendor/assets/ckeditor/ckeditor/_source/adapters/jquery.js +306 -306
  57. data/vendor/assets/ckeditor/ckeditor/_source/core/_bootstrap.js +87 -87
  58. data/vendor/assets/ckeditor/ckeditor/_source/core/ckeditor.js +141 -141
  59. data/vendor/assets/ckeditor/ckeditor/_source/core/ckeditor_base.js +235 -227
  60. data/vendor/assets/ckeditor/ckeditor/_source/core/ckeditor_basic.js +238 -238
  61. data/vendor/assets/ckeditor/ckeditor/_source/core/command.js +225 -209
  62. data/vendor/assets/ckeditor/ckeditor/_source/core/commanddefinition.js +129 -129
  63. data/vendor/assets/ckeditor/ckeditor/_source/core/config.js +447 -431
  64. data/vendor/assets/ckeditor/ckeditor/_source/core/dataprocessor.js +65 -65
  65. data/vendor/assets/ckeditor/ckeditor/_source/core/dom.js +20 -20
  66. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/comment.js +44 -32
  67. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/document.js +251 -251
  68. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/documentfragment.js +49 -49
  69. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/domobject.js +258 -258
  70. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/element.js +1796 -1681
  71. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/elementpath.js +117 -119
  72. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/event.js +145 -145
  73. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/node.js +691 -695
  74. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/nodelist.js +26 -26
  75. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/range.js +2068 -2032
  76. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/rangelist.js +213 -213
  77. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/text.js +128 -128
  78. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/walker.js +496 -462
  79. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/window.js +96 -96
  80. data/vendor/assets/ckeditor/ckeditor/_source/core/dtd.js +266 -266
  81. data/vendor/assets/ckeditor/ckeditor/_source/core/editor.js +1059 -1059
  82. data/vendor/assets/ckeditor/ckeditor/_source/core/editor_basic.js +186 -186
  83. data/vendor/assets/ckeditor/ckeditor/_source/core/env.js +305 -291
  84. data/vendor/assets/ckeditor/ckeditor/_source/core/event.js +342 -342
  85. data/vendor/assets/ckeditor/ckeditor/_source/core/eventInfo.js +120 -120
  86. data/vendor/assets/ckeditor/ckeditor/_source/core/focusmanager.js +152 -152
  87. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser.js +224 -224
  88. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/basicwriter.js +145 -145
  89. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/cdata.js +43 -43
  90. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/comment.js +60 -60
  91. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/element.js +308 -308
  92. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/filter.js +288 -288
  93. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/fragment.js +537 -497
  94. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/text.js +53 -55
  95. data/vendor/assets/ckeditor/ckeditor/_source/core/lang.js +157 -157
  96. data/vendor/assets/ckeditor/ckeditor/_source/core/loader.js +240 -240
  97. data/vendor/assets/ckeditor/ckeditor/_source/core/plugindefinition.js +83 -83
  98. data/vendor/assets/ckeditor/ckeditor/_source/core/plugins.js +103 -103
  99. data/vendor/assets/ckeditor/ckeditor/_source/core/resourcemanager.js +238 -238
  100. data/vendor/assets/ckeditor/ckeditor/_source/core/scriptloader.js +180 -180
  101. data/vendor/assets/ckeditor/ckeditor/_source/core/skins.js +184 -184
  102. data/vendor/assets/ckeditor/ckeditor/_source/core/themes.js +19 -19
  103. data/vendor/assets/ckeditor/ckeditor/_source/core/tools.js +763 -763
  104. data/vendor/assets/ckeditor/ckeditor/_source/core/ui.js +128 -128
  105. data/vendor/assets/ckeditor/ckeditor/_source/lang/_languages.js +84 -84
  106. data/vendor/assets/ckeditor/ckeditor/_source/lang/_translationstatus.txt +63 -61
  107. data/vendor/assets/ckeditor/ckeditor/_source/lang/af.js +815 -812
  108. data/vendor/assets/ckeditor/ckeditor/_source/lang/ar.js +815 -812
  109. data/vendor/assets/ckeditor/ckeditor/_source/lang/bg.js +815 -812
  110. data/vendor/assets/ckeditor/ckeditor/_source/lang/bn.js +815 -812
  111. data/vendor/assets/ckeditor/ckeditor/_source/lang/bs.js +815 -812
  112. data/vendor/assets/ckeditor/ckeditor/_source/lang/ca.js +815 -812
  113. data/vendor/assets/ckeditor/ckeditor/_source/lang/cs.js +815 -812
  114. data/vendor/assets/ckeditor/ckeditor/_source/lang/cy.js +815 -812
  115. data/vendor/assets/ckeditor/ckeditor/_source/lang/da.js +815 -812
  116. data/vendor/assets/ckeditor/ckeditor/_source/lang/de.js +815 -812
  117. data/vendor/assets/ckeditor/ckeditor/_source/lang/el.js +815 -812
  118. data/vendor/assets/ckeditor/ckeditor/_source/lang/en-au.js +815 -812
  119. data/vendor/assets/ckeditor/ckeditor/_source/lang/en-ca.js +815 -812
  120. data/vendor/assets/ckeditor/ckeditor/_source/lang/en-gb.js +815 -812
  121. data/vendor/assets/ckeditor/ckeditor/_source/lang/en.js +815 -812
  122. data/vendor/assets/ckeditor/ckeditor/_source/lang/eo.js +815 -812
  123. data/vendor/assets/ckeditor/ckeditor/_source/lang/es.js +815 -812
  124. data/vendor/assets/ckeditor/ckeditor/_source/lang/et.js +815 -812
  125. data/vendor/assets/ckeditor/ckeditor/_source/lang/eu.js +815 -812
  126. data/vendor/assets/ckeditor/ckeditor/_source/lang/fa.js +815 -812
  127. data/vendor/assets/ckeditor/ckeditor/_source/lang/fi.js +815 -812
  128. data/vendor/assets/ckeditor/ckeditor/_source/lang/fo.js +815 -812
  129. data/vendor/assets/ckeditor/ckeditor/_source/lang/fr-ca.js +815 -812
  130. data/vendor/assets/ckeditor/ckeditor/_source/lang/fr.js +815 -812
  131. data/vendor/assets/ckeditor/ckeditor/_source/lang/gl.js +815 -812
  132. data/vendor/assets/ckeditor/ckeditor/_source/lang/gu.js +815 -812
  133. data/vendor/assets/ckeditor/ckeditor/_source/lang/he.js +815 -812
  134. data/vendor/assets/ckeditor/ckeditor/_source/lang/hi.js +815 -812
  135. data/vendor/assets/ckeditor/ckeditor/_source/lang/hr.js +815 -812
  136. data/vendor/assets/ckeditor/ckeditor/_source/lang/hu.js +815 -812
  137. data/vendor/assets/ckeditor/ckeditor/_source/lang/is.js +815 -812
  138. data/vendor/assets/ckeditor/ckeditor/_source/lang/it.js +815 -812
  139. data/vendor/assets/ckeditor/ckeditor/_source/lang/ja.js +815 -812
  140. data/vendor/assets/ckeditor/ckeditor/_source/lang/ka.js +815 -812
  141. data/vendor/assets/ckeditor/ckeditor/_source/lang/km.js +815 -812
  142. data/vendor/assets/ckeditor/ckeditor/_source/lang/ko.js +815 -812
  143. data/vendor/assets/ckeditor/ckeditor/_source/lang/lt.js +815 -812
  144. data/vendor/assets/ckeditor/ckeditor/_source/lang/lv.js +815 -812
  145. data/vendor/assets/ckeditor/ckeditor/_source/lang/mk.js +814 -0
  146. data/vendor/assets/ckeditor/ckeditor/_source/lang/mn.js +815 -812
  147. data/vendor/assets/ckeditor/ckeditor/_source/lang/ms.js +815 -812
  148. data/vendor/assets/ckeditor/ckeditor/_source/lang/nb.js +815 -812
  149. data/vendor/assets/ckeditor/ckeditor/_source/lang/nl.js +815 -812
  150. data/vendor/assets/ckeditor/ckeditor/_source/lang/no.js +815 -812
  151. data/vendor/assets/ckeditor/ckeditor/_source/lang/pl.js +815 -812
  152. data/vendor/assets/ckeditor/ckeditor/_source/lang/pt-br.js +814 -811
  153. data/vendor/assets/ckeditor/ckeditor/_source/lang/pt.js +815 -812
  154. data/vendor/assets/ckeditor/ckeditor/_source/lang/ro.js +815 -812
  155. data/vendor/assets/ckeditor/ckeditor/_source/lang/ru.js +815 -812
  156. data/vendor/assets/ckeditor/ckeditor/_source/lang/sk.js +815 -812
  157. data/vendor/assets/ckeditor/ckeditor/_source/lang/sl.js +815 -812
  158. data/vendor/assets/ckeditor/ckeditor/_source/lang/sr-latn.js +815 -812
  159. data/vendor/assets/ckeditor/ckeditor/_source/lang/sr.js +815 -812
  160. data/vendor/assets/ckeditor/ckeditor/_source/lang/sv.js +814 -811
  161. data/vendor/assets/ckeditor/ckeditor/_source/lang/th.js +815 -812
  162. data/vendor/assets/ckeditor/ckeditor/_source/lang/tr.js +814 -811
  163. data/vendor/assets/ckeditor/ckeditor/_source/lang/ug.js +814 -0
  164. data/vendor/assets/ckeditor/ckeditor/_source/lang/uk.js +815 -812
  165. data/vendor/assets/ckeditor/ckeditor/_source/lang/vi.js +815 -812
  166. data/vendor/assets/ckeditor/ckeditor/_source/lang/zh-cn.js +815 -812
  167. data/vendor/assets/ckeditor/ckeditor/_source/lang/zh.js +815 -812
  168. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js +222 -222
  169. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/_translationstatus.txt +23 -0
  170. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/cs.js +89 -0
  171. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/cy.js +89 -0
  172. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/da.js +89 -0
  173. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/de.js +89 -0
  174. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/el.js +89 -0
  175. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/en.js +108 -108
  176. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/eo.js +89 -0
  177. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/fa.js +89 -0
  178. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/fi.js +89 -0
  179. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/fr.js +89 -0
  180. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/gu.js +89 -0
  181. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/he.js +89 -216
  182. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/it.js +89 -0
  183. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/mk.js +89 -0
  184. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/nb.js +89 -0
  185. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/nl.js +89 -0
  186. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/no.js +89 -0
  187. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/tr.js +89 -0
  188. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/ug.js +89 -0
  189. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/vi.js +89 -0
  190. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/zh-cn.js +89 -0
  191. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/plugin.js +47 -47
  192. data/vendor/assets/ckeditor/ckeditor/_source/plugins/about/dialogs/about.js +76 -76
  193. data/vendor/assets/ckeditor/ckeditor/_source/plugins/about/plugin.js +24 -24
  194. data/vendor/assets/ckeditor/ckeditor/_source/plugins/adobeair/plugin.js +228 -228
  195. data/vendor/assets/ckeditor/ckeditor/_source/plugins/ajax/plugin.js +152 -152
  196. data/vendor/assets/ckeditor/ckeditor/_source/plugins/autogrow/plugin.js +141 -88
  197. data/vendor/assets/ckeditor/ckeditor/_source/plugins/basicstyles/plugin.js +129 -101
  198. data/vendor/assets/ckeditor/ckeditor/_source/plugins/bbcode/plugin.js +931 -931
  199. data/vendor/assets/ckeditor/ckeditor/_source/plugins/bidi/plugin.js +334 -334
  200. data/vendor/assets/ckeditor/ckeditor/_source/plugins/blockquote/plugin.js +305 -305
  201. data/vendor/assets/ckeditor/ckeditor/_source/plugins/button/plugin.js +290 -290
  202. data/vendor/assets/ckeditor/ckeditor/_source/plugins/clipboard/dialogs/paste.js +223 -223
  203. data/vendor/assets/ckeditor/ckeditor/_source/plugins/clipboard/plugin.js +479 -453
  204. data/vendor/assets/ckeditor/ckeditor/_source/plugins/colorbutton/plugin.js +300 -294
  205. data/vendor/assets/ckeditor/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js +387 -340
  206. data/vendor/assets/ckeditor/ckeditor/_source/plugins/colordialog/plugin.js +15 -15
  207. data/vendor/assets/ckeditor/ckeditor/_source/plugins/contextmenu/plugin.js +179 -177
  208. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/_translationstatus.txt +27 -0
  209. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/bg.js +16 -0
  210. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/cs.js +16 -0
  211. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/cy.js +16 -0
  212. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/da.js +16 -0
  213. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/de.js +16 -0
  214. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/el.js +16 -0
  215. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/en.js +16 -16
  216. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/eo.js +16 -0
  217. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/et.js +16 -0
  218. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/fa.js +16 -0
  219. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/fi.js +16 -0
  220. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/fr.js +16 -0
  221. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/gu.js +16 -0
  222. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/he.js +16 -0
  223. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/hr.js +16 -0
  224. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/it.js +16 -0
  225. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/nb.js +16 -0
  226. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/nl.js +16 -0
  227. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/no.js +16 -0
  228. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/pl.js +16 -0
  229. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/tr.js +16 -0
  230. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/ug.js +16 -0
  231. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/uk.js +16 -0
  232. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/vi.js +16 -0
  233. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/zh-cn.js +16 -0
  234. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/plugin.js +173 -173
  235. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialog/dialogDefinition.js +1166 -1166
  236. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialog/plugin.js +3319 -3289
  237. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialogadvtab/plugin.js +208 -207
  238. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialogui/plugin.js +1549 -1541
  239. data/vendor/assets/ckeditor/ckeditor/_source/plugins/div/dialogs/div.js +535 -535
  240. data/vendor/assets/ckeditor/ckeditor/_source/plugins/div/plugin.js +121 -121
  241. data/vendor/assets/ckeditor/ckeditor/_source/plugins/docprops/dialogs/docprops.js +674 -686
  242. data/vendor/assets/ckeditor/ckeditor/_source/plugins/docprops/plugin.js +22 -22
  243. data/vendor/assets/ckeditor/ckeditor/_source/plugins/domiterator/plugin.js +366 -361
  244. data/vendor/assets/ckeditor/ckeditor/_source/plugins/editingblock/plugin.js +278 -275
  245. data/vendor/assets/ckeditor/ckeditor/_source/plugins/elementspath/plugin.js +218 -218
  246. data/vendor/assets/ckeditor/ckeditor/_source/plugins/enterkey/plugin.js +433 -413
  247. data/vendor/assets/ckeditor/ckeditor/_source/plugins/entities/plugin.js +254 -250
  248. data/vendor/assets/ckeditor/ckeditor/_source/plugins/fakeobjects/plugin.js +175 -175
  249. data/vendor/assets/ckeditor/ckeditor/_source/plugins/filebrowser/plugin.js +533 -524
  250. data/vendor/assets/ckeditor/ckeditor/_source/plugins/find/dialogs/find.js +915 -903
  251. data/vendor/assets/ckeditor/ckeditor/_source/plugins/find/plugin.js +47 -47
  252. data/vendor/assets/ckeditor/ckeditor/_source/plugins/flash/dialogs/flash.js +674 -673
  253. data/vendor/assets/ckeditor/ckeditor/_source/plugins/flash/plugin.js +154 -154
  254. data/vendor/assets/ckeditor/ckeditor/_source/plugins/floatpanel/plugin.js +476 -428
  255. data/vendor/assets/ckeditor/ckeditor/_source/plugins/font/plugin.js +234 -234
  256. data/vendor/assets/ckeditor/ckeditor/_source/plugins/format/plugin.js +197 -197
  257. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/button.js +118 -118
  258. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/checkbox.js +153 -153
  259. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/form.js +177 -177
  260. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/hiddenfield.js +100 -100
  261. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/radio.js +135 -135
  262. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/select.js +558 -558
  263. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/textarea.js +135 -114
  264. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/textfield.js +199 -199
  265. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/plugin.js +288 -288
  266. data/vendor/assets/ckeditor/ckeditor/_source/plugins/horizontalrule/plugin.js +48 -48
  267. data/vendor/assets/ckeditor/ckeditor/_source/plugins/htmldataprocessor/plugin.js +600 -595
  268. data/vendor/assets/ckeditor/ckeditor/_source/plugins/htmlwriter/plugin.js +319 -319
  269. data/vendor/assets/ckeditor/ckeditor/_source/plugins/iframe/dialogs/iframe.js +229 -229
  270. data/vendor/assets/ckeditor/ckeditor/_source/plugins/iframe/plugin.js +87 -87
  271. data/vendor/assets/ckeditor/ckeditor/_source/plugins/iframedialog/plugin.js +188 -188
  272. data/vendor/assets/ckeditor/ckeditor/_source/plugins/image/dialogs/image.js +1406 -1406
  273. data/vendor/assets/ckeditor/ckeditor/_source/plugins/image/plugin.js +164 -81
  274. data/vendor/assets/ckeditor/ckeditor/_source/plugins/indent/plugin.js +480 -461
  275. data/vendor/assets/ckeditor/ckeditor/_source/plugins/justify/plugin.js +251 -253
  276. data/vendor/assets/ckeditor/ckeditor/_source/plugins/keystrokes/plugin.js +225 -225
  277. data/vendor/assets/ckeditor/ckeditor/_source/plugins/link/dialogs/anchor.js +144 -144
  278. data/vendor/assets/ckeditor/ckeditor/_source/plugins/link/dialogs/link.js +1427 -1424
  279. data/vendor/assets/ckeditor/ckeditor/_source/plugins/link/plugin.js +374 -374
  280. data/vendor/assets/ckeditor/ckeditor/_source/plugins/list/plugin.js +967 -734
  281. data/vendor/assets/ckeditor/ckeditor/_source/plugins/listblock/plugin.js +260 -268
  282. data/vendor/assets/ckeditor/ckeditor/_source/plugins/liststyle/dialogs/liststyle.js +225 -225
  283. data/vendor/assets/ckeditor/ckeditor/_source/plugins/liststyle/plugin.js +66 -66
  284. data/vendor/assets/ckeditor/ckeditor/_source/plugins/maximize/plugin.js +353 -352
  285. data/vendor/assets/ckeditor/ckeditor/_source/plugins/menu/plugin.js +542 -541
  286. data/vendor/assets/ckeditor/ckeditor/_source/plugins/menubutton/plugin.js +98 -98
  287. data/vendor/assets/ckeditor/ckeditor/_source/plugins/newpage/plugin.js +55 -54
  288. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pagebreak/plugin.js +164 -164
  289. data/vendor/assets/ckeditor/ckeditor/_source/plugins/panel/plugin.js +396 -403
  290. data/vendor/assets/ckeditor/ckeditor/_source/plugins/panelbutton/plugin.js +144 -144
  291. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastefromword/filter/default.js +1367 -1367
  292. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastefromword/plugin.js +141 -141
  293. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastetext/dialogs/pastetext.js +67 -67
  294. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastetext/plugin.js +98 -98
  295. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js +71 -71
  296. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/_translationstatus.txt +26 -0
  297. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/bg.js +16 -0
  298. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/cs.js +16 -0
  299. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/cy.js +16 -0
  300. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/da.js +16 -0
  301. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/de.js +16 -0
  302. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/el.js +16 -0
  303. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/en.js +16 -16
  304. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/eo.js +16 -0
  305. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/et.js +16 -0
  306. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/fa.js +16 -0
  307. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/fi.js +16 -0
  308. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/fr.js +16 -0
  309. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/he.js +16 -16
  310. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/hr.js +16 -0
  311. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/it.js +16 -0
  312. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/nb.js +16 -0
  313. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/nl.js +16 -0
  314. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/no.js +16 -0
  315. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/pl.js +16 -0
  316. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/tr.js +16 -0
  317. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/ug.js +16 -0
  318. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/uk.js +16 -0
  319. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/vi.js +16 -0
  320. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/zh-cn.js +16 -0
  321. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/plugin.js +171 -171
  322. data/vendor/assets/ckeditor/ckeditor/_source/plugins/popup/plugin.js +69 -64
  323. data/vendor/assets/ckeditor/ckeditor/_source/plugins/preview/plugin.js +113 -109
  324. data/vendor/assets/ckeditor/ckeditor/_source/plugins/print/plugin.js +42 -42
  325. data/vendor/assets/ckeditor/ckeditor/_source/plugins/removeformat/plugin.js +185 -185
  326. data/vendor/assets/ckeditor/ckeditor/_source/plugins/resize/plugin.js +169 -168
  327. data/vendor/assets/ckeditor/ckeditor/_source/plugins/richcombo/plugin.js +381 -381
  328. data/vendor/assets/ckeditor/ckeditor/_source/plugins/save/plugin.js +56 -56
  329. data/vendor/assets/ckeditor/ckeditor/_source/plugins/scayt/dialogs/options.js +537 -537
  330. data/vendor/assets/ckeditor/ckeditor/_source/plugins/scayt/dialogs/toolbar.css +71 -71
  331. data/vendor/assets/ckeditor/ckeditor/_source/plugins/scayt/plugin.js +973 -964
  332. data/vendor/assets/ckeditor/ckeditor/_source/plugins/selection/plugin.js +1855 -1601
  333. data/vendor/assets/ckeditor/ckeditor/_source/plugins/showblocks/plugin.js +160 -160
  334. data/vendor/assets/ckeditor/ckeditor/_source/plugins/showborders/plugin.js +207 -207
  335. data/vendor/assets/ckeditor/ckeditor/_source/plugins/smiley/dialogs/smiley.js +224 -224
  336. data/vendor/assets/ckeditor/ckeditor/_source/plugins/smiley/plugin.js +94 -94
  337. data/vendor/assets/ckeditor/ckeditor/_source/plugins/sourcearea/plugin.js +209 -209
  338. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/dialogs/specialchar.js +350 -350
  339. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/_translationstatus.txt +19 -0
  340. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/cs.js +126 -0
  341. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/cy.js +126 -0
  342. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/de.js +126 -0
  343. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/en.js +126 -89
  344. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/eo.js +126 -0
  345. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/et.js +126 -0
  346. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/fa.js +126 -0
  347. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/fi.js +126 -0
  348. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/fr.js +126 -0
  349. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/hr.js +126 -0
  350. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/it.js +126 -0
  351. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/nb.js +126 -0
  352. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/nl.js +126 -0
  353. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/no.js +126 -0
  354. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/tr.js +126 -0
  355. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/ug.js +126 -0
  356. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/zh-cn.js +126 -0
  357. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/plugin.js +70 -70
  358. data/vendor/assets/ckeditor/ckeditor/_source/plugins/styles/plugin.js +1706 -1696
  359. data/vendor/assets/ckeditor/ckeditor/_source/plugins/styles/styles/default.js +88 -88
  360. data/vendor/assets/ckeditor/ckeditor/_source/plugins/stylescombo/plugin.js +218 -218
  361. data/vendor/assets/ckeditor/ckeditor/_source/plugins/stylesheetparser/plugin.js +148 -148
  362. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tab/plugin.js +367 -367
  363. data/vendor/assets/ckeditor/ckeditor/_source/plugins/table/dialogs/table.js +618 -602
  364. data/vendor/assets/ckeditor/ckeditor/_source/plugins/table/plugin.js +78 -78
  365. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tableresize/plugin.js +443 -443
  366. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tabletools/dialogs/tableCell.js +520 -525
  367. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tabletools/plugin.js +1185 -1194
  368. data/vendor/assets/ckeditor/ckeditor/_source/plugins/templates/dialogs/templates.js +234 -234
  369. data/vendor/assets/ckeditor/ckeditor/_source/plugins/templates/plugin.js +100 -99
  370. data/vendor/assets/ckeditor/ckeditor/_source/plugins/templates/templates/default.js +94 -94
  371. data/vendor/assets/ckeditor/ckeditor/_source/plugins/toolbar/plugin.js +545 -545
  372. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/dialogs/uicolor.js +205 -205
  373. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/_translationstatus.txt +27 -0
  374. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/bg.js +15 -0
  375. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/cs.js +15 -0
  376. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/cy.js +15 -0
  377. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/da.js +15 -0
  378. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/de.js +15 -0
  379. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/el.js +15 -0
  380. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/en.js +15 -15
  381. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/eo.js +15 -0
  382. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/et.js +15 -0
  383. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/fa.js +15 -0
  384. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/fi.js +15 -0
  385. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/fr.js +15 -0
  386. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/he.js +15 -15
  387. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/hr.js +15 -0
  388. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/it.js +15 -0
  389. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/mk.js +15 -0
  390. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/nb.js +15 -0
  391. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/nl.js +15 -0
  392. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/no.js +15 -0
  393. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/pl.js +15 -0
  394. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/tr.js +15 -0
  395. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/ug.js +15 -0
  396. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/uk.js +15 -0
  397. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/vi.js +15 -0
  398. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/zh-cn.js +15 -0
  399. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/plugin.js +37 -37
  400. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/yui/assets/yui.css +15 -15
  401. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/yui/yui.js +71 -71
  402. data/vendor/assets/ckeditor/ckeditor/_source/plugins/undo/plugin.js +593 -580
  403. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/ciframe.html +49 -49
  404. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/tmpFrameset.html +52 -52
  405. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/wsc.css +82 -82
  406. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/wsc.js +192 -192
  407. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/plugin.js +33 -33
  408. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wysiwygarea/plugin.js +1346 -1351
  409. data/vendor/assets/ckeditor/ckeditor/_source/plugins/xml/plugin.js +170 -170
  410. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/dialog.css +989 -943
  411. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/editor.css +25 -25
  412. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/elementspath.css +73 -73
  413. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/icons.css +366 -366
  414. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/mainui.css +206 -203
  415. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/menu.css +232 -232
  416. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/panel.css +217 -217
  417. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/presets.css +49 -49
  418. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/reset.css +85 -84
  419. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/richcombo.css +287 -287
  420. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/skin.js +236 -236
  421. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/templates.css +88 -88
  422. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/toolbar.css +408 -407
  423. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/dialog.css +891 -844
  424. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/editor.css +25 -25
  425. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/elementspath.css +74 -74
  426. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/icons.css +363 -363
  427. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/mainui.css +153 -153
  428. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/menu.css +229 -229
  429. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/panel.css +212 -212
  430. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/presets.css +49 -49
  431. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/reset.css +85 -84
  432. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/richcombo.css +309 -309
  433. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/skin.js +74 -74
  434. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/templates.css +87 -87
  435. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/toolbar.css +522 -522
  436. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/dialog.css +907 -861
  437. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/editor.css +25 -25
  438. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/elementspath.css +74 -74
  439. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/icons.css +363 -363
  440. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/mainui.css +162 -162
  441. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/menu.css +232 -232
  442. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/panel.css +212 -212
  443. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/presets.css +50 -50
  444. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/reset.css +85 -84
  445. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/richcombo.css +302 -302
  446. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/skin.js +70 -70
  447. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/templates.css +87 -87
  448. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/toolbar.css +465 -465
  449. data/vendor/assets/ckeditor/ckeditor/_source/themes/default/theme.js +407 -395
  450. data/vendor/assets/ckeditor/ckeditor/adapters/jquery.js +6 -6
  451. data/vendor/assets/ckeditor/ckeditor/ckeditor.asp +955 -955
  452. data/vendor/assets/ckeditor/ckeditor/ckeditor.js +134 -130
  453. data/vendor/assets/ckeditor/ckeditor/ckeditor.pack +211 -211
  454. data/vendor/assets/ckeditor/ckeditor/ckeditor.php +29 -29
  455. data/vendor/assets/ckeditor/ckeditor/ckeditor_basic.js +8 -8
  456. data/vendor/assets/ckeditor/ckeditor/ckeditor_basic_source.js +20 -20
  457. data/vendor/assets/ckeditor/ckeditor/ckeditor_php4.php +566 -566
  458. data/vendor/assets/ckeditor/ckeditor/ckeditor_php5.php +556 -556
  459. data/vendor/assets/ckeditor/ckeditor/ckeditor_source.js +14 -4
  460. data/vendor/assets/ckeditor/ckeditor/config.js +11 -11
  461. data/vendor/assets/ckeditor/ckeditor/contents.css +25 -25
  462. data/vendor/assets/ckeditor/ckeditor/lang/_languages.js +1 -1
  463. data/vendor/assets/ckeditor/ckeditor/lang/_translationstatus.txt +61 -59
  464. data/vendor/assets/ckeditor/ckeditor/lang/af.js +2 -2
  465. data/vendor/assets/ckeditor/ckeditor/lang/ar.js +2 -2
  466. data/vendor/assets/ckeditor/ckeditor/lang/bg.js +2 -2
  467. data/vendor/assets/ckeditor/ckeditor/lang/bn.js +2 -2
  468. data/vendor/assets/ckeditor/ckeditor/lang/bs.js +2 -2
  469. data/vendor/assets/ckeditor/ckeditor/lang/ca.js +2 -2
  470. data/vendor/assets/ckeditor/ckeditor/lang/cs.js +2 -2
  471. data/vendor/assets/ckeditor/ckeditor/lang/cy.js +2 -2
  472. data/vendor/assets/ckeditor/ckeditor/lang/da.js +2 -2
  473. data/vendor/assets/ckeditor/ckeditor/lang/de.js +2 -2
  474. data/vendor/assets/ckeditor/ckeditor/lang/el.js +2 -2
  475. data/vendor/assets/ckeditor/ckeditor/lang/en-au.js +2 -2
  476. data/vendor/assets/ckeditor/ckeditor/lang/en-ca.js +2 -2
  477. data/vendor/assets/ckeditor/ckeditor/lang/en-gb.js +2 -2
  478. data/vendor/assets/ckeditor/ckeditor/lang/en.js +2 -2
  479. data/vendor/assets/ckeditor/ckeditor/lang/eo.js +2 -2
  480. data/vendor/assets/ckeditor/ckeditor/lang/es.js +2 -2
  481. data/vendor/assets/ckeditor/ckeditor/lang/et.js +2 -2
  482. data/vendor/assets/ckeditor/ckeditor/lang/eu.js +2 -2
  483. data/vendor/assets/ckeditor/ckeditor/lang/fa.js +2 -2
  484. data/vendor/assets/ckeditor/ckeditor/lang/fi.js +2 -2
  485. data/vendor/assets/ckeditor/ckeditor/lang/fo.js +2 -2
  486. data/vendor/assets/ckeditor/ckeditor/lang/fr-ca.js +2 -2
  487. data/vendor/assets/ckeditor/ckeditor/lang/fr.js +2 -2
  488. data/vendor/assets/ckeditor/ckeditor/lang/gl.js +2 -2
  489. data/vendor/assets/ckeditor/ckeditor/lang/gu.js +2 -2
  490. data/vendor/assets/ckeditor/ckeditor/lang/he.js +2 -2
  491. data/vendor/assets/ckeditor/ckeditor/lang/hi.js +2 -2
  492. data/vendor/assets/ckeditor/ckeditor/lang/hr.js +2 -2
  493. data/vendor/assets/ckeditor/ckeditor/lang/hu.js +2 -2
  494. data/vendor/assets/ckeditor/ckeditor/lang/is.js +2 -2
  495. data/vendor/assets/ckeditor/ckeditor/lang/it.js +2 -2
  496. data/vendor/assets/ckeditor/ckeditor/lang/ja.js +2 -2
  497. data/vendor/assets/ckeditor/ckeditor/lang/ka.js +2 -2
  498. data/vendor/assets/ckeditor/ckeditor/lang/km.js +2 -2
  499. data/vendor/assets/ckeditor/ckeditor/lang/ko.js +2 -2
  500. data/vendor/assets/ckeditor/ckeditor/lang/lt.js +2 -2
  501. data/vendor/assets/ckeditor/ckeditor/lang/lv.js +2 -2
  502. data/vendor/assets/ckeditor/ckeditor/lang/mk.js +6 -0
  503. data/vendor/assets/ckeditor/ckeditor/lang/mn.js +2 -2
  504. data/vendor/assets/ckeditor/ckeditor/lang/ms.js +2 -2
  505. data/vendor/assets/ckeditor/ckeditor/lang/nb.js +2 -2
  506. data/vendor/assets/ckeditor/ckeditor/lang/nl.js +2 -2
  507. data/vendor/assets/ckeditor/ckeditor/lang/no.js +2 -2
  508. data/vendor/assets/ckeditor/ckeditor/lang/pl.js +2 -2
  509. data/vendor/assets/ckeditor/ckeditor/lang/pt-br.js +2 -2
  510. data/vendor/assets/ckeditor/ckeditor/lang/pt.js +2 -2
  511. data/vendor/assets/ckeditor/ckeditor/lang/ro.js +2 -2
  512. data/vendor/assets/ckeditor/ckeditor/lang/ru.js +2 -2
  513. data/vendor/assets/ckeditor/ckeditor/lang/sk.js +2 -2
  514. data/vendor/assets/ckeditor/ckeditor/lang/sl.js +2 -2
  515. data/vendor/assets/ckeditor/ckeditor/lang/sr-latn.js +2 -2
  516. data/vendor/assets/ckeditor/ckeditor/lang/sr.js +2 -2
  517. data/vendor/assets/ckeditor/ckeditor/lang/sv.js +2 -2
  518. data/vendor/assets/ckeditor/ckeditor/lang/th.js +2 -2
  519. data/vendor/assets/ckeditor/ckeditor/lang/tr.js +2 -2
  520. data/vendor/assets/ckeditor/ckeditor/lang/ug.js +6 -0
  521. data/vendor/assets/ckeditor/ckeditor/lang/uk.js +2 -2
  522. data/vendor/assets/ckeditor/ckeditor/lang/vi.js +2 -2
  523. data/vendor/assets/ckeditor/ckeditor/lang/zh-cn.js +2 -2
  524. data/vendor/assets/ckeditor/ckeditor/lang/zh.js +2 -2
  525. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -1
  526. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/_translationstatus.txt +23 -0
  527. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/cs.js +6 -0
  528. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/cy.js +6 -0
  529. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/da.js +6 -0
  530. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/de.js +6 -0
  531. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/el.js +6 -0
  532. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/en.js +2 -2
  533. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/eo.js +6 -0
  534. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/fa.js +6 -0
  535. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/fi.js +6 -0
  536. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/fr.js +6 -0
  537. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/gu.js +6 -0
  538. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/he.js +2 -2
  539. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/it.js +6 -0
  540. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/mk.js +6 -0
  541. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/nb.js +6 -0
  542. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/nl.js +6 -0
  543. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/no.js +6 -0
  544. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/tr.js +6 -0
  545. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/ug.js +6 -0
  546. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/vi.js +6 -0
  547. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/zh-cn.js +6 -0
  548. data/vendor/assets/ckeditor/ckeditor/plugins/about/dialogs/about.js +1 -1
  549. data/vendor/assets/ckeditor/ckeditor/plugins/adobeair/plugin.js +1 -1
  550. data/vendor/assets/ckeditor/ckeditor/plugins/ajax/plugin.js +1 -1
  551. data/vendor/assets/ckeditor/ckeditor/plugins/autogrow/plugin.js +2 -2
  552. data/vendor/assets/ckeditor/ckeditor/plugins/bbcode/plugin.js +1 -1
  553. data/vendor/assets/ckeditor/ckeditor/plugins/clipboard/dialogs/paste.js +2 -2
  554. data/vendor/assets/ckeditor/ckeditor/plugins/colordialog/dialogs/colordialog.js +3 -3
  555. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/_translationstatus.txt +27 -0
  556. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/bg.js +6 -0
  557. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/cs.js +6 -0
  558. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/cy.js +6 -0
  559. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/da.js +6 -0
  560. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/de.js +6 -0
  561. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/el.js +6 -0
  562. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/en.js +1 -1
  563. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/eo.js +6 -0
  564. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/et.js +6 -0
  565. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/fa.js +6 -0
  566. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/fi.js +6 -0
  567. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/fr.js +6 -0
  568. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/gu.js +6 -0
  569. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/he.js +6 -0
  570. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/hr.js +6 -0
  571. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/it.js +6 -0
  572. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/nb.js +6 -0
  573. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/nl.js +6 -0
  574. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/no.js +6 -0
  575. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/pl.js +6 -0
  576. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/tr.js +6 -0
  577. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/ug.js +6 -0
  578. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/uk.js +6 -0
  579. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/vi.js +6 -0
  580. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/zh-cn.js +6 -0
  581. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/plugin.js +2 -2
  582. data/vendor/assets/ckeditor/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
  583. data/vendor/assets/ckeditor/ckeditor/plugins/div/dialogs/div.js +1 -1
  584. data/vendor/assets/ckeditor/ckeditor/plugins/docprops/dialogs/docprops.js +3 -3
  585. data/vendor/assets/ckeditor/ckeditor/plugins/docprops/plugin.js +1 -1
  586. data/vendor/assets/ckeditor/ckeditor/plugins/find/dialogs/find.js +6 -6
  587. data/vendor/assets/ckeditor/ckeditor/plugins/flash/dialogs/flash.js +2 -2
  588. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/button.js +1 -1
  589. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
  590. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/form.js +1 -1
  591. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
  592. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/radio.js +1 -1
  593. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/select.js +1 -1
  594. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/textarea.js +2 -2
  595. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
  596. data/vendor/assets/ckeditor/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
  597. data/vendor/assets/ckeditor/ckeditor/plugins/iframedialog/plugin.js +1 -1
  598. data/vendor/assets/ckeditor/ckeditor/plugins/image/dialogs/image.js +9 -9
  599. data/vendor/assets/ckeditor/ckeditor/plugins/link/dialogs/anchor.js +1 -1
  600. data/vendor/assets/ckeditor/ckeditor/plugins/link/dialogs/link.js +6 -6
  601. data/vendor/assets/ckeditor/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
  602. data/vendor/assets/ckeditor/ckeditor/plugins/pastefromword/filter/default.js +1 -1
  603. data/vendor/assets/ckeditor/ckeditor/plugins/pastetext/dialogs/pastetext.js +1 -1
  604. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/dialogs/placeholder.js +1 -1
  605. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/_translationstatus.txt +26 -0
  606. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/bg.js +6 -0
  607. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/cs.js +6 -0
  608. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/cy.js +6 -0
  609. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/da.js +6 -0
  610. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/de.js +6 -0
  611. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/el.js +6 -0
  612. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/en.js +1 -1
  613. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/eo.js +6 -0
  614. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/et.js +6 -0
  615. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/fa.js +6 -0
  616. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/fi.js +6 -0
  617. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/fr.js +6 -0
  618. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/he.js +1 -1
  619. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/hr.js +6 -0
  620. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/it.js +6 -0
  621. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/nb.js +6 -0
  622. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/nl.js +6 -0
  623. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/no.js +6 -0
  624. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/pl.js +6 -0
  625. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/tr.js +6 -0
  626. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/ug.js +6 -0
  627. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/uk.js +6 -0
  628. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/vi.js +6 -0
  629. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/zh-cn.js +6 -0
  630. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/plugin.js +2 -2
  631. data/vendor/assets/ckeditor/ckeditor/plugins/scayt/dialogs/options.js +1 -1
  632. data/vendor/assets/ckeditor/ckeditor/plugins/scayt/dialogs/toolbar.css +1 -1
  633. data/vendor/assets/ckeditor/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
  634. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/dialogs/specialchar.js +2 -2
  635. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/_translationstatus.txt +19 -0
  636. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/cs.js +6 -0
  637. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/cy.js +6 -0
  638. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/de.js +6 -0
  639. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/en.js +2 -2
  640. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/eo.js +6 -0
  641. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/et.js +6 -0
  642. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/fa.js +6 -0
  643. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/fi.js +6 -0
  644. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/fr.js +6 -0
  645. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/hr.js +6 -0
  646. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/it.js +6 -0
  647. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/nb.js +6 -0
  648. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/nl.js +6 -0
  649. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/no.js +6 -0
  650. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/tr.js +6 -0
  651. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/ug.js +6 -0
  652. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/zh-cn.js +6 -0
  653. data/vendor/assets/ckeditor/ckeditor/plugins/styles/styles/default.js +1 -1
  654. data/vendor/assets/ckeditor/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
  655. data/vendor/assets/ckeditor/ckeditor/plugins/table/dialogs/table.js +5 -5
  656. data/vendor/assets/ckeditor/ckeditor/plugins/tableresize/plugin.js +1 -1
  657. data/vendor/assets/ckeditor/ckeditor/plugins/tabletools/dialogs/tableCell.js +3 -3
  658. data/vendor/assets/ckeditor/ckeditor/plugins/templates/dialogs/templates.js +1 -1
  659. data/vendor/assets/ckeditor/ckeditor/plugins/templates/templates/default.js +1 -1
  660. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/dialogs/uicolor.js +1 -1
  661. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/_translationstatus.txt +27 -0
  662. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/bg.js +6 -0
  663. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/cs.js +6 -0
  664. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/cy.js +6 -0
  665. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/da.js +6 -0
  666. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/de.js +6 -0
  667. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/el.js +6 -0
  668. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/en.js +1 -1
  669. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/eo.js +6 -0
  670. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/et.js +6 -0
  671. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/fa.js +6 -0
  672. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/fi.js +6 -0
  673. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/fr.js +6 -0
  674. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/he.js +1 -1
  675. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/hr.js +6 -0
  676. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/it.js +6 -0
  677. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/mk.js +6 -0
  678. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/nb.js +6 -0
  679. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/nl.js +6 -0
  680. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/no.js +6 -0
  681. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/pl.js +6 -0
  682. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/tr.js +6 -0
  683. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/ug.js +6 -0
  684. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/uk.js +6 -0
  685. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/vi.js +6 -0
  686. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/zh-cn.js +6 -0
  687. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/plugin.js +2 -2
  688. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/yui/assets/yui.css +1 -1
  689. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/yui/yui.js +1 -1
  690. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
  691. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
  692. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
  693. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.js +2 -2
  694. data/vendor/assets/ckeditor/ckeditor/plugins/xml/plugin.js +1 -1
  695. data/vendor/assets/ckeditor/ckeditor/skins/kama/dialog.css +2 -2
  696. data/vendor/assets/ckeditor/ckeditor/skins/kama/editor.css +4 -4
  697. data/vendor/assets/ckeditor/ckeditor/skins/kama/skin.js +1 -1
  698. data/vendor/assets/ckeditor/ckeditor/skins/kama/templates.css +1 -1
  699. data/vendor/assets/ckeditor/ckeditor/skins/office2003/dialog.css +2 -2
  700. data/vendor/assets/ckeditor/ckeditor/skins/office2003/editor.css +2 -2
  701. data/vendor/assets/ckeditor/ckeditor/skins/office2003/skin.js +1 -1
  702. data/vendor/assets/ckeditor/ckeditor/skins/office2003/templates.css +1 -1
  703. data/vendor/assets/ckeditor/ckeditor/skins/v2/dialog.css +2 -2
  704. data/vendor/assets/ckeditor/ckeditor/skins/v2/editor.css +2 -2
  705. data/vendor/assets/ckeditor/ckeditor/skins/v2/skin.js +1 -1
  706. data/vendor/assets/ckeditor/ckeditor/skins/v2/templates.css +1 -1
  707. data/vendor/assets/ckeditor/ckeditor/themes/default/theme.js +8 -8
  708. metadata +225 -3
@@ -1,207 +1,208 @@
1
- /*
2
- Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.html or http://ckeditor.com/license
4
- */
5
-
6
- (function()
7
- {
8
-
9
- function setupAdvParams( element )
10
- {
11
- var attrName = this.att;
12
-
13
- var value = element && element.hasAttribute( attrName ) && element.getAttribute( attrName ) || '';
14
-
15
- if ( value !== undefined )
16
- this.setValue( value );
17
- }
18
-
19
- function commitAdvParams()
20
- {
21
- // Dialogs may use different parameters in the commit list, so, by
22
- // definition, we take the first CKEDITOR.dom.element available.
23
- var element;
24
-
25
- for ( var i = 0 ; i < arguments.length ; i++ )
26
- {
27
- if ( arguments[ i ] instanceof CKEDITOR.dom.element )
28
- {
29
- element = arguments[ i ];
30
- break;
31
- }
32
- }
33
-
34
- if ( element )
35
- {
36
- var attrName = this.att,
37
- value = this.getValue();
38
-
39
- if ( value )
40
- element.setAttribute( attrName, value );
41
- else
42
- element.removeAttribute( attrName, value );
43
- }
44
- }
45
-
46
- CKEDITOR.plugins.add( 'dialogadvtab',
47
- {
48
- /**
49
- *
50
- * @param tabConfig
51
- * id, dir, classes, styles
52
- */
53
- createAdvancedTab : function( editor, tabConfig )
54
- {
55
- if ( !tabConfig )
56
- tabConfig = { id:1, dir:1, classes:1, styles:1 };
57
-
58
- var lang = editor.lang.common;
59
-
60
- var result =
61
- {
62
- id : 'advanced',
63
- label : lang.advancedTab,
64
- title : lang.advancedTab,
65
- elements :
66
- [
67
- {
68
- type : 'vbox',
69
- padding : 1,
70
- children : []
71
- }
72
- ]
73
- };
74
-
75
- var contents = [];
76
-
77
- if ( tabConfig.id || tabConfig.dir )
78
- {
79
- if ( tabConfig.id )
80
- {
81
- contents.push(
82
- {
83
- id : 'advId',
84
- att : 'id',
85
- type : 'text',
86
- label : lang.id,
87
- setup : setupAdvParams,
88
- commit : commitAdvParams
89
- });
90
- }
91
-
92
- if ( tabConfig.dir )
93
- {
94
- contents.push(
95
- {
96
- id : 'advLangDir',
97
- att : 'dir',
98
- type : 'select',
99
- label : lang.langDir,
100
- 'default' : '',
101
- style : 'width:100%',
102
- items :
103
- [
104
- [ lang.notSet, '' ],
105
- [ lang.langDirLTR, 'ltr' ],
106
- [ lang.langDirRTL, 'rtl' ]
107
- ],
108
- setup : setupAdvParams,
109
- commit : commitAdvParams
110
- });
111
- }
112
-
113
- result.elements[ 0 ].children.push(
114
- {
115
- type : 'hbox',
116
- widths : [ '50%', '50%' ],
117
- children : [].concat( contents )
118
- });
119
- }
120
-
121
- if ( tabConfig.styles || tabConfig.classes )
122
- {
123
- contents = [];
124
-
125
- if ( tabConfig.styles )
126
- {
127
- contents.push(
128
- {
129
- id : 'advStyles',
130
- att : 'style',
131
- type : 'text',
132
- label : lang.styles,
133
- 'default' : '',
134
-
135
- onChange : function(){},
136
-
137
- getStyle : function( name, defaultValue )
138
- {
139
- var match = this.getValue().match( new RegExp( name + '\\s*:\\s*([^;]*)', 'i') );
140
- return match ? match[ 1 ] : defaultValue;
141
- },
142
-
143
- updateStyle : function( name, value )
144
- {
145
- var styles = this.getValue();
146
-
147
- // Remove the current value.
148
- if ( styles )
149
- {
150
- styles = styles
151
- .replace( new RegExp( '\\s*' + name + '\s*:[^;]*(?:$|;\s*)', 'i' ), '' )
152
- .replace( /^[;\s]+/, '' )
153
- .replace( /\s+$/, '' );
154
- }
155
-
156
- if ( value )
157
- {
158
- styles && !(/;\s*$/).test( styles ) && ( styles += '; ' );
159
- styles += name + ': ' + value;
160
- }
161
-
162
- this.setValue( styles, 1 );
163
-
164
- },
165
-
166
- setup : setupAdvParams,
167
-
168
- commit : commitAdvParams
169
-
170
- });
171
- }
172
-
173
- if ( tabConfig.classes )
174
- {
175
- contents.push(
176
- {
177
- type : 'hbox',
178
- widths : [ '45%', '55%' ],
179
- children :
180
- [
181
- {
182
- id : 'advCSSClasses',
183
- att : 'class',
184
- type : 'text',
185
- label : lang.cssClasses,
186
- 'default' : '',
187
- setup : setupAdvParams,
188
- commit : commitAdvParams
189
-
190
- }
191
- ]
192
- });
193
- }
194
-
195
- result.elements[ 0 ].children.push(
196
- {
197
- type : 'hbox',
198
- widths : [ '50%', '50%' ],
199
- children : [].concat( contents )
200
- });
201
- }
202
-
203
- return result;
204
- }
205
- });
206
-
207
- })();
1
+ /*
2
+ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ (function()
7
+ {
8
+
9
+ function setupAdvParams( element )
10
+ {
11
+ var attrName = this.att;
12
+
13
+ var value = element && element.hasAttribute( attrName ) && element.getAttribute( attrName ) || '';
14
+
15
+ if ( value !== undefined )
16
+ this.setValue( value );
17
+ }
18
+
19
+ function commitAdvParams()
20
+ {
21
+ // Dialogs may use different parameters in the commit list, so, by
22
+ // definition, we take the first CKEDITOR.dom.element available.
23
+ var element;
24
+
25
+ for ( var i = 0 ; i < arguments.length ; i++ )
26
+ {
27
+ if ( arguments[ i ] instanceof CKEDITOR.dom.element )
28
+ {
29
+ element = arguments[ i ];
30
+ break;
31
+ }
32
+ }
33
+
34
+ if ( element )
35
+ {
36
+ var attrName = this.att,
37
+ value = this.getValue();
38
+
39
+ if ( value )
40
+ element.setAttribute( attrName, value );
41
+ else
42
+ element.removeAttribute( attrName, value );
43
+ }
44
+ }
45
+
46
+ CKEDITOR.plugins.add( 'dialogadvtab',
47
+ {
48
+ /**
49
+ *
50
+ * @param tabConfig
51
+ * id, dir, classes, styles
52
+ */
53
+ createAdvancedTab : function( editor, tabConfig )
54
+ {
55
+ if ( !tabConfig )
56
+ tabConfig = { id:1, dir:1, classes:1, styles:1 };
57
+
58
+ var lang = editor.lang.common;
59
+
60
+ var result =
61
+ {
62
+ id : 'advanced',
63
+ label : lang.advancedTab,
64
+ title : lang.advancedTab,
65
+ elements :
66
+ [
67
+ {
68
+ type : 'vbox',
69
+ padding : 1,
70
+ children : []
71
+ }
72
+ ]
73
+ };
74
+
75
+ var contents = [];
76
+
77
+ if ( tabConfig.id || tabConfig.dir )
78
+ {
79
+ if ( tabConfig.id )
80
+ {
81
+ contents.push(
82
+ {
83
+ id : 'advId',
84
+ att : 'id',
85
+ type : 'text',
86
+ label : lang.id,
87
+ setup : setupAdvParams,
88
+ commit : commitAdvParams
89
+ });
90
+ }
91
+
92
+ if ( tabConfig.dir )
93
+ {
94
+ contents.push(
95
+ {
96
+ id : 'advLangDir',
97
+ att : 'dir',
98
+ type : 'select',
99
+ label : lang.langDir,
100
+ 'default' : '',
101
+ style : 'width:100%',
102
+ items :
103
+ [
104
+ [ lang.notSet, '' ],
105
+ [ lang.langDirLTR, 'ltr' ],
106
+ [ lang.langDirRTL, 'rtl' ]
107
+ ],
108
+ setup : setupAdvParams,
109
+ commit : commitAdvParams
110
+ });
111
+ }
112
+
113
+ result.elements[ 0 ].children.push(
114
+ {
115
+ type : 'hbox',
116
+ widths : [ '50%', '50%' ],
117
+ children : [].concat( contents )
118
+ });
119
+ }
120
+
121
+ if ( tabConfig.styles || tabConfig.classes )
122
+ {
123
+ contents = [];
124
+
125
+ if ( tabConfig.styles )
126
+ {
127
+ contents.push(
128
+ {
129
+ id : 'advStyles',
130
+ att : 'style',
131
+ type : 'text',
132
+ label : lang.styles,
133
+ 'default' : '',
134
+
135
+ validate : CKEDITOR.dialog.validate.inlineStyle( lang.invalidInlineStyle ),
136
+ onChange : function(){},
137
+
138
+ getStyle : function( name, defaultValue )
139
+ {
140
+ var match = this.getValue().match( new RegExp( name + '\\s*:\\s*([^;]*)', 'i') );
141
+ return match ? match[ 1 ] : defaultValue;
142
+ },
143
+
144
+ updateStyle : function( name, value )
145
+ {
146
+ var styles = this.getValue();
147
+
148
+ // Remove the current value.
149
+ if ( styles )
150
+ {
151
+ styles = styles
152
+ .replace( new RegExp( '\\s*' + name + '\s*:[^;]*(?:$|;\s*)', 'i' ), '' )
153
+ .replace( /^[;\s]+/, '' )
154
+ .replace( /\s+$/, '' );
155
+ }
156
+
157
+ if ( value )
158
+ {
159
+ styles && !(/;\s*$/).test( styles ) && ( styles += '; ' );
160
+ styles += name + ': ' + value;
161
+ }
162
+
163
+ this.setValue( styles, 1 );
164
+
165
+ },
166
+
167
+ setup : setupAdvParams,
168
+
169
+ commit : commitAdvParams
170
+
171
+ });
172
+ }
173
+
174
+ if ( tabConfig.classes )
175
+ {
176
+ contents.push(
177
+ {
178
+ type : 'hbox',
179
+ widths : [ '45%', '55%' ],
180
+ children :
181
+ [
182
+ {
183
+ id : 'advCSSClasses',
184
+ att : 'class',
185
+ type : 'text',
186
+ label : lang.cssClasses,
187
+ 'default' : '',
188
+ setup : setupAdvParams,
189
+ commit : commitAdvParams
190
+
191
+ }
192
+ ]
193
+ });
194
+ }
195
+
196
+ result.elements[ 0 ].children.push(
197
+ {
198
+ type : 'hbox',
199
+ widths : [ '50%', '50%' ],
200
+ children : [].concat( contents )
201
+ });
202
+ }
203
+
204
+ return result;
205
+ }
206
+ });
207
+
208
+ })();
@@ -1,1541 +1,1549 @@
1
- /*
2
- Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.html or http://ckeditor.com/license
4
- */
5
-
6
- /** @fileoverview The "dialogui" plugin. */
7
-
8
- CKEDITOR.plugins.add( 'dialogui' );
9
-
10
- (function()
11
- {
12
- var initPrivateObject = function( elementDefinition )
13
- {
14
- this._ || ( this._ = {} );
15
- this._['default'] = this._.initValue = elementDefinition['default'] || '';
16
- this._.required = elementDefinition[ 'required' ] || false;
17
- var args = [ this._ ];
18
- for ( var i = 1 ; i < arguments.length ; i++ )
19
- args.push( arguments[i] );
20
- args.push( true );
21
- CKEDITOR.tools.extend.apply( CKEDITOR.tools, args );
22
- return this._;
23
- },
24
- textBuilder =
25
- {
26
- build : function( dialog, elementDefinition, output )
27
- {
28
- return new CKEDITOR.ui.dialog.textInput( dialog, elementDefinition, output );
29
- }
30
- },
31
- commonBuilder =
32
- {
33
- build : function( dialog, elementDefinition, output )
34
- {
35
- return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, elementDefinition, output );
36
- }
37
- },
38
- containerBuilder =
39
- {
40
- build : function( dialog, elementDefinition, output )
41
- {
42
- var children = elementDefinition.children,
43
- child,
44
- childHtmlList = [],
45
- childObjList = [];
46
- for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ )
47
- {
48
- var childHtml = [];
49
- childHtmlList.push( childHtml );
50
- childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) );
51
- }
52
- return new CKEDITOR.ui.dialog[ elementDefinition.type ]( dialog, childObjList, childHtmlList, output, elementDefinition );
53
- }
54
- },
55
- commonPrototype =
56
- {
57
- isChanged : function()
58
- {
59
- return this.getValue() != this.getInitValue();
60
- },
61
-
62
- reset : function( noChangeEvent )
63
- {
64
- this.setValue( this.getInitValue(), noChangeEvent );
65
- },
66
-
67
- setInitValue : function()
68
- {
69
- this._.initValue = this.getValue();
70
- },
71
-
72
- resetInitValue : function()
73
- {
74
- this._.initValue = this._['default'];
75
- },
76
-
77
- getInitValue : function()
78
- {
79
- return this._.initValue;
80
- }
81
- },
82
- commonEventProcessors = CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
83
- {
84
- onChange : function( dialog, func )
85
- {
86
- if ( !this._.domOnChangeRegistered )
87
- {
88
- dialog.on( 'load', function()
89
- {
90
- this.getInputElement().on( 'change', function()
91
- {
92
- // Make sure 'onchange' doesn't get fired after dialog closed. (#5719)
93
- if ( !dialog.parts.dialog.isVisible() )
94
- return;
95
-
96
- this.fire( 'change', { value : this.getValue() } );
97
- }, this );
98
- }, this );
99
- this._.domOnChangeRegistered = true;
100
- }
101
-
102
- this.on( 'change', func );
103
- }
104
- }, true ),
105
- eventRegex = /^on([A-Z]\w+)/,
106
- cleanInnerDefinition = function( def )
107
- {
108
- // An inner UI element should not have the parent's type, title or events.
109
- for ( var i in def )
110
- {
111
- if ( eventRegex.test( i ) || i == 'title' || i == 'type' )
112
- delete def[i];
113
- }
114
- return def;
115
- };
116
-
117
- CKEDITOR.tools.extend( CKEDITOR.ui.dialog,
118
- /** @lends CKEDITOR.ui.dialog */
119
- {
120
- /**
121
- * Base class for all dialog elements with a textual label on the left.
122
- * @constructor
123
- * @example
124
- * @extends CKEDITOR.ui.dialog.uiElement
125
- * @param {CKEDITOR.dialog} dialog
126
- * Parent dialog object.
127
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
128
- * The element definition. Accepted fields:
129
- * <ul>
130
- * <li><strong>label</strong> (Required) The label string.</li>
131
- * <li><strong>labelLayout</strong> (Optional) Put 'horizontal' here if the
132
- * label element is to be layed out horizontally. Otherwise a vertical
133
- * layout will be used.</li>
134
- * <li><strong>widths</strong> (Optional) This applies only for horizontal
135
- * layouts - an 2-element array of lengths to specify the widths of the
136
- * label and the content element.</li>
137
- * </ul>
138
- * @param {Array} htmlList
139
- * List of HTML code to output to.
140
- * @param {Function} contentHtml
141
- * A function returning the HTML code string to be added inside the content
142
- * cell.
143
- */
144
- labeledElement : function( dialog, elementDefinition, htmlList, contentHtml )
145
- {
146
- if ( arguments.length < 4 )
147
- return;
148
-
149
- var _ = initPrivateObject.call( this, elementDefinition );
150
- _.labelId = CKEDITOR.tools.getNextId() + '_label';
151
- var children = this._.children = [];
152
- /** @ignore */
153
- var innerHTML = function()
154
- {
155
- var html = [],
156
- requiredClass = elementDefinition.required ? ' cke_required' : '' ;
157
- if ( elementDefinition.labelLayout != 'horizontal' )
158
- html.push( '<label class="cke_dialog_ui_labeled_label' + requiredClass + '" ',
159
- ' id="'+ _.labelId + '"',
160
- ' for="' + _.inputId + '"',
161
- ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>',
162
- elementDefinition.label,
163
- '</label>',
164
- '<div class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + ' role="presentation">',
165
- contentHtml.call( this, dialog, elementDefinition ),
166
- '</div>' );
167
- else
168
- {
169
- var hboxDefinition = {
170
- type : 'hbox',
171
- widths : elementDefinition.widths,
172
- padding : 0,
173
- children :
174
- [
175
- {
176
- type : 'html',
177
- html : '<label class="cke_dialog_ui_labeled_label' + requiredClass + '"' +
178
- ' id="' + _.labelId + '"' +
179
- ' for="' + _.inputId + '"' +
180
- ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>' +
181
- CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
182
- '</span>'
183
- },
184
- {
185
- type : 'html',
186
- html : '<span class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + '>' +
187
- contentHtml.call( this, dialog, elementDefinition ) +
188
- '</span>'
189
- }
190
- ]
191
- };
192
- CKEDITOR.dialog._.uiElementBuilders.hbox.build( dialog, hboxDefinition, html );
193
- }
194
- return html.join( '' );
195
- };
196
- CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, { role : 'presentation' }, innerHTML );
197
- },
198
-
199
- /**
200
- * A text input with a label. This UI element class represents both the
201
- * single-line text inputs and password inputs in dialog boxes.
202
- * @constructor
203
- * @example
204
- * @extends CKEDITOR.ui.dialog.labeledElement
205
- * @param {CKEDITOR.dialog} dialog
206
- * Parent dialog object.
207
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
208
- * The element definition. Accepted fields:
209
- * <ul>
210
- * <li><strong>default</strong> (Optional) The default value.</li>
211
- * <li><strong>validate</strong> (Optional) The validation function. </li>
212
- * <li><strong>maxLength</strong> (Optional) The maximum length of text box
213
- * contents.</li>
214
- * <li><strong>size</strong> (Optional) The size of the text box. This is
215
- * usually overridden by the size defined by the skin, however.</li>
216
- * </ul>
217
- * @param {Array} htmlList
218
- * List of HTML code to output to.
219
- */
220
- textInput : function( dialog, elementDefinition, htmlList )
221
- {
222
- if ( arguments.length < 3 )
223
- return;
224
-
225
- initPrivateObject.call( this, elementDefinition );
226
- var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput',
227
- attributes = { 'class' : 'cke_dialog_ui_input_' + elementDefinition.type, id : domId, type : 'text' },
228
- i;
229
-
230
- // Set the validator, if any.
231
- if ( elementDefinition.validate )
232
- this.validate = elementDefinition.validate;
233
-
234
- // Set the max length and size.
235
- if ( elementDefinition.maxLength )
236
- attributes.maxlength = elementDefinition.maxLength;
237
- if ( elementDefinition.size )
238
- attributes.size = elementDefinition.size;
239
-
240
- if ( elementDefinition.inputStyle )
241
- attributes.style = elementDefinition.inputStyle;
242
-
243
- // If user presses Enter in a text box, it implies clicking OK for the dialog.
244
- var me = this, keyPressedOnMe = false;
245
- dialog.on( 'load', function()
246
- {
247
- me.getInputElement().on( 'keydown', function( evt )
248
- {
249
- if ( evt.data.getKeystroke() == 13 )
250
- keyPressedOnMe = true;
251
- } );
252
-
253
- // Lower the priority this 'keyup' since 'ok' will close the dialog.(#3749)
254
- me.getInputElement().on( 'keyup', function( evt )
255
- {
256
- if ( evt.data.getKeystroke() == 13 && keyPressedOnMe )
257
- {
258
- dialog.getButton( 'ok' ) && setTimeout( function ()
259
- {
260
- dialog.getButton( 'ok' ).click();
261
- }, 0 );
262
- keyPressedOnMe = false;
263
- }
264
- }, null, null, 1000 );
265
- } );
266
-
267
- /** @ignore */
268
- var innerHTML = function()
269
- {
270
- // IE BUG: Text input fields in IE at 100% would exceed a <td> or inline
271
- // container's width, so need to wrap it inside a <div>.
272
- var html = [ '<div class="cke_dialog_ui_input_', elementDefinition.type, '" role="presentation"' ];
273
-
274
- if ( elementDefinition.width )
275
- html.push( 'style="width:'+ elementDefinition.width +'" ' );
276
-
277
- html.push( '><input ' );
278
-
279
- attributes[ 'aria-labelledby' ] = this._.labelId;
280
- this._.required && ( attributes[ 'aria-required' ] = this._.required );
281
- for ( var i in attributes )
282
- html.push( i + '="' + attributes[i] + '" ' );
283
- html.push( ' /></div>' );
284
- return html.join( '' );
285
- };
286
- CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
287
- },
288
-
289
- /**
290
- * A text area with a label on the top or left.
291
- * @constructor
292
- * @extends CKEDITOR.ui.dialog.labeledElement
293
- * @example
294
- * @param {CKEDITOR.dialog} dialog
295
- * Parent dialog object.
296
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
297
- * The element definition. Accepted fields:
298
- * <ul>
299
- * <li><strong>rows</strong> (Optional) The number of rows displayed.
300
- * Defaults to 5 if not defined.</li>
301
- * <li><strong>cols</strong> (Optional) The number of cols displayed.
302
- * Defaults to 20 if not defined. Usually overridden by skins.</li>
303
- * <li><strong>default</strong> (Optional) The default value.</li>
304
- * <li><strong>validate</strong> (Optional) The validation function. </li>
305
- * </ul>
306
- * @param {Array} htmlList
307
- * List of HTML code to output to.
308
- */
309
- textarea : function( dialog, elementDefinition, htmlList )
310
- {
311
- if ( arguments.length < 3 )
312
- return;
313
-
314
- initPrivateObject.call( this, elementDefinition );
315
- var me = this,
316
- domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textarea',
317
- attributes = {};
318
-
319
- if ( elementDefinition.validate )
320
- this.validate = elementDefinition.validate;
321
-
322
- // Generates the essential attributes for the textarea tag.
323
- attributes.rows = elementDefinition.rows || 5;
324
- attributes.cols = elementDefinition.cols || 20;
325
-
326
- if ( typeof elementDefinition.inputStyle != 'undefined' )
327
- attributes.style = elementDefinition.inputStyle;
328
-
329
-
330
- /** @ignore */
331
- var innerHTML = function()
332
- {
333
- attributes[ 'aria-labelledby' ] = this._.labelId;
334
- this._.required && ( attributes[ 'aria-required' ] = this._.required );
335
- var html = [ '<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea class="cke_dialog_ui_input_textarea" id="', domId, '" ' ];
336
- for ( var i in attributes )
337
- html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" ' );
338
- html.push( '>', CKEDITOR.tools.htmlEncode( me._['default'] ), '</textarea></div>' );
339
- return html.join( '' );
340
- };
341
- CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
342
- },
343
-
344
- /**
345
- * A single checkbox with a label on the right.
346
- * @constructor
347
- * @extends CKEDITOR.ui.dialog.uiElement
348
- * @example
349
- * @param {CKEDITOR.dialog} dialog
350
- * Parent dialog object.
351
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
352
- * The element definition. Accepted fields:
353
- * <ul>
354
- * <li><strong>checked</strong> (Optional) Whether the checkbox is checked
355
- * on instantiation. Defaults to false.</li>
356
- * <li><strong>validate</strong> (Optional) The validation function.</li>
357
- * <li><strong>label</strong> (Optional) The checkbox label.</li>
358
- * </ul>
359
- * @param {Array} htmlList
360
- * List of HTML code to output to.
361
- */
362
- checkbox : function( dialog, elementDefinition, htmlList )
363
- {
364
- if ( arguments.length < 3 )
365
- return;
366
-
367
- var _ = initPrivateObject.call( this, elementDefinition, { 'default' : !!elementDefinition[ 'default' ] } );
368
-
369
- if ( elementDefinition.validate )
370
- this.validate = elementDefinition.validate;
371
-
372
- /** @ignore */
373
- var innerHTML = function()
374
- {
375
- var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
376
- {
377
- id : elementDefinition.id ? elementDefinition.id + '_checkbox' : CKEDITOR.tools.getNextId() + '_checkbox'
378
- }, true ),
379
- html = [];
380
-
381
- var labelId = CKEDITOR.tools.getNextId() + '_label';
382
- var attributes = { 'class' : 'cke_dialog_ui_checkbox_input', type : 'checkbox', 'aria-labelledby' : labelId };
383
- cleanInnerDefinition( myDefinition );
384
- if ( elementDefinition[ 'default' ] )
385
- attributes.checked = 'checked';
386
-
387
- if ( typeof myDefinition.inputStyle != 'undefined' )
388
- myDefinition.style = myDefinition.inputStyle;
389
-
390
- _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
391
- html.push( ' <label id="', labelId, '" for="', attributes.id, '"' + ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) + '>',
392
- CKEDITOR.tools.htmlEncode( elementDefinition.label ),
393
- '</label>' );
394
- return html.join( '' );
395
- };
396
-
397
- CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'span', null, null, innerHTML );
398
- },
399
-
400
- /**
401
- * A group of radio buttons.
402
- * @constructor
403
- * @example
404
- * @extends CKEDITOR.ui.dialog.labeledElement
405
- * @param {CKEDITOR.dialog} dialog
406
- * Parent dialog object.
407
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
408
- * The element definition. Accepted fields:
409
- * <ul>
410
- * <li><strong>default</strong> (Required) The default value.</li>
411
- * <li><strong>validate</strong> (Optional) The validation function.</li>
412
- * <li><strong>items</strong> (Required) An array of options. Each option
413
- * is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value'
414
- * is missing, then the value would be assumed to be the same as the
415
- * description.</li>
416
- * </ul>
417
- * @param {Array} htmlList
418
- * List of HTML code to output to.
419
- */
420
- radio : function( dialog, elementDefinition, htmlList )
421
- {
422
- if ( arguments.length < 3)
423
- return;
424
-
425
- initPrivateObject.call( this, elementDefinition );
426
- if ( !this._['default'] )
427
- this._['default'] = this._.initValue = elementDefinition.items[0][1];
428
- if ( elementDefinition.validate )
429
- this.validate = elementDefinition.valdiate;
430
- var children = [], me = this;
431
-
432
- /** @ignore */
433
- var innerHTML = function()
434
- {
435
- var inputHtmlList = [], html = [],
436
- commonAttributes = { 'class' : 'cke_dialog_ui_radio_item', 'aria-labelledby' : this._.labelId },
437
- commonName = elementDefinition.id ? elementDefinition.id + '_radio' : CKEDITOR.tools.getNextId() + '_radio';
438
- for ( var i = 0 ; i < elementDefinition.items.length ; i++ )
439
- {
440
- var item = elementDefinition.items[i],
441
- title = item[2] !== undefined ? item[2] : item[0],
442
- value = item[1] !== undefined ? item[1] : item[0],
443
- inputId = CKEDITOR.tools.getNextId() + '_radio_input',
444
- labelId = inputId + '_label',
445
- inputDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
446
- {
447
- id : inputId,
448
- title : null,
449
- type : null
450
- }, true ),
451
- labelDefinition = CKEDITOR.tools.extend( {}, inputDefinition,
452
- {
453
- title : title
454
- }, true ),
455
- inputAttributes =
456
- {
457
- type : 'radio',
458
- 'class' : 'cke_dialog_ui_radio_input',
459
- name : commonName,
460
- value : value,
461
- 'aria-labelledby' : labelId
462
- },
463
- inputHtml = [];
464
- if ( me._['default'] == value )
465
- inputAttributes.checked = 'checked';
466
- cleanInnerDefinition( inputDefinition );
467
- cleanInnerDefinition( labelDefinition );
468
-
469
- if ( typeof inputDefinition.inputStyle != 'undefined' )
470
- inputDefinition.style = inputDefinition.inputStyle;
471
-
472
- children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
473
- inputHtml.push( ' ' );
474
- new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtml, 'label', null, { id : labelId, 'for' : inputAttributes.id },
475
- item[0] );
476
- inputHtmlList.push( inputHtml.join( '' ) );
477
- }
478
- new CKEDITOR.ui.dialog.hbox( dialog, [], inputHtmlList, html );
479
- return html.join( '' );
480
- };
481
-
482
- CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
483
- this._.children = children;
484
- },
485
-
486
- /**
487
- * A button with a label inside.
488
- * @constructor
489
- * @example
490
- * @extends CKEDITOR.ui.dialog.uiElement
491
- * @param {CKEDITOR.dialog} dialog
492
- * Parent dialog object.
493
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
494
- * The element definition. Accepted fields:
495
- * <ul>
496
- * <li><strong>label</strong> (Required) The button label.</li>
497
- * <li><strong>disabled</strong> (Optional) Set to true if you want the
498
- * button to appear in disabled state.</li>
499
- * </ul>
500
- * @param {Array} htmlList
501
- * List of HTML code to output to.
502
- */
503
- button : function( dialog, elementDefinition, htmlList )
504
- {
505
- if ( !arguments.length )
506
- return;
507
-
508
- if ( typeof elementDefinition == 'function' )
509
- elementDefinition = elementDefinition( dialog.getParentEditor() );
510
-
511
- initPrivateObject.call( this, elementDefinition, { disabled : elementDefinition.disabled || false } );
512
-
513
- // Add OnClick event to this input.
514
- CKEDITOR.event.implementOn( this );
515
-
516
- var me = this;
517
-
518
- // Register an event handler for processing button clicks.
519
- dialog.on( 'load', function( eventInfo )
520
- {
521
- var element = this.getElement();
522
-
523
- (function()
524
- {
525
- element.on( 'click', function( evt )
526
- {
527
- me.fire( 'click', { dialog : me.getDialog() } );
528
- evt.data.preventDefault();
529
- } );
530
-
531
- element.on( 'keydown', function( evt )
532
- {
533
- if ( evt.data.getKeystroke() in { 32:1 } )
534
- {
535
- me.click();
536
- evt.data.preventDefault();
537
- }
538
- } );
539
- })();
540
-
541
- element.unselectable();
542
- }, this );
543
-
544
- var outerDefinition = CKEDITOR.tools.extend( {}, elementDefinition );
545
- delete outerDefinition.style;
546
-
547
- var labelId = CKEDITOR.tools.getNextId() + '_label';
548
- CKEDITOR.ui.dialog.uiElement.call(
549
- this,
550
- dialog,
551
- outerDefinition,
552
- htmlList,
553
- 'a',
554
- null,
555
- {
556
- style : elementDefinition.style,
557
- href : 'javascript:void(0)',
558
- title : elementDefinition.label,
559
- hidefocus : 'true',
560
- 'class' : elementDefinition['class'],
561
- role : 'button',
562
- 'aria-labelledby' : labelId
563
- },
564
- '<span id="' + labelId + '" class="cke_dialog_ui_button">' +
565
- CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
566
- '</span>' );
567
- },
568
-
569
- /**
570
- * A select box.
571
- * @extends CKEDITOR.ui.dialog.uiElement
572
- * @example
573
- * @constructor
574
- * @param {CKEDITOR.dialog} dialog
575
- * Parent dialog object.
576
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
577
- * The element definition. Accepted fields:
578
- * <ul>
579
- * <li><strong>default</strong> (Required) The default value.</li>
580
- * <li><strong>validate</strong> (Optional) The validation function.</li>
581
- * <li><strong>items</strong> (Required) An array of options. Each option
582
- * is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value'
583
- * is missing, then the value would be assumed to be the same as the
584
- * description.</li>
585
- * <li><strong>multiple</strong> (Optional) Set this to true if you'd like
586
- * to have a multiple-choice select box.</li>
587
- * <li><strong>size</strong> (Optional) The number of items to display in
588
- * the select box.</li>
589
- * </ul>
590
- * @param {Array} htmlList
591
- * List of HTML code to output to.
592
- */
593
- select : function( dialog, elementDefinition, htmlList )
594
- {
595
- if ( arguments.length < 3 )
596
- return;
597
-
598
- var _ = initPrivateObject.call( this, elementDefinition );
599
-
600
- if ( elementDefinition.validate )
601
- this.validate = elementDefinition.validate;
602
-
603
- _.inputId = CKEDITOR.tools.getNextId() + '_select';
604
- /** @ignore */
605
- var innerHTML = function()
606
- {
607
- var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
608
- {
609
- id : elementDefinition.id ? elementDefinition.id + '_select' : CKEDITOR.tools.getNextId() + '_select'
610
- }, true ),
611
- html = [],
612
- innerHTML = [],
613
- attributes = { 'id' : _.inputId, 'class' : 'cke_dialog_ui_input_select', 'aria-labelledby' : this._.labelId };
614
-
615
- // Add multiple and size attributes from element definition.
616
- if ( elementDefinition.size != undefined )
617
- attributes.size = elementDefinition.size;
618
- if ( elementDefinition.multiple != undefined )
619
- attributes.multiple = elementDefinition.multiple;
620
-
621
- cleanInnerDefinition( myDefinition );
622
- for ( var i = 0, item ; i < elementDefinition.items.length && ( item = elementDefinition.items[i] ) ; i++ )
623
- {
624
- innerHTML.push( '<option value="',
625
- CKEDITOR.tools.htmlEncode( item[1] !== undefined ? item[1] : item[0] ).replace( /"/g, '&quot;' ), '" /> ',
626
- CKEDITOR.tools.htmlEncode( item[0] ) );
627
- }
628
-
629
- if ( typeof myDefinition.inputStyle != 'undefined' )
630
- myDefinition.style = myDefinition.inputStyle;
631
-
632
- _.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );
633
- return html.join( '' );
634
- };
635
-
636
- CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
637
- },
638
-
639
- /**
640
- * A file upload input.
641
- * @extends CKEDITOR.ui.dialog.labeledElement
642
- * @example
643
- * @constructor
644
- * @param {CKEDITOR.dialog} dialog
645
- * Parent dialog object.
646
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
647
- * The element definition. Accepted fields:
648
- * <ul>
649
- * <li><strong>validate</strong> (Optional) The validation function.</li>
650
- * </ul>
651
- * @param {Array} htmlList
652
- * List of HTML code to output to.
653
- */
654
- file : function( dialog, elementDefinition, htmlList )
655
- {
656
- if ( arguments.length < 3 )
657
- return;
658
-
659
- if ( elementDefinition['default'] === undefined )
660
- elementDefinition['default'] = '';
661
-
662
- var _ = CKEDITOR.tools.extend( initPrivateObject.call( this, elementDefinition ), { definition : elementDefinition, buttons : [] } );
663
-
664
- if ( elementDefinition.validate )
665
- this.validate = elementDefinition.validate;
666
-
667
- /** @ignore */
668
- var innerHTML = function()
669
- {
670
- _.frameId = CKEDITOR.tools.getNextId() + '_fileInput';
671
-
672
- // Support for custom document.domain in IE.
673
- var isCustomDomain = CKEDITOR.env.isCustomDomain();
674
-
675
- var html = [
676
- '<iframe' +
677
- ' frameborder="0"' +
678
- ' allowtransparency="0"' +
679
- ' class="cke_dialog_ui_input_file"' +
680
- ' id="', _.frameId, '"' +
681
- ' title="', elementDefinition.label, '"' +
682
- ' src="javascript:void(' ];
683
-
684
- html.push(
685
- isCustomDomain ?
686
- '(function(){' +
687
- 'document.open();' +
688
- 'document.domain=\'' + document.domain + '\';' +
689
- 'document.close();' +
690
- '})()'
691
- :
692
- '0' );
693
-
694
- html.push(
695
- ')">' +
696
- '</iframe>' );
697
-
698
- return html.join( '' );
699
- };
700
-
701
- // IE BUG: Parent container does not resize to contain the iframe automatically.
702
- dialog.on( 'load', function()
703
- {
704
- var iframe = CKEDITOR.document.getById( _.frameId ),
705
- contentDiv = iframe.getParent();
706
- contentDiv.addClass( 'cke_dialog_ui_input_file' );
707
- } );
708
-
709
- CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
710
- },
711
-
712
- /**
713
- * A button for submitting the file in a file upload input.
714
- * @extends CKEDITOR.ui.dialog.button
715
- * @example
716
- * @constructor
717
- * @param {CKEDITOR.dialog} dialog
718
- * Parent dialog object.
719
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
720
- * The element definition. Accepted fields:
721
- * <ul>
722
- * <li><strong>for</strong> (Required) The file input's page and element Id
723
- * to associate to, in a 2-item array format: [ 'page_id', 'element_id' ].
724
- * </li>
725
- * <li><strong>validate</strong> (Optional) The validation function.</li>
726
- * </ul>
727
- * @param {Array} htmlList
728
- * List of HTML code to output to.
729
- */
730
- fileButton : function( dialog, elementDefinition, htmlList )
731
- {
732
- if ( arguments.length < 3 )
733
- return;
734
-
735
- var _ = initPrivateObject.call( this, elementDefinition ),
736
- me = this;
737
-
738
- if ( elementDefinition.validate )
739
- this.validate = elementDefinition.validate;
740
-
741
- var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition );
742
- var onClick = myDefinition.onClick;
743
- myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button';
744
- myDefinition.onClick = function( evt )
745
- {
746
- var target = elementDefinition[ 'for' ]; // [ pageId, elementId ]
747
- if ( !onClick || onClick.call( this, evt ) !== false )
748
- {
749
- dialog.getContentElement( target[0], target[1] ).submit();
750
- this.disable();
751
- }
752
- };
753
-
754
- dialog.on( 'load', function()
755
- {
756
- dialog.getContentElement( elementDefinition[ 'for' ][0], elementDefinition[ 'for' ][1] )._.buttons.push( me );
757
- } );
758
-
759
- CKEDITOR.ui.dialog.button.call( this, dialog, myDefinition, htmlList );
760
- },
761
-
762
- html : (function()
763
- {
764
- var myHtmlRe = /^\s*<[\w:]+\s+([^>]*)?>/,
765
- theirHtmlRe = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
766
- emptyTagRe = /\/$/;
767
- /**
768
- * A dialog element made from raw HTML code.
769
- * @extends CKEDITOR.ui.dialog.uiElement
770
- * @name CKEDITOR.ui.dialog.html
771
- * @param {CKEDITOR.dialog} dialog Parent dialog object.
772
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition Element definition.
773
- * Accepted fields:
774
- * <ul>
775
- * <li><strong>html</strong> (Required) HTML code of this element.</li>
776
- * </ul>
777
- * @param {Array} htmlList List of HTML code to be added to the dialog's content area.
778
- * @example
779
- * @constructor
780
- */
781
- return function( dialog, elementDefinition, htmlList )
782
- {
783
- if ( arguments.length < 3 )
784
- return;
785
-
786
- var myHtmlList = [],
787
- myHtml,
788
- theirHtml = elementDefinition.html,
789
- myMatch, theirMatch;
790
-
791
- // If the HTML input doesn't contain any tags at the beginning, add a <span> tag around it.
792
- if ( theirHtml.charAt( 0 ) != '<' )
793
- theirHtml = '<span>' + theirHtml + '</span>';
794
-
795
- // Look for focus function in definition.
796
- var focus = elementDefinition.focus;
797
- if ( focus )
798
- {
799
- var oldFocus = this.focus;
800
- this.focus = function()
801
- {
802
- oldFocus.call( this );
803
- typeof focus == 'function' && focus.call( this );
804
- this.fire( 'focus' );
805
- };
806
- if ( elementDefinition.isFocusable )
807
- {
808
- var oldIsFocusable = this.isFocusable;
809
- this.isFocusable = oldIsFocusable;
810
- }
811
- this.keyboardFocusable = true;
812
- }
813
-
814
- CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtmlList, 'span', null, null, '' );
815
-
816
- // Append the attributes created by the uiElement call to the real HTML.
817
- myHtml = myHtmlList.join( '' );
818
- myMatch = myHtml.match( myHtmlRe );
819
- theirMatch = theirHtml.match( theirHtmlRe ) || [ '', '', '' ];
820
-
821
- if ( emptyTagRe.test( theirMatch[1] ) )
822
- {
823
- theirMatch[1] = theirMatch[1].slice( 0, -1 );
824
- theirMatch[2] = '/' + theirMatch[2];
825
- }
826
-
827
- htmlList.push( [ theirMatch[1], ' ', myMatch[1] || '', theirMatch[2] ].join( '' ) );
828
- };
829
- })(),
830
-
831
- /**
832
- * Form fieldset for grouping dialog UI elements.
833
- * @constructor
834
- * @extends CKEDITOR.ui.dialog.uiElement
835
- * @param {CKEDITOR.dialog} dialog Parent dialog object.
836
- * @param {Array} childObjList
837
- * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
838
- * container.
839
- * @param {Array} childHtmlList
840
- * Array of HTML code that correspond to the HTML output of all the
841
- * objects in childObjList.
842
- * @param {Array} htmlList
843
- * Array of HTML code that this element will output to.
844
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
845
- * The element definition. Accepted fields:
846
- * <ul>
847
- * <li><strong>label</strong> (Optional) The legend of the this fieldset.</li>
848
- * <li><strong>children</strong> (Required) An array of dialog field definitions which will be grouped inside this fieldset. </li>
849
- * </ul>
850
- */
851
- fieldset : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
852
- {
853
- var legendLabel = elementDefinition.label;
854
- /** @ignore */
855
- var innerHTML = function()
856
- {
857
- var html = [];
858
- legendLabel && html.push( '<legend>' + legendLabel + '</legend>' );
859
- for ( var i = 0; i < childHtmlList.length; i++ )
860
- html.push( childHtmlList[ i ] );
861
- return html.join( '' );
862
- };
863
-
864
- this._ = { children : childObjList };
865
- CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'fieldset', null, null, innerHTML );
866
- }
867
-
868
- }, true );
869
-
870
- CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
871
-
872
- CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
873
- /** @lends CKEDITOR.ui.dialog.labeledElement.prototype */
874
- {
875
- /**
876
- * Sets the label text of the element.
877
- * @param {String} label The new label text.
878
- * @returns {CKEDITOR.ui.dialog.labeledElement} The current labeled element.
879
- * @example
880
- */
881
- setLabel : function( label )
882
- {
883
- var node = CKEDITOR.document.getById( this._.labelId );
884
- if ( node.getChildCount() < 1 )
885
- ( new CKEDITOR.dom.text( label, CKEDITOR.document ) ).appendTo( node );
886
- else
887
- node.getChild( 0 ).$.nodeValue = label;
888
- return this;
889
- },
890
-
891
- /**
892
- * Retrieves the current label text of the elment.
893
- * @returns {String} The current label text.
894
- * @example
895
- */
896
- getLabel : function()
897
- {
898
- var node = CKEDITOR.document.getById( this._.labelId );
899
- if ( !node || node.getChildCount() < 1 )
900
- return '';
901
- else
902
- return node.getChild( 0 ).getText();
903
- },
904
-
905
- /**
906
- * Defines the onChange event for UI element definitions.
907
- * @field
908
- * @type Object
909
- * @example
910
- */
911
- eventProcessors : commonEventProcessors
912
- }, true );
913
-
914
- CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
915
- /** @lends CKEDITOR.ui.dialog.button.prototype */
916
- {
917
- /**
918
- * Simulates a click to the button.
919
- * @example
920
- * @returns {Object} Return value of the 'click' event.
921
- */
922
- click : function()
923
- {
924
- if ( !this._.disabled )
925
- return this.fire( 'click', { dialog : this._.dialog } );
926
- this.getElement().$.blur();
927
- return false;
928
- },
929
-
930
- /**
931
- * Enables the button.
932
- * @example
933
- */
934
- enable : function()
935
- {
936
- this._.disabled = false;
937
- var element = this.getElement();
938
- element && element.removeClass( 'cke_disabled' );
939
- },
940
-
941
- /**
942
- * Disables the button.
943
- * @example
944
- */
945
- disable : function()
946
- {
947
- this._.disabled = true;
948
- this.getElement().addClass( 'cke_disabled' );
949
- },
950
-
951
- isVisible : function()
952
- {
953
- return this.getElement().getFirst().isVisible();
954
- },
955
-
956
- isEnabled : function()
957
- {
958
- return !this._.disabled;
959
- },
960
-
961
- /**
962
- * Defines the onChange event and onClick for button element definitions.
963
- * @field
964
- * @type Object
965
- * @example
966
- */
967
- eventProcessors : CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
968
- {
969
- /** @ignore */
970
- onClick : function( dialog, func )
971
- {
972
- this.on( 'click', func );
973
- }
974
- }, true ),
975
-
976
- /**
977
- * Handler for the element's access key up event. Simulates a click to
978
- * the button.
979
- * @example
980
- */
981
- accessKeyUp : function()
982
- {
983
- this.click();
984
- },
985
-
986
- /**
987
- * Handler for the element's access key down event. Simulates a mouse
988
- * down to the button.
989
- * @example
990
- */
991
- accessKeyDown : function()
992
- {
993
- this.focus();
994
- },
995
-
996
- keyboardFocusable : true
997
- }, true );
998
-
999
- CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
1000
- /** @lends CKEDITOR.ui.dialog.textInput.prototype */
1001
- {
1002
- /**
1003
- * Gets the text input DOM element under this UI object.
1004
- * @example
1005
- * @returns {CKEDITOR.dom.element} The DOM element of the text input.
1006
- */
1007
- getInputElement : function()
1008
- {
1009
- return CKEDITOR.document.getById( this._.inputId );
1010
- },
1011
-
1012
- /**
1013
- * Puts focus into the text input.
1014
- * @example
1015
- */
1016
- focus : function()
1017
- {
1018
- var me = this.selectParentTab();
1019
-
1020
- // GECKO BUG: setTimeout() is needed to workaround invisible selections.
1021
- setTimeout( function()
1022
- {
1023
- var element = me.getInputElement();
1024
- element && element.$.focus();
1025
- }, 0 );
1026
- },
1027
-
1028
- /**
1029
- * Selects all the text in the text input.
1030
- * @example
1031
- */
1032
- select : function()
1033
- {
1034
- var me = this.selectParentTab();
1035
-
1036
- // GECKO BUG: setTimeout() is needed to workaround invisible selections.
1037
- setTimeout( function()
1038
- {
1039
- var e = me.getInputElement();
1040
- if ( e )
1041
- {
1042
- e.$.focus();
1043
- e.$.select();
1044
- }
1045
- }, 0 );
1046
- },
1047
-
1048
- /**
1049
- * Handler for the text input's access key up event. Makes a select()
1050
- * call to the text input.
1051
- * @example
1052
- */
1053
- accessKeyUp : function()
1054
- {
1055
- this.select();
1056
- },
1057
-
1058
- /**
1059
- * Sets the value of this text input object.
1060
- * @param {Object} value The new value.
1061
- * @returns {CKEDITOR.ui.dialog.textInput} The current UI element.
1062
- * @example
1063
- * uiElement.setValue( 'Blamo' );
1064
- */
1065
- setValue : function( value )
1066
- {
1067
- !value && ( value = '' );
1068
- return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments );
1069
- },
1070
-
1071
- keyboardFocusable : true
1072
- }, commonPrototype, true );
1073
-
1074
- CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput();
1075
-
1076
- CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
1077
- /** @lends CKEDITOR.ui.dialog.select.prototype */
1078
- {
1079
- /**
1080
- * Gets the DOM element of the select box.
1081
- * @returns {CKEDITOR.dom.element} The &lt;select&gt; element of this UI
1082
- * element.
1083
- * @example
1084
- */
1085
- getInputElement : function()
1086
- {
1087
- return this._.select.getElement();
1088
- },
1089
-
1090
- /**
1091
- * Adds an option to the select box.
1092
- * @param {String} label Option label.
1093
- * @param {String} value (Optional) Option value, if not defined it'll be
1094
- * assumed to be the same as the label.
1095
- * @param {Number} index (Optional) Position of the option to be inserted
1096
- * to. If not defined the new option will be inserted to the end of list.
1097
- * @example
1098
- * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
1099
- */
1100
- add : function( label, value, index )
1101
- {
1102
- var option = new CKEDITOR.dom.element( 'option', this.getDialog().getParentEditor().document ),
1103
- selectElement = this.getInputElement().$;
1104
- option.$.text = label;
1105
- option.$.value = ( value === undefined || value === null ) ? label : value;
1106
- if ( index === undefined || index === null )
1107
- {
1108
- if ( CKEDITOR.env.ie )
1109
- selectElement.add( option.$ );
1110
- else
1111
- selectElement.add( option.$, null );
1112
- }
1113
- else
1114
- selectElement.add( option.$, index );
1115
- return this;
1116
- },
1117
-
1118
- /**
1119
- * Removes an option from the selection list.
1120
- * @param {Number} index Index of the option to be removed.
1121
- * @example
1122
- * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
1123
- */
1124
- remove : function( index )
1125
- {
1126
- var selectElement = this.getInputElement().$;
1127
- selectElement.remove( index );
1128
- return this;
1129
- },
1130
-
1131
- /**
1132
- * Clears all options out of the selection list.
1133
- * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
1134
- */
1135
- clear : function()
1136
- {
1137
- var selectElement = this.getInputElement().$;
1138
- while ( selectElement.length > 0 )
1139
- selectElement.remove( 0 );
1140
- return this;
1141
- },
1142
-
1143
- keyboardFocusable : true
1144
- }, commonPrototype, true );
1145
-
1146
- CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
1147
- /** @lends CKEDITOR.ui.dialog.checkbox.prototype */
1148
- {
1149
- /**
1150
- * Gets the checkbox DOM element.
1151
- * @example
1152
- * @returns {CKEDITOR.dom.element} The DOM element of the checkbox.
1153
- */
1154
- getInputElement : function()
1155
- {
1156
- return this._.checkbox.getElement();
1157
- },
1158
-
1159
- /**
1160
- * Sets the state of the checkbox.
1161
- * @example
1162
- * @param {Boolean} true to tick the checkbox, false to untick it.
1163
- * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
1164
- */
1165
- setValue : function( checked, noChangeEvent )
1166
- {
1167
- this.getInputElement().$.checked = checked;
1168
- !noChangeEvent && this.fire( 'change', { value : checked } );
1169
- },
1170
-
1171
- /**
1172
- * Gets the state of the checkbox.
1173
- * @example
1174
- * @returns {Boolean} true means the checkbox is ticked, false means it's not ticked.
1175
- */
1176
- getValue : function()
1177
- {
1178
- return this.getInputElement().$.checked;
1179
- },
1180
-
1181
- /**
1182
- * Handler for the access key up event. Toggles the checkbox.
1183
- * @example
1184
- */
1185
- accessKeyUp : function()
1186
- {
1187
- this.setValue( !this.getValue() );
1188
- },
1189
-
1190
- /**
1191
- * Defines the onChange event for UI element definitions.
1192
- * @field
1193
- * @type Object
1194
- * @example
1195
- */
1196
- eventProcessors :
1197
- {
1198
- onChange : function( dialog, func )
1199
- {
1200
- if ( !CKEDITOR.env.ie )
1201
- return commonEventProcessors.onChange.apply( this, arguments );
1202
- else
1203
- {
1204
- dialog.on( 'load', function()
1205
- {
1206
- var element = this._.checkbox.getElement();
1207
- element.on( 'propertychange', function( evt )
1208
- {
1209
- evt = evt.data.$;
1210
- if ( evt.propertyName == 'checked' )
1211
- this.fire( 'change', { value : element.$.checked } );
1212
- }, this );
1213
- }, this );
1214
- this.on( 'change', func );
1215
- }
1216
- return null;
1217
- }
1218
- },
1219
-
1220
- keyboardFocusable : true
1221
- }, commonPrototype, true );
1222
-
1223
- CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
1224
- /** @lends CKEDITOR.ui.dialog.radio.prototype */
1225
- {
1226
- /**
1227
- * Checks one of the radio buttons in this button group.
1228
- * @example
1229
- * @param {String} value The value of the button to be chcked.
1230
- * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
1231
- */
1232
- setValue : function( value, noChangeEvent )
1233
- {
1234
- var children = this._.children,
1235
- item;
1236
- for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ )
1237
- item.getElement().$.checked = ( item.getValue() == value );
1238
- !noChangeEvent && this.fire( 'change', { value : value } );
1239
- },
1240
-
1241
- /**
1242
- * Gets the value of the currently checked radio button.
1243
- * @example
1244
- * @returns {String} The currently checked button's value.
1245
- */
1246
- getValue : function()
1247
- {
1248
- var children = this._.children;
1249
- for ( var i = 0 ; i < children.length ; i++ )
1250
- {
1251
- if ( children[i].getElement().$.checked )
1252
- return children[i].getValue();
1253
- }
1254
- return null;
1255
- },
1256
-
1257
- /**
1258
- * Handler for the access key up event. Focuses the currently
1259
- * selected radio button, or the first radio button if none is
1260
- * selected.
1261
- * @example
1262
- */
1263
- accessKeyUp : function()
1264
- {
1265
- var children = this._.children, i;
1266
- for ( i = 0 ; i < children.length ; i++ )
1267
- {
1268
- if ( children[i].getElement().$.checked )
1269
- {
1270
- children[i].getElement().focus();
1271
- return;
1272
- }
1273
- }
1274
- children[0].getElement().focus();
1275
- },
1276
-
1277
- /**
1278
- * Defines the onChange event for UI element definitions.
1279
- * @field
1280
- * @type Object
1281
- * @example
1282
- */
1283
- eventProcessors :
1284
- {
1285
- onChange : function( dialog, func )
1286
- {
1287
- if ( !CKEDITOR.env.ie )
1288
- return commonEventProcessors.onChange.apply( this, arguments );
1289
- else
1290
- {
1291
- dialog.on( 'load', function()
1292
- {
1293
- var children = this._.children, me = this;
1294
- for ( var i = 0 ; i < children.length ; i++ )
1295
- {
1296
- var element = children[i].getElement();
1297
- element.on( 'propertychange', function( evt )
1298
- {
1299
- evt = evt.data.$;
1300
- if ( evt.propertyName == 'checked' && this.$.checked )
1301
- me.fire( 'change', { value : this.getAttribute( 'value' ) } );
1302
- } );
1303
- }
1304
- }, this );
1305
- this.on( 'change', func );
1306
- }
1307
- return null;
1308
- }
1309
- },
1310
-
1311
- keyboardFocusable : true
1312
- }, commonPrototype, true );
1313
-
1314
- CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
1315
- commonPrototype,
1316
- /** @lends CKEDITOR.ui.dialog.file.prototype */
1317
- {
1318
- /**
1319
- * Gets the &lt;input&gt; element of this file input.
1320
- * @returns {CKEDITOR.dom.element} The file input element.
1321
- * @example
1322
- */
1323
- getInputElement : function()
1324
- {
1325
- var frameDocument = CKEDITOR.document.getById( this._.frameId ).getFrameDocument();
1326
- return frameDocument.$.forms.length > 0 ?
1327
- new CKEDITOR.dom.element( frameDocument.$.forms[0].elements[0] ) :
1328
- this.getElement();
1329
- },
1330
-
1331
- /**
1332
- * Uploads the file in the file input.
1333
- * @returns {CKEDITOR.ui.dialog.file} This object.
1334
- * @example
1335
- */
1336
- submit : function()
1337
- {
1338
- this.getInputElement().getParent().$.submit();
1339
- return this;
1340
- },
1341
-
1342
- /**
1343
- * Get the action assigned to the form.
1344
- * @returns {String} The value of the action.
1345
- * @example
1346
- */
1347
- getAction : function()
1348
- {
1349
- return this.getInputElement().getParent().$.action;
1350
- },
1351
-
1352
- /**
1353
- * The events must be applied on the inner input element, and
1354
- * that must be done when the iframe & form has been loaded
1355
- */
1356
- registerEvents : function( definition )
1357
- {
1358
- var regex = /^on([A-Z]\w+)/,
1359
- match;
1360
-
1361
- var registerDomEvent = function( uiElement, dialog, eventName, func )
1362
- {
1363
- uiElement.on( 'formLoaded', function()
1364
- {
1365
- uiElement.getInputElement().on( eventName, func, uiElement );
1366
- });
1367
- };
1368
-
1369
- for ( var i in definition )
1370
- {
1371
- if ( !( match = i.match( regex ) ) )
1372
- continue;
1373
-
1374
- if ( this.eventProcessors[i] )
1375
- this.eventProcessors[i].call( this, this._.dialog, definition[i] );
1376
- else
1377
- registerDomEvent( this, this._.dialog, match[1].toLowerCase(), definition[i] );
1378
- }
1379
-
1380
- return this;
1381
- },
1382
-
1383
- /**
1384
- * Redraws the file input and resets the file path in the file input.
1385
- * The redraw logic is necessary because non-IE browsers tend to clear
1386
- * the &lt;iframe&gt; containing the file input after closing the dialog.
1387
- * @example
1388
- */
1389
- reset : function()
1390
- {
1391
- var _ = this._,
1392
- frameElement = CKEDITOR.document.getById( _.frameId ),
1393
- frameDocument = frameElement.getFrameDocument(),
1394
- elementDefinition = _.definition,
1395
- buttons = _.buttons,
1396
- callNumber = this.formLoadedNumber,
1397
- unloadNumber = this.formUnloadNumber,
1398
- langDir = _.dialog._.editor.lang.dir,
1399
- langCode = _.dialog._.editor.langCode;
1400
-
1401
- // The callback function for the iframe, but we must call tools.addFunction only once
1402
- // so we store the function number in this.formLoadedNumber
1403
- if ( !callNumber )
1404
- {
1405
- callNumber = this.formLoadedNumber = CKEDITOR.tools.addFunction(
1406
- function()
1407
- {
1408
- // Now we can apply the events to the input type=file
1409
- this.fire( 'formLoaded' ) ;
1410
- }, this ) ;
1411
-
1412
- // Remove listeners attached to the content of the iframe (the file input)
1413
- unloadNumber = this.formUnloadNumber = CKEDITOR.tools.addFunction(
1414
- function()
1415
- {
1416
- this.getInputElement().clearCustomData();
1417
- }, this ) ;
1418
-
1419
- this.getDialog()._.editor.on( 'destroy', function()
1420
- {
1421
- CKEDITOR.tools.removeFunction( callNumber );
1422
- CKEDITOR.tools.removeFunction( unloadNumber );
1423
- } );
1424
- }
1425
-
1426
- function generateFormField()
1427
- {
1428
- frameDocument.$.open();
1429
-
1430
- // Support for custom document.domain in IE.
1431
- if ( CKEDITOR.env.isCustomDomain() )
1432
- frameDocument.$.domain = document.domain;
1433
-
1434
- var size = '';
1435
- if ( elementDefinition.size )
1436
- size = elementDefinition.size - ( CKEDITOR.env.ie ? 7 : 0 ); // "Browse" button is bigger in IE.
1437
-
1438
- frameDocument.$.write( [ '<html dir="' + langDir + '" lang="' + langCode + '"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">',
1439
- '<form enctype="multipart/form-data" method="POST" dir="' + langDir + '" lang="' + langCode + '" action="',
1440
- CKEDITOR.tools.htmlEncode( elementDefinition.action ),
1441
- '">',
1442
- '<input type="file" name="',
1443
- CKEDITOR.tools.htmlEncode( elementDefinition.id || 'cke_upload' ),
1444
- '" size="',
1445
- CKEDITOR.tools.htmlEncode( size > 0 ? size : "" ),
1446
- '" />',
1447
- '</form>',
1448
- '</body></html>',
1449
- '<script>window.parent.CKEDITOR.tools.callFunction(' + callNumber + ');',
1450
- 'window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction(' + unloadNumber + ')}</script>' ].join( '' ) );
1451
-
1452
- frameDocument.$.close();
1453
-
1454
- for ( var i = 0 ; i < buttons.length ; i++ )
1455
- buttons[i].enable();
1456
- }
1457
-
1458
- // #3465: Wait for the browser to finish rendering the dialog first.
1459
- if ( CKEDITOR.env.gecko )
1460
- setTimeout( generateFormField, 500 );
1461
- else
1462
- generateFormField();
1463
- },
1464
-
1465
- getValue : function()
1466
- {
1467
- return this.getInputElement().$.value || '';
1468
- },
1469
-
1470
- /***
1471
- * The default value of input type="file" is an empty string, but during initialization
1472
- * of this UI element, the iframe still isn't ready so it can't be read from that object
1473
- * Setting it manually prevents later issues about the current value ("") being different
1474
- * of the initial value (undefined as it asked for .value of a div)
1475
- */
1476
- setInitValue : function()
1477
- {
1478
- this._.initValue = '';
1479
- },
1480
-
1481
- /**
1482
- * Defines the onChange event for UI element definitions.
1483
- * @field
1484
- * @type Object
1485
- * @example
1486
- */
1487
- eventProcessors :
1488
- {
1489
- onChange : function( dialog, func )
1490
- {
1491
- // If this method is called several times (I'm not sure about how this can happen but the default
1492
- // onChange processor includes this protection)
1493
- // In order to reapply to the new element, the property is deleted at the beggining of the registerEvents method
1494
- if ( !this._.domOnChangeRegistered )
1495
- {
1496
- // By listening for the formLoaded event, this handler will get reapplied when a new
1497
- // form is created
1498
- this.on( 'formLoaded', function()
1499
- {
1500
- this.getInputElement().on( 'change', function(){ this.fire( 'change', { value : this.getValue() } ); }, this );
1501
- }, this );
1502
- this._.domOnChangeRegistered = true;
1503
- }
1504
-
1505
- this.on( 'change', func );
1506
- }
1507
- },
1508
-
1509
- keyboardFocusable : true
1510
- }, true );
1511
-
1512
- CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
1513
-
1514
- CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone( CKEDITOR.ui.dialog.hbox.prototype );
1515
-
1516
- CKEDITOR.dialog.addUIElement( 'text', textBuilder );
1517
- CKEDITOR.dialog.addUIElement( 'password', textBuilder );
1518
- CKEDITOR.dialog.addUIElement( 'textarea', commonBuilder );
1519
- CKEDITOR.dialog.addUIElement( 'checkbox', commonBuilder );
1520
- CKEDITOR.dialog.addUIElement( 'radio', commonBuilder );
1521
- CKEDITOR.dialog.addUIElement( 'button', commonBuilder );
1522
- CKEDITOR.dialog.addUIElement( 'select', commonBuilder );
1523
- CKEDITOR.dialog.addUIElement( 'file', commonBuilder );
1524
- CKEDITOR.dialog.addUIElement( 'fileButton', commonBuilder );
1525
- CKEDITOR.dialog.addUIElement( 'html', commonBuilder );
1526
- CKEDITOR.dialog.addUIElement( 'fieldset', containerBuilder );
1527
- })();
1528
-
1529
- /**
1530
- * Fired when the value of the uiElement is changed
1531
- * @name CKEDITOR.ui.dialog.uiElement#change
1532
- * @event
1533
- */
1534
-
1535
- /**
1536
- * Fired when the inner frame created by the element is ready.
1537
- * Each time the button is used or the dialog is loaded a new
1538
- * form might be created.
1539
- * @name CKEDITOR.ui.dialog.fileButton#formLoaded
1540
- * @event
1541
- */
1
+ /*
2
+ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ /** @fileoverview The "dialogui" plugin. */
7
+
8
+ CKEDITOR.plugins.add( 'dialogui' );
9
+
10
+ (function()
11
+ {
12
+ var initPrivateObject = function( elementDefinition )
13
+ {
14
+ this._ || ( this._ = {} );
15
+ this._['default'] = this._.initValue = elementDefinition['default'] || '';
16
+ this._.required = elementDefinition[ 'required' ] || false;
17
+ var args = [ this._ ];
18
+ for ( var i = 1 ; i < arguments.length ; i++ )
19
+ args.push( arguments[i] );
20
+ args.push( true );
21
+ CKEDITOR.tools.extend.apply( CKEDITOR.tools, args );
22
+ return this._;
23
+ },
24
+ textBuilder =
25
+ {
26
+ build : function( dialog, elementDefinition, output )
27
+ {
28
+ return new CKEDITOR.ui.dialog.textInput( dialog, elementDefinition, output );
29
+ }
30
+ },
31
+ commonBuilder =
32
+ {
33
+ build : function( dialog, elementDefinition, output )
34
+ {
35
+ return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, elementDefinition, output );
36
+ }
37
+ },
38
+ containerBuilder =
39
+ {
40
+ build : function( dialog, elementDefinition, output )
41
+ {
42
+ var children = elementDefinition.children,
43
+ child,
44
+ childHtmlList = [],
45
+ childObjList = [];
46
+ for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ )
47
+ {
48
+ var childHtml = [];
49
+ childHtmlList.push( childHtml );
50
+ childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) );
51
+ }
52
+ return new CKEDITOR.ui.dialog[ elementDefinition.type ]( dialog, childObjList, childHtmlList, output, elementDefinition );
53
+ }
54
+ },
55
+ commonPrototype =
56
+ {
57
+ isChanged : function()
58
+ {
59
+ return this.getValue() != this.getInitValue();
60
+ },
61
+
62
+ reset : function( noChangeEvent )
63
+ {
64
+ this.setValue( this.getInitValue(), noChangeEvent );
65
+ },
66
+
67
+ setInitValue : function()
68
+ {
69
+ this._.initValue = this.getValue();
70
+ },
71
+
72
+ resetInitValue : function()
73
+ {
74
+ this._.initValue = this._['default'];
75
+ },
76
+
77
+ getInitValue : function()
78
+ {
79
+ return this._.initValue;
80
+ }
81
+ },
82
+ commonEventProcessors = CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
83
+ {
84
+ onChange : function( dialog, func )
85
+ {
86
+ if ( !this._.domOnChangeRegistered )
87
+ {
88
+ dialog.on( 'load', function()
89
+ {
90
+ this.getInputElement().on( 'change', function()
91
+ {
92
+ // Make sure 'onchange' doesn't get fired after dialog closed. (#5719)
93
+ if ( !dialog.parts.dialog.isVisible() )
94
+ return;
95
+
96
+ this.fire( 'change', { value : this.getValue() } );
97
+ }, this );
98
+ }, this );
99
+ this._.domOnChangeRegistered = true;
100
+ }
101
+
102
+ this.on( 'change', func );
103
+ }
104
+ }, true ),
105
+ eventRegex = /^on([A-Z]\w+)/,
106
+ cleanInnerDefinition = function( def )
107
+ {
108
+ // An inner UI element should not have the parent's type, title or events.
109
+ for ( var i in def )
110
+ {
111
+ if ( eventRegex.test( i ) || i == 'title' || i == 'type' )
112
+ delete def[i];
113
+ }
114
+ return def;
115
+ };
116
+
117
+ CKEDITOR.tools.extend( CKEDITOR.ui.dialog,
118
+ /** @lends CKEDITOR.ui.dialog */
119
+ {
120
+ /**
121
+ * Base class for all dialog elements with a textual label on the left.
122
+ * @constructor
123
+ * @example
124
+ * @extends CKEDITOR.ui.dialog.uiElement
125
+ * @param {CKEDITOR.dialog} dialog
126
+ * Parent dialog object.
127
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
128
+ * The element definition. Accepted fields:
129
+ * <ul>
130
+ * <li><strong>label</strong> (Required) The label string.</li>
131
+ * <li><strong>labelLayout</strong> (Optional) Put 'horizontal' here if the
132
+ * label element is to be layed out horizontally. Otherwise a vertical
133
+ * layout will be used.</li>
134
+ * <li><strong>widths</strong> (Optional) This applies only for horizontal
135
+ * layouts - an 2-element array of lengths to specify the widths of the
136
+ * label and the content element.</li>
137
+ * </ul>
138
+ * @param {Array} htmlList
139
+ * List of HTML code to output to.
140
+ * @param {Function} contentHtml
141
+ * A function returning the HTML code string to be added inside the content
142
+ * cell.
143
+ */
144
+ labeledElement : function( dialog, elementDefinition, htmlList, contentHtml )
145
+ {
146
+ if ( arguments.length < 4 )
147
+ return;
148
+
149
+ var _ = initPrivateObject.call( this, elementDefinition );
150
+ _.labelId = CKEDITOR.tools.getNextId() + '_label';
151
+ var children = this._.children = [];
152
+ /** @ignore */
153
+ var innerHTML = function()
154
+ {
155
+ var html = [],
156
+ requiredClass = elementDefinition.required ? ' cke_required' : '' ;
157
+ if ( elementDefinition.labelLayout != 'horizontal' )
158
+ html.push( '<label class="cke_dialog_ui_labeled_label' + requiredClass + '" ',
159
+ ' id="'+ _.labelId + '"',
160
+ ' for="' + _.inputId + '"',
161
+ ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>',
162
+ elementDefinition.label,
163
+ '</label>',
164
+ '<div class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + ' role="presentation">',
165
+ contentHtml.call( this, dialog, elementDefinition ),
166
+ '</div>' );
167
+ else
168
+ {
169
+ var hboxDefinition = {
170
+ type : 'hbox',
171
+ widths : elementDefinition.widths,
172
+ padding : 0,
173
+ children :
174
+ [
175
+ {
176
+ type : 'html',
177
+ html : '<label class="cke_dialog_ui_labeled_label' + requiredClass + '"' +
178
+ ' id="' + _.labelId + '"' +
179
+ ' for="' + _.inputId + '"' +
180
+ ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>' +
181
+ CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
182
+ '</span>'
183
+ },
184
+ {
185
+ type : 'html',
186
+ html : '<span class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + '>' +
187
+ contentHtml.call( this, dialog, elementDefinition ) +
188
+ '</span>'
189
+ }
190
+ ]
191
+ };
192
+ CKEDITOR.dialog._.uiElementBuilders.hbox.build( dialog, hboxDefinition, html );
193
+ }
194
+ return html.join( '' );
195
+ };
196
+ CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, { role : 'presentation' }, innerHTML );
197
+ },
198
+
199
+ /**
200
+ * A text input with a label. This UI element class represents both the
201
+ * single-line text inputs and password inputs in dialog boxes.
202
+ * @constructor
203
+ * @example
204
+ * @extends CKEDITOR.ui.dialog.labeledElement
205
+ * @param {CKEDITOR.dialog} dialog
206
+ * Parent dialog object.
207
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
208
+ * The element definition. Accepted fields:
209
+ * <ul>
210
+ * <li><strong>default</strong> (Optional) The default value.</li>
211
+ * <li><strong>validate</strong> (Optional) The validation function. </li>
212
+ * <li><strong>maxLength</strong> (Optional) The maximum length of text box
213
+ * contents.</li>
214
+ * <li><strong>size</strong> (Optional) The size of the text box. This is
215
+ * usually overridden by the size defined by the skin, however.</li>
216
+ * </ul>
217
+ * @param {Array} htmlList
218
+ * List of HTML code to output to.
219
+ */
220
+ textInput : function( dialog, elementDefinition, htmlList )
221
+ {
222
+ if ( arguments.length < 3 )
223
+ return;
224
+
225
+ initPrivateObject.call( this, elementDefinition );
226
+ var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput',
227
+ attributes = { 'class' : 'cke_dialog_ui_input_' + elementDefinition.type, id : domId, type : elementDefinition.type },
228
+ i;
229
+
230
+ // Set the validator, if any.
231
+ if ( elementDefinition.validate )
232
+ this.validate = elementDefinition.validate;
233
+
234
+ // Set the max length and size.
235
+ if ( elementDefinition.maxLength )
236
+ attributes.maxlength = elementDefinition.maxLength;
237
+ if ( elementDefinition.size )
238
+ attributes.size = elementDefinition.size;
239
+
240
+ if ( elementDefinition.inputStyle )
241
+ attributes.style = elementDefinition.inputStyle;
242
+
243
+ // If user presses Enter in a text box, it implies clicking OK for the dialog.
244
+ var me = this, keyPressedOnMe = false;
245
+ dialog.on( 'load', function()
246
+ {
247
+ me.getInputElement().on( 'keydown', function( evt )
248
+ {
249
+ if ( evt.data.getKeystroke() == 13 )
250
+ keyPressedOnMe = true;
251
+ } );
252
+
253
+ // Lower the priority this 'keyup' since 'ok' will close the dialog.(#3749)
254
+ me.getInputElement().on( 'keyup', function( evt )
255
+ {
256
+ if ( evt.data.getKeystroke() == 13 && keyPressedOnMe )
257
+ {
258
+ dialog.getButton( 'ok' ) && setTimeout( function ()
259
+ {
260
+ dialog.getButton( 'ok' ).click();
261
+ }, 0 );
262
+ keyPressedOnMe = false;
263
+ }
264
+ }, null, null, 1000 );
265
+ } );
266
+
267
+ /** @ignore */
268
+ var innerHTML = function()
269
+ {
270
+ // IE BUG: Text input fields in IE at 100% would exceed a <td> or inline
271
+ // container's width, so need to wrap it inside a <div>.
272
+ var html = [ '<div class="cke_dialog_ui_input_', elementDefinition.type, '" role="presentation"' ];
273
+
274
+ if ( elementDefinition.width )
275
+ html.push( 'style="width:'+ elementDefinition.width +'" ' );
276
+
277
+ html.push( '><input ' );
278
+
279
+ attributes[ 'aria-labelledby' ] = this._.labelId;
280
+ this._.required && ( attributes[ 'aria-required' ] = this._.required );
281
+ for ( var i in attributes )
282
+ html.push( i + '="' + attributes[i] + '" ' );
283
+ html.push( ' /></div>' );
284
+ return html.join( '' );
285
+ };
286
+ CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
287
+ },
288
+
289
+ /**
290
+ * A text area with a label on the top or left.
291
+ * @constructor
292
+ * @extends CKEDITOR.ui.dialog.labeledElement
293
+ * @example
294
+ * @param {CKEDITOR.dialog} dialog
295
+ * Parent dialog object.
296
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
297
+ * The element definition. Accepted fields:
298
+ * <ul>
299
+ * <li><strong>rows</strong> (Optional) The number of rows displayed.
300
+ * Defaults to 5 if not defined.</li>
301
+ * <li><strong>cols</strong> (Optional) The number of cols displayed.
302
+ * Defaults to 20 if not defined. Usually overridden by skins.</li>
303
+ * <li><strong>default</strong> (Optional) The default value.</li>
304
+ * <li><strong>validate</strong> (Optional) The validation function. </li>
305
+ * </ul>
306
+ * @param {Array} htmlList
307
+ * List of HTML code to output to.
308
+ */
309
+ textarea : function( dialog, elementDefinition, htmlList )
310
+ {
311
+ if ( arguments.length < 3 )
312
+ return;
313
+
314
+ initPrivateObject.call( this, elementDefinition );
315
+ var me = this,
316
+ domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textarea',
317
+ attributes = {};
318
+
319
+ if ( elementDefinition.validate )
320
+ this.validate = elementDefinition.validate;
321
+
322
+ // Generates the essential attributes for the textarea tag.
323
+ attributes.rows = elementDefinition.rows || 5;
324
+ attributes.cols = elementDefinition.cols || 20;
325
+
326
+ if ( typeof elementDefinition.inputStyle != 'undefined' )
327
+ attributes.style = elementDefinition.inputStyle;
328
+
329
+
330
+ /** @ignore */
331
+ var innerHTML = function()
332
+ {
333
+ attributes[ 'aria-labelledby' ] = this._.labelId;
334
+ this._.required && ( attributes[ 'aria-required' ] = this._.required );
335
+ var html = [ '<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea class="cke_dialog_ui_input_textarea" id="', domId, '" ' ];
336
+ for ( var i in attributes )
337
+ html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" ' );
338
+ html.push( '>', CKEDITOR.tools.htmlEncode( me._['default'] ), '</textarea></div>' );
339
+ return html.join( '' );
340
+ };
341
+ CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
342
+ },
343
+
344
+ /**
345
+ * A single checkbox with a label on the right.
346
+ * @constructor
347
+ * @extends CKEDITOR.ui.dialog.uiElement
348
+ * @example
349
+ * @param {CKEDITOR.dialog} dialog
350
+ * Parent dialog object.
351
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
352
+ * The element definition. Accepted fields:
353
+ * <ul>
354
+ * <li><strong>checked</strong> (Optional) Whether the checkbox is checked
355
+ * on instantiation. Defaults to false.</li>
356
+ * <li><strong>validate</strong> (Optional) The validation function.</li>
357
+ * <li><strong>label</strong> (Optional) The checkbox label.</li>
358
+ * </ul>
359
+ * @param {Array} htmlList
360
+ * List of HTML code to output to.
361
+ */
362
+ checkbox : function( dialog, elementDefinition, htmlList )
363
+ {
364
+ if ( arguments.length < 3 )
365
+ return;
366
+
367
+ var _ = initPrivateObject.call( this, elementDefinition, { 'default' : !!elementDefinition[ 'default' ] } );
368
+
369
+ if ( elementDefinition.validate )
370
+ this.validate = elementDefinition.validate;
371
+
372
+ /** @ignore */
373
+ var innerHTML = function()
374
+ {
375
+ var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
376
+ {
377
+ id : elementDefinition.id ? elementDefinition.id + '_checkbox' : CKEDITOR.tools.getNextId() + '_checkbox'
378
+ }, true ),
379
+ html = [];
380
+
381
+ var labelId = CKEDITOR.tools.getNextId() + '_label';
382
+ var attributes = { 'class' : 'cke_dialog_ui_checkbox_input', type : 'checkbox', 'aria-labelledby' : labelId };
383
+ cleanInnerDefinition( myDefinition );
384
+ if ( elementDefinition[ 'default' ] )
385
+ attributes.checked = 'checked';
386
+
387
+ if ( typeof myDefinition.inputStyle != 'undefined' )
388
+ myDefinition.style = myDefinition.inputStyle;
389
+
390
+ _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
391
+ html.push( ' <label id="', labelId, '" for="', attributes.id, '"' + ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) + '>',
392
+ CKEDITOR.tools.htmlEncode( elementDefinition.label ),
393
+ '</label>' );
394
+ return html.join( '' );
395
+ };
396
+
397
+ CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'span', null, null, innerHTML );
398
+ },
399
+
400
+ /**
401
+ * A group of radio buttons.
402
+ * @constructor
403
+ * @example
404
+ * @extends CKEDITOR.ui.dialog.labeledElement
405
+ * @param {CKEDITOR.dialog} dialog
406
+ * Parent dialog object.
407
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
408
+ * The element definition. Accepted fields:
409
+ * <ul>
410
+ * <li><strong>default</strong> (Required) The default value.</li>
411
+ * <li><strong>validate</strong> (Optional) The validation function.</li>
412
+ * <li><strong>items</strong> (Required) An array of options. Each option
413
+ * is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value'
414
+ * is missing, then the value would be assumed to be the same as the
415
+ * description.</li>
416
+ * </ul>
417
+ * @param {Array} htmlList
418
+ * List of HTML code to output to.
419
+ */
420
+ radio : function( dialog, elementDefinition, htmlList )
421
+ {
422
+ if ( arguments.length < 3)
423
+ return;
424
+
425
+ initPrivateObject.call( this, elementDefinition );
426
+ if ( !this._['default'] )
427
+ this._['default'] = this._.initValue = elementDefinition.items[0][1];
428
+ if ( elementDefinition.validate )
429
+ this.validate = elementDefinition.valdiate;
430
+ var children = [], me = this;
431
+
432
+ /** @ignore */
433
+ var innerHTML = function()
434
+ {
435
+ var inputHtmlList = [], html = [],
436
+ commonAttributes = { 'class' : 'cke_dialog_ui_radio_item', 'aria-labelledby' : this._.labelId },
437
+ commonName = elementDefinition.id ? elementDefinition.id + '_radio' : CKEDITOR.tools.getNextId() + '_radio';
438
+ for ( var i = 0 ; i < elementDefinition.items.length ; i++ )
439
+ {
440
+ var item = elementDefinition.items[i],
441
+ title = item[2] !== undefined ? item[2] : item[0],
442
+ value = item[1] !== undefined ? item[1] : item[0],
443
+ inputId = CKEDITOR.tools.getNextId() + '_radio_input',
444
+ labelId = inputId + '_label',
445
+ inputDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
446
+ {
447
+ id : inputId,
448
+ title : null,
449
+ type : null
450
+ }, true ),
451
+ labelDefinition = CKEDITOR.tools.extend( {}, inputDefinition,
452
+ {
453
+ title : title
454
+ }, true ),
455
+ inputAttributes =
456
+ {
457
+ type : 'radio',
458
+ 'class' : 'cke_dialog_ui_radio_input',
459
+ name : commonName,
460
+ value : value,
461
+ 'aria-labelledby' : labelId
462
+ },
463
+ inputHtml = [];
464
+ if ( me._['default'] == value )
465
+ inputAttributes.checked = 'checked';
466
+ cleanInnerDefinition( inputDefinition );
467
+ cleanInnerDefinition( labelDefinition );
468
+
469
+ if ( typeof inputDefinition.inputStyle != 'undefined' )
470
+ inputDefinition.style = inputDefinition.inputStyle;
471
+
472
+ children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
473
+ inputHtml.push( ' ' );
474
+ new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtml, 'label', null, { id : labelId, 'for' : inputAttributes.id },
475
+ item[0] );
476
+ inputHtmlList.push( inputHtml.join( '' ) );
477
+ }
478
+ new CKEDITOR.ui.dialog.hbox( dialog, children, inputHtmlList, html );
479
+ return html.join( '' );
480
+ };
481
+
482
+ CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
483
+ this._.children = children;
484
+ },
485
+
486
+ /**
487
+ * A button with a label inside.
488
+ * @constructor
489
+ * @example
490
+ * @extends CKEDITOR.ui.dialog.uiElement
491
+ * @param {CKEDITOR.dialog} dialog
492
+ * Parent dialog object.
493
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
494
+ * The element definition. Accepted fields:
495
+ * <ul>
496
+ * <li><strong>label</strong> (Required) The button label.</li>
497
+ * <li><strong>disabled</strong> (Optional) Set to true if you want the
498
+ * button to appear in disabled state.</li>
499
+ * </ul>
500
+ * @param {Array} htmlList
501
+ * List of HTML code to output to.
502
+ */
503
+ button : function( dialog, elementDefinition, htmlList )
504
+ {
505
+ if ( !arguments.length )
506
+ return;
507
+
508
+ if ( typeof elementDefinition == 'function' )
509
+ elementDefinition = elementDefinition( dialog.getParentEditor() );
510
+
511
+ initPrivateObject.call( this, elementDefinition, { disabled : elementDefinition.disabled || false } );
512
+
513
+ // Add OnClick event to this input.
514
+ CKEDITOR.event.implementOn( this );
515
+
516
+ var me = this;
517
+
518
+ // Register an event handler for processing button clicks.
519
+ dialog.on( 'load', function( eventInfo )
520
+ {
521
+ var element = this.getElement();
522
+
523
+ (function()
524
+ {
525
+ element.on( 'click', function( evt )
526
+ {
527
+ me.fire( 'click', { dialog : me.getDialog() } );
528
+ evt.data.preventDefault();
529
+ } );
530
+
531
+ element.on( 'keydown', function( evt )
532
+ {
533
+ if ( evt.data.getKeystroke() in { 32:1 } )
534
+ {
535
+ me.click();
536
+ evt.data.preventDefault();
537
+ }
538
+ } );
539
+ })();
540
+
541
+ element.unselectable();
542
+ }, this );
543
+
544
+ var outerDefinition = CKEDITOR.tools.extend( {}, elementDefinition );
545
+ delete outerDefinition.style;
546
+
547
+ var labelId = CKEDITOR.tools.getNextId() + '_label';
548
+ CKEDITOR.ui.dialog.uiElement.call(
549
+ this,
550
+ dialog,
551
+ outerDefinition,
552
+ htmlList,
553
+ 'a',
554
+ null,
555
+ {
556
+ style : elementDefinition.style,
557
+ href : 'javascript:void(0)',
558
+ title : elementDefinition.label,
559
+ hidefocus : 'true',
560
+ 'class' : elementDefinition['class'],
561
+ role : 'button',
562
+ 'aria-labelledby' : labelId
563
+ },
564
+ '<span id="' + labelId + '" class="cke_dialog_ui_button">' +
565
+ CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
566
+ '</span>' );
567
+ },
568
+
569
+ /**
570
+ * A select box.
571
+ * @extends CKEDITOR.ui.dialog.uiElement
572
+ * @example
573
+ * @constructor
574
+ * @param {CKEDITOR.dialog} dialog
575
+ * Parent dialog object.
576
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
577
+ * The element definition. Accepted fields:
578
+ * <ul>
579
+ * <li><strong>default</strong> (Required) The default value.</li>
580
+ * <li><strong>validate</strong> (Optional) The validation function.</li>
581
+ * <li><strong>items</strong> (Required) An array of options. Each option
582
+ * is a 1- or 2-item array of format [ 'Description', 'Value' ]. If 'Value'
583
+ * is missing, then the value would be assumed to be the same as the
584
+ * description.</li>
585
+ * <li><strong>multiple</strong> (Optional) Set this to true if you'd like
586
+ * to have a multiple-choice select box.</li>
587
+ * <li><strong>size</strong> (Optional) The number of items to display in
588
+ * the select box.</li>
589
+ * </ul>
590
+ * @param {Array} htmlList
591
+ * List of HTML code to output to.
592
+ */
593
+ select : function( dialog, elementDefinition, htmlList )
594
+ {
595
+ if ( arguments.length < 3 )
596
+ return;
597
+
598
+ var _ = initPrivateObject.call( this, elementDefinition );
599
+
600
+ if ( elementDefinition.validate )
601
+ this.validate = elementDefinition.validate;
602
+
603
+ _.inputId = CKEDITOR.tools.getNextId() + '_select';
604
+ /** @ignore */
605
+ var innerHTML = function()
606
+ {
607
+ var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
608
+ {
609
+ id : elementDefinition.id ? elementDefinition.id + '_select' : CKEDITOR.tools.getNextId() + '_select'
610
+ }, true ),
611
+ html = [],
612
+ innerHTML = [],
613
+ attributes = { 'id' : _.inputId, 'class' : 'cke_dialog_ui_input_select', 'aria-labelledby' : this._.labelId };
614
+
615
+ // Add multiple and size attributes from element definition.
616
+ if ( elementDefinition.size != undefined )
617
+ attributes.size = elementDefinition.size;
618
+ if ( elementDefinition.multiple != undefined )
619
+ attributes.multiple = elementDefinition.multiple;
620
+
621
+ cleanInnerDefinition( myDefinition );
622
+ for ( var i = 0, item ; i < elementDefinition.items.length && ( item = elementDefinition.items[i] ) ; i++ )
623
+ {
624
+ innerHTML.push( '<option value="',
625
+ CKEDITOR.tools.htmlEncode( item[1] !== undefined ? item[1] : item[0] ).replace( /"/g, '&quot;' ), '" /> ',
626
+ CKEDITOR.tools.htmlEncode( item[0] ) );
627
+ }
628
+
629
+ if ( typeof myDefinition.inputStyle != 'undefined' )
630
+ myDefinition.style = myDefinition.inputStyle;
631
+
632
+ _.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );
633
+ return html.join( '' );
634
+ };
635
+
636
+ CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
637
+ },
638
+
639
+ /**
640
+ * A file upload input.
641
+ * @extends CKEDITOR.ui.dialog.labeledElement
642
+ * @example
643
+ * @constructor
644
+ * @param {CKEDITOR.dialog} dialog
645
+ * Parent dialog object.
646
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
647
+ * The element definition. Accepted fields:
648
+ * <ul>
649
+ * <li><strong>validate</strong> (Optional) The validation function.</li>
650
+ * </ul>
651
+ * @param {Array} htmlList
652
+ * List of HTML code to output to.
653
+ */
654
+ file : function( dialog, elementDefinition, htmlList )
655
+ {
656
+ if ( arguments.length < 3 )
657
+ return;
658
+
659
+ if ( elementDefinition['default'] === undefined )
660
+ elementDefinition['default'] = '';
661
+
662
+ var _ = CKEDITOR.tools.extend( initPrivateObject.call( this, elementDefinition ), { definition : elementDefinition, buttons : [] } );
663
+
664
+ if ( elementDefinition.validate )
665
+ this.validate = elementDefinition.validate;
666
+
667
+ /** @ignore */
668
+ var innerHTML = function()
669
+ {
670
+ _.frameId = CKEDITOR.tools.getNextId() + '_fileInput';
671
+
672
+ // Support for custom document.domain in IE.
673
+ var isCustomDomain = CKEDITOR.env.isCustomDomain();
674
+
675
+ var html = [
676
+ '<iframe' +
677
+ ' frameborder="0"' +
678
+ ' allowtransparency="0"' +
679
+ ' class="cke_dialog_ui_input_file"' +
680
+ ' id="', _.frameId, '"' +
681
+ ' title="', elementDefinition.label, '"' +
682
+ ' src="javascript:void(' ];
683
+
684
+ html.push(
685
+ isCustomDomain ?
686
+ '(function(){' +
687
+ 'document.open();' +
688
+ 'document.domain=\'' + document.domain + '\';' +
689
+ 'document.close();' +
690
+ '})()'
691
+ :
692
+ '0' );
693
+
694
+ html.push(
695
+ ')">' +
696
+ '</iframe>' );
697
+
698
+ return html.join( '' );
699
+ };
700
+
701
+ // IE BUG: Parent container does not resize to contain the iframe automatically.
702
+ dialog.on( 'load', function()
703
+ {
704
+ var iframe = CKEDITOR.document.getById( _.frameId ),
705
+ contentDiv = iframe.getParent();
706
+ contentDiv.addClass( 'cke_dialog_ui_input_file' );
707
+ } );
708
+
709
+ CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
710
+ },
711
+
712
+ /**
713
+ * A button for submitting the file in a file upload input.
714
+ * @extends CKEDITOR.ui.dialog.button
715
+ * @example
716
+ * @constructor
717
+ * @param {CKEDITOR.dialog} dialog
718
+ * Parent dialog object.
719
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
720
+ * The element definition. Accepted fields:
721
+ * <ul>
722
+ * <li><strong>for</strong> (Required) The file input's page and element Id
723
+ * to associate to, in a 2-item array format: [ 'page_id', 'element_id' ].
724
+ * </li>
725
+ * <li><strong>validate</strong> (Optional) The validation function.</li>
726
+ * </ul>
727
+ * @param {Array} htmlList
728
+ * List of HTML code to output to.
729
+ */
730
+ fileButton : function( dialog, elementDefinition, htmlList )
731
+ {
732
+ if ( arguments.length < 3 )
733
+ return;
734
+
735
+ var _ = initPrivateObject.call( this, elementDefinition ),
736
+ me = this;
737
+
738
+ if ( elementDefinition.validate )
739
+ this.validate = elementDefinition.validate;
740
+
741
+ var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition );
742
+ var onClick = myDefinition.onClick;
743
+ myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button';
744
+ myDefinition.onClick = function( evt )
745
+ {
746
+ var target = elementDefinition[ 'for' ]; // [ pageId, elementId ]
747
+ if ( !onClick || onClick.call( this, evt ) !== false )
748
+ {
749
+ dialog.getContentElement( target[0], target[1] ).submit();
750
+ this.disable();
751
+ }
752
+ };
753
+
754
+ dialog.on( 'load', function()
755
+ {
756
+ dialog.getContentElement( elementDefinition[ 'for' ][0], elementDefinition[ 'for' ][1] )._.buttons.push( me );
757
+ } );
758
+
759
+ CKEDITOR.ui.dialog.button.call( this, dialog, myDefinition, htmlList );
760
+ },
761
+
762
+ html : (function()
763
+ {
764
+ var myHtmlRe = /^\s*<[\w:]+\s+([^>]*)?>/,
765
+ theirHtmlRe = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
766
+ emptyTagRe = /\/$/;
767
+ /**
768
+ * A dialog element made from raw HTML code.
769
+ * @extends CKEDITOR.ui.dialog.uiElement
770
+ * @name CKEDITOR.ui.dialog.html
771
+ * @param {CKEDITOR.dialog} dialog Parent dialog object.
772
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition Element definition.
773
+ * Accepted fields:
774
+ * <ul>
775
+ * <li><strong>html</strong> (Required) HTML code of this element.</li>
776
+ * </ul>
777
+ * @param {Array} htmlList List of HTML code to be added to the dialog's content area.
778
+ * @example
779
+ * @constructor
780
+ */
781
+ return function( dialog, elementDefinition, htmlList )
782
+ {
783
+ if ( arguments.length < 3 )
784
+ return;
785
+
786
+ var myHtmlList = [],
787
+ myHtml,
788
+ theirHtml = elementDefinition.html,
789
+ myMatch, theirMatch;
790
+
791
+ // If the HTML input doesn't contain any tags at the beginning, add a <span> tag around it.
792
+ if ( theirHtml.charAt( 0 ) != '<' )
793
+ theirHtml = '<span>' + theirHtml + '</span>';
794
+
795
+ // Look for focus function in definition.
796
+ var focus = elementDefinition.focus;
797
+ if ( focus )
798
+ {
799
+ var oldFocus = this.focus;
800
+ this.focus = function()
801
+ {
802
+ oldFocus.call( this );
803
+ typeof focus == 'function' && focus.call( this );
804
+ this.fire( 'focus' );
805
+ };
806
+ if ( elementDefinition.isFocusable )
807
+ {
808
+ var oldIsFocusable = this.isFocusable;
809
+ this.isFocusable = oldIsFocusable;
810
+ }
811
+ this.keyboardFocusable = true;
812
+ }
813
+
814
+ CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtmlList, 'span', null, null, '' );
815
+
816
+ // Append the attributes created by the uiElement call to the real HTML.
817
+ myHtml = myHtmlList.join( '' );
818
+ myMatch = myHtml.match( myHtmlRe );
819
+ theirMatch = theirHtml.match( theirHtmlRe ) || [ '', '', '' ];
820
+
821
+ if ( emptyTagRe.test( theirMatch[1] ) )
822
+ {
823
+ theirMatch[1] = theirMatch[1].slice( 0, -1 );
824
+ theirMatch[2] = '/' + theirMatch[2];
825
+ }
826
+
827
+ htmlList.push( [ theirMatch[1], ' ', myMatch[1] || '', theirMatch[2] ].join( '' ) );
828
+ };
829
+ })(),
830
+
831
+ /**
832
+ * Form fieldset for grouping dialog UI elements.
833
+ * @constructor
834
+ * @extends CKEDITOR.ui.dialog.uiElement
835
+ * @param {CKEDITOR.dialog} dialog Parent dialog object.
836
+ * @param {Array} childObjList
837
+ * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
838
+ * container.
839
+ * @param {Array} childHtmlList
840
+ * Array of HTML code that correspond to the HTML output of all the
841
+ * objects in childObjList.
842
+ * @param {Array} htmlList
843
+ * Array of HTML code that this element will output to.
844
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
845
+ * The element definition. Accepted fields:
846
+ * <ul>
847
+ * <li><strong>label</strong> (Optional) The legend of the this fieldset.</li>
848
+ * <li><strong>children</strong> (Required) An array of dialog field definitions which will be grouped inside this fieldset. </li>
849
+ * </ul>
850
+ */
851
+ fieldset : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
852
+ {
853
+ var legendLabel = elementDefinition.label;
854
+ /** @ignore */
855
+ var innerHTML = function()
856
+ {
857
+ var html = [];
858
+ legendLabel && html.push( '<legend' +
859
+ ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +
860
+ '>' + legendLabel + '</legend>' );
861
+ for ( var i = 0; i < childHtmlList.length; i++ )
862
+ html.push( childHtmlList[ i ] );
863
+ return html.join( '' );
864
+ };
865
+
866
+ this._ = { children : childObjList };
867
+ CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'fieldset', null, null, innerHTML );
868
+ }
869
+
870
+ }, true );
871
+
872
+ CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
873
+
874
+ CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
875
+ /** @lends CKEDITOR.ui.dialog.labeledElement.prototype */
876
+ {
877
+ /**
878
+ * Sets the label text of the element.
879
+ * @param {String} label The new label text.
880
+ * @returns {CKEDITOR.ui.dialog.labeledElement} The current labeled element.
881
+ * @example
882
+ */
883
+ setLabel : function( label )
884
+ {
885
+ var node = CKEDITOR.document.getById( this._.labelId );
886
+ if ( node.getChildCount() < 1 )
887
+ ( new CKEDITOR.dom.text( label, CKEDITOR.document ) ).appendTo( node );
888
+ else
889
+ node.getChild( 0 ).$.nodeValue = label;
890
+ return this;
891
+ },
892
+
893
+ /**
894
+ * Retrieves the current label text of the elment.
895
+ * @returns {String} The current label text.
896
+ * @example
897
+ */
898
+ getLabel : function()
899
+ {
900
+ var node = CKEDITOR.document.getById( this._.labelId );
901
+ if ( !node || node.getChildCount() < 1 )
902
+ return '';
903
+ else
904
+ return node.getChild( 0 ).getText();
905
+ },
906
+
907
+ /**
908
+ * Defines the onChange event for UI element definitions.
909
+ * @field
910
+ * @type Object
911
+ * @example
912
+ */
913
+ eventProcessors : commonEventProcessors
914
+ }, true );
915
+
916
+ CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
917
+ /** @lends CKEDITOR.ui.dialog.button.prototype */
918
+ {
919
+ /**
920
+ * Simulates a click to the button.
921
+ * @example
922
+ * @returns {Object} Return value of the 'click' event.
923
+ */
924
+ click : function()
925
+ {
926
+ if ( !this._.disabled )
927
+ return this.fire( 'click', { dialog : this._.dialog } );
928
+ this.getElement().$.blur();
929
+ return false;
930
+ },
931
+
932
+ /**
933
+ * Enables the button.
934
+ * @example
935
+ */
936
+ enable : function()
937
+ {
938
+ this._.disabled = false;
939
+ var element = this.getElement();
940
+ element && element.removeClass( 'cke_disabled' );
941
+ },
942
+
943
+ /**
944
+ * Disables the button.
945
+ * @example
946
+ */
947
+ disable : function()
948
+ {
949
+ this._.disabled = true;
950
+ this.getElement().addClass( 'cke_disabled' );
951
+ },
952
+
953
+ isVisible : function()
954
+ {
955
+ return this.getElement().getFirst().isVisible();
956
+ },
957
+
958
+ isEnabled : function()
959
+ {
960
+ return !this._.disabled;
961
+ },
962
+
963
+ /**
964
+ * Defines the onChange event and onClick for button element definitions.
965
+ * @field
966
+ * @type Object
967
+ * @example
968
+ */
969
+ eventProcessors : CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
970
+ {
971
+ /** @ignore */
972
+ onClick : function( dialog, func )
973
+ {
974
+ this.on( 'click', function()
975
+ {
976
+ // Some browsers (Chrome, IE8, IE7 compat mode) don't move
977
+ // focus to clicked button. Force this.
978
+ this.getElement().focus();
979
+ func.apply( this, arguments );
980
+ });
981
+ }
982
+ }, true ),
983
+
984
+ /**
985
+ * Handler for the element's access key up event. Simulates a click to
986
+ * the button.
987
+ * @example
988
+ */
989
+ accessKeyUp : function()
990
+ {
991
+ this.click();
992
+ },
993
+
994
+ /**
995
+ * Handler for the element's access key down event. Simulates a mouse
996
+ * down to the button.
997
+ * @example
998
+ */
999
+ accessKeyDown : function()
1000
+ {
1001
+ this.focus();
1002
+ },
1003
+
1004
+ keyboardFocusable : true
1005
+ }, true );
1006
+
1007
+ CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
1008
+ /** @lends CKEDITOR.ui.dialog.textInput.prototype */
1009
+ {
1010
+ /**
1011
+ * Gets the text input DOM element under this UI object.
1012
+ * @example
1013
+ * @returns {CKEDITOR.dom.element} The DOM element of the text input.
1014
+ */
1015
+ getInputElement : function()
1016
+ {
1017
+ return CKEDITOR.document.getById( this._.inputId );
1018
+ },
1019
+
1020
+ /**
1021
+ * Puts focus into the text input.
1022
+ * @example
1023
+ */
1024
+ focus : function()
1025
+ {
1026
+ var me = this.selectParentTab();
1027
+
1028
+ // GECKO BUG: setTimeout() is needed to workaround invisible selections.
1029
+ setTimeout( function()
1030
+ {
1031
+ var element = me.getInputElement();
1032
+ element && element.$.focus();
1033
+ }, 0 );
1034
+ },
1035
+
1036
+ /**
1037
+ * Selects all the text in the text input.
1038
+ * @example
1039
+ */
1040
+ select : function()
1041
+ {
1042
+ var me = this.selectParentTab();
1043
+
1044
+ // GECKO BUG: setTimeout() is needed to workaround invisible selections.
1045
+ setTimeout( function()
1046
+ {
1047
+ var e = me.getInputElement();
1048
+ if ( e )
1049
+ {
1050
+ e.$.focus();
1051
+ e.$.select();
1052
+ }
1053
+ }, 0 );
1054
+ },
1055
+
1056
+ /**
1057
+ * Handler for the text input's access key up event. Makes a select()
1058
+ * call to the text input.
1059
+ * @example
1060
+ */
1061
+ accessKeyUp : function()
1062
+ {
1063
+ this.select();
1064
+ },
1065
+
1066
+ /**
1067
+ * Sets the value of this text input object.
1068
+ * @param {Object} value The new value.
1069
+ * @returns {CKEDITOR.ui.dialog.textInput} The current UI element.
1070
+ * @example
1071
+ * uiElement.setValue( 'Blamo' );
1072
+ */
1073
+ setValue : function( value )
1074
+ {
1075
+ !value && ( value = '' );
1076
+ return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments );
1077
+ },
1078
+
1079
+ keyboardFocusable : true
1080
+ }, commonPrototype, true );
1081
+
1082
+ CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput();
1083
+
1084
+ CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
1085
+ /** @lends CKEDITOR.ui.dialog.select.prototype */
1086
+ {
1087
+ /**
1088
+ * Gets the DOM element of the select box.
1089
+ * @returns {CKEDITOR.dom.element} The &lt;select&gt; element of this UI
1090
+ * element.
1091
+ * @example
1092
+ */
1093
+ getInputElement : function()
1094
+ {
1095
+ return this._.select.getElement();
1096
+ },
1097
+
1098
+ /**
1099
+ * Adds an option to the select box.
1100
+ * @param {String} label Option label.
1101
+ * @param {String} value (Optional) Option value, if not defined it'll be
1102
+ * assumed to be the same as the label.
1103
+ * @param {Number} index (Optional) Position of the option to be inserted
1104
+ * to. If not defined the new option will be inserted to the end of list.
1105
+ * @example
1106
+ * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
1107
+ */
1108
+ add : function( label, value, index )
1109
+ {
1110
+ var option = new CKEDITOR.dom.element( 'option', this.getDialog().getParentEditor().document ),
1111
+ selectElement = this.getInputElement().$;
1112
+ option.$.text = label;
1113
+ option.$.value = ( value === undefined || value === null ) ? label : value;
1114
+ if ( index === undefined || index === null )
1115
+ {
1116
+ if ( CKEDITOR.env.ie )
1117
+ selectElement.add( option.$ );
1118
+ else
1119
+ selectElement.add( option.$, null );
1120
+ }
1121
+ else
1122
+ selectElement.add( option.$, index );
1123
+ return this;
1124
+ },
1125
+
1126
+ /**
1127
+ * Removes an option from the selection list.
1128
+ * @param {Number} index Index of the option to be removed.
1129
+ * @example
1130
+ * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
1131
+ */
1132
+ remove : function( index )
1133
+ {
1134
+ var selectElement = this.getInputElement().$;
1135
+ selectElement.remove( index );
1136
+ return this;
1137
+ },
1138
+
1139
+ /**
1140
+ * Clears all options out of the selection list.
1141
+ * @returns {CKEDITOR.ui.dialog.select} The current select UI element.
1142
+ */
1143
+ clear : function()
1144
+ {
1145
+ var selectElement = this.getInputElement().$;
1146
+ while ( selectElement.length > 0 )
1147
+ selectElement.remove( 0 );
1148
+ return this;
1149
+ },
1150
+
1151
+ keyboardFocusable : true
1152
+ }, commonPrototype, true );
1153
+
1154
+ CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
1155
+ /** @lends CKEDITOR.ui.dialog.checkbox.prototype */
1156
+ {
1157
+ /**
1158
+ * Gets the checkbox DOM element.
1159
+ * @example
1160
+ * @returns {CKEDITOR.dom.element} The DOM element of the checkbox.
1161
+ */
1162
+ getInputElement : function()
1163
+ {
1164
+ return this._.checkbox.getElement();
1165
+ },
1166
+
1167
+ /**
1168
+ * Sets the state of the checkbox.
1169
+ * @example
1170
+ * @param {Boolean} true to tick the checkbox, false to untick it.
1171
+ * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
1172
+ */
1173
+ setValue : function( checked, noChangeEvent )
1174
+ {
1175
+ this.getInputElement().$.checked = checked;
1176
+ !noChangeEvent && this.fire( 'change', { value : checked } );
1177
+ },
1178
+
1179
+ /**
1180
+ * Gets the state of the checkbox.
1181
+ * @example
1182
+ * @returns {Boolean} true means the checkbox is ticked, false means it's not ticked.
1183
+ */
1184
+ getValue : function()
1185
+ {
1186
+ return this.getInputElement().$.checked;
1187
+ },
1188
+
1189
+ /**
1190
+ * Handler for the access key up event. Toggles the checkbox.
1191
+ * @example
1192
+ */
1193
+ accessKeyUp : function()
1194
+ {
1195
+ this.setValue( !this.getValue() );
1196
+ },
1197
+
1198
+ /**
1199
+ * Defines the onChange event for UI element definitions.
1200
+ * @field
1201
+ * @type Object
1202
+ * @example
1203
+ */
1204
+ eventProcessors :
1205
+ {
1206
+ onChange : function( dialog, func )
1207
+ {
1208
+ if ( !CKEDITOR.env.ie )
1209
+ return commonEventProcessors.onChange.apply( this, arguments );
1210
+ else
1211
+ {
1212
+ dialog.on( 'load', function()
1213
+ {
1214
+ var element = this._.checkbox.getElement();
1215
+ element.on( 'propertychange', function( evt )
1216
+ {
1217
+ evt = evt.data.$;
1218
+ if ( evt.propertyName == 'checked' )
1219
+ this.fire( 'change', { value : element.$.checked } );
1220
+ }, this );
1221
+ }, this );
1222
+ this.on( 'change', func );
1223
+ }
1224
+ return null;
1225
+ }
1226
+ },
1227
+
1228
+ keyboardFocusable : true
1229
+ }, commonPrototype, true );
1230
+
1231
+ CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
1232
+ /** @lends CKEDITOR.ui.dialog.radio.prototype */
1233
+ {
1234
+ /**
1235
+ * Checks one of the radio buttons in this button group.
1236
+ * @example
1237
+ * @param {String} value The value of the button to be chcked.
1238
+ * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
1239
+ */
1240
+ setValue : function( value, noChangeEvent )
1241
+ {
1242
+ var children = this._.children,
1243
+ item;
1244
+ for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ )
1245
+ item.getElement().$.checked = ( item.getValue() == value );
1246
+ !noChangeEvent && this.fire( 'change', { value : value } );
1247
+ },
1248
+
1249
+ /**
1250
+ * Gets the value of the currently checked radio button.
1251
+ * @example
1252
+ * @returns {String} The currently checked button's value.
1253
+ */
1254
+ getValue : function()
1255
+ {
1256
+ var children = this._.children;
1257
+ for ( var i = 0 ; i < children.length ; i++ )
1258
+ {
1259
+ if ( children[i].getElement().$.checked )
1260
+ return children[i].getValue();
1261
+ }
1262
+ return null;
1263
+ },
1264
+
1265
+ /**
1266
+ * Handler for the access key up event. Focuses the currently
1267
+ * selected radio button, or the first radio button if none is
1268
+ * selected.
1269
+ * @example
1270
+ */
1271
+ accessKeyUp : function()
1272
+ {
1273
+ var children = this._.children, i;
1274
+ for ( i = 0 ; i < children.length ; i++ )
1275
+ {
1276
+ if ( children[i].getElement().$.checked )
1277
+ {
1278
+ children[i].getElement().focus();
1279
+ return;
1280
+ }
1281
+ }
1282
+ children[0].getElement().focus();
1283
+ },
1284
+
1285
+ /**
1286
+ * Defines the onChange event for UI element definitions.
1287
+ * @field
1288
+ * @type Object
1289
+ * @example
1290
+ */
1291
+ eventProcessors :
1292
+ {
1293
+ onChange : function( dialog, func )
1294
+ {
1295
+ if ( !CKEDITOR.env.ie )
1296
+ return commonEventProcessors.onChange.apply( this, arguments );
1297
+ else
1298
+ {
1299
+ dialog.on( 'load', function()
1300
+ {
1301
+ var children = this._.children, me = this;
1302
+ for ( var i = 0 ; i < children.length ; i++ )
1303
+ {
1304
+ var element = children[i].getElement();
1305
+ element.on( 'propertychange', function( evt )
1306
+ {
1307
+ evt = evt.data.$;
1308
+ if ( evt.propertyName == 'checked' && this.$.checked )
1309
+ me.fire( 'change', { value : this.getAttribute( 'value' ) } );
1310
+ } );
1311
+ }
1312
+ }, this );
1313
+ this.on( 'change', func );
1314
+ }
1315
+ return null;
1316
+ }
1317
+ },
1318
+
1319
+ keyboardFocusable : true
1320
+ }, commonPrototype, true );
1321
+
1322
+ CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
1323
+ commonPrototype,
1324
+ /** @lends CKEDITOR.ui.dialog.file.prototype */
1325
+ {
1326
+ /**
1327
+ * Gets the &lt;input&gt; element of this file input.
1328
+ * @returns {CKEDITOR.dom.element} The file input element.
1329
+ * @example
1330
+ */
1331
+ getInputElement : function()
1332
+ {
1333
+ var frameDocument = CKEDITOR.document.getById( this._.frameId ).getFrameDocument();
1334
+ return frameDocument.$.forms.length > 0 ?
1335
+ new CKEDITOR.dom.element( frameDocument.$.forms[0].elements[0] ) :
1336
+ this.getElement();
1337
+ },
1338
+
1339
+ /**
1340
+ * Uploads the file in the file input.
1341
+ * @returns {CKEDITOR.ui.dialog.file} This object.
1342
+ * @example
1343
+ */
1344
+ submit : function()
1345
+ {
1346
+ this.getInputElement().getParent().$.submit();
1347
+ return this;
1348
+ },
1349
+
1350
+ /**
1351
+ * Get the action assigned to the form.
1352
+ * @returns {String} The value of the action.
1353
+ * @example
1354
+ */
1355
+ getAction : function()
1356
+ {
1357
+ return this.getInputElement().getParent().$.action;
1358
+ },
1359
+
1360
+ /**
1361
+ * The events must be applied on the inner input element, and
1362
+ * that must be done when the iframe & form has been loaded
1363
+ */
1364
+ registerEvents : function( definition )
1365
+ {
1366
+ var regex = /^on([A-Z]\w+)/,
1367
+ match;
1368
+
1369
+ var registerDomEvent = function( uiElement, dialog, eventName, func )
1370
+ {
1371
+ uiElement.on( 'formLoaded', function()
1372
+ {
1373
+ uiElement.getInputElement().on( eventName, func, uiElement );
1374
+ });
1375
+ };
1376
+
1377
+ for ( var i in definition )
1378
+ {
1379
+ if ( !( match = i.match( regex ) ) )
1380
+ continue;
1381
+
1382
+ if ( this.eventProcessors[i] )
1383
+ this.eventProcessors[i].call( this, this._.dialog, definition[i] );
1384
+ else
1385
+ registerDomEvent( this, this._.dialog, match[1].toLowerCase(), definition[i] );
1386
+ }
1387
+
1388
+ return this;
1389
+ },
1390
+
1391
+ /**
1392
+ * Redraws the file input and resets the file path in the file input.
1393
+ * The redraw logic is necessary because non-IE browsers tend to clear
1394
+ * the &lt;iframe&gt; containing the file input after closing the dialog.
1395
+ * @example
1396
+ */
1397
+ reset : function()
1398
+ {
1399
+ var _ = this._,
1400
+ frameElement = CKEDITOR.document.getById( _.frameId ),
1401
+ frameDocument = frameElement.getFrameDocument(),
1402
+ elementDefinition = _.definition,
1403
+ buttons = _.buttons,
1404
+ callNumber = this.formLoadedNumber,
1405
+ unloadNumber = this.formUnloadNumber,
1406
+ langDir = _.dialog._.editor.lang.dir,
1407
+ langCode = _.dialog._.editor.langCode;
1408
+
1409
+ // The callback function for the iframe, but we must call tools.addFunction only once
1410
+ // so we store the function number in this.formLoadedNumber
1411
+ if ( !callNumber )
1412
+ {
1413
+ callNumber = this.formLoadedNumber = CKEDITOR.tools.addFunction(
1414
+ function()
1415
+ {
1416
+ // Now we can apply the events to the input type=file
1417
+ this.fire( 'formLoaded' ) ;
1418
+ }, this ) ;
1419
+
1420
+ // Remove listeners attached to the content of the iframe (the file input)
1421
+ unloadNumber = this.formUnloadNumber = CKEDITOR.tools.addFunction(
1422
+ function()
1423
+ {
1424
+ this.getInputElement().clearCustomData();
1425
+ }, this ) ;
1426
+
1427
+ this.getDialog()._.editor.on( 'destroy', function()
1428
+ {
1429
+ CKEDITOR.tools.removeFunction( callNumber );
1430
+ CKEDITOR.tools.removeFunction( unloadNumber );
1431
+ } );
1432
+ }
1433
+
1434
+ function generateFormField()
1435
+ {
1436
+ frameDocument.$.open();
1437
+
1438
+ // Support for custom document.domain in IE.
1439
+ if ( CKEDITOR.env.isCustomDomain() )
1440
+ frameDocument.$.domain = document.domain;
1441
+
1442
+ var size = '';
1443
+ if ( elementDefinition.size )
1444
+ size = elementDefinition.size - ( CKEDITOR.env.ie ? 7 : 0 ); // "Browse" button is bigger in IE.
1445
+
1446
+ frameDocument.$.write( [ '<html dir="' + langDir + '" lang="' + langCode + '"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">',
1447
+ '<form enctype="multipart/form-data" method="POST" dir="' + langDir + '" lang="' + langCode + '" action="',
1448
+ CKEDITOR.tools.htmlEncode( elementDefinition.action ),
1449
+ '">',
1450
+ '<input type="file" name="',
1451
+ CKEDITOR.tools.htmlEncode( elementDefinition.id || 'cke_upload' ),
1452
+ '" size="',
1453
+ CKEDITOR.tools.htmlEncode( size > 0 ? size : "" ),
1454
+ '" />',
1455
+ '</form>',
1456
+ '</body></html>',
1457
+ '<script>window.parent.CKEDITOR.tools.callFunction(' + callNumber + ');',
1458
+ 'window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction(' + unloadNumber + ')}</script>' ].join( '' ) );
1459
+
1460
+ frameDocument.$.close();
1461
+
1462
+ for ( var i = 0 ; i < buttons.length ; i++ )
1463
+ buttons[i].enable();
1464
+ }
1465
+
1466
+ // #3465: Wait for the browser to finish rendering the dialog first.
1467
+ if ( CKEDITOR.env.gecko )
1468
+ setTimeout( generateFormField, 500 );
1469
+ else
1470
+ generateFormField();
1471
+ },
1472
+
1473
+ getValue : function()
1474
+ {
1475
+ return this.getInputElement().$.value || '';
1476
+ },
1477
+
1478
+ /***
1479
+ * The default value of input type="file" is an empty string, but during initialization
1480
+ * of this UI element, the iframe still isn't ready so it can't be read from that object
1481
+ * Setting it manually prevents later issues about the current value ("") being different
1482
+ * of the initial value (undefined as it asked for .value of a div)
1483
+ */
1484
+ setInitValue : function()
1485
+ {
1486
+ this._.initValue = '';
1487
+ },
1488
+
1489
+ /**
1490
+ * Defines the onChange event for UI element definitions.
1491
+ * @field
1492
+ * @type Object
1493
+ * @example
1494
+ */
1495
+ eventProcessors :
1496
+ {
1497
+ onChange : function( dialog, func )
1498
+ {
1499
+ // If this method is called several times (I'm not sure about how this can happen but the default
1500
+ // onChange processor includes this protection)
1501
+ // In order to reapply to the new element, the property is deleted at the beggining of the registerEvents method
1502
+ if ( !this._.domOnChangeRegistered )
1503
+ {
1504
+ // By listening for the formLoaded event, this handler will get reapplied when a new
1505
+ // form is created
1506
+ this.on( 'formLoaded', function()
1507
+ {
1508
+ this.getInputElement().on( 'change', function(){ this.fire( 'change', { value : this.getValue() } ); }, this );
1509
+ }, this );
1510
+ this._.domOnChangeRegistered = true;
1511
+ }
1512
+
1513
+ this.on( 'change', func );
1514
+ }
1515
+ },
1516
+
1517
+ keyboardFocusable : true
1518
+ }, true );
1519
+
1520
+ CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
1521
+
1522
+ CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone( CKEDITOR.ui.dialog.hbox.prototype );
1523
+
1524
+ CKEDITOR.dialog.addUIElement( 'text', textBuilder );
1525
+ CKEDITOR.dialog.addUIElement( 'password', textBuilder );
1526
+ CKEDITOR.dialog.addUIElement( 'textarea', commonBuilder );
1527
+ CKEDITOR.dialog.addUIElement( 'checkbox', commonBuilder );
1528
+ CKEDITOR.dialog.addUIElement( 'radio', commonBuilder );
1529
+ CKEDITOR.dialog.addUIElement( 'button', commonBuilder );
1530
+ CKEDITOR.dialog.addUIElement( 'select', commonBuilder );
1531
+ CKEDITOR.dialog.addUIElement( 'file', commonBuilder );
1532
+ CKEDITOR.dialog.addUIElement( 'fileButton', commonBuilder );
1533
+ CKEDITOR.dialog.addUIElement( 'html', commonBuilder );
1534
+ CKEDITOR.dialog.addUIElement( 'fieldset', containerBuilder );
1535
+ })();
1536
+
1537
+ /**
1538
+ * Fired when the value of the uiElement is changed
1539
+ * @name CKEDITOR.ui.dialog.uiElement#change
1540
+ * @event
1541
+ */
1542
+
1543
+ /**
1544
+ * Fired when the inner frame created by the element is ready.
1545
+ * Each time the button is used or the dialog is loaded a new
1546
+ * form might be created.
1547
+ * @name CKEDITOR.ui.dialog.fileButton#formLoaded
1548
+ * @event
1549
+ */