ckeditor 3.2.4 → 3.3.2

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