ckeditor 3.2.1

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