ckeditor 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (634) hide show
  1. data/CHANGELOG +15 -0
  2. data/README.textile +225 -0
  3. data/Rakefile +44 -0
  4. data/TODO +3 -0
  5. data/app/controllers/ckeditor_controller.rb +87 -0
  6. data/app/helpers/ckeditor_helper.rb +37 -0
  7. data/app/views/ckeditor/_file.html.erb +15 -0
  8. data/app/views/ckeditor/_image.html.erb +15 -0
  9. data/app/views/ckeditor/_swfupload.html.erb +51 -0
  10. data/app/views/ckeditor/files.html.erb +91 -0
  11. data/app/views/ckeditor/images.html.erb +91 -0
  12. data/app/views/layouts/ckeditor.html.erb +30 -0
  13. data/config/routes.rb +5 -0
  14. data/examples/migrations/attachment_fu/create_assets.rb +30 -0
  15. data/examples/migrations/paperclip/create_assets.rb +25 -0
  16. data/examples/models/attachment_fu/asset.rb +45 -0
  17. data/examples/models/attachment_fu/attachment_file.rb +46 -0
  18. data/examples/models/attachment_fu/picture.rb +46 -0
  19. data/examples/models/paperclip/asset.rb +65 -0
  20. data/examples/models/paperclip/attachment_file.rb +22 -0
  21. data/examples/models/paperclip/picture.rb +39 -0
  22. data/examples/s3/attachment_file.rb +23 -0
  23. data/examples/s3/picture.rb +41 -0
  24. data/lib/ckeditor.rb +57 -0
  25. data/lib/ckeditor/engine.rb +10 -0
  26. data/lib/ckeditor/file_storage.rb +178 -0
  27. data/lib/ckeditor/form_builder.rb +22 -0
  28. data/lib/ckeditor/utils.rb +15 -0
  29. data/lib/ckeditor/version.rb +11 -0
  30. data/lib/ckeditor/view_helper.rb +119 -0
  31. data/lib/generators/ckeditor_generator.rb +23 -0
  32. data/lib/generators/templates/ckeditor.rb +51 -0
  33. data/lib/generators/templates/ckeditor.yml +28 -0
  34. data/lib/generators/templates/ckeditor/CHANGES.html +642 -0
  35. data/lib/generators/templates/ckeditor/INSTALL.html +92 -0
  36. data/lib/generators/templates/ckeditor/LICENSE.html +1334 -0
  37. data/lib/generators/templates/ckeditor/_samples/ajax.html +87 -0
  38. data/lib/generators/templates/ckeditor/_samples/api.html +152 -0
  39. data/lib/generators/templates/ckeditor/_samples/api_dialog.html +181 -0
  40. data/lib/generators/templates/ckeditor/_samples/api_dialog/my_dialog.js +28 -0
  41. data/lib/generators/templates/ckeditor/_samples/assets/output_xhtml.css +204 -0
  42. data/lib/generators/templates/ckeditor/_samples/divreplace.html +137 -0
  43. data/lib/generators/templates/ckeditor/_samples/enterkey.html +88 -0
  44. data/lib/generators/templates/ckeditor/_samples/fullpage.html +62 -0
  45. data/lib/generators/templates/ckeditor/_samples/index.html +54 -0
  46. data/lib/generators/templates/ckeditor/_samples/jqueryadapter.html +73 -0
  47. data/lib/generators/templates/ckeditor/_samples/output_xhtml.html +159 -0
  48. data/lib/generators/templates/ckeditor/_samples/php/advanced.php +93 -0
  49. data/lib/generators/templates/ckeditor/_samples/php/events.php +130 -0
  50. data/lib/generators/templates/ckeditor/_samples/php/replace.php +63 -0
  51. data/lib/generators/templates/ckeditor/_samples/php/replaceall.php +68 -0
  52. data/lib/generators/templates/ckeditor/_samples/php/standalone.php +64 -0
  53. data/lib/generators/templates/ckeditor/_samples/replacebyclass.html +49 -0
  54. data/lib/generators/templates/ckeditor/_samples/replacebycode.html +80 -0
  55. data/lib/generators/templates/ckeditor/_samples/sample.css +81 -0
  56. data/lib/generators/templates/ckeditor/_samples/sample.js +65 -0
  57. data/lib/generators/templates/ckeditor/_samples/sample_posteddata.php +59 -0
  58. data/lib/generators/templates/ckeditor/_samples/sharedspaces.html +131 -0
  59. data/lib/generators/templates/ckeditor/_samples/skins.html +83 -0
  60. data/lib/generators/templates/ckeditor/_samples/ui_color.html +87 -0
  61. data/lib/generators/templates/ckeditor/_samples/ui_languages.html +103 -0
  62. data/lib/generators/templates/ckeditor/_source/adapters/jquery.js +297 -0
  63. data/lib/generators/templates/ckeditor/_source/core/_bootstrap.js +91 -0
  64. data/lib/generators/templates/ckeditor/_source/core/ajax.js +143 -0
  65. data/lib/generators/templates/ckeditor/_source/core/ckeditor.js +103 -0
  66. data/lib/generators/templates/ckeditor/_source/core/ckeditor_base.js +193 -0
  67. data/lib/generators/templates/ckeditor/_source/core/ckeditor_basic.js +242 -0
  68. data/lib/generators/templates/ckeditor/_source/core/command.js +73 -0
  69. data/lib/generators/templates/ckeditor/_source/core/commanddefinition.js +102 -0
  70. data/lib/generators/templates/ckeditor/_source/core/config.js +319 -0
  71. data/lib/generators/templates/ckeditor/_source/core/dataprocessor.js +66 -0
  72. data/lib/generators/templates/ckeditor/_source/core/dom.js +21 -0
  73. data/lib/generators/templates/ckeditor/_source/core/dom/comment.js +32 -0
  74. data/lib/generators/templates/ckeditor/_source/core/dom/document.js +224 -0
  75. data/lib/generators/templates/ckeditor/_source/core/dom/documentfragment.js +49 -0
  76. data/lib/generators/templates/ckeditor/_source/core/dom/domobject.js +246 -0
  77. data/lib/generators/templates/ckeditor/_source/core/dom/element.js +1441 -0
  78. data/lib/generators/templates/ckeditor/_source/core/dom/elementpath.js +104 -0
  79. data/lib/generators/templates/ckeditor/_source/core/dom/event.js +142 -0
  80. data/lib/generators/templates/ckeditor/_source/core/dom/node.js +662 -0
  81. data/lib/generators/templates/ckeditor/_source/core/dom/nodelist.js +23 -0
  82. data/lib/generators/templates/ckeditor/_source/core/dom/range.js +1836 -0
  83. data/lib/generators/templates/ckeditor/_source/core/dom/text.js +123 -0
  84. data/lib/generators/templates/ckeditor/_source/core/dom/walker.js +451 -0
  85. data/lib/generators/templates/ckeditor/_source/core/dom/window.js +96 -0
  86. data/lib/generators/templates/ckeditor/_source/core/dtd.js +233 -0
  87. data/lib/generators/templates/ckeditor/_source/core/editor.js +756 -0
  88. data/lib/generators/templates/ckeditor/_source/core/editor_basic.js +182 -0
  89. data/lib/generators/templates/ckeditor/_source/core/env.js +222 -0
  90. data/lib/generators/templates/ckeditor/_source/core/event.js +336 -0
  91. data/lib/generators/templates/ckeditor/_source/core/eventInfo.js +120 -0
  92. data/lib/generators/templates/ckeditor/_source/core/focusmanager.js +137 -0
  93. data/lib/generators/templates/ckeditor/_source/core/htmlparser.js +212 -0
  94. data/lib/generators/templates/ckeditor/_source/core/htmlparser/basicwriter.js +145 -0
  95. data/lib/generators/templates/ckeditor/_source/core/htmlparser/cdata.js +43 -0
  96. data/lib/generators/templates/ckeditor/_source/core/htmlparser/comment.js +60 -0
  97. data/lib/generators/templates/ckeditor/_source/core/htmlparser/element.js +240 -0
  98. data/lib/generators/templates/ckeditor/_source/core/htmlparser/filter.js +262 -0
  99. data/lib/generators/templates/ckeditor/_source/core/htmlparser/fragment.js +496 -0
  100. data/lib/generators/templates/ckeditor/_source/core/htmlparser/text.js +55 -0
  101. data/lib/generators/templates/ckeditor/_source/core/imagecacher.js +59 -0
  102. data/lib/generators/templates/ckeditor/_source/core/lang.js +152 -0
  103. data/lib/generators/templates/ckeditor/_source/core/loader.js +242 -0
  104. data/lib/generators/templates/ckeditor/_source/core/plugindefinition.js +66 -0
  105. data/lib/generators/templates/ckeditor/_source/core/plugins.js +85 -0
  106. data/lib/generators/templates/ckeditor/_source/core/resourcemanager.js +238 -0
  107. data/lib/generators/templates/ckeditor/_source/core/scriptloader.js +198 -0
  108. data/lib/generators/templates/ckeditor/_source/core/skins.js +204 -0
  109. data/lib/generators/templates/ckeditor/_source/core/themes.js +19 -0
  110. data/lib/generators/templates/ckeditor/_source/core/tools.js +698 -0
  111. data/lib/generators/templates/ckeditor/_source/core/ui.js +116 -0
  112. data/lib/generators/templates/ckeditor/_source/core/xml.js +165 -0
  113. data/lib/generators/templates/ckeditor/_source/lang/_languages.js +83 -0
  114. data/lib/generators/templates/ckeditor/_source/lang/_translationstatus.txt +60 -0
  115. data/lib/generators/templates/ckeditor/_source/lang/af.js +708 -0
  116. data/lib/generators/templates/ckeditor/_source/lang/ar.js +708 -0
  117. data/lib/generators/templates/ckeditor/_source/lang/bg.js +708 -0
  118. data/lib/generators/templates/ckeditor/_source/lang/bn.js +708 -0
  119. data/lib/generators/templates/ckeditor/_source/lang/bs.js +708 -0
  120. data/lib/generators/templates/ckeditor/_source/lang/ca.js +708 -0
  121. data/lib/generators/templates/ckeditor/_source/lang/cs.js +708 -0
  122. data/lib/generators/templates/ckeditor/_source/lang/cy.js +708 -0
  123. data/lib/generators/templates/ckeditor/_source/lang/da.js +708 -0
  124. data/lib/generators/templates/ckeditor/_source/lang/de.js +708 -0
  125. data/lib/generators/templates/ckeditor/_source/lang/el.js +708 -0
  126. data/lib/generators/templates/ckeditor/_source/lang/en-au.js +708 -0
  127. data/lib/generators/templates/ckeditor/_source/lang/en-ca.js +708 -0
  128. data/lib/generators/templates/ckeditor/_source/lang/en-gb.js +708 -0
  129. data/lib/generators/templates/ckeditor/_source/lang/en.js +708 -0
  130. data/lib/generators/templates/ckeditor/_source/lang/eo.js +708 -0
  131. data/lib/generators/templates/ckeditor/_source/lang/es.js +708 -0
  132. data/lib/generators/templates/ckeditor/_source/lang/et.js +708 -0
  133. data/lib/generators/templates/ckeditor/_source/lang/eu.js +708 -0
  134. data/lib/generators/templates/ckeditor/_source/lang/fa.js +708 -0
  135. data/lib/generators/templates/ckeditor/_source/lang/fi.js +708 -0
  136. data/lib/generators/templates/ckeditor/_source/lang/fo.js +708 -0
  137. data/lib/generators/templates/ckeditor/_source/lang/fr-ca.js +708 -0
  138. data/lib/generators/templates/ckeditor/_source/lang/fr.js +708 -0
  139. data/lib/generators/templates/ckeditor/_source/lang/gl.js +708 -0
  140. data/lib/generators/templates/ckeditor/_source/lang/gu.js +708 -0
  141. data/lib/generators/templates/ckeditor/_source/lang/he.js +708 -0
  142. data/lib/generators/templates/ckeditor/_source/lang/hi.js +708 -0
  143. data/lib/generators/templates/ckeditor/_source/lang/hr.js +708 -0
  144. data/lib/generators/templates/ckeditor/_source/lang/hu.js +708 -0
  145. data/lib/generators/templates/ckeditor/_source/lang/is.js +708 -0
  146. data/lib/generators/templates/ckeditor/_source/lang/it.js +708 -0
  147. data/lib/generators/templates/ckeditor/_source/lang/ja.js +708 -0
  148. data/lib/generators/templates/ckeditor/_source/lang/km.js +708 -0
  149. data/lib/generators/templates/ckeditor/_source/lang/ko.js +708 -0
  150. data/lib/generators/templates/ckeditor/_source/lang/lt.js +708 -0
  151. data/lib/generators/templates/ckeditor/_source/lang/lv.js +708 -0
  152. data/lib/generators/templates/ckeditor/_source/lang/mn.js +708 -0
  153. data/lib/generators/templates/ckeditor/_source/lang/ms.js +708 -0
  154. data/lib/generators/templates/ckeditor/_source/lang/nb.js +708 -0
  155. data/lib/generators/templates/ckeditor/_source/lang/nl.js +708 -0
  156. data/lib/generators/templates/ckeditor/_source/lang/no.js +708 -0
  157. data/lib/generators/templates/ckeditor/_source/lang/pl.js +708 -0
  158. data/lib/generators/templates/ckeditor/_source/lang/pt-br.js +708 -0
  159. data/lib/generators/templates/ckeditor/_source/lang/pt.js +708 -0
  160. data/lib/generators/templates/ckeditor/_source/lang/ro.js +708 -0
  161. data/lib/generators/templates/ckeditor/_source/lang/ru.js +708 -0
  162. data/lib/generators/templates/ckeditor/_source/lang/sk.js +708 -0
  163. data/lib/generators/templates/ckeditor/_source/lang/sl.js +708 -0
  164. data/lib/generators/templates/ckeditor/_source/lang/sr-latn.js +708 -0
  165. data/lib/generators/templates/ckeditor/_source/lang/sr.js +708 -0
  166. data/lib/generators/templates/ckeditor/_source/lang/sv.js +708 -0
  167. data/lib/generators/templates/ckeditor/_source/lang/th.js +708 -0
  168. data/lib/generators/templates/ckeditor/_source/lang/tr.js +708 -0
  169. data/lib/generators/templates/ckeditor/_source/lang/uk.js +708 -0
  170. data/lib/generators/templates/ckeditor/_source/lang/vi.js +708 -0
  171. data/lib/generators/templates/ckeditor/_source/lang/zh-cn.js +708 -0
  172. data/lib/generators/templates/ckeditor/_source/lang/zh.js +708 -0
  173. data/lib/generators/templates/ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js +211 -0
  174. data/lib/generators/templates/ckeditor/_source/plugins/a11yhelp/lang/en.js +108 -0
  175. data/lib/generators/templates/ckeditor/_source/plugins/a11yhelp/plugin.js +46 -0
  176. data/lib/generators/templates/ckeditor/_source/plugins/about/dialogs/about.js +73 -0
  177. data/lib/generators/templates/ckeditor/_source/plugins/about/dialogs/logo_ckeditor.png +0 -0
  178. data/lib/generators/templates/ckeditor/_source/plugins/about/plugin.js +23 -0
  179. data/lib/generators/templates/ckeditor/_source/plugins/attachment/dialogs/attachment.js +384 -0
  180. data/lib/generators/templates/ckeditor/_source/plugins/attachment/images/attachment.png +0 -0
  181. data/lib/generators/templates/ckeditor/_source/plugins/attachment/lang/en.js +10 -0
  182. data/lib/generators/templates/ckeditor/_source/plugins/attachment/lang/ru.js +10 -0
  183. data/lib/generators/templates/ckeditor/_source/plugins/attachment/lang/uk.js +10 -0
  184. data/lib/generators/templates/ckeditor/_source/plugins/attachment/plugin.js +44 -0
  185. data/lib/generators/templates/ckeditor/_source/plugins/basicstyles/plugin.js +101 -0
  186. data/lib/generators/templates/ckeditor/_source/plugins/blockquote/plugin.js +301 -0
  187. data/lib/generators/templates/ckeditor/_source/plugins/button/plugin.js +272 -0
  188. data/lib/generators/templates/ckeditor/_source/plugins/clipboard/dialogs/paste.js +186 -0
  189. data/lib/generators/templates/ckeditor/_source/plugins/clipboard/plugin.js +379 -0
  190. data/lib/generators/templates/ckeditor/_source/plugins/colorbutton/plugin.js +247 -0
  191. data/lib/generators/templates/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js +191 -0
  192. data/lib/generators/templates/ckeditor/_source/plugins/colordialog/plugin.js +13 -0
  193. data/lib/generators/templates/ckeditor/_source/plugins/contextmenu/plugin.js +274 -0
  194. data/lib/generators/templates/ckeditor/_source/plugins/dialog/dialogDefinition.js +315 -0
  195. data/lib/generators/templates/ckeditor/_source/plugins/dialog/plugin.js +2913 -0
  196. data/lib/generators/templates/ckeditor/_source/plugins/dialogui/plugin.js +1408 -0
  197. data/lib/generators/templates/ckeditor/_source/plugins/div/dialogs/div.js +529 -0
  198. data/lib/generators/templates/ckeditor/_source/plugins/div/plugin.js +121 -0
  199. data/lib/generators/templates/ckeditor/_source/plugins/domiterator/plugin.js +355 -0
  200. data/lib/generators/templates/ckeditor/_source/plugins/editingblock/plugin.js +224 -0
  201. data/lib/generators/templates/ckeditor/_source/plugins/elementspath/plugin.js +203 -0
  202. data/lib/generators/templates/ckeditor/_source/plugins/embed/dialogs/embed.js +65 -0
  203. data/lib/generators/templates/ckeditor/_source/plugins/embed/images/embed.png +0 -0
  204. data/lib/generators/templates/ckeditor/_source/plugins/embed/lang/en.js +9 -0
  205. data/lib/generators/templates/ckeditor/_source/plugins/embed/lang/ru.js +9 -0
  206. data/lib/generators/templates/ckeditor/_source/plugins/embed/lang/uk.js +9 -0
  207. data/lib/generators/templates/ckeditor/_source/plugins/embed/plugin.js +43 -0
  208. data/lib/generators/templates/ckeditor/_source/plugins/enterkey/plugin.js +339 -0
  209. data/lib/generators/templates/ckeditor/_source/plugins/entities/plugin.js +200 -0
  210. data/lib/generators/templates/ckeditor/_source/plugins/fakeobjects/plugin.js +120 -0
  211. data/lib/generators/templates/ckeditor/_source/plugins/filebrowser/plugin.js +479 -0
  212. data/lib/generators/templates/ckeditor/_source/plugins/find/dialogs/find.js +867 -0
  213. data/lib/generators/templates/ckeditor/_source/plugins/find/plugin.js +46 -0
  214. data/lib/generators/templates/ckeditor/_source/plugins/flash/dialogs/flash.js +698 -0
  215. data/lib/generators/templates/ckeditor/_source/plugins/flash/images/placeholder.png +0 -0
  216. data/lib/generators/templates/ckeditor/_source/plugins/flash/plugin.js +165 -0
  217. data/lib/generators/templates/ckeditor/_source/plugins/floatpanel/plugin.js +376 -0
  218. data/lib/generators/templates/ckeditor/_source/plugins/font/plugin.js +234 -0
  219. data/lib/generators/templates/ckeditor/_source/plugins/format/plugin.js +193 -0
  220. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/button.js +135 -0
  221. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/checkbox.js +155 -0
  222. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/form.js +177 -0
  223. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/hiddenfield.js +91 -0
  224. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/radio.js +135 -0
  225. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/select.js +556 -0
  226. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/textarea.js +114 -0
  227. data/lib/generators/templates/ckeditor/_source/plugins/forms/dialogs/textfield.js +193 -0
  228. data/lib/generators/templates/ckeditor/_source/plugins/forms/plugin.js +217 -0
  229. data/lib/generators/templates/ckeditor/_source/plugins/horizontalrule/plugin.js +36 -0
  230. data/lib/generators/templates/ckeditor/_source/plugins/htmldataprocessor/plugin.js +463 -0
  231. data/lib/generators/templates/ckeditor/_source/plugins/htmlwriter/plugin.js +314 -0
  232. data/lib/generators/templates/ckeditor/_source/plugins/iframedialog/plugin.js +136 -0
  233. data/lib/generators/templates/ckeditor/_source/plugins/image/dialogs/image.js +1380 -0
  234. data/lib/generators/templates/ckeditor/_source/plugins/image/plugin.js +73 -0
  235. data/lib/generators/templates/ckeditor/_source/plugins/indent/plugin.js +381 -0
  236. data/lib/generators/templates/ckeditor/_source/plugins/justify/plugin.js +168 -0
  237. data/lib/generators/templates/ckeditor/_source/plugins/keystrokes/plugin.js +229 -0
  238. data/lib/generators/templates/ckeditor/_source/plugins/link/dialogs/anchor.js +99 -0
  239. data/lib/generators/templates/ckeditor/_source/plugins/link/dialogs/link.js +1413 -0
  240. data/lib/generators/templates/ckeditor/_source/plugins/link/images/anchor.gif +0 -0
  241. data/lib/generators/templates/ckeditor/_source/plugins/link/plugin.js +219 -0
  242. data/lib/generators/templates/ckeditor/_source/plugins/list/plugin.js +645 -0
  243. data/lib/generators/templates/ckeditor/_source/plugins/listblock/plugin.js +257 -0
  244. data/lib/generators/templates/ckeditor/_source/plugins/maximize/plugin.js +305 -0
  245. data/lib/generators/templates/ckeditor/_source/plugins/menu/plugin.js +406 -0
  246. data/lib/generators/templates/ckeditor/_source/plugins/menubutton/plugin.js +94 -0
  247. data/lib/generators/templates/ckeditor/_source/plugins/newpage/plugin.js +54 -0
  248. data/lib/generators/templates/ckeditor/_source/plugins/pagebreak/images/pagebreak.gif +0 -0
  249. data/lib/generators/templates/ckeditor/_source/plugins/pagebreak/plugin.js +103 -0
  250. data/lib/generators/templates/ckeditor/_source/plugins/panel/plugin.js +397 -0
  251. data/lib/generators/templates/ckeditor/_source/plugins/panelbutton/plugin.js +147 -0
  252. data/lib/generators/templates/ckeditor/_source/plugins/pastefromword/filter/default.js +1179 -0
  253. data/lib/generators/templates/ckeditor/_source/plugins/pastefromword/plugin.js +120 -0
  254. data/lib/generators/templates/ckeditor/_source/plugins/pastetext/dialogs/pastetext.js +77 -0
  255. data/lib/generators/templates/ckeditor/_source/plugins/pastetext/plugin.js +162 -0
  256. data/lib/generators/templates/ckeditor/_source/plugins/popup/plugin.js +62 -0
  257. data/lib/generators/templates/ckeditor/_source/plugins/preview/plugin.js +108 -0
  258. data/lib/generators/templates/ckeditor/_source/plugins/print/plugin.js +41 -0
  259. data/lib/generators/templates/ckeditor/_source/plugins/removeformat/plugin.js +132 -0
  260. data/lib/generators/templates/ckeditor/_source/plugins/resize/plugin.js +117 -0
  261. data/lib/generators/templates/ckeditor/_source/plugins/richcombo/plugin.js +370 -0
  262. data/lib/generators/templates/ckeditor/_source/plugins/save/plugin.js +55 -0
  263. data/lib/generators/templates/ckeditor/_source/plugins/scayt/dialogs/options.js +533 -0
  264. data/lib/generators/templates/ckeditor/_source/plugins/scayt/dialogs/toolbar.css +71 -0
  265. data/lib/generators/templates/ckeditor/_source/plugins/scayt/plugin.js +767 -0
  266. data/lib/generators/templates/ckeditor/_source/plugins/selection/plugin.js +1145 -0
  267. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_address.png +0 -0
  268. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_blockquote.png +0 -0
  269. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_div.png +0 -0
  270. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h1.png +0 -0
  271. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h2.png +0 -0
  272. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h3.png +0 -0
  273. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h4.png +0 -0
  274. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h5.png +0 -0
  275. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_h6.png +0 -0
  276. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_p.png +0 -0
  277. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/images/block_pre.png +0 -0
  278. data/lib/generators/templates/ckeditor/_source/plugins/showblocks/plugin.js +154 -0
  279. data/lib/generators/templates/ckeditor/_source/plugins/showborders/plugin.js +167 -0
  280. data/lib/generators/templates/ckeditor/_source/plugins/smiley/dialogs/smiley.js +216 -0
  281. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/angel_smile.gif +0 -0
  282. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/angry_smile.gif +0 -0
  283. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/broken_heart.gif +0 -0
  284. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/confused_smile.gif +0 -0
  285. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/cry_smile.gif +0 -0
  286. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/devil_smile.gif +0 -0
  287. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/embaressed_smile.gif +0 -0
  288. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/envelope.gif +0 -0
  289. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/heart.gif +0 -0
  290. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/kiss.gif +0 -0
  291. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/lightbulb.gif +0 -0
  292. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/omg_smile.gif +0 -0
  293. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/regular_smile.gif +0 -0
  294. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/sad_smile.gif +0 -0
  295. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/shades_smile.gif +0 -0
  296. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/teeth_smile.gif +0 -0
  297. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/thumbs_down.gif +0 -0
  298. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/thumbs_up.gif +0 -0
  299. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/tounge_smile.gif +0 -0
  300. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  301. data/lib/generators/templates/ckeditor/_source/plugins/smiley/images/wink_smile.gif +0 -0
  302. data/lib/generators/templates/ckeditor/_source/plugins/smiley/plugin.js +84 -0
  303. data/lib/generators/templates/ckeditor/_source/plugins/sourcearea/plugin.js +206 -0
  304. data/lib/generators/templates/ckeditor/_source/plugins/specialchar/dialogs/specialchar.js +403 -0
  305. data/lib/generators/templates/ckeditor/_source/plugins/specialchar/plugin.js +29 -0
  306. data/lib/generators/templates/ckeditor/_source/plugins/styles/plugin.js +1442 -0
  307. data/lib/generators/templates/ckeditor/_source/plugins/styles/styles/default.js +88 -0
  308. data/lib/generators/templates/ckeditor/_source/plugins/stylescombo/plugin.js +204 -0
  309. data/lib/generators/templates/ckeditor/_source/plugins/tab/plugin.js +261 -0
  310. data/lib/generators/templates/ckeditor/_source/plugins/table/dialogs/table.js +591 -0
  311. data/lib/generators/templates/ckeditor/_source/plugins/table/plugin.js +70 -0
  312. data/lib/generators/templates/ckeditor/_source/plugins/tabletools/dialogs/tableCell.js +528 -0
  313. data/lib/generators/templates/ckeditor/_source/plugins/tabletools/plugin.js +1068 -0
  314. data/lib/generators/templates/ckeditor/_source/plugins/templates/dialogs/templates.js +230 -0
  315. data/lib/generators/templates/ckeditor/_source/plugins/templates/plugin.js +100 -0
  316. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/default.js +94 -0
  317. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/images/template1.gif +0 -0
  318. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/images/template2.gif +0 -0
  319. data/lib/generators/templates/ckeditor/_source/plugins/templates/templates/images/template3.gif +0 -0
  320. data/lib/generators/templates/ckeditor/_source/plugins/toolbar/plugin.js +479 -0
  321. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/dialogs/uicolor.js +204 -0
  322. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/lang/en.js +15 -0
  323. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/plugin.js +37 -0
  324. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/uicolor.gif +0 -0
  325. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  326. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  327. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  328. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  329. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/assets/yui.css +15 -0
  330. data/lib/generators/templates/ckeditor/_source/plugins/uicolor/yui/yui.js +71 -0
  331. data/lib/generators/templates/ckeditor/_source/plugins/undo/plugin.js +519 -0
  332. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/ciframe.html +49 -0
  333. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  334. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/wsc.css +83 -0
  335. data/lib/generators/templates/ckeditor/_source/plugins/wsc/dialogs/wsc.js +176 -0
  336. data/lib/generators/templates/ckeditor/_source/plugins/wsc/plugin.js +33 -0
  337. data/lib/generators/templates/ckeditor/_source/plugins/wysiwygarea/plugin.js +882 -0
  338. data/lib/generators/templates/ckeditor/_source/skins/kama/dialog.css +835 -0
  339. data/lib/generators/templates/ckeditor/_source/skins/kama/editor.css +25 -0
  340. data/lib/generators/templates/ckeditor/_source/skins/kama/elementspath.css +72 -0
  341. data/lib/generators/templates/ckeditor/_source/skins/kama/icons.css +326 -0
  342. data/lib/generators/templates/ckeditor/_source/skins/kama/icons.png +0 -0
  343. data/lib/generators/templates/ckeditor/_source/skins/kama/images/dialog_sides.gif +0 -0
  344. data/lib/generators/templates/ckeditor/_source/skins/kama/images/dialog_sides.png +0 -0
  345. data/lib/generators/templates/ckeditor/_source/skins/kama/images/dialog_sides_rtl.png +0 -0
  346. data/lib/generators/templates/ckeditor/_source/skins/kama/images/mini.gif +0 -0
  347. data/lib/generators/templates/ckeditor/_source/skins/kama/images/noimage.png +0 -0
  348. data/lib/generators/templates/ckeditor/_source/skins/kama/images/sprites.png +0 -0
  349. data/lib/generators/templates/ckeditor/_source/skins/kama/images/sprites_ie6.png +0 -0
  350. data/lib/generators/templates/ckeditor/_source/skins/kama/images/toolbar_start.gif +0 -0
  351. data/lib/generators/templates/ckeditor/_source/skins/kama/mainui.css +183 -0
  352. data/lib/generators/templates/ckeditor/_source/skins/kama/menu.css +197 -0
  353. data/lib/generators/templates/ckeditor/_source/skins/kama/panel.css +216 -0
  354. data/lib/generators/templates/ckeditor/_source/skins/kama/presets.css +49 -0
  355. data/lib/generators/templates/ckeditor/_source/skins/kama/reset.css +78 -0
  356. data/lib/generators/templates/ckeditor/_source/skins/kama/richcombo.css +270 -0
  357. data/lib/generators/templates/ckeditor/_source/skins/kama/skin.js +268 -0
  358. data/lib/generators/templates/ckeditor/_source/skins/kama/templates.css +84 -0
  359. data/lib/generators/templates/ckeditor/_source/skins/kama/toolbar.css +409 -0
  360. data/lib/generators/templates/ckeditor/_source/skins/office2003/dialog.css +738 -0
  361. data/lib/generators/templates/ckeditor/_source/skins/office2003/editor.css +25 -0
  362. data/lib/generators/templates/ckeditor/_source/skins/office2003/elementspath.css +73 -0
  363. data/lib/generators/templates/ckeditor/_source/skins/office2003/icons.css +324 -0
  364. data/lib/generators/templates/ckeditor/_source/skins/office2003/icons.png +0 -0
  365. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/dialog_sides.gif +0 -0
  366. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/dialog_sides.png +0 -0
  367. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/dialog_sides_rtl.png +0 -0
  368. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/mini.gif +0 -0
  369. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/noimage.png +0 -0
  370. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/sprites.png +0 -0
  371. data/lib/generators/templates/ckeditor/_source/skins/office2003/images/sprites_ie6.png +0 -0
  372. data/lib/generators/templates/ckeditor/_source/skins/office2003/mainui.css +133 -0
  373. data/lib/generators/templates/ckeditor/_source/skins/office2003/menu.css +194 -0
  374. data/lib/generators/templates/ckeditor/_source/skins/office2003/panel.css +211 -0
  375. data/lib/generators/templates/ckeditor/_source/skins/office2003/presets.css +49 -0
  376. data/lib/generators/templates/ckeditor/_source/skins/office2003/reset.css +78 -0
  377. data/lib/generators/templates/ckeditor/_source/skins/office2003/richcombo.css +289 -0
  378. data/lib/generators/templates/ckeditor/_source/skins/office2003/skin.js +81 -0
  379. data/lib/generators/templates/ckeditor/_source/skins/office2003/templates.css +81 -0
  380. data/lib/generators/templates/ckeditor/_source/skins/office2003/toolbar.css +463 -0
  381. data/lib/generators/templates/ckeditor/_source/skins/v2/dialog.css +753 -0
  382. data/lib/generators/templates/ckeditor/_source/skins/v2/editor.css +25 -0
  383. data/lib/generators/templates/ckeditor/_source/skins/v2/elementspath.css +73 -0
  384. data/lib/generators/templates/ckeditor/_source/skins/v2/icons.css +324 -0
  385. data/lib/generators/templates/ckeditor/_source/skins/v2/icons.png +0 -0
  386. data/lib/generators/templates/ckeditor/_source/skins/v2/images/dialog_sides.gif +0 -0
  387. data/lib/generators/templates/ckeditor/_source/skins/v2/images/dialog_sides.png +0 -0
  388. data/lib/generators/templates/ckeditor/_source/skins/v2/images/dialog_sides_rtl.png +0 -0
  389. data/lib/generators/templates/ckeditor/_source/skins/v2/images/mini.gif +0 -0
  390. data/lib/generators/templates/ckeditor/_source/skins/v2/images/noimage.png +0 -0
  391. data/lib/generators/templates/ckeditor/_source/skins/v2/images/sprites.png +0 -0
  392. data/lib/generators/templates/ckeditor/_source/skins/v2/images/sprites_ie6.png +0 -0
  393. data/lib/generators/templates/ckeditor/_source/skins/v2/images/toolbar_start.gif +0 -0
  394. data/lib/generators/templates/ckeditor/_source/skins/v2/mainui.css +142 -0
  395. data/lib/generators/templates/ckeditor/_source/skins/v2/menu.css +196 -0
  396. data/lib/generators/templates/ckeditor/_source/skins/v2/panel.css +211 -0
  397. data/lib/generators/templates/ckeditor/_source/skins/v2/presets.css +50 -0
  398. data/lib/generators/templates/ckeditor/_source/skins/v2/reset.css +78 -0
  399. data/lib/generators/templates/ckeditor/_source/skins/v2/richcombo.css +289 -0
  400. data/lib/generators/templates/ckeditor/_source/skins/v2/skin.js +77 -0
  401. data/lib/generators/templates/ckeditor/_source/skins/v2/templates.css +81 -0
  402. data/lib/generators/templates/ckeditor/_source/skins/v2/toolbar.css +415 -0
  403. data/lib/generators/templates/ckeditor/_source/themes/default/theme.js +335 -0
  404. data/lib/generators/templates/ckeditor/adapters/jquery.js +6 -0
  405. data/lib/generators/templates/ckeditor/ckeditor.js +124 -0
  406. data/lib/generators/templates/ckeditor/ckeditor.pack +205 -0
  407. data/lib/generators/templates/ckeditor/ckeditor_basic.js +8 -0
  408. data/lib/generators/templates/ckeditor/ckeditor_basic_source.js +20 -0
  409. data/lib/generators/templates/ckeditor/ckeditor_source.js +25 -0
  410. data/lib/generators/templates/ckeditor/config.js +42 -0
  411. data/lib/generators/templates/ckeditor/contents.css +35 -0
  412. data/lib/generators/templates/ckeditor/css/ckfinder.css +299 -0
  413. data/lib/generators/templates/ckeditor/css/fck_dialog.css +119 -0
  414. data/lib/generators/templates/ckeditor/css/fck_editor.css +448 -0
  415. data/lib/generators/templates/ckeditor/css/swfupload.css +94 -0
  416. data/lib/generators/templates/ckeditor/images/add.gif +0 -0
  417. data/lib/generators/templates/ckeditor/images/cancelbutton.gif +0 -0
  418. data/lib/generators/templates/ckeditor/images/ckfnothumb.gif +0 -0
  419. data/lib/generators/templates/ckeditor/images/doc.gif +0 -0
  420. data/lib/generators/templates/ckeditor/images/mp3.gif +0 -0
  421. data/lib/generators/templates/ckeditor/images/pdf.gif +0 -0
  422. data/lib/generators/templates/ckeditor/images/rar.gif +0 -0
  423. data/lib/generators/templates/ckeditor/images/refresh.gif +0 -0
  424. data/lib/generators/templates/ckeditor/images/select_files.png +0 -0
  425. data/lib/generators/templates/ckeditor/images/spacer.gif +0 -0
  426. data/lib/generators/templates/ckeditor/images/swf.gif +0 -0
  427. data/lib/generators/templates/ckeditor/images/toolbar.start.gif +0 -0
  428. data/lib/generators/templates/ckeditor/images/xls.gif +0 -0
  429. data/lib/generators/templates/ckeditor/lang/_languages.js +6 -0
  430. data/lib/generators/templates/ckeditor/lang/_translationstatus.txt +60 -0
  431. data/lib/generators/templates/ckeditor/lang/af.js +6 -0
  432. data/lib/generators/templates/ckeditor/lang/ar.js +6 -0
  433. data/lib/generators/templates/ckeditor/lang/bg.js +6 -0
  434. data/lib/generators/templates/ckeditor/lang/bn.js +6 -0
  435. data/lib/generators/templates/ckeditor/lang/bs.js +6 -0
  436. data/lib/generators/templates/ckeditor/lang/ca.js +6 -0
  437. data/lib/generators/templates/ckeditor/lang/cs.js +6 -0
  438. data/lib/generators/templates/ckeditor/lang/cy.js +6 -0
  439. data/lib/generators/templates/ckeditor/lang/da.js +6 -0
  440. data/lib/generators/templates/ckeditor/lang/de.js +6 -0
  441. data/lib/generators/templates/ckeditor/lang/el.js +6 -0
  442. data/lib/generators/templates/ckeditor/lang/en-au.js +6 -0
  443. data/lib/generators/templates/ckeditor/lang/en-ca.js +6 -0
  444. data/lib/generators/templates/ckeditor/lang/en-gb.js +6 -0
  445. data/lib/generators/templates/ckeditor/lang/en.js +6 -0
  446. data/lib/generators/templates/ckeditor/lang/eo.js +6 -0
  447. data/lib/generators/templates/ckeditor/lang/es.js +6 -0
  448. data/lib/generators/templates/ckeditor/lang/et.js +6 -0
  449. data/lib/generators/templates/ckeditor/lang/eu.js +6 -0
  450. data/lib/generators/templates/ckeditor/lang/fa.js +6 -0
  451. data/lib/generators/templates/ckeditor/lang/fi.js +6 -0
  452. data/lib/generators/templates/ckeditor/lang/fo.js +6 -0
  453. data/lib/generators/templates/ckeditor/lang/fr-ca.js +6 -0
  454. data/lib/generators/templates/ckeditor/lang/fr.js +6 -0
  455. data/lib/generators/templates/ckeditor/lang/gl.js +6 -0
  456. data/lib/generators/templates/ckeditor/lang/gu.js +6 -0
  457. data/lib/generators/templates/ckeditor/lang/he.js +6 -0
  458. data/lib/generators/templates/ckeditor/lang/hi.js +6 -0
  459. data/lib/generators/templates/ckeditor/lang/hr.js +6 -0
  460. data/lib/generators/templates/ckeditor/lang/hu.js +6 -0
  461. data/lib/generators/templates/ckeditor/lang/is.js +6 -0
  462. data/lib/generators/templates/ckeditor/lang/it.js +6 -0
  463. data/lib/generators/templates/ckeditor/lang/ja.js +6 -0
  464. data/lib/generators/templates/ckeditor/lang/km.js +6 -0
  465. data/lib/generators/templates/ckeditor/lang/ko.js +6 -0
  466. data/lib/generators/templates/ckeditor/lang/lt.js +6 -0
  467. data/lib/generators/templates/ckeditor/lang/lv.js +6 -0
  468. data/lib/generators/templates/ckeditor/lang/mn.js +6 -0
  469. data/lib/generators/templates/ckeditor/lang/ms.js +6 -0
  470. data/lib/generators/templates/ckeditor/lang/nb.js +6 -0
  471. data/lib/generators/templates/ckeditor/lang/nl.js +6 -0
  472. data/lib/generators/templates/ckeditor/lang/no.js +6 -0
  473. data/lib/generators/templates/ckeditor/lang/pl.js +6 -0
  474. data/lib/generators/templates/ckeditor/lang/pt-br.js +6 -0
  475. data/lib/generators/templates/ckeditor/lang/pt.js +6 -0
  476. data/lib/generators/templates/ckeditor/lang/ro.js +6 -0
  477. data/lib/generators/templates/ckeditor/lang/ru.js +6 -0
  478. data/lib/generators/templates/ckeditor/lang/sk.js +6 -0
  479. data/lib/generators/templates/ckeditor/lang/sl.js +6 -0
  480. data/lib/generators/templates/ckeditor/lang/sr-latn.js +6 -0
  481. data/lib/generators/templates/ckeditor/lang/sr.js +6 -0
  482. data/lib/generators/templates/ckeditor/lang/sv.js +6 -0
  483. data/lib/generators/templates/ckeditor/lang/th.js +6 -0
  484. data/lib/generators/templates/ckeditor/lang/tr.js +6 -0
  485. data/lib/generators/templates/ckeditor/lang/uk.js +6 -0
  486. data/lib/generators/templates/ckeditor/lang/vi.js +6 -0
  487. data/lib/generators/templates/ckeditor/lang/zh-cn.js +6 -0
  488. data/lib/generators/templates/ckeditor/lang/zh.js +6 -0
  489. data/lib/generators/templates/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -0
  490. data/lib/generators/templates/ckeditor/plugins/a11yhelp/lang/en.js +6 -0
  491. data/lib/generators/templates/ckeditor/plugins/about/dialogs/about.js +6 -0
  492. data/lib/generators/templates/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  493. data/lib/generators/templates/ckeditor/plugins/attachment/dialogs/attachment.js +1 -0
  494. data/lib/generators/templates/ckeditor/plugins/attachment/images/attachment.png +0 -0
  495. data/lib/generators/templates/ckeditor/plugins/attachment/lang/en.js +1 -0
  496. data/lib/generators/templates/ckeditor/plugins/attachment/lang/ru.js +1 -0
  497. data/lib/generators/templates/ckeditor/plugins/attachment/lang/uk.js +1 -0
  498. data/lib/generators/templates/ckeditor/plugins/attachment/plugin.js +1 -0
  499. data/lib/generators/templates/ckeditor/plugins/clipboard/dialogs/paste.js +7 -0
  500. data/lib/generators/templates/ckeditor/plugins/colordialog/dialogs/colordialog.js +6 -0
  501. data/lib/generators/templates/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
  502. data/lib/generators/templates/ckeditor/plugins/div/dialogs/div.js +7 -0
  503. data/lib/generators/templates/ckeditor/plugins/embed/dialogs/embed.js +1 -0
  504. data/lib/generators/templates/ckeditor/plugins/embed/images/embed.png +0 -0
  505. data/lib/generators/templates/ckeditor/plugins/embed/lang/en.js +1 -0
  506. data/lib/generators/templates/ckeditor/plugins/embed/lang/ru.js +1 -0
  507. data/lib/generators/templates/ckeditor/plugins/embed/lang/uk.js +1 -0
  508. data/lib/generators/templates/ckeditor/plugins/embed/plugin.js +1 -0
  509. data/lib/generators/templates/ckeditor/plugins/find/dialogs/find.js +9 -0
  510. data/lib/generators/templates/ckeditor/plugins/flash/dialogs/flash.js +9 -0
  511. data/lib/generators/templates/ckeditor/plugins/flash/images/placeholder.png +0 -0
  512. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/button.js +6 -0
  513. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/checkbox.js +6 -0
  514. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/form.js +6 -0
  515. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/hiddenfield.js +6 -0
  516. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/radio.js +6 -0
  517. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/select.js +9 -0
  518. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/textarea.js +6 -0
  519. data/lib/generators/templates/ckeditor/plugins/forms/dialogs/textfield.js +6 -0
  520. data/lib/generators/templates/ckeditor/plugins/iframedialog/plugin.js +6 -0
  521. data/lib/generators/templates/ckeditor/plugins/image/dialogs/image.js +13 -0
  522. data/lib/generators/templates/ckeditor/plugins/link/dialogs/anchor.js +6 -0
  523. data/lib/generators/templates/ckeditor/plugins/link/dialogs/link.js +11 -0
  524. data/lib/generators/templates/ckeditor/plugins/link/images/anchor.gif +0 -0
  525. data/lib/generators/templates/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
  526. data/lib/generators/templates/ckeditor/plugins/pastefromword/filter/default.js +10 -0
  527. data/lib/generators/templates/ckeditor/plugins/pastetext/dialogs/pastetext.js +6 -0
  528. data/lib/generators/templates/ckeditor/plugins/scayt/dialogs/options.js +8 -0
  529. data/lib/generators/templates/ckeditor/plugins/scayt/dialogs/toolbar.css +6 -0
  530. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  531. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  532. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  533. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  534. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  535. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  536. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  537. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  538. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  539. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  540. data/lib/generators/templates/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  541. data/lib/generators/templates/ckeditor/plugins/smiley/dialogs/smiley.js +7 -0
  542. data/lib/generators/templates/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  543. data/lib/generators/templates/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  544. data/lib/generators/templates/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  545. data/lib/generators/templates/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  546. data/lib/generators/templates/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  547. data/lib/generators/templates/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  548. data/lib/generators/templates/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  549. data/lib/generators/templates/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  550. data/lib/generators/templates/ckeditor/plugins/smiley/images/heart.gif +0 -0
  551. data/lib/generators/templates/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  552. data/lib/generators/templates/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  553. data/lib/generators/templates/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  554. data/lib/generators/templates/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  555. data/lib/generators/templates/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  556. data/lib/generators/templates/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  557. data/lib/generators/templates/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  558. data/lib/generators/templates/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  559. data/lib/generators/templates/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  560. data/lib/generators/templates/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  561. data/lib/generators/templates/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  562. data/lib/generators/templates/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  563. data/lib/generators/templates/ckeditor/plugins/specialchar/dialogs/specialchar.js +7 -0
  564. data/lib/generators/templates/ckeditor/plugins/styles/styles/default.js +6 -0
  565. data/lib/generators/templates/ckeditor/plugins/table/dialogs/table.js +9 -0
  566. data/lib/generators/templates/ckeditor/plugins/tabletools/dialogs/tableCell.js +8 -0
  567. data/lib/generators/templates/ckeditor/plugins/templates/dialogs/templates.js +7 -0
  568. data/lib/generators/templates/ckeditor/plugins/templates/templates/default.js +6 -0
  569. data/lib/generators/templates/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  570. data/lib/generators/templates/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  571. data/lib/generators/templates/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  572. data/lib/generators/templates/ckeditor/plugins/uicolor/dialogs/uicolor.js +7 -0
  573. data/lib/generators/templates/ckeditor/plugins/uicolor/lang/en.js +6 -0
  574. data/lib/generators/templates/ckeditor/plugins/uicolor/plugin.js +6 -0
  575. data/lib/generators/templates/ckeditor/plugins/uicolor/uicolor.gif +0 -0
  576. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  577. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  578. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  579. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  580. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/assets/yui.css +6 -0
  581. data/lib/generators/templates/ckeditor/plugins/uicolor/yui/yui.js +76 -0
  582. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
  583. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  584. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/wsc.css +6 -0
  585. data/lib/generators/templates/ckeditor/plugins/wsc/dialogs/wsc.js +7 -0
  586. data/lib/generators/templates/ckeditor/skins/kama/dialog.css +9 -0
  587. data/lib/generators/templates/ckeditor/skins/kama/editor.css +12 -0
  588. data/lib/generators/templates/ckeditor/skins/kama/icons.png +0 -0
  589. data/lib/generators/templates/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
  590. data/lib/generators/templates/ckeditor/skins/kama/images/dialog_sides.png +0 -0
  591. data/lib/generators/templates/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
  592. data/lib/generators/templates/ckeditor/skins/kama/images/mini.gif +0 -0
  593. data/lib/generators/templates/ckeditor/skins/kama/images/noimage.png +0 -0
  594. data/lib/generators/templates/ckeditor/skins/kama/images/sprites.png +0 -0
  595. data/lib/generators/templates/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
  596. data/lib/generators/templates/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
  597. data/lib/generators/templates/ckeditor/skins/kama/skin.js +7 -0
  598. data/lib/generators/templates/ckeditor/skins/kama/templates.css +6 -0
  599. data/lib/generators/templates/ckeditor/skins/office2003/dialog.css +9 -0
  600. data/lib/generators/templates/ckeditor/skins/office2003/editor.css +13 -0
  601. data/lib/generators/templates/ckeditor/skins/office2003/icons.png +0 -0
  602. data/lib/generators/templates/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
  603. data/lib/generators/templates/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
  604. data/lib/generators/templates/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
  605. data/lib/generators/templates/ckeditor/skins/office2003/images/mini.gif +0 -0
  606. data/lib/generators/templates/ckeditor/skins/office2003/images/noimage.png +0 -0
  607. data/lib/generators/templates/ckeditor/skins/office2003/images/sprites.png +0 -0
  608. data/lib/generators/templates/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
  609. data/lib/generators/templates/ckeditor/skins/office2003/skin.js +6 -0
  610. data/lib/generators/templates/ckeditor/skins/office2003/templates.css +6 -0
  611. data/lib/generators/templates/ckeditor/skins/v2/dialog.css +8 -0
  612. data/lib/generators/templates/ckeditor/skins/v2/editor.css +12 -0
  613. data/lib/generators/templates/ckeditor/skins/v2/icons.png +0 -0
  614. data/lib/generators/templates/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
  615. data/lib/generators/templates/ckeditor/skins/v2/images/dialog_sides.png +0 -0
  616. data/lib/generators/templates/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
  617. data/lib/generators/templates/ckeditor/skins/v2/images/mini.gif +0 -0
  618. data/lib/generators/templates/ckeditor/skins/v2/images/noimage.png +0 -0
  619. data/lib/generators/templates/ckeditor/skins/v2/images/sprites.png +0 -0
  620. data/lib/generators/templates/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
  621. data/lib/generators/templates/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
  622. data/lib/generators/templates/ckeditor/skins/v2/skin.js +6 -0
  623. data/lib/generators/templates/ckeditor/skins/v2/templates.css +6 -0
  624. data/lib/generators/templates/ckeditor/swfupload/fileprogress.js +290 -0
  625. data/lib/generators/templates/ckeditor/swfupload/handlers.js +170 -0
  626. data/lib/generators/templates/ckeditor/swfupload/mootools-1.2.3-core-yc.js +356 -0
  627. data/lib/generators/templates/ckeditor/swfupload/querystring.js +40 -0
  628. data/lib/generators/templates/ckeditor/swfupload/swfupload.js +980 -0
  629. data/lib/generators/templates/ckeditor/swfupload/swfupload.queue.js +98 -0
  630. data/lib/generators/templates/ckeditor/swfupload/swfupload.swf +0 -0
  631. data/lib/generators/templates/ckeditor/swfupload/swfupload.swfobject.js +111 -0
  632. data/lib/generators/templates/ckeditor/themes/default/theme.js +8 -0
  633. data/lib/tasks/ckeditor_tasks.rake +3 -0
  634. metadata +694 -0
@@ -0,0 +1,314 @@
1
+ /*
2
+ Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ CKEDITOR.plugins.add( 'htmlwriter' );
7
+
8
+ /**
9
+ * Class used to write HTML data.
10
+ * @constructor
11
+ * @example
12
+ * var writer = new CKEDITOR.htmlWriter();
13
+ * writer.openTag( 'p' );
14
+ * writer.attribute( 'class', 'MyClass' );
15
+ * writer.openTagClose( 'p' );
16
+ * writer.text( 'Hello' );
17
+ * writer.closeTag( 'p' );
18
+ * alert( writer.getHtml() ); "<p class="MyClass">Hello</p>"
19
+ */
20
+ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass(
21
+ {
22
+ base : CKEDITOR.htmlParser.basicWriter,
23
+
24
+ $ : function()
25
+ {
26
+ // Call the base contructor.
27
+ this.base();
28
+
29
+ /**
30
+ * The characters to be used for each identation step.
31
+ * @type String
32
+ * @default "\t" (tab)
33
+ * @example
34
+ * // Use two spaces for indentation.
35
+ * editorInstance.dataProcessor.writer.indentationChars = ' ';
36
+ */
37
+ this.indentationChars = '\t';
38
+
39
+ /**
40
+ * The characters to be used to close "self-closing" elements, like "br" or
41
+ * "img".
42
+ * @type String
43
+ * @default " />"
44
+ * @example
45
+ * // Use HTML4 notation for self-closing elements.
46
+ * editorInstance.dataProcessor.writer.selfClosingEnd = '>';
47
+ */
48
+ this.selfClosingEnd = ' />';
49
+
50
+ /**
51
+ * The characters to be used for line breaks.
52
+ * @type String
53
+ * @default "\n" (LF)
54
+ * @example
55
+ * // Use CRLF for line breaks.
56
+ * editorInstance.dataProcessor.writer.lineBreakChars = '\r\n';
57
+ */
58
+ this.lineBreakChars = '\n';
59
+
60
+ this.forceSimpleAmpersand = false;
61
+
62
+ this.sortAttributes = true;
63
+
64
+ this._.indent = false;
65
+ this._.indentation = '';
66
+ this._.rules = {};
67
+
68
+ var dtd = CKEDITOR.dtd;
69
+
70
+ for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) )
71
+ {
72
+ this.setRules( e,
73
+ {
74
+ indent : true,
75
+ breakBeforeOpen : true,
76
+ breakAfterOpen : true,
77
+ breakBeforeClose : !dtd[ e ][ '#' ],
78
+ breakAfterClose : true
79
+ });
80
+ }
81
+
82
+ this.setRules( 'br',
83
+ {
84
+ breakAfterOpen : true
85
+ });
86
+
87
+ this.setRules( 'title',
88
+ {
89
+ indent : false,
90
+ breakAfterOpen : false
91
+ });
92
+
93
+ this.setRules( 'style',
94
+ {
95
+ indent : false,
96
+ breakBeforeClose : true
97
+ });
98
+
99
+ // Disable indentation on <pre>.
100
+ this.setRules( 'pre',
101
+ {
102
+ indent: false
103
+ });
104
+ },
105
+
106
+ proto :
107
+ {
108
+ /**
109
+ * Writes the tag opening part for a opener tag.
110
+ * @param {String} tagName The element name for this tag.
111
+ * @param {Object} attributes The attributes defined for this tag. The
112
+ * attributes could be used to inspect the tag.
113
+ * @example
114
+ * // Writes "&lt;p".
115
+ * writer.openTag( 'p', { class : 'MyClass', id : 'MyId' } );
116
+ */
117
+ openTag : function( tagName, attributes )
118
+ {
119
+ var rules = this._.rules[ tagName ];
120
+
121
+ if ( this._.indent )
122
+ this.indentation();
123
+ // Do not break if indenting.
124
+ else if ( rules && rules.breakBeforeOpen )
125
+ {
126
+ this.lineBreak();
127
+ this.indentation();
128
+ }
129
+
130
+ this._.output.push( '<', tagName );
131
+ },
132
+
133
+ /**
134
+ * Writes the tag closing part for a opener tag.
135
+ * @param {String} tagName The element name for this tag.
136
+ * @param {Boolean} isSelfClose Indicates that this is a self-closing tag,
137
+ * like "br" or "img".
138
+ * @example
139
+ * // Writes "&gt;".
140
+ * writer.openTagClose( 'p', false );
141
+ * @example
142
+ * // Writes " /&gt;".
143
+ * writer.openTagClose( 'br', true );
144
+ */
145
+ openTagClose : function( tagName, isSelfClose )
146
+ {
147
+ var rules = this._.rules[ tagName ];
148
+
149
+ if ( isSelfClose )
150
+ this._.output.push( this.selfClosingEnd );
151
+ else
152
+ {
153
+ this._.output.push( '>' );
154
+
155
+ if ( rules && rules.indent )
156
+ this._.indentation += this.indentationChars;
157
+ }
158
+
159
+ if ( rules && rules.breakAfterOpen )
160
+ this.lineBreak();
161
+ },
162
+
163
+ /**
164
+ * Writes an attribute. This function should be called after opening the
165
+ * tag with {@link #openTagClose}.
166
+ * @param {String} attName The attribute name.
167
+ * @param {String} attValue The attribute value.
168
+ * @example
169
+ * // Writes ' class="MyClass"'.
170
+ * writer.attribute( 'class', 'MyClass' );
171
+ */
172
+ attribute : function( attName, attValue )
173
+ {
174
+
175
+ if ( typeof attValue == 'string' )
176
+ {
177
+ this.forceSimpleAmpersand && ( attValue = attValue.replace( /&amp;/g, '&' ) );
178
+ // Browsers don't always escape special character in attribute values. (#4683, #4719).
179
+ attValue = CKEDITOR.tools.htmlEncodeAttr( attValue );
180
+ }
181
+
182
+ this._.output.push( ' ', attName, '="', attValue, '"' );
183
+ },
184
+
185
+ /**
186
+ * Writes a closer tag.
187
+ * @param {String} tagName The element name for this tag.
188
+ * @example
189
+ * // Writes "&lt;/p&gt;".
190
+ * writer.closeTag( 'p' );
191
+ */
192
+ closeTag : function( tagName )
193
+ {
194
+ var rules = this._.rules[ tagName ];
195
+
196
+ if ( rules && rules.indent )
197
+ this._.indentation = this._.indentation.substr( this.indentationChars.length );
198
+
199
+ if ( this._.indent )
200
+ this.indentation();
201
+ // Do not break if indenting.
202
+ else if ( rules && rules.breakBeforeClose )
203
+ {
204
+ this.lineBreak();
205
+ this.indentation();
206
+ }
207
+
208
+ this._.output.push( '</', tagName, '>' );
209
+
210
+ if ( rules && rules.breakAfterClose )
211
+ this.lineBreak();
212
+ },
213
+
214
+ /**
215
+ * Writes text.
216
+ * @param {String} text The text value
217
+ * @example
218
+ * // Writes "Hello Word".
219
+ * writer.text( 'Hello Word' );
220
+ */
221
+ text : function( text )
222
+ {
223
+ if ( this._.indent )
224
+ {
225
+ this.indentation();
226
+ text = CKEDITOR.tools.ltrim( text );
227
+ }
228
+
229
+ this._.output.push( text );
230
+ },
231
+
232
+ /**
233
+ * Writes a comment.
234
+ * @param {String} comment The comment text.
235
+ * @example
236
+ * // Writes "&lt;!-- My comment --&gt;".
237
+ * writer.comment( ' My comment ' );
238
+ */
239
+ comment : function( comment )
240
+ {
241
+ if ( this._.indent )
242
+ this.indentation();
243
+
244
+ this._.output.push( '<!--', comment, '-->' );
245
+ },
246
+
247
+ /**
248
+ * Writes a line break. It uses the {@link #lineBreakChars} property for it.
249
+ * @example
250
+ * // Writes "\n" (e.g.).
251
+ * writer.lineBreak();
252
+ */
253
+ lineBreak : function()
254
+ {
255
+ if ( this._.output.length > 0 )
256
+ this._.output.push( this.lineBreakChars );
257
+ this._.indent = true;
258
+ },
259
+
260
+ /**
261
+ * Writes the current indentation chars. It uses the
262
+ * {@link #indentationChars} property, repeating it for the current
263
+ * indentation steps.
264
+ * @example
265
+ * // Writes "\t" (e.g.).
266
+ * writer.indentation();
267
+ */
268
+ indentation : function()
269
+ {
270
+ this._.output.push( this._.indentation );
271
+ this._.indent = false;
272
+ },
273
+
274
+ /**
275
+ * Sets formatting rules for a give element. The possible rules are:
276
+ * <ul>
277
+ * <li><b>indent</b>: indent the element contents.</li>
278
+ * <li><b>breakBeforeOpen</b>: break line before the opener tag for this element.</li>
279
+ * <li><b>breakAfterOpen</b>: break line after the opener tag for this element.</li>
280
+ * <li><b>breakBeforeClose</b>: break line before the closer tag for this element.</li>
281
+ * <li><b>breakAfterClose</b>: break line after the closer tag for this element.</li>
282
+ * </ul>
283
+ *
284
+ * All rules default to "false". Each call to the function overrides
285
+ * already present rules, leaving the undefined untouched.
286
+ *
287
+ * By default, all elements available in the {@link CKEDITOR.dtd.$block),
288
+ * {@link CKEDITOR.dtd.$listItem} and {@link CKEDITOR.dtd.$tableContent}
289
+ * lists have all the above rules set to "true". Additionaly, the "br"
290
+ * element has the "breakAfterOpen" set to "true".
291
+ * @param {String} tagName The element name to which set the rules.
292
+ * @param {Object} rules An object containing the element rules.
293
+ * @example
294
+ * // Break line before and after "img" tags.
295
+ * writer.setRules( 'img',
296
+ * {
297
+ * breakBeforeOpen : true
298
+ * breakAfterOpen : true
299
+ * });
300
+ * @example
301
+ * // Reset the rules for the "h1" tag.
302
+ * writer.setRules( 'h1', {} );
303
+ */
304
+ setRules : function( tagName, rules )
305
+ {
306
+ var currentRules = this._.rules[ tagName ];
307
+
308
+ if ( currentRules )
309
+ CKEDITOR.tools.extend( currentRules, rules, true );
310
+ else
311
+ this._.rules[ tagName ] = rules;
312
+ }
313
+ }
314
+ });
@@ -0,0 +1,136 @@
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 Plugin for making iframe based dialogs.
8
+ */
9
+
10
+ CKEDITOR.plugins.add( 'iframedialog',
11
+ {
12
+ requires : [ 'dialog' ],
13
+ onLoad : function()
14
+ {
15
+ CKEDITOR.dialog.addIframe = function( name, title, src, width, height, onContentLoad )
16
+ {
17
+ var element =
18
+ {
19
+ type : 'iframe',
20
+ src : src,
21
+ width : '100%',
22
+ height : '100%'
23
+ };
24
+
25
+ if ( typeof( onContentLoad ) == 'function' )
26
+ element.onContentLoad = onContentLoad;
27
+
28
+ var definition =
29
+ {
30
+ title : title,
31
+ minWidth : width,
32
+ minHeight : height,
33
+ contents :
34
+ [
35
+ {
36
+ id : 'iframe',
37
+ label : title,
38
+ expand : true,
39
+ elements : [ element ]
40
+ }
41
+ ]
42
+ };
43
+
44
+ return this.add( name, function(){ return definition; } );
45
+ };
46
+
47
+ (function()
48
+ {
49
+ /**
50
+ * An iframe element.
51
+ * @extends CKEDITOR.ui.dialog.uiElement
52
+ * @example
53
+ * @constructor
54
+ * @param {CKEDITOR.dialog} dialog
55
+ * Parent dialog object.
56
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
57
+ * The element definition. Accepted fields:
58
+ * <ul>
59
+ * <li><strong>src</strong> (Required) The src field of the iframe. </li>
60
+ * <li><strong>width</strong> (Required) The iframe's width.</li>
61
+ * <li><strong>height</strong> (Required) The iframe's height.</li>
62
+ * <li><strong>onContentLoad</strong> (Optional) A function to be executed
63
+ * after the iframe's contents has finished loading.</li>
64
+ * </ul>
65
+ * @param {Array} htmlList
66
+ * List of HTML code to output to.
67
+ */
68
+ var iframeElement = function( dialog, elementDefinition, htmlList )
69
+ {
70
+ if ( arguments.length < 3 )
71
+ return;
72
+
73
+ var _ = ( this._ || ( this._ = {} ) ),
74
+ contentLoad = elementDefinition.onContentLoad && CKEDITOR.tools.bind( elementDefinition.onContentLoad, this ),
75
+ cssWidth = CKEDITOR.tools.cssLength( elementDefinition.width ),
76
+ cssHeight = CKEDITOR.tools.cssLength( elementDefinition.height );
77
+ _.frameId = CKEDITOR.tools.getNextNumber() + '_iframe';
78
+
79
+ // IE BUG: Parent container does not resize to contain the iframe automatically.
80
+ dialog.on( 'load', function()
81
+ {
82
+ var iframe = CKEDITOR.document.getById( _.frameId ),
83
+ parentContainer = iframe.getParent();
84
+
85
+ parentContainer.setStyles(
86
+ {
87
+ width : cssWidth,
88
+ height : cssHeight
89
+ } );
90
+ } );
91
+
92
+ var attributes =
93
+ {
94
+ src : '%2',
95
+ id : _.frameId,
96
+ frameborder : 0,
97
+ allowtransparency : true
98
+ };
99
+ var myHtml = [];
100
+
101
+ if ( typeof( elementDefinition.onContentLoad ) == 'function' )
102
+ attributes.onload = 'CKEDITOR.tools.callFunction(%1);';
103
+
104
+ CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtml, 'iframe',
105
+ {
106
+ width : cssWidth,
107
+ height : cssHeight
108
+ }, attributes, '' );
109
+
110
+ // Put a placeholder for the first time.
111
+ htmlList.push( '<div style="width:' + cssWidth + ';height:' + cssHeight + ';" id="' + this.domId + '"></div>' );
112
+
113
+ // Iframe elements should be refreshed whenever it is shown.
114
+ myHtml = myHtml.join( '' );
115
+ dialog.on( 'show', function()
116
+ {
117
+ var iframe = CKEDITOR.document.getById( _.frameId ),
118
+ parentContainer = iframe.getParent(),
119
+ callIndex = CKEDITOR.tools.addFunction( contentLoad ),
120
+ html = myHtml.replace( '%1', callIndex ).replace( '%2', CKEDITOR.tools.htmlEncode( elementDefinition.src ) );
121
+ parentContainer.setHtml( html );
122
+ } );
123
+ };
124
+
125
+ iframeElement.prototype = new CKEDITOR.ui.dialog.uiElement;
126
+
127
+ CKEDITOR.dialog.addUIElement( 'iframe',
128
+ {
129
+ build : function( dialog, elementDefinition, output )
130
+ {
131
+ return new iframeElement( dialog, elementDefinition, output );
132
+ }
133
+ } );
134
+ })();
135
+ }
136
+ } );
@@ -0,0 +1,1380 @@
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
+ (function()
7
+ {
8
+ // Load image preview.
9
+ var IMAGE = 1,
10
+ LINK = 2,
11
+ PREVIEW = 4,
12
+ CLEANUP = 8,
13
+ regexGetSize = /^\s*(\d+)((px)|\%)?\s*$/i,
14
+ regexGetSizeOrEmpty = /(^\s*(\d+)((px)|\%)?\s*$)|^$/i,
15
+ pxLengthRegex = /^\d+px$/;
16
+
17
+ var onSizeChange = function()
18
+ {
19
+ var value = this.getValue(), // This = input element.
20
+ dialog = this.getDialog(),
21
+ aMatch = value.match( regexGetSize ); // Check value
22
+ if ( aMatch )
23
+ {
24
+ if ( aMatch[2] == '%' ) // % is allowed - > unlock ratio.
25
+ switchLockRatio( dialog, false ); // Unlock.
26
+ value = aMatch[1];
27
+ }
28
+
29
+ // Only if ratio is locked
30
+ if ( dialog.lockRatio )
31
+ {
32
+ var oImageOriginal = dialog.originalElement;
33
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
34
+ {
35
+ if ( this.id == 'txtHeight' )
36
+ {
37
+ if ( value && value != '0' )
38
+ value = Math.round( oImageOriginal.$.width * ( value / oImageOriginal.$.height ) );
39
+ if ( !isNaN( value ) )
40
+ dialog.setValueOf( 'info', 'txtWidth', value );
41
+ }
42
+ else //this.id = txtWidth.
43
+ {
44
+ if ( value && value != '0' )
45
+ value = Math.round( oImageOriginal.$.height * ( value / oImageOriginal.$.width ) );
46
+ if ( !isNaN( value ) )
47
+ dialog.setValueOf( 'info', 'txtHeight', value );
48
+ }
49
+ }
50
+ }
51
+ updatePreview( dialog );
52
+ };
53
+
54
+ var updatePreview = function( dialog )
55
+ {
56
+ //Don't load before onShow.
57
+ if ( !dialog.originalElement || !dialog.preview )
58
+ return 1;
59
+
60
+ // Read attributes and update imagePreview;
61
+ dialog.commitContent( PREVIEW, dialog.preview );
62
+ return 0;
63
+ };
64
+
65
+ // Custom commit dialog logic, where we're intended to give inline style
66
+ // field (txtdlgGenStyle) higher priority to avoid overwriting styles contribute
67
+ // by other fields.
68
+ function commitContent()
69
+ {
70
+ var args = arguments;
71
+ var inlineStyleField = this.getContentElement( 'advanced', 'txtdlgGenStyle' );
72
+ inlineStyleField && inlineStyleField.commit.apply( inlineStyleField, args );
73
+
74
+ this.foreach( function( widget )
75
+ {
76
+ if ( widget.commit && widget.id != 'txtdlgGenStyle' )
77
+ widget.commit.apply( widget, args );
78
+ });
79
+ }
80
+
81
+ // Avoid recursions.
82
+ var incommit;
83
+
84
+ // Synchronous field values to other impacted fields is required, e.g. border
85
+ // size change should alter inline-style text as well.
86
+ function commitInternally( targetFields )
87
+ {
88
+ if ( incommit )
89
+ return;
90
+
91
+ incommit = 1;
92
+
93
+ var dialog = this.getDialog(),
94
+ element = dialog.imageElement;
95
+ if ( element )
96
+ {
97
+ // Commit this field and broadcast to target fields.
98
+ this.commit( IMAGE, element );
99
+
100
+ targetFields = [].concat( targetFields );
101
+ var length = targetFields.length,
102
+ field;
103
+ for ( var i = 0; i < length; i++ )
104
+ {
105
+ field = dialog.getContentElement.apply( dialog, targetFields[ i ].split( ':' ) );
106
+ // May cause recursion.
107
+ field && field.setup( IMAGE, element );
108
+ }
109
+ }
110
+
111
+ incommit = 0;
112
+ }
113
+
114
+ var switchLockRatio = function( dialog, value )
115
+ {
116
+ var oImageOriginal = dialog.originalElement,
117
+ ratioButton = CKEDITOR.document.getById( 'btnLockSizes' );
118
+
119
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
120
+ {
121
+ if ( value == 'check' ) // Check image ratio and original image ratio.
122
+ {
123
+ var width = dialog.getValueOf( 'info', 'txtWidth' ),
124
+ height = dialog.getValueOf( 'info', 'txtHeight' ),
125
+ originalRatio = oImageOriginal.$.width * 1000 / oImageOriginal.$.height,
126
+ thisRatio = width * 1000 / height;
127
+ dialog.lockRatio = false; // Default: unlock ratio
128
+
129
+ if ( !width && !height )
130
+ dialog.lockRatio = true;
131
+ else if ( !isNaN( originalRatio ) && !isNaN( thisRatio ) )
132
+ {
133
+ if ( Math.round( originalRatio ) == Math.round( thisRatio ) )
134
+ dialog.lockRatio = true;
135
+ }
136
+ }
137
+ else if ( value != undefined )
138
+ dialog.lockRatio = value;
139
+ else
140
+ dialog.lockRatio = !dialog.lockRatio;
141
+ }
142
+ else if ( value != 'check' ) // I can't lock ratio if ratio is unknown.
143
+ dialog.lockRatio = false;
144
+
145
+ if ( dialog.lockRatio )
146
+ ratioButton.removeClass( 'cke_btn_unlocked' );
147
+ else
148
+ ratioButton.addClass( 'cke_btn_unlocked' );
149
+
150
+ var lang = dialog._.editor.lang.image,
151
+ label = lang[ dialog.lockRatio ? 'unlockRatio' : 'lockRatio' ];
152
+
153
+ ratioButton.setAttribute( 'title', label );
154
+ ratioButton.getFirst().setText( label );
155
+
156
+ return dialog.lockRatio;
157
+ };
158
+
159
+ var resetSize = function( dialog )
160
+ {
161
+ var oImageOriginal = dialog.originalElement;
162
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
163
+ {
164
+ dialog.setValueOf( 'info', 'txtWidth', oImageOriginal.$.width );
165
+ dialog.setValueOf( 'info', 'txtHeight', oImageOriginal.$.height );
166
+ }
167
+ updatePreview( dialog );
168
+ };
169
+
170
+ var setupDimension = function( type, element )
171
+ {
172
+ if ( type != IMAGE )
173
+ return;
174
+
175
+ function checkDimension( size, defaultValue )
176
+ {
177
+ var aMatch = size.match( regexGetSize );
178
+ if ( aMatch )
179
+ {
180
+ if ( aMatch[2] == '%' ) // % is allowed.
181
+ {
182
+ aMatch[1] += '%';
183
+ switchLockRatio( dialog, false ); // Unlock ratio
184
+ }
185
+ return aMatch[1];
186
+ }
187
+ return defaultValue;
188
+ }
189
+
190
+ var dialog = this.getDialog(),
191
+ value = '',
192
+ dimension = (( this.id == 'txtWidth' )? 'width' : 'height' ),
193
+ size = element.getAttribute( dimension );
194
+
195
+ if ( size )
196
+ value = checkDimension( size, value );
197
+ value = checkDimension( element.getStyle( dimension ), value );
198
+
199
+ this.setValue( value );
200
+ };
201
+
202
+ var imageDialog = function( editor, dialogType )
203
+ {
204
+ var previewPreloader;
205
+
206
+ var onImgLoadEvent = function()
207
+ {
208
+ // Image is ready.
209
+ var original = this.originalElement;
210
+ original.setCustomData( 'isReady', 'true' );
211
+ original.removeListener( 'load', onImgLoadEvent );
212
+ original.removeListener( 'error', onImgLoadErrorEvent );
213
+ original.removeListener( 'abort', onImgLoadErrorEvent );
214
+
215
+ // Hide loader
216
+ CKEDITOR.document.getById( 'ImagePreviewLoader' ).setStyle( 'display', 'none' );
217
+
218
+ // New image -> new domensions
219
+ if ( !this.dontResetSize )
220
+ resetSize( this );
221
+
222
+ if ( this.firstLoad )
223
+ CKEDITOR.tools.setTimeout( function(){ switchLockRatio( this, 'check' ); }, 0, this );
224
+
225
+ this.firstLoad = false;
226
+ this.dontResetSize = false;
227
+ };
228
+
229
+ var onImgLoadErrorEvent = function()
230
+ {
231
+ // Error. Image is not loaded.
232
+ var original = this.originalElement;
233
+ original.removeListener( 'load', onImgLoadEvent );
234
+ original.removeListener( 'error', onImgLoadErrorEvent );
235
+ original.removeListener( 'abort', onImgLoadErrorEvent );
236
+
237
+ // Set Error image.
238
+ var noimage = CKEDITOR.getUrl( editor.skinPath + 'images/noimage.png' );
239
+
240
+ if ( this.preview )
241
+ this.preview.setAttribute( 'src', noimage );
242
+
243
+ // Hide loader
244
+ CKEDITOR.document.getById( 'ImagePreviewLoader' ).setStyle( 'display', 'none' );
245
+ switchLockRatio( this, false ); // Unlock.
246
+ };
247
+ return {
248
+ title : ( dialogType == 'image' ) ? editor.lang.image.title : editor.lang.image.titleButton,
249
+ minWidth : 420,
250
+ minHeight : 310,
251
+ onShow : function()
252
+ {
253
+ this.imageElement = false;
254
+ this.linkElement = false;
255
+
256
+ // Default: create a new element.
257
+ this.imageEditMode = false;
258
+ this.linkEditMode = false;
259
+
260
+ this.lockRatio = true;
261
+ this.dontResetSize = false;
262
+ this.firstLoad = true;
263
+ this.addLink = false;
264
+
265
+ var editor = this.getParentEditor(),
266
+ sel = this.getParentEditor().getSelection(),
267
+ element = sel.getSelectedElement(),
268
+ link = element && element.getAscendant( 'a' );
269
+
270
+ //Hide loader.
271
+ CKEDITOR.document.getById( 'ImagePreviewLoader' ).setStyle( 'display', 'none' );
272
+ // Create the preview before setup the dialog contents.
273
+ previewPreloader = new CKEDITOR.dom.element( 'img', editor.document );
274
+ this.preview = CKEDITOR.document.getById( 'previewImage' );
275
+
276
+ // Copy of the image
277
+ this.originalElement = editor.document.createElement( 'img' );
278
+ this.originalElement.setAttribute( 'alt', '' );
279
+ this.originalElement.setCustomData( 'isReady', 'false' );
280
+
281
+ if ( link )
282
+ {
283
+ this.linkElement = link;
284
+ this.linkEditMode = true;
285
+
286
+ // Look for Image element.
287
+ var linkChildren = link.getChildren();
288
+ if ( linkChildren.count() == 1 ) // 1 child.
289
+ {
290
+ var childTagName = linkChildren.getItem( 0 ).getName();
291
+ if ( childTagName == 'img' || childTagName == 'input' )
292
+ {
293
+ this.imageElement = linkChildren.getItem( 0 );
294
+ if ( this.imageElement.getName() == 'img' )
295
+ this.imageEditMode = 'img';
296
+ else if ( this.imageElement.getName() == 'input' )
297
+ this.imageEditMode = 'input';
298
+ }
299
+ }
300
+ // Fill out all fields.
301
+ if ( dialogType == 'image' )
302
+ this.setupContent( LINK, link );
303
+ }
304
+
305
+ if ( element && element.getName() == 'img' && !element.getAttribute( '_cke_realelement' )
306
+ || element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'image' )
307
+ {
308
+ this.imageEditMode = element.getName();
309
+ this.imageElement = element;
310
+ }
311
+
312
+ if ( this.imageEditMode )
313
+ {
314
+ // Use the original element as a buffer from since we don't want
315
+ // temporary changes to be committed, e.g. if the dialog is canceled.
316
+ this.cleanImageElement = this.imageElement;
317
+ this.imageElement = this.cleanImageElement.clone( true, true );
318
+
319
+ // Fill out all fields.
320
+ this.setupContent( IMAGE, this.imageElement );
321
+
322
+ // Refresh LockRatio button
323
+ switchLockRatio ( this, true );
324
+ }
325
+ else
326
+ this.imageElement = editor.document.createElement( 'img' );
327
+
328
+ // Dont show preview if no URL given.
329
+ if ( !CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtUrl' ) ) )
330
+ {
331
+ this.preview.removeAttribute( 'src' );
332
+ this.preview.setStyle( 'display', 'none' );
333
+ }
334
+ },
335
+ onOk : function()
336
+ {
337
+ // Edit existing Image.
338
+ if ( this.imageEditMode )
339
+ {
340
+ var imgTagName = this.imageEditMode;
341
+
342
+ // Image dialog and Input element.
343
+ if ( dialogType == 'image' && imgTagName == 'input' && confirm( editor.lang.image.button2Img ) )
344
+ {
345
+ // Replace INPUT-> IMG
346
+ imgTagName = 'img';
347
+ this.imageElement = editor.document.createElement( 'img' );
348
+ this.imageElement.setAttribute( 'alt', '' );
349
+ editor.insertElement( this.imageElement );
350
+ }
351
+ // ImageButton dialog and Image element.
352
+ else if ( dialogType != 'image' && imgTagName == 'img' && confirm( editor.lang.image.img2Button ))
353
+ {
354
+ // Replace IMG -> INPUT
355
+ imgTagName = 'input';
356
+ this.imageElement = editor.document.createElement( 'input' );
357
+ this.imageElement.setAttributes(
358
+ {
359
+ type : 'image',
360
+ alt : ''
361
+ }
362
+ );
363
+ editor.insertElement( this.imageElement );
364
+ }
365
+ else
366
+ {
367
+ // Restore the original element before all commits.
368
+ this.imageElement = this.cleanImageElement;
369
+ delete this.cleanImageElement;
370
+ }
371
+ }
372
+ else // Create a new image.
373
+ {
374
+ // Image dialog -> create IMG element.
375
+ if ( dialogType == 'image' )
376
+ this.imageElement = editor.document.createElement( 'img' );
377
+ else
378
+ {
379
+ this.imageElement = editor.document.createElement( 'input' );
380
+ this.imageElement.setAttribute ( 'type' ,'image' );
381
+ }
382
+ this.imageElement.setAttribute( 'alt', '' );
383
+ }
384
+
385
+ // Create a new link.
386
+ if ( !this.linkEditMode )
387
+ this.linkElement = editor.document.createElement( 'a' );
388
+
389
+ // Set attributes.
390
+ this.commitContent( IMAGE, this.imageElement );
391
+ this.commitContent( LINK, this.linkElement );
392
+
393
+ // Remove empty style attribute.
394
+ if ( !this.imageElement.getAttribute( 'style' ) )
395
+ this.imageElement.removeAttribute( 'style' );
396
+
397
+ // Insert a new Image.
398
+ if ( !this.imageEditMode )
399
+ {
400
+ if ( this.addLink )
401
+ {
402
+ //Insert a new Link.
403
+ if ( !this.linkEditMode )
404
+ {
405
+ editor.insertElement(this.linkElement);
406
+ this.linkElement.append(this.imageElement, false);
407
+ }
408
+ else //Link already exists, image not.
409
+ editor.insertElement(this.imageElement );
410
+ }
411
+ else
412
+ editor.insertElement( this.imageElement );
413
+ }
414
+ else // Image already exists.
415
+ {
416
+ //Add a new link element.
417
+ if ( !this.linkEditMode && this.addLink )
418
+ {
419
+ editor.insertElement( this.linkElement );
420
+ this.imageElement.appendTo( this.linkElement );
421
+ }
422
+ //Remove Link, Image exists.
423
+ else if ( this.linkEditMode && !this.addLink )
424
+ {
425
+ editor.getSelection().selectElement( this.linkElement );
426
+ editor.insertElement( this.imageElement );
427
+ }
428
+ }
429
+ },
430
+ onLoad : function()
431
+ {
432
+ if ( dialogType != 'image' )
433
+ this.hidePage( 'Link' ); //Hide Link tab.
434
+ var doc = this._.element.getDocument();
435
+ this.addFocusable( doc.getById( 'btnResetSize' ), 5 );
436
+ this.addFocusable( doc.getById( 'btnLockSizes' ), 5 );
437
+
438
+ this.commitContent = commitContent;
439
+ },
440
+ onHide : function()
441
+ {
442
+ if ( this.preview )
443
+ this.commitContent( CLEANUP, this.preview );
444
+
445
+ if ( this.originalElement )
446
+ {
447
+ this.originalElement.removeListener( 'load', onImgLoadEvent );
448
+ this.originalElement.removeListener( 'error', onImgLoadErrorEvent );
449
+ this.originalElement.removeListener( 'abort', onImgLoadErrorEvent );
450
+ this.originalElement.remove();
451
+ this.originalElement = false; // Dialog is closed.
452
+ }
453
+
454
+ delete this.imageElement;
455
+ },
456
+ contents : [
457
+ {
458
+ id : 'info',
459
+ label : editor.lang.image.infoTab,
460
+ accessKey : 'I',
461
+ elements :
462
+ [
463
+ {
464
+ type : 'vbox',
465
+ padding : 0,
466
+ children :
467
+ [
468
+ {
469
+ type : 'hbox',
470
+ widths : [ '280px', '110px' ],
471
+ align : 'right',
472
+ children :
473
+ [
474
+ {
475
+ id : 'txtUrl',
476
+ type : 'text',
477
+ label : editor.lang.common.url,
478
+ required: true,
479
+ onChange : function()
480
+ {
481
+ var dialog = this.getDialog(),
482
+ newUrl = this.getValue();
483
+
484
+ //Update original image
485
+ if ( newUrl.length > 0 ) //Prevent from load before onShow
486
+ {
487
+ dialog = this.getDialog();
488
+ var original = dialog.originalElement;
489
+
490
+ dialog.preview.removeStyle( 'display' );
491
+
492
+ original.setCustomData( 'isReady', 'false' );
493
+ // Show loader
494
+ var loader = CKEDITOR.document.getById( 'ImagePreviewLoader' );
495
+ if ( loader )
496
+ loader.setStyle( 'display', '' );
497
+
498
+ original.on( 'load', onImgLoadEvent, dialog );
499
+ original.on( 'error', onImgLoadErrorEvent, dialog );
500
+ original.on( 'abort', onImgLoadErrorEvent, dialog );
501
+ original.setAttribute( 'src', newUrl );
502
+
503
+ // Query the preloader to figure out the url impacted by based href.
504
+ previewPreloader.setAttribute( 'src', newUrl );
505
+ dialog.preview.setAttribute( 'src', previewPreloader.$.src );
506
+ updatePreview( dialog );
507
+ }
508
+ // Dont show preview if no URL given.
509
+ else if ( dialog.preview )
510
+ {
511
+ dialog.preview.removeAttribute( 'src' );
512
+ dialog.preview.setStyle( 'display', 'none' );
513
+ }
514
+ },
515
+ setup : function( type, element )
516
+ {
517
+ if ( type == IMAGE )
518
+ {
519
+ var url = element.getAttribute( '_cke_saved_src' ) || element.getAttribute( 'src' );
520
+ var field = this;
521
+
522
+ this.getDialog().dontResetSize = true;
523
+
524
+ field.setValue( url ); // And call this.onChange()
525
+ // Manually set the initial value.(#4191)
526
+ field.setInitValue();
527
+ field.focus();
528
+ }
529
+ },
530
+ commit : function( type, element )
531
+ {
532
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) )
533
+ {
534
+ element.setAttribute( '_cke_saved_src', decodeURI( this.getValue() ) );
535
+ element.setAttribute( 'src', decodeURI( this.getValue() ) );
536
+ }
537
+ else if ( type == CLEANUP )
538
+ {
539
+ element.setAttribute( 'src', '' ); // If removeAttribute doesn't work.
540
+ element.removeAttribute( 'src' );
541
+ }
542
+ },
543
+ validate : CKEDITOR.dialog.validate.notEmpty( editor.lang.image.urlMissing )
544
+ },
545
+ {
546
+ type : 'button',
547
+ id : 'browse',
548
+ // v-align with the 'txtUrl' field.
549
+ // TODO: We need something better than a fixed size here.
550
+ style : 'display:inline-block;margin-top:10px;',
551
+ align : 'center',
552
+ label : editor.lang.common.browseServer,
553
+ hidden : true,
554
+ filebrowser : 'info:txtUrl'
555
+ }
556
+ ]
557
+ }
558
+ ]
559
+ },
560
+ {
561
+ id : 'txtAlt',
562
+ type : 'text',
563
+ label : editor.lang.image.alt,
564
+ accessKey : 'A',
565
+ 'default' : '',
566
+ onChange : function()
567
+ {
568
+ updatePreview( this.getDialog() );
569
+ },
570
+ setup : function( type, element )
571
+ {
572
+ if ( type == IMAGE )
573
+ this.setValue( element.getAttribute( 'alt' ) );
574
+ },
575
+ commit : function( type, element )
576
+ {
577
+ if ( type == IMAGE )
578
+ {
579
+ if ( this.getValue() || this.isChanged() )
580
+ element.setAttribute( 'alt', this.getValue() );
581
+ }
582
+ else if ( type == PREVIEW )
583
+ {
584
+ element.setAttribute( 'alt', this.getValue() );
585
+ }
586
+ else if ( type == CLEANUP )
587
+ {
588
+ element.removeAttribute( 'alt' );
589
+ }
590
+ }
591
+ },
592
+ {
593
+ type : 'hbox',
594
+ widths : [ '140px', '240px' ],
595
+ children :
596
+ [
597
+ {
598
+ type : 'vbox',
599
+ padding : 10,
600
+ children :
601
+ [
602
+ {
603
+ type : 'hbox',
604
+ widths : [ '70%', '30%' ],
605
+ children :
606
+ [
607
+ {
608
+ type : 'vbox',
609
+ padding : 1,
610
+ children :
611
+ [
612
+ {
613
+ type : 'text',
614
+ width: '40px',
615
+ id : 'txtWidth',
616
+ labelLayout : 'horizontal',
617
+ label : editor.lang.image.width,
618
+ onKeyUp : onSizeChange,
619
+ onChange : function()
620
+ {
621
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
622
+ },
623
+ validate : function()
624
+ {
625
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty );
626
+ if ( !aMatch )
627
+ alert( editor.lang.image.validateWidth );
628
+ return !!aMatch;
629
+ },
630
+ setup : setupDimension,
631
+ commit : function( type, element, internalCommit )
632
+ {
633
+ var value = this.getValue();
634
+ if ( type == IMAGE )
635
+ {
636
+ if ( value )
637
+ element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
638
+ else if ( !value && this.isChanged( ) )
639
+ element.removeStyle( 'width' );
640
+
641
+ !internalCommit && element.removeAttribute( 'width' );
642
+ }
643
+ else if ( type == PREVIEW )
644
+ {
645
+ var aMatch = value.match( regexGetSize );
646
+ if ( !aMatch )
647
+ {
648
+ var oImageOriginal = this.getDialog().originalElement;
649
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
650
+ element.setStyle( 'width', oImageOriginal.$.width + 'px');
651
+ }
652
+ else
653
+ element.setStyle( 'width', value + 'px');
654
+ }
655
+ else if ( type == CLEANUP )
656
+ {
657
+ element.removeAttribute( 'width' );
658
+ element.removeStyle( 'width' );
659
+ }
660
+ }
661
+ },
662
+ {
663
+ type : 'text',
664
+ id : 'txtHeight',
665
+ width: '40px',
666
+ labelLayout : 'horizontal',
667
+ label : editor.lang.image.height,
668
+ onKeyUp : onSizeChange,
669
+ onChange : function()
670
+ {
671
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
672
+ },
673
+ validate : function()
674
+ {
675
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty );
676
+ if ( !aMatch )
677
+ alert( editor.lang.image.validateHeight );
678
+ return !!aMatch;
679
+ },
680
+ setup : setupDimension,
681
+ commit : function( type, element, internalCommit )
682
+ {
683
+ var value = this.getValue();
684
+ if ( type == IMAGE )
685
+ {
686
+ if ( value )
687
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
688
+ else if ( !value && this.isChanged( ) )
689
+ element.removeStyle( 'height' );
690
+
691
+ if ( !internalCommit && type == IMAGE )
692
+ element.removeAttribute( 'height' );
693
+ }
694
+ else if ( type == PREVIEW )
695
+ {
696
+ var aMatch = value.match( regexGetSize );
697
+ if ( !aMatch )
698
+ {
699
+ var oImageOriginal = this.getDialog().originalElement;
700
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
701
+ element.setStyle( 'height', oImageOriginal.$.height + 'px' );
702
+ }
703
+ else
704
+ element.setStyle( 'height', value + 'px' );
705
+ }
706
+ else if ( type == CLEANUP )
707
+ {
708
+ element.removeAttribute( 'height' );
709
+ element.removeStyle( 'height' );
710
+ }
711
+ }
712
+ }
713
+ ]
714
+ },
715
+ {
716
+ type : 'html',
717
+ style : 'margin-top:10px;width:40px;height:40px;',
718
+ onLoad : function()
719
+ {
720
+ // Activate Reset button
721
+ var resetButton = CKEDITOR.document.getById( 'btnResetSize' ),
722
+ ratioButton = CKEDITOR.document.getById( 'btnLockSizes' );
723
+ if ( resetButton )
724
+ {
725
+ resetButton.on( 'click', function(evt)
726
+ {
727
+ resetSize( this );
728
+ evt.data.preventDefault();
729
+ }, this.getDialog() );
730
+ resetButton.on( 'mouseover', function()
731
+ {
732
+ this.addClass( 'cke_btn_over' );
733
+ }, resetButton );
734
+ resetButton.on( 'mouseout', function()
735
+ {
736
+ this.removeClass( 'cke_btn_over' );
737
+ }, resetButton );
738
+ }
739
+ // Activate (Un)LockRatio button
740
+ if ( ratioButton )
741
+ {
742
+ ratioButton.on( 'click', function(evt)
743
+ {
744
+ var locked = switchLockRatio( this ),
745
+ oImageOriginal = this.originalElement,
746
+ width = this.getValueOf( 'info', 'txtWidth' );
747
+
748
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' && width )
749
+ {
750
+ var height = oImageOriginal.$.height / oImageOriginal.$.width * width;
751
+ if ( !isNaN( height ) )
752
+ {
753
+ this.setValueOf( 'info', 'txtHeight', Math.round( height ) );
754
+ updatePreview( this );
755
+ }
756
+ }
757
+ evt.data.preventDefault();
758
+ }, this.getDialog() );
759
+ ratioButton.on( 'mouseover', function()
760
+ {
761
+ this.addClass( 'cke_btn_over' );
762
+ }, ratioButton );
763
+ ratioButton.on( 'mouseout', function()
764
+ {
765
+ this.removeClass( 'cke_btn_over' );
766
+ }, ratioButton );
767
+ }
768
+ },
769
+ html : '<div>'+
770
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.unlockRatio +
771
+ '" class="cke_btn_locked" id="btnLockSizes" role="button"><span class="cke_label">' + editor.lang.image.unlockRatio + '</span></a>' +
772
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize +
773
+ '" class="cke_btn_reset" id="btnResetSize" role="button"><span class="cke_label">' + editor.lang.image.resetSize + '</span></a>'+
774
+ '</div>'
775
+ }
776
+ ]
777
+ },
778
+ {
779
+ type : 'vbox',
780
+ padding : 1,
781
+ children :
782
+ [
783
+ {
784
+ type : 'text',
785
+ id : 'txtBorder',
786
+ width: '60px',
787
+ labelLayout : 'horizontal',
788
+ label : editor.lang.image.border,
789
+ 'default' : '',
790
+ onKeyUp : function()
791
+ {
792
+ updatePreview( this.getDialog() );
793
+ },
794
+ onChange : function()
795
+ {
796
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
797
+ },
798
+ validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateBorder ),
799
+ setup : function( type, element )
800
+ {
801
+ if ( type == IMAGE )
802
+ {
803
+ var value,
804
+ borderStyle = element.getStyle( 'border-width' );
805
+ borderStyle = borderStyle && borderStyle.match( /^(\d+px)(?: \1 \1 \1)?$/ );
806
+ value = borderStyle && parseInt( borderStyle[ 1 ], 10 );
807
+ isNaN ( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'border' ) );
808
+ this.setValue( value );
809
+ }
810
+ },
811
+ commit : function( type, element, internalCommit )
812
+ {
813
+ var value = parseInt( this.getValue(), 10 );
814
+ if ( type == IMAGE || type == PREVIEW )
815
+ {
816
+ if ( !isNaN( value ) )
817
+ {
818
+ element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
819
+ element.setStyle( 'border-style', 'solid' );
820
+ }
821
+ else if ( !value && this.isChanged() )
822
+ {
823
+ element.removeStyle( 'border-width' );
824
+ element.removeStyle( 'border-style' );
825
+ element.removeStyle( 'border-color' );
826
+ }
827
+
828
+ if ( !internalCommit && type == IMAGE )
829
+ element.removeAttribute( 'border' );
830
+ }
831
+ else if ( type == CLEANUP )
832
+ {
833
+ element.removeAttribute( 'border' );
834
+ element.removeStyle( 'border-width' );
835
+ element.removeStyle( 'border-style' );
836
+ element.removeStyle( 'border-color' );
837
+ }
838
+ }
839
+ },
840
+ {
841
+ type : 'text',
842
+ id : 'txtHSpace',
843
+ width: '60px',
844
+ labelLayout : 'horizontal',
845
+ label : editor.lang.image.hSpace,
846
+ 'default' : '',
847
+ onKeyUp : function()
848
+ {
849
+ updatePreview( this.getDialog() );
850
+ },
851
+ onChange : function()
852
+ {
853
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
854
+ },
855
+ validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateHSpace ),
856
+ setup : function( type, element )
857
+ {
858
+ if ( type == IMAGE )
859
+ {
860
+ var value,
861
+ marginLeftPx,
862
+ marginRightPx,
863
+ marginLeftStyle = element.getStyle( 'margin-left' ),
864
+ marginRightStyle = element.getStyle( 'margin-right' );
865
+
866
+ marginLeftStyle = marginLeftStyle && marginLeftStyle.match( pxLengthRegex );
867
+ marginRightStyle = marginRightStyle && marginRightStyle.match( pxLengthRegex );
868
+ marginLeftPx = parseInt( marginLeftStyle, 10 );
869
+ marginRightPx = parseInt( marginRightStyle, 10 );
870
+
871
+ value = ( marginLeftPx == marginRightPx ) && marginLeftPx;
872
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'hspace' ) );
873
+
874
+ this.setValue( value );
875
+ }
876
+ },
877
+ commit : function( type, element, internalCommit )
878
+ {
879
+ var value = parseInt( this.getValue(), 10 );
880
+ if ( type == IMAGE || type == PREVIEW )
881
+ {
882
+ if ( !isNaN( value ) )
883
+ {
884
+ element.setStyle( 'margin-left', CKEDITOR.tools.cssLength( value ) );
885
+ element.setStyle( 'margin-right', CKEDITOR.tools.cssLength( value ) );
886
+ }
887
+ else if ( !value && this.isChanged( ) )
888
+ {
889
+ element.removeStyle( 'margin-left' );
890
+ element.removeStyle( 'margin-right' );
891
+ }
892
+
893
+ if ( !internalCommit && type == IMAGE )
894
+ element.removeAttribute( 'hspace' );
895
+ }
896
+ else if ( type == CLEANUP )
897
+ {
898
+ element.removeAttribute( 'hspace' );
899
+ element.removeStyle( 'margin-left' );
900
+ element.removeStyle( 'margin-right' );
901
+ }
902
+ }
903
+ },
904
+ {
905
+ type : 'text',
906
+ id : 'txtVSpace',
907
+ width : '60px',
908
+ labelLayout : 'horizontal',
909
+ label : editor.lang.image.vSpace,
910
+ 'default' : '',
911
+ onKeyUp : function()
912
+ {
913
+ updatePreview( this.getDialog() );
914
+ },
915
+ onChange : function()
916
+ {
917
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
918
+ },
919
+ validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateVSpace ),
920
+ setup : function( type, element )
921
+ {
922
+ if ( type == IMAGE )
923
+ {
924
+ var value,
925
+ marginTopPx,
926
+ marginBottomPx,
927
+ marginTopStyle = element.getStyle( 'margin-top' ),
928
+ marginBottomStyle = element.getStyle( 'margin-bottom' );
929
+
930
+ marginTopStyle = marginTopStyle && marginTopStyle.match( pxLengthRegex );
931
+ marginBottomStyle = marginBottomStyle && marginBottomStyle.match( pxLengthRegex );
932
+ marginTopPx = parseInt( marginTopStyle, 10 );
933
+ marginBottomPx = parseInt( marginBottomStyle, 10 );
934
+
935
+ value = ( marginTopPx == marginBottomPx ) && marginTopPx;
936
+ isNaN ( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'vspace' ) );
937
+ this.setValue( value );
938
+ }
939
+ },
940
+ commit : function( type, element, internalCommit )
941
+ {
942
+ var value = parseInt( this.getValue(), 10 );
943
+ if ( type == IMAGE || type == PREVIEW )
944
+ {
945
+ if ( !isNaN( value ) )
946
+ {
947
+ element.setStyle( 'margin-top', CKEDITOR.tools.cssLength( value ) );
948
+ element.setStyle( 'margin-bottom', CKEDITOR.tools.cssLength( value ) );
949
+ }
950
+ else if ( !value && this.isChanged( ) )
951
+ {
952
+ element.removeStyle( 'margin-top' );
953
+ element.removeStyle( 'margin-bottom' );
954
+ }
955
+
956
+ if ( !internalCommit && type == IMAGE )
957
+ element.removeAttribute( 'vspace' );
958
+ }
959
+ else if ( type == CLEANUP )
960
+ {
961
+ element.removeAttribute( 'vspace' );
962
+ element.removeStyle( 'margin-top' );
963
+ element.removeStyle( 'margin-bottom' );
964
+ }
965
+ }
966
+ },
967
+ {
968
+ id : 'cmbAlign',
969
+ type : 'select',
970
+ labelLayout : 'horizontal',
971
+ widths : [ '35%','65%' ],
972
+ style : 'width:90px',
973
+ label : editor.lang.image.align,
974
+ 'default' : '',
975
+ items :
976
+ [
977
+ [ editor.lang.common.notSet , ''],
978
+ [ editor.lang.image.alignLeft , 'left'],
979
+ [ editor.lang.image.alignRight , 'right']
980
+ // Backward compatible with v2 on setup when specified as attribute value,
981
+ // while these values are no more available as select options.
982
+ // [ editor.lang.image.alignAbsBottom , 'absBottom'],
983
+ // [ editor.lang.image.alignAbsMiddle , 'absMiddle'],
984
+ // [ editor.lang.image.alignBaseline , 'baseline'],
985
+ // [ editor.lang.image.alignTextTop , 'text-top'],
986
+ // [ editor.lang.image.alignBottom , 'bottom'],
987
+ // [ editor.lang.image.alignMiddle , 'middle'],
988
+ // [ editor.lang.image.alignTop , 'top']
989
+ ],
990
+ onChange : function()
991
+ {
992
+ updatePreview( this.getDialog() );
993
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
994
+ },
995
+ setup : function( type, element )
996
+ {
997
+ if ( type == IMAGE )
998
+ {
999
+ var value = element.getStyle( 'float' );
1000
+ switch( value )
1001
+ {
1002
+ // Ignore those unrelated values.
1003
+ case 'inherit':
1004
+ case 'none':
1005
+ value = '';
1006
+ }
1007
+
1008
+ !value && ( value = ( element.getAttribute( 'align' ) || '' ).toLowerCase() );
1009
+ this.setValue( value );
1010
+ }
1011
+ },
1012
+ commit : function( type, element, internalCommit )
1013
+ {
1014
+ var value = this.getValue();
1015
+ if ( type == IMAGE || type == PREVIEW )
1016
+ {
1017
+ if ( value )
1018
+ element.setStyle( 'float', value );
1019
+ else
1020
+ element.removeStyle( 'float' );
1021
+
1022
+ if ( !internalCommit && type == IMAGE )
1023
+ {
1024
+ value = ( element.getAttribute( 'align' ) || '' ).toLowerCase();
1025
+ switch( value )
1026
+ {
1027
+ // we should remove it only if it matches "left" or "right",
1028
+ // otherwise leave it intact.
1029
+ case 'left':
1030
+ case 'right':
1031
+ element.removeAttribute( 'align' );
1032
+ }
1033
+ }
1034
+ }
1035
+ else if ( type == CLEANUP )
1036
+ element.removeStyle( 'float' );
1037
+
1038
+ }
1039
+ }
1040
+ ]
1041
+ }
1042
+ ]
1043
+ },
1044
+ {
1045
+ type : 'vbox',
1046
+ height : '250px',
1047
+ children :
1048
+ [
1049
+ {
1050
+ type : 'html',
1051
+ style : 'width:95%;',
1052
+ html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'<br>'+
1053
+ '<div id="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>'+
1054
+ '<div id="ImagePreviewBox"><table><tr><td>'+
1055
+ '<a href="javascript:void(0)" target="_blank" onclick="return false;" id="previewLink">'+
1056
+ '<img id="previewImage" alt="" /></a>' +
1057
+ ( editor.config.image_previewText ||
1058
+ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. '+
1059
+ 'Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, '+
1060
+ 'nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.' ) +
1061
+ '</td></tr></table></div></div>'
1062
+ }
1063
+ ]
1064
+ }
1065
+ ]
1066
+ }
1067
+ ]
1068
+ },
1069
+ {
1070
+ id : 'Link',
1071
+ label : editor.lang.link.title,
1072
+ padding : 0,
1073
+ elements :
1074
+ [
1075
+ {
1076
+ id : 'txtUrl',
1077
+ type : 'text',
1078
+ label : editor.lang.common.url,
1079
+ style : 'width: 100%',
1080
+ 'default' : '',
1081
+ setup : function( type, element )
1082
+ {
1083
+ if ( type == LINK )
1084
+ {
1085
+ var href = element.getAttribute( '_cke_saved_href' );
1086
+ if ( !href )
1087
+ href = element.getAttribute( 'href' );
1088
+ this.setValue( href );
1089
+ }
1090
+ },
1091
+ commit : function( type, element )
1092
+ {
1093
+ if ( type == LINK )
1094
+ {
1095
+ if ( this.getValue() || this.isChanged() )
1096
+ {
1097
+ element.setAttribute( '_cke_saved_href', decodeURI( this.getValue() ) );
1098
+ element.setAttribute( 'href', 'javascript:void(0)/*' +
1099
+ CKEDITOR.tools.getNextNumber() + '*/' );
1100
+
1101
+ if ( this.getValue() || !editor.config.image_removeLinkByEmptyURL )
1102
+ this.getDialog().addLink = true;
1103
+ }
1104
+ }
1105
+ }
1106
+ },
1107
+ {
1108
+ type : 'button',
1109
+ id : 'browse',
1110
+ filebrowser :
1111
+ {
1112
+ action : 'Browse',
1113
+ target: 'Link:txtUrl',
1114
+ url: editor.config.filebrowserImageBrowseLinkUrl || editor.config.filebrowserBrowseUrl
1115
+ },
1116
+ style : 'float:right',
1117
+ hidden : true,
1118
+ label : editor.lang.common.browseServer
1119
+ },
1120
+ {
1121
+ id : 'cmbTarget',
1122
+ type : 'select',
1123
+ label : editor.lang.common.target,
1124
+ 'default' : '',
1125
+ items :
1126
+ [
1127
+ [ editor.lang.common.notSet , ''],
1128
+ [ editor.lang.common.targetNew , '_blank'],
1129
+ [ editor.lang.common.targetTop , '_top'],
1130
+ [ editor.lang.common.targetSelf , '_self'],
1131
+ [ editor.lang.common.targetParent , '_parent']
1132
+ ],
1133
+ setup : function( type, element )
1134
+ {
1135
+ if ( type == LINK )
1136
+ this.setValue( element.getAttribute( 'target' ) );
1137
+ },
1138
+ commit : function( type, element )
1139
+ {
1140
+ if ( type == LINK )
1141
+ {
1142
+ if ( this.getValue() || this.isChanged() )
1143
+ element.setAttribute( 'target', this.getValue() );
1144
+ }
1145
+ }
1146
+ }
1147
+ ]
1148
+ },
1149
+ {
1150
+ id : 'Upload',
1151
+ hidden : true,
1152
+ filebrowser : 'uploadButton',
1153
+ label : editor.lang.image.upload,
1154
+ elements :
1155
+ [
1156
+ {
1157
+ type : 'file',
1158
+ id : 'upload',
1159
+ label : editor.lang.image.btnUpload,
1160
+ style: 'height:40px',
1161
+ size : 38
1162
+ },
1163
+ {
1164
+ type : 'fileButton',
1165
+ id : 'uploadButton',
1166
+ filebrowser : 'info:txtUrl',
1167
+ label : editor.lang.image.btnUpload,
1168
+ 'for' : [ 'Upload', 'upload' ]
1169
+ }
1170
+ ]
1171
+ },
1172
+ {
1173
+ id : 'advanced',
1174
+ label : editor.lang.common.advancedTab,
1175
+ elements :
1176
+ [
1177
+ {
1178
+ type : 'hbox',
1179
+ widths : [ '50%', '25%', '25%' ],
1180
+ children :
1181
+ [
1182
+ {
1183
+ type : 'text',
1184
+ id : 'linkId',
1185
+ label : editor.lang.common.id,
1186
+ setup : function( type, element )
1187
+ {
1188
+ if ( type == IMAGE )
1189
+ this.setValue( element.getAttribute( 'id' ) );
1190
+ },
1191
+ commit : function( type, element )
1192
+ {
1193
+ if ( type == IMAGE )
1194
+ {
1195
+ if ( this.getValue() || this.isChanged() )
1196
+ element.setAttribute( 'id', this.getValue() );
1197
+ }
1198
+ }
1199
+ },
1200
+ {
1201
+ id : 'cmbLangDir',
1202
+ type : 'select',
1203
+ style : 'width : 100px;',
1204
+ label : editor.lang.common.langDir,
1205
+ 'default' : '',
1206
+ items :
1207
+ [
1208
+ [ editor.lang.common.notSet, '' ],
1209
+ [ editor.lang.common.langDirLtr, 'ltr' ],
1210
+ [ editor.lang.common.langDirRtl, 'rtl' ]
1211
+ ],
1212
+ setup : function( type, element )
1213
+ {
1214
+ if ( type == IMAGE )
1215
+ this.setValue( element.getAttribute( 'dir' ) );
1216
+ },
1217
+ commit : function( type, element )
1218
+ {
1219
+ if ( type == IMAGE )
1220
+ {
1221
+ if ( this.getValue() || this.isChanged() )
1222
+ element.setAttribute( 'dir', this.getValue() );
1223
+ }
1224
+ }
1225
+ },
1226
+ {
1227
+ type : 'text',
1228
+ id : 'txtLangCode',
1229
+ label : editor.lang.common.langCode,
1230
+ 'default' : '',
1231
+ setup : function( type, element )
1232
+ {
1233
+ if ( type == IMAGE )
1234
+ this.setValue( element.getAttribute( 'lang' ) );
1235
+ },
1236
+ commit : function( type, element )
1237
+ {
1238
+ if ( type == IMAGE )
1239
+ {
1240
+ if ( this.getValue() || this.isChanged() )
1241
+ element.setAttribute( 'lang', this.getValue() );
1242
+ }
1243
+ }
1244
+ }
1245
+ ]
1246
+ },
1247
+ {
1248
+ type : 'text',
1249
+ id : 'txtGenLongDescr',
1250
+ label : editor.lang.common.longDescr,
1251
+ setup : function( type, element )
1252
+ {
1253
+ if ( type == IMAGE )
1254
+ this.setValue( element.getAttribute( 'longDesc' ) );
1255
+ },
1256
+ commit : function( type, element )
1257
+ {
1258
+ if ( type == IMAGE )
1259
+ {
1260
+ if ( this.getValue() || this.isChanged() )
1261
+ element.setAttribute( 'longDesc', this.getValue() );
1262
+ }
1263
+ }
1264
+ },
1265
+ {
1266
+ type : 'hbox',
1267
+ widths : [ '50%', '50%' ],
1268
+ children :
1269
+ [
1270
+ {
1271
+ type : 'text',
1272
+ id : 'txtGenClass',
1273
+ label : editor.lang.common.cssClass,
1274
+ 'default' : '',
1275
+ setup : function( type, element )
1276
+ {
1277
+ if ( type == IMAGE )
1278
+ this.setValue( element.getAttribute( 'class' ) );
1279
+ },
1280
+ commit : function( type, element )
1281
+ {
1282
+ if ( type == IMAGE )
1283
+ {
1284
+ if ( this.getValue() || this.isChanged() )
1285
+ element.setAttribute( 'class', this.getValue() );
1286
+ }
1287
+ }
1288
+ },
1289
+ {
1290
+ type : 'text',
1291
+ id : 'txtGenTitle',
1292
+ label : editor.lang.common.advisoryTitle,
1293
+ 'default' : '',
1294
+ onChange : function()
1295
+ {
1296
+ updatePreview( this.getDialog() );
1297
+ },
1298
+ setup : function( type, element )
1299
+ {
1300
+ if ( type == IMAGE )
1301
+ this.setValue( element.getAttribute( 'title' ) );
1302
+ },
1303
+ commit : function( type, element )
1304
+ {
1305
+ if ( type == IMAGE )
1306
+ {
1307
+ if ( this.getValue() || this.isChanged() )
1308
+ element.setAttribute( 'title', this.getValue() );
1309
+ }
1310
+ else if ( type == PREVIEW )
1311
+ {
1312
+ element.setAttribute( 'title', this.getValue() );
1313
+ }
1314
+ else if ( type == CLEANUP )
1315
+ {
1316
+ element.removeAttribute( 'title' );
1317
+ }
1318
+ }
1319
+ }
1320
+ ]
1321
+ },
1322
+ {
1323
+ type : 'text',
1324
+ id : 'txtdlgGenStyle',
1325
+ label : editor.lang.common.cssStyle,
1326
+ 'default' : '',
1327
+ setup : function( type, element )
1328
+ {
1329
+ if ( type == IMAGE )
1330
+ {
1331
+ var genStyle = element.getAttribute( 'style' );
1332
+ if ( !genStyle && element.$.style.cssText )
1333
+ genStyle = element.$.style.cssText;
1334
+ this.setValue( genStyle );
1335
+
1336
+ var height = element.$.style.height,
1337
+ width = element.$.style.width,
1338
+ aMatchH = ( height ? height : '' ).match( regexGetSize ),
1339
+ aMatchW = ( width ? width : '').match( regexGetSize );
1340
+
1341
+ this.attributesInStyle =
1342
+ {
1343
+ height : !!aMatchH,
1344
+ width : !!aMatchW
1345
+ };
1346
+ }
1347
+ },
1348
+ onChange : function ()
1349
+ {
1350
+ commitInternally.call( this,
1351
+ [ 'info:cmbFloat', 'info:cmbAlign',
1352
+ 'info:txtVSpace', 'info:txtHSpace',
1353
+ 'info:txtBorder',
1354
+ 'info:txtWidth', 'info:txtHeight' ] );
1355
+ updatePreview( this );
1356
+ },
1357
+ commit : function( type, element )
1358
+ {
1359
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) )
1360
+ {
1361
+ element.setAttribute( 'style', this.getValue() );
1362
+ }
1363
+ }
1364
+ }
1365
+ ]
1366
+ }
1367
+ ]
1368
+ };
1369
+ };
1370
+
1371
+ CKEDITOR.dialog.add( 'image', function( editor )
1372
+ {
1373
+ return imageDialog( editor, 'image' );
1374
+ });
1375
+
1376
+ CKEDITOR.dialog.add( 'imagebutton', function( editor )
1377
+ {
1378
+ return imageDialog( editor, 'imagebutton' );
1379
+ });
1380
+ })();