ckeditor 3.5.0 → 3.5.1

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