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,29 @@
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
+ * @file Special Character plugin
8
+ */
9
+
10
+ CKEDITOR.plugins.add( 'specialchar',
11
+ {
12
+ init : function( editor )
13
+ {
14
+ var pluginName = 'specialchar';
15
+
16
+ // Register the dialog.
17
+ CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
18
+
19
+ // Register the command.
20
+ editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
21
+
22
+ // Register the toolbar button.
23
+ editor.ui.addButton( 'SpecialChar',
24
+ {
25
+ label : editor.lang.specialChar.toolbar,
26
+ command : pluginName
27
+ });
28
+ }
29
+ } );
@@ -0,0 +1,1442 @@
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( 'styles',
7
+ {
8
+ requires : [ 'selection' ]
9
+ });
10
+
11
+ /**
12
+ * Registers a function to be called whenever a style changes its state in the
13
+ * editing area. The current state is passed to the function. The possible
14
+ * states are {@link CKEDITOR.TRISTATE_ON} and {@link CKEDITOR.TRISTATE_OFF}.
15
+ * @param {CKEDITOR.style} The style to be watched.
16
+ * @param {Function} The function to be called when the style state changes.
17
+ * @example
18
+ * // Create a style object for the <b> element.
19
+ * var style = new CKEDITOR.style( { element : 'b' } );
20
+ * var editor = CKEDITOR.instances.editor1;
21
+ * editor.attachStyleStateChange( style, function( state )
22
+ * {
23
+ * if ( state == CKEDITOR.TRISTATE_ON )
24
+ * alert( 'The current state for the B element is ON' );
25
+ * else
26
+ * alert( 'The current state for the B element is OFF' );
27
+ * });
28
+ */
29
+ CKEDITOR.editor.prototype.attachStyleStateChange = function( style, callback )
30
+ {
31
+ // Try to get the list of attached callbacks.
32
+ var styleStateChangeCallbacks = this._.styleStateChangeCallbacks;
33
+
34
+ // If it doesn't exist, it means this is the first call. So, let's create
35
+ // all the structure to manage the style checks and the callback calls.
36
+ if ( !styleStateChangeCallbacks )
37
+ {
38
+ // Create the callbacks array.
39
+ styleStateChangeCallbacks = this._.styleStateChangeCallbacks = [];
40
+
41
+ // Attach to the selectionChange event, so we can check the styles at
42
+ // that point.
43
+ this.on( 'selectionChange', function( ev )
44
+ {
45
+ // Loop throw all registered callbacks.
46
+ for ( var i = 0 ; i < styleStateChangeCallbacks.length ; i++ )
47
+ {
48
+ var callback = styleStateChangeCallbacks[ i ];
49
+
50
+ // Check the current state for the style defined for that
51
+ // callback.
52
+ var currentState = callback.style.checkActive( ev.data.path ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
53
+
54
+ // If the state changed since the last check.
55
+ if ( callback.state !== currentState )
56
+ {
57
+ // Call the callback function, passing the current
58
+ // state to it.
59
+ callback.fn.call( this, currentState );
60
+
61
+ // Save the current state, so it can be compared next
62
+ // time.
63
+ callback.state !== currentState;
64
+ }
65
+ }
66
+ });
67
+ }
68
+
69
+ // Save the callback info, so it can be checked on the next occurence of
70
+ // selectionChange.
71
+ styleStateChangeCallbacks.push( { style : style, fn : callback } );
72
+ };
73
+
74
+ CKEDITOR.STYLE_BLOCK = 1;
75
+ CKEDITOR.STYLE_INLINE = 2;
76
+ CKEDITOR.STYLE_OBJECT = 3;
77
+
78
+ (function()
79
+ {
80
+ var blockElements = { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 };
81
+ var objectElements = { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1};
82
+
83
+ var semicolonFixRegex = /\s*(?:;\s*|$)/;
84
+
85
+ CKEDITOR.style = function( styleDefinition, variablesValues )
86
+ {
87
+ if ( variablesValues )
88
+ {
89
+ styleDefinition = CKEDITOR.tools.clone( styleDefinition );
90
+
91
+ replaceVariables( styleDefinition.attributes, variablesValues );
92
+ replaceVariables( styleDefinition.styles, variablesValues );
93
+ }
94
+
95
+ var element = this.element = ( styleDefinition.element || '*' ).toLowerCase();
96
+
97
+ this.type =
98
+ ( element == '#' || blockElements[ element ] ) ?
99
+ CKEDITOR.STYLE_BLOCK
100
+ : objectElements[ element ] ?
101
+ CKEDITOR.STYLE_OBJECT
102
+ :
103
+ CKEDITOR.STYLE_INLINE;
104
+
105
+ this._ =
106
+ {
107
+ definition : styleDefinition
108
+ };
109
+ };
110
+
111
+ CKEDITOR.style.prototype =
112
+ {
113
+ apply : function( document )
114
+ {
115
+ applyStyle.call( this, document, false );
116
+ },
117
+
118
+ remove : function( document )
119
+ {
120
+ applyStyle.call( this, document, true );
121
+ },
122
+
123
+ applyToRange : function( range )
124
+ {
125
+ return ( this.applyToRange =
126
+ this.type == CKEDITOR.STYLE_INLINE ?
127
+ applyInlineStyle
128
+ : this.type == CKEDITOR.STYLE_BLOCK ?
129
+ applyBlockStyle
130
+ : this.type == CKEDITOR.STYLE_OBJECT ?
131
+ applyObjectStyle
132
+ : null ).call( this, range );
133
+ },
134
+
135
+ removeFromRange : function( range )
136
+ {
137
+ return ( this.removeFromRange =
138
+ this.type == CKEDITOR.STYLE_INLINE ?
139
+ removeInlineStyle
140
+ : null ).call( this, range );
141
+ },
142
+
143
+ applyToObject : function( element )
144
+ {
145
+ setupElement( element, this );
146
+ },
147
+
148
+ /**
149
+ * Get the style state inside an element path. Returns "true" if the
150
+ * element is active in the path.
151
+ */
152
+ checkActive : function( elementPath )
153
+ {
154
+ switch ( this.type )
155
+ {
156
+ case CKEDITOR.STYLE_BLOCK :
157
+ return this.checkElementRemovable( elementPath.block || elementPath.blockLimit, true );
158
+
159
+ case CKEDITOR.STYLE_OBJECT :
160
+ case CKEDITOR.STYLE_INLINE :
161
+
162
+ var elements = elementPath.elements;
163
+
164
+ for ( var i = 0, element ; i < elements.length ; i++ )
165
+ {
166
+ element = elements[ i ];
167
+
168
+ if ( this.type == CKEDITOR.STYLE_INLINE
169
+ && ( element == elementPath.block || element == elementPath.blockLimit ) )
170
+ continue;
171
+
172
+ if( this.type == CKEDITOR.STYLE_OBJECT
173
+ && !( element.getName() in objectElements ) )
174
+ continue;
175
+
176
+ if ( this.checkElementRemovable( element, true ) )
177
+ return true;
178
+ }
179
+ }
180
+ return false;
181
+ },
182
+
183
+ checkApplicable : function( elementPath )
184
+ {
185
+ switch ( this.type )
186
+ {
187
+ case CKEDITOR.STYLE_INLINE :
188
+ case CKEDITOR.STYLE_BLOCK :
189
+ break;
190
+
191
+ case CKEDITOR.STYLE_OBJECT :
192
+ return elementPath.lastElement.getAscendant( this.element, true );
193
+ }
194
+
195
+ return true;
196
+ },
197
+
198
+ // Checks if an element, or any of its attributes, is removable by the
199
+ // current style definition.
200
+ checkElementRemovable : function( element, fullMatch )
201
+ {
202
+ if ( !element )
203
+ return false;
204
+
205
+ var def = this._.definition,
206
+ attribs;
207
+
208
+ // If the element name is the same as the style name.
209
+ if ( element.getName() == this.element )
210
+ {
211
+ // If no attributes are defined in the element.
212
+ if ( !fullMatch && !element.hasAttributes() )
213
+ return true;
214
+
215
+ attribs = getAttributesForComparison( def );
216
+
217
+ if ( attribs._length )
218
+ {
219
+ for ( var attName in attribs )
220
+ {
221
+ if ( attName == '_length' )
222
+ continue;
223
+
224
+ var elementAttr = element.getAttribute( attName ) || '';
225
+ if ( attName == 'style' ?
226
+ compareCssText( attribs[ attName ], normalizeCssText( elementAttr, false ) )
227
+ : attribs[ attName ] == elementAttr )
228
+ {
229
+ if ( !fullMatch )
230
+ return true;
231
+ }
232
+ else if ( fullMatch )
233
+ return false;
234
+ }
235
+ if ( fullMatch )
236
+ return true;
237
+ }
238
+ else
239
+ return true;
240
+ }
241
+
242
+ // Check if the element can be somehow overriden.
243
+ var override = getOverrides( this )[ element.getName() ] ;
244
+ if ( override )
245
+ {
246
+ // If no attributes have been defined, remove the element.
247
+ if ( !( attribs = override.attributes ) )
248
+ return true;
249
+
250
+ for ( var i = 0 ; i < attribs.length ; i++ )
251
+ {
252
+ attName = attribs[i][0];
253
+ var actualAttrValue = element.getAttribute( attName );
254
+ if ( actualAttrValue )
255
+ {
256
+ var attValue = attribs[i][1];
257
+
258
+ // Remove the attribute if:
259
+ // - The override definition value is null;
260
+ // - The override definition value is a string that
261
+ // matches the attribute value exactly.
262
+ // - The override definition value is a regex that
263
+ // has matches in the attribute value.
264
+ if ( attValue === null ||
265
+ ( typeof attValue == 'string' && actualAttrValue == attValue ) ||
266
+ attValue.test( actualAttrValue ) )
267
+ return true;
268
+ }
269
+ }
270
+ }
271
+ return false;
272
+ },
273
+
274
+ // Builds the preview HTML based on the styles definition.
275
+ buildPreview : function()
276
+ {
277
+ var styleDefinition = this._.definition,
278
+ html = [],
279
+ elementName = styleDefinition.element;
280
+
281
+ // Avoid <bdo> in the preview.
282
+ if ( elementName == 'bdo' )
283
+ elementName = 'span';
284
+
285
+ html = [ '<', elementName ];
286
+
287
+ // Assign all defined attributes.
288
+ var attribs = styleDefinition.attributes;
289
+ if ( attribs )
290
+ {
291
+ for ( var att in attribs )
292
+ {
293
+ html.push( ' ', att, '="', attribs[ att ], '"' );
294
+ }
295
+ }
296
+
297
+ // Assign the style attribute.
298
+ var cssStyle = CKEDITOR.style.getStyleText( styleDefinition );
299
+ if ( cssStyle )
300
+ html.push( ' style="', cssStyle, '"' );
301
+
302
+ html.push( '>', styleDefinition.name, '</', elementName, '>' );
303
+
304
+ return html.join( '' );
305
+ }
306
+ };
307
+
308
+ // Build the cssText based on the styles definition.
309
+ CKEDITOR.style.getStyleText = function( styleDefinition )
310
+ {
311
+ // If we have already computed it, just return it.
312
+ var stylesDef = styleDefinition._ST;
313
+ if ( stylesDef )
314
+ return stylesDef;
315
+
316
+ stylesDef = styleDefinition.styles;
317
+
318
+ // Builds the StyleText.
319
+ var stylesText = ( styleDefinition.attributes && styleDefinition.attributes[ 'style' ] ) || '',
320
+ specialStylesText = '';
321
+
322
+ if ( stylesText.length )
323
+ stylesText = stylesText.replace( semicolonFixRegex, ';' );
324
+
325
+ for ( var style in stylesDef )
326
+ {
327
+ var styleVal = stylesDef[ style ],
328
+ text = ( style + ':' + styleVal ).replace( semicolonFixRegex, ';' );
329
+
330
+ // Some browsers don't support 'inherit' property value, leave them intact. (#5242)
331
+ if ( styleVal == 'inherit' )
332
+ specialStylesText += text;
333
+ else
334
+ stylesText += text;
335
+ }
336
+
337
+ // Browsers make some changes to the style when applying them. So, here
338
+ // we normalize it to the browser format.
339
+ if ( stylesText.length )
340
+ stylesText = normalizeCssText( stylesText );
341
+
342
+ stylesText += specialStylesText;
343
+
344
+ // Return it, saving it to the next request.
345
+ return ( styleDefinition._ST = stylesText );
346
+ };
347
+
348
+ function applyInlineStyle( range )
349
+ {
350
+ var document = range.document;
351
+
352
+ if ( range.collapsed )
353
+ {
354
+ // Create the element to be inserted in the DOM.
355
+ var collapsedElement = getElement( this, document );
356
+
357
+ // Insert the empty element into the DOM at the range position.
358
+ range.insertNode( collapsedElement );
359
+
360
+ // Place the selection right inside the empty element.
361
+ range.moveToPosition( collapsedElement, CKEDITOR.POSITION_BEFORE_END );
362
+
363
+ return;
364
+ }
365
+
366
+ var elementName = this.element;
367
+ var def = this._.definition;
368
+ var isUnknownElement;
369
+
370
+ // Get the DTD definition for the element. Defaults to "span".
371
+ var dtd = CKEDITOR.dtd[ elementName ] || ( isUnknownElement = true, CKEDITOR.dtd.span );
372
+
373
+ // Bookmark the range so we can re-select it after processing.
374
+ var bookmark = range.createBookmark();
375
+
376
+ // Expand the range.
377
+ range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
378
+ range.trim();
379
+
380
+ // Get the first node to be processed and the last, which concludes the
381
+ // processing.
382
+ var boundaryNodes = range.getBoundaryNodes();
383
+ var firstNode = boundaryNodes.startNode;
384
+ var lastNode = boundaryNodes.endNode.getNextSourceNode( true );
385
+
386
+ // Probably the document end is reached, we need a marker node.
387
+ if ( !lastNode )
388
+ {
389
+ var marker;
390
+ lastNode = marker = document.createText( '' );
391
+ lastNode.insertAfter( range.endContainer );
392
+ }
393
+ // The detection algorithm below skips the contents inside bookmark nodes, so
394
+ // we'll need to make sure lastNode isn't the &nbsp; inside a bookmark node.
395
+ var lastParent = lastNode.getParent();
396
+ if ( lastParent && lastParent.getAttribute( '_fck_bookmark' ) )
397
+ lastNode = lastParent;
398
+
399
+ if ( lastNode.equals( firstNode ) )
400
+ {
401
+ // If the last node is the same as the the first one, we must move
402
+ // it to the next one, otherwise the first one will not be
403
+ // processed.
404
+ lastNode = lastNode.getNextSourceNode( true );
405
+
406
+ // It may happen that there are no more nodes after it (the end of
407
+ // the document), so we must add something there to make our code
408
+ // simpler.
409
+ if ( !lastNode )
410
+ {
411
+ lastNode = marker = document.createText( '' );
412
+ lastNode.insertAfter( firstNode );
413
+ }
414
+ }
415
+
416
+ var currentNode = firstNode;
417
+
418
+ var styleRange;
419
+
420
+ while ( currentNode )
421
+ {
422
+ var applyStyle = false;
423
+
424
+ if ( currentNode.equals( lastNode ) )
425
+ {
426
+ currentNode = null;
427
+ applyStyle = true;
428
+ }
429
+ else
430
+ {
431
+ var nodeType = currentNode.type;
432
+ var nodeName = nodeType == CKEDITOR.NODE_ELEMENT ? currentNode.getName() : null;
433
+
434
+ if ( nodeName && currentNode.getAttribute( '_fck_bookmark' ) )
435
+ {
436
+ currentNode = currentNode.getNextSourceNode( true );
437
+ continue;
438
+ }
439
+
440
+ // Check if the current node can be a child of the style element.
441
+ if ( !nodeName || ( dtd[ nodeName ]
442
+ && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
443
+ && ( !def.childRule || def.childRule( currentNode ) ) ) )
444
+ {
445
+ var currentParent = currentNode.getParent();
446
+
447
+ // Check if the style element can be a child of the current
448
+ // node parent or if the element is not defined in the DTD.
449
+ if ( currentParent
450
+ && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement )
451
+ && ( !def.parentRule || def.parentRule( currentParent ) ) )
452
+ {
453
+ // This node will be part of our range, so if it has not
454
+ // been started, place its start right before the node.
455
+ // In the case of an element node, it will be included
456
+ // only if it is entirely inside the range.
457
+ if ( !styleRange && ( !nodeName || !CKEDITOR.dtd.$removeEmpty[ nodeName ] || ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) ) )
458
+ {
459
+ styleRange = new CKEDITOR.dom.range( document );
460
+ styleRange.setStartBefore( currentNode );
461
+ }
462
+
463
+ // Non element nodes, or empty elements can be added
464
+ // completely to the range.
465
+ if ( nodeType == CKEDITOR.NODE_TEXT || ( nodeType == CKEDITOR.NODE_ELEMENT && !currentNode.getChildCount() ) )
466
+ {
467
+ var includedNode = currentNode;
468
+ var parentNode;
469
+
470
+ // This node is about to be included completelly, but,
471
+ // if this is the last node in its parent, we must also
472
+ // check if the parent itself can be added completelly
473
+ // to the range.
474
+ while ( !includedNode.$.nextSibling
475
+ && ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] )
476
+ && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
477
+ && ( !def.childRule || def.childRule( parentNode ) ) )
478
+ {
479
+ includedNode = parentNode;
480
+ }
481
+
482
+ styleRange.setEndAfter( includedNode );
483
+
484
+ // If the included node still is the last node in its
485
+ // parent, it means that the parent can't be included
486
+ // in this style DTD, so apply the style immediately.
487
+ if ( !includedNode.$.nextSibling )
488
+ applyStyle = true;
489
+
490
+ }
491
+ }
492
+ else
493
+ applyStyle = true;
494
+ }
495
+ else
496
+ applyStyle = true;
497
+
498
+ // Get the next node to be processed.
499
+ currentNode = currentNode.getNextSourceNode();
500
+ }
501
+
502
+ // Apply the style if we have something to which apply it.
503
+ if ( applyStyle && styleRange && !styleRange.collapsed )
504
+ {
505
+ // Build the style element, based on the style object definition.
506
+ var styleNode = getElement( this, document );
507
+
508
+ // Get the element that holds the entire range.
509
+ var parent = styleRange.getCommonAncestor();
510
+
511
+ // Loop through the parents, removing the redundant attributes
512
+ // from the element to be applied.
513
+ while ( styleNode && parent )
514
+ {
515
+ if ( parent.getName() == elementName )
516
+ {
517
+ for ( var attName in def.attributes )
518
+ {
519
+ if ( styleNode.getAttribute( attName ) == parent.getAttribute( attName ) )
520
+ styleNode.removeAttribute( attName );
521
+ }
522
+
523
+ for ( var styleName in def.styles )
524
+ {
525
+ if ( styleNode.getStyle( styleName ) == parent.getStyle( styleName ) )
526
+ styleNode.removeStyle( styleName );
527
+ }
528
+
529
+ if ( !styleNode.hasAttributes() )
530
+ {
531
+ styleNode = null;
532
+ break;
533
+ }
534
+ }
535
+
536
+ parent = parent.getParent();
537
+ }
538
+
539
+ if ( styleNode )
540
+ {
541
+ // Move the contents of the range to the style element.
542
+ styleRange.extractContents().appendTo( styleNode );
543
+
544
+ // Here we do some cleanup, removing all duplicated
545
+ // elements from the style element.
546
+ removeFromInsideElement( this, styleNode );
547
+
548
+ // Insert it into the range position (it is collapsed after
549
+ // extractContents.
550
+ styleRange.insertNode( styleNode );
551
+
552
+ // Let's merge our new style with its neighbors, if possible.
553
+ mergeSiblings( styleNode );
554
+
555
+ // As the style system breaks text nodes constantly, let's normalize
556
+ // things for performance.
557
+ // With IE, some paragraphs get broken when calling normalize()
558
+ // repeatedly. Also, for IE, we must normalize body, not documentElement.
559
+ // IE is also known for having a "crash effect" with normalize().
560
+ // We should try to normalize with IE too in some way, somewhere.
561
+ if ( !CKEDITOR.env.ie )
562
+ styleNode.$.normalize();
563
+ }
564
+
565
+ // Style applied, let's release the range, so it gets
566
+ // re-initialization in the next loop.
567
+ styleRange = null;
568
+ }
569
+ }
570
+
571
+ // Remove the temporary marking node.(#4111)
572
+ marker && marker.remove();
573
+ range.moveToBookmark( bookmark );
574
+ // Minimize the result range to exclude empty text nodes. (#5374)
575
+ range.shrink( CKEDITOR.SHRINK_TEXT );
576
+ }
577
+
578
+ function removeInlineStyle( range )
579
+ {
580
+ /*
581
+ * Make sure our range has included all "collpased" parent inline nodes so
582
+ * that our operation logic can be simpler.
583
+ */
584
+ range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
585
+
586
+ var bookmark = range.createBookmark(),
587
+ startNode = bookmark.startNode;
588
+
589
+ if ( range.collapsed )
590
+ {
591
+
592
+ var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ),
593
+ // The topmost element in elementspatch which we should jump out of.
594
+ boundaryElement;
595
+
596
+
597
+ for ( var i = 0, element ; i < startPath.elements.length
598
+ && ( element = startPath.elements[i] ) ; i++ )
599
+ {
600
+ /*
601
+ * 1. If it's collaped inside text nodes, try to remove the style from the whole element.
602
+ *
603
+ * 2. Otherwise if it's collapsed on element boundaries, moving the selection
604
+ * outside the styles instead of removing the whole tag,
605
+ * also make sure other inner styles were well preserverd.(#3309)
606
+ */
607
+ if ( element == startPath.block || element == startPath.blockLimit )
608
+ break;
609
+
610
+ if ( this.checkElementRemovable( element ) )
611
+ {
612
+ var endOfElement = range.checkBoundaryOfElement( element, CKEDITOR.END ),
613
+ startOfElement = !endOfElement && range.checkBoundaryOfElement( element, CKEDITOR.START );
614
+ if ( startOfElement || endOfElement )
615
+ {
616
+ boundaryElement = element;
617
+ boundaryElement.match = startOfElement ? 'start' : 'end';
618
+ }
619
+ else
620
+ {
621
+ /*
622
+ * Before removing the style node, there may be a sibling to the style node
623
+ * that's exactly the same to the one to be removed. To the user, it makes
624
+ * no difference that they're separate entities in the DOM tree. So, merge
625
+ * them before removal.
626
+ */
627
+ mergeSiblings( element );
628
+ removeFromElement( this, element );
629
+
630
+ }
631
+ }
632
+ }
633
+
634
+ // Re-create the style tree after/before the boundary element,
635
+ // the replication start from bookmark start node to define the
636
+ // new range.
637
+ if ( boundaryElement )
638
+ {
639
+ var clonedElement = startNode;
640
+ for ( i = 0 ;; i++ )
641
+ {
642
+ var newElement = startPath.elements[ i ];
643
+ if ( newElement.equals( boundaryElement ) )
644
+ break;
645
+ // Avoid copying any matched element.
646
+ else if ( newElement.match )
647
+ continue;
648
+ else
649
+ newElement = newElement.clone();
650
+ newElement.append( clonedElement );
651
+ clonedElement = newElement;
652
+ }
653
+ clonedElement[ boundaryElement.match == 'start' ?
654
+ 'insertBefore' : 'insertAfter' ]( boundaryElement );
655
+ }
656
+ }
657
+ else
658
+ {
659
+ /*
660
+ * Now our range isn't collapsed. Lets walk from the start node to the end
661
+ * node via DFS and remove the styles one-by-one.
662
+ */
663
+ var endNode = bookmark.endNode,
664
+ me = this;
665
+
666
+ /*
667
+ * Find out the style ancestor that needs to be broken down at startNode
668
+ * and endNode.
669
+ */
670
+ function breakNodes()
671
+ {
672
+ var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ),
673
+ endPath = new CKEDITOR.dom.elementPath( endNode.getParent() ),
674
+ breakStart = null,
675
+ breakEnd = null;
676
+ for ( var i = 0 ; i < startPath.elements.length ; i++ )
677
+ {
678
+ var element = startPath.elements[ i ];
679
+
680
+ if ( element == startPath.block || element == startPath.blockLimit )
681
+ break;
682
+
683
+ if ( me.checkElementRemovable( element ) )
684
+ breakStart = element;
685
+ }
686
+ for ( i = 0 ; i < endPath.elements.length ; i++ )
687
+ {
688
+ element = endPath.elements[ i ];
689
+
690
+ if ( element == endPath.block || element == endPath.blockLimit )
691
+ break;
692
+
693
+ if ( me.checkElementRemovable( element ) )
694
+ breakEnd = element;
695
+ }
696
+
697
+ if ( breakEnd )
698
+ endNode.breakParent( breakEnd );
699
+ if ( breakStart )
700
+ startNode.breakParent( breakStart );
701
+ }
702
+ breakNodes();
703
+
704
+ // Now, do the DFS walk.
705
+ var currentNode = startNode.getNext();
706
+ while ( !currentNode.equals( endNode ) )
707
+ {
708
+ /*
709
+ * Need to get the next node first because removeFromElement() can remove
710
+ * the current node from DOM tree.
711
+ */
712
+ var nextNode = currentNode.getNextSourceNode();
713
+ if ( currentNode.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable( currentNode ) )
714
+ {
715
+ // Remove style from element or overriding element.
716
+ if ( currentNode.getName() == this.element )
717
+ removeFromElement( this, currentNode );
718
+ else
719
+ removeOverrides( currentNode, getOverrides( this )[ currentNode.getName() ] );
720
+
721
+ /*
722
+ * removeFromElement() may have merged the next node with something before
723
+ * the startNode via mergeSiblings(). In that case, the nextNode would
724
+ * contain startNode and we'll have to call breakNodes() again and also
725
+ * reassign the nextNode to something after startNode.
726
+ */
727
+ if ( nextNode.type == CKEDITOR.NODE_ELEMENT && nextNode.contains( startNode ) )
728
+ {
729
+ breakNodes();
730
+ nextNode = startNode.getNext();
731
+ }
732
+ }
733
+ currentNode = nextNode;
734
+ }
735
+ }
736
+
737
+ range.moveToBookmark( bookmark );
738
+ }
739
+
740
+ function applyObjectStyle( range )
741
+ {
742
+ var root = range.getCommonAncestor( true, true ),
743
+ element = root.getAscendant( this.element, true );
744
+ element && setupElement( element, this );
745
+ }
746
+
747
+ function applyBlockStyle( range )
748
+ {
749
+ // Serializible bookmarks is needed here since
750
+ // elements may be merged.
751
+ var bookmark = range.createBookmark( true );
752
+
753
+ var iterator = range.createIterator();
754
+ iterator.enforceRealBlocks = true;
755
+
756
+ var block;
757
+ var doc = range.document;
758
+ var previousPreBlock;
759
+
760
+ while ( ( block = iterator.getNextParagraph() ) ) // Only one =
761
+ {
762
+ var newBlock = getElement( this, doc );
763
+ replaceBlock( block, newBlock );
764
+ }
765
+
766
+ range.moveToBookmark( bookmark );
767
+ }
768
+
769
+ // Replace the original block with new one, with special treatment
770
+ // for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent
771
+ // when necessary.(#3188)
772
+ function replaceBlock( block, newBlock )
773
+ {
774
+ var newBlockIsPre = newBlock.is( 'pre' );
775
+ var blockIsPre = block.is( 'pre' );
776
+
777
+ var isToPre = newBlockIsPre && !blockIsPre;
778
+ var isFromPre = !newBlockIsPre && blockIsPre;
779
+
780
+ if ( isToPre )
781
+ newBlock = toPre( block, newBlock );
782
+ else if ( isFromPre )
783
+ // Split big <pre> into pieces before start to convert.
784
+ newBlock = fromPres( splitIntoPres( block ), newBlock );
785
+ else
786
+ block.moveChildren( newBlock );
787
+
788
+ newBlock.replace( block );
789
+
790
+ if ( newBlockIsPre )
791
+ {
792
+ // Merge previous <pre> blocks.
793
+ mergePre( newBlock );
794
+ }
795
+ }
796
+
797
+ /**
798
+ * Merge a <pre> block with a previous sibling if available.
799
+ */
800
+ function mergePre( preBlock )
801
+ {
802
+ var previousBlock;
803
+ if ( !( ( previousBlock = preBlock.getPreviousSourceNode( true, CKEDITOR.NODE_ELEMENT ) )
804
+ && previousBlock.is
805
+ && previousBlock.is( 'pre') ) )
806
+ return;
807
+
808
+ // Merge the previous <pre> block contents into the current <pre>
809
+ // block.
810
+ //
811
+ // Another thing to be careful here is that currentBlock might contain
812
+ // a '\n' at the beginning, and previousBlock might contain a '\n'
813
+ // towards the end. These new lines are not normally displayed but they
814
+ // become visible after merging.
815
+ var mergedHtml = replace( previousBlock.getHtml(), /\n$/, '' ) + '\n\n' +
816
+ replace( preBlock.getHtml(), /^\n/, '' ) ;
817
+
818
+ // Krugle: IE normalizes innerHTML from <pre>, breaking whitespaces.
819
+ if ( CKEDITOR.env.ie )
820
+ preBlock.$.outerHTML = '<pre>' + mergedHtml + '</pre>';
821
+ else
822
+ preBlock.setHtml( mergedHtml );
823
+
824
+ previousBlock.remove();
825
+ }
826
+
827
+ /**
828
+ * Split into multiple <pre> blocks separated by double line-break.
829
+ * @param preBlock
830
+ */
831
+ function splitIntoPres( preBlock )
832
+ {
833
+ // Exclude the ones at header OR at tail,
834
+ // and ignore bookmark content between them.
835
+ var duoBrRegex = /(\S\s*)\n(?:\s|(<span[^>]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,
836
+ blockName = preBlock.getName(),
837
+ splitedHtml = replace( preBlock.getOuterHtml(),
838
+ duoBrRegex,
839
+ function( match, charBefore, bookmark )
840
+ {
841
+ return charBefore + '</pre>' + bookmark + '<pre>';
842
+ } );
843
+
844
+ var pres = [];
845
+ splitedHtml.replace( /<pre\b.*?>([\s\S]*?)<\/pre>/gi, function( match, preContent ){
846
+ pres.push( preContent );
847
+ } );
848
+ return pres;
849
+ }
850
+
851
+ // Wrapper function of String::replace without considering of head/tail bookmarks nodes.
852
+ function replace( str, regexp, replacement )
853
+ {
854
+ var headBookmark = '',
855
+ tailBookmark = '';
856
+
857
+ str = str.replace( /(^<span[^>]+_fck_bookmark.*?\/span>)|(<span[^>]+_fck_bookmark.*?\/span>$)/gi,
858
+ function( str, m1, m2 ){
859
+ m1 && ( headBookmark = m1 );
860
+ m2 && ( tailBookmark = m2 );
861
+ return '';
862
+ } );
863
+ return headBookmark + str.replace( regexp, replacement ) + tailBookmark;
864
+ }
865
+ /**
866
+ * Converting a list of <pre> into blocks with format well preserved.
867
+ */
868
+ function fromPres( preHtmls, newBlock )
869
+ {
870
+ var docFrag = new CKEDITOR.dom.documentFragment( newBlock.getDocument() );
871
+ for ( var i = 0 ; i < preHtmls.length ; i++ )
872
+ {
873
+ var blockHtml = preHtmls[ i ];
874
+
875
+ // 1. Trim the first and last line-breaks immediately after and before <pre>,
876
+ // they're not visible.
877
+ blockHtml = blockHtml.replace( /(\r\n|\r)/g, '\n' ) ;
878
+ blockHtml = replace( blockHtml, /^[ \t]*\n/, '' ) ;
879
+ blockHtml = replace( blockHtml, /\n$/, '' ) ;
880
+ // 2. Convert spaces or tabs at the beginning or at the end to &nbsp;
881
+ blockHtml = replace( blockHtml, /^[ \t]+|[ \t]+$/g, function( match, offset, s )
882
+ {
883
+ if ( match.length == 1 ) // one space, preserve it
884
+ return '&nbsp;' ;
885
+ else if ( !offset ) // beginning of block
886
+ return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ';
887
+ else // end of block
888
+ return ' ' + CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 );
889
+ } ) ;
890
+
891
+ // 3. Convert \n to <BR>.
892
+ // 4. Convert contiguous (i.e. non-singular) spaces or tabs to &nbsp;
893
+ blockHtml = blockHtml.replace( /\n/g, '<br>' ) ;
894
+ blockHtml = blockHtml.replace( /[ \t]{2,}/g,
895
+ function ( match )
896
+ {
897
+ return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ' ;
898
+ } ) ;
899
+
900
+ var newBlockClone = newBlock.clone();
901
+ newBlockClone.setHtml( blockHtml );
902
+ docFrag.append( newBlockClone );
903
+ }
904
+ return docFrag;
905
+ }
906
+
907
+ /**
908
+ * Converting from a non-PRE block to a PRE block in formatting operations.
909
+ */
910
+ function toPre( block, newBlock )
911
+ {
912
+ // First trim the block content.
913
+ var preHtml = block.getHtml();
914
+
915
+ // 1. Trim head/tail spaces, they're not visible.
916
+ preHtml = replace( preHtml, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '' );
917
+ // 2. Delete ANSI whitespaces immediately before and after <BR> because
918
+ // they are not visible.
919
+ preHtml = preHtml.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '$1' );
920
+ // 3. Compress other ANSI whitespaces since they're only visible as one
921
+ // single space previously.
922
+ // 4. Convert &nbsp; to spaces since &nbsp; is no longer needed in <PRE>.
923
+ preHtml = preHtml.replace( /([ \t\n\r]+|&nbsp;)/g, ' ' );
924
+ // 5. Convert any <BR /> to \n. This must not be done earlier because
925
+ // the \n would then get compressed.
926
+ preHtml = preHtml.replace( /<br\b[^>]*>/gi, '\n' );
927
+
928
+ // Krugle: IE normalizes innerHTML to <pre>, breaking whitespaces.
929
+ if ( CKEDITOR.env.ie )
930
+ {
931
+ var temp = block.getDocument().createElement( 'div' );
932
+ temp.append( newBlock );
933
+ newBlock.$.outerHTML = '<pre>' + preHtml + '</pre>';
934
+ newBlock = temp.getFirst().remove();
935
+ }
936
+ else
937
+ newBlock.setHtml( preHtml );
938
+
939
+ return newBlock;
940
+ }
941
+
942
+ // Removes a style from an element itself, don't care about its subtree.
943
+ function removeFromElement( style, element )
944
+ {
945
+ var def = style._.definition,
946
+ attributes = CKEDITOR.tools.extend( {}, def.attributes, getOverrides( style )[ element.getName() ] ),
947
+ styles = def.styles,
948
+ // If the style is only about the element itself, we have to remove the element.
949
+ removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles );
950
+
951
+ // Remove definition attributes/style from the elemnt.
952
+ for ( var attName in attributes )
953
+ {
954
+ // The 'class' element value must match (#1318).
955
+ if ( ( attName == 'class' || style._.definition.fullMatch )
956
+ && element.getAttribute( attName ) != normalizeProperty( attName, attributes[ attName ] ) )
957
+ continue;
958
+ removeEmpty = element.hasAttribute( attName );
959
+ element.removeAttribute( attName );
960
+ }
961
+
962
+ for ( var styleName in styles )
963
+ {
964
+ // Full match style insist on having fully equivalence. (#5018)
965
+ if ( style._.definition.fullMatch
966
+ && element.getStyle( styleName ) != normalizeProperty( styleName, styles[ styleName ], true ) )
967
+ continue;
968
+
969
+ removeEmpty = removeEmpty || !!element.getStyle( styleName );
970
+ element.removeStyle( styleName );
971
+ }
972
+
973
+ removeEmpty && removeNoAttribsElement( element );
974
+ }
975
+
976
+ // Removes a style from inside an element.
977
+ function removeFromInsideElement( style, element )
978
+ {
979
+ var def = style._.definition,
980
+ attribs = def.attributes,
981
+ styles = def.styles,
982
+ overrides = getOverrides( style );
983
+
984
+ var innerElements = element.getElementsByTag( style.element );
985
+
986
+ for ( var i = innerElements.count(); --i >= 0 ; )
987
+ removeFromElement( style, innerElements.getItem( i ) );
988
+
989
+ // Now remove any other element with different name that is
990
+ // defined to be overriden.
991
+ for ( var overrideElement in overrides )
992
+ {
993
+ if ( overrideElement != style.element )
994
+ {
995
+ innerElements = element.getElementsByTag( overrideElement ) ;
996
+ for ( i = innerElements.count() - 1 ; i >= 0 ; i-- )
997
+ {
998
+ var innerElement = innerElements.getItem( i );
999
+ removeOverrides( innerElement, overrides[ overrideElement ] ) ;
1000
+ }
1001
+ }
1002
+ }
1003
+
1004
+ }
1005
+
1006
+ /**
1007
+ * Remove overriding styles/attributes from the specific element.
1008
+ * Note: Remove the element if no attributes remain.
1009
+ * @param {Object} element
1010
+ * @param {Object} overrides
1011
+ */
1012
+ function removeOverrides( element, overrides )
1013
+ {
1014
+ var attributes = overrides && overrides.attributes ;
1015
+
1016
+ if ( attributes )
1017
+ {
1018
+ for ( var i = 0 ; i < attributes.length ; i++ )
1019
+ {
1020
+ var attName = attributes[i][0], actualAttrValue ;
1021
+
1022
+ if ( ( actualAttrValue = element.getAttribute( attName ) ) )
1023
+ {
1024
+ var attValue = attributes[i][1] ;
1025
+
1026
+ // Remove the attribute if:
1027
+ // - The override definition value is null ;
1028
+ // - The override definition valie is a string that
1029
+ // matches the attribute value exactly.
1030
+ // - The override definition value is a regex that
1031
+ // has matches in the attribute value.
1032
+ if ( attValue === null ||
1033
+ ( attValue.test && attValue.test( actualAttrValue ) ) ||
1034
+ ( typeof attValue == 'string' && actualAttrValue == attValue ) )
1035
+ element.removeAttribute( attName ) ;
1036
+ }
1037
+ }
1038
+ }
1039
+
1040
+ removeNoAttribsElement( element );
1041
+ }
1042
+
1043
+ // If the element has no more attributes, remove it.
1044
+ function removeNoAttribsElement( element )
1045
+ {
1046
+ // If no more attributes remained in the element, remove it,
1047
+ // leaving its children.
1048
+ if ( !element.hasAttributes() )
1049
+ {
1050
+ // Removing elements may open points where merging is possible,
1051
+ // so let's cache the first and last nodes for later checking.
1052
+ var firstChild = element.getFirst();
1053
+ var lastChild = element.getLast();
1054
+
1055
+ element.remove( true );
1056
+
1057
+ if ( firstChild )
1058
+ {
1059
+ // Check the cached nodes for merging.
1060
+ mergeSiblings( firstChild );
1061
+
1062
+ if ( lastChild && !firstChild.equals( lastChild ) )
1063
+ mergeSiblings( lastChild );
1064
+ }
1065
+ }
1066
+ }
1067
+
1068
+ function mergeSiblings( element )
1069
+ {
1070
+ if ( !element || element.type != CKEDITOR.NODE_ELEMENT || !CKEDITOR.dtd.$removeEmpty[ element.getName() ] )
1071
+ return;
1072
+
1073
+ mergeElements( element, element.getNext(), true );
1074
+ mergeElements( element, element.getPrevious() );
1075
+ }
1076
+
1077
+ function mergeElements( element, sibling, isNext )
1078
+ {
1079
+ if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT )
1080
+ {
1081
+ var hasBookmark = sibling.getAttribute( '_fck_bookmark' );
1082
+
1083
+ if ( hasBookmark )
1084
+ sibling = isNext ? sibling.getNext() : sibling.getPrevious();
1085
+
1086
+ if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT && element.isIdentical( sibling ) )
1087
+ {
1088
+ // Save the last child to be checked too, to merge things like
1089
+ // <b><i></i></b><b><i></i></b> => <b><i></i></b>
1090
+ var innerSibling = isNext ? element.getLast() : element.getFirst();
1091
+
1092
+ if ( hasBookmark )
1093
+ ( isNext ? sibling.getPrevious() : sibling.getNext() ).move( element, !isNext );
1094
+
1095
+ sibling.moveChildren( element, !isNext );
1096
+ sibling.remove();
1097
+
1098
+ // Now check the last inner child (see two comments above).
1099
+ if ( innerSibling )
1100
+ mergeSiblings( innerSibling );
1101
+ }
1102
+ }
1103
+ }
1104
+
1105
+ function getElement( style, targetDocument )
1106
+ {
1107
+ var el;
1108
+
1109
+ var def = style._.definition;
1110
+
1111
+ var elementName = style.element;
1112
+
1113
+ // The "*" element name will always be a span for this function.
1114
+ if ( elementName == '*' )
1115
+ elementName = 'span';
1116
+
1117
+ // Create the element.
1118
+ el = new CKEDITOR.dom.element( elementName, targetDocument );
1119
+
1120
+ return setupElement( el, style );
1121
+ }
1122
+
1123
+ function setupElement( el, style )
1124
+ {
1125
+ var def = style._.definition;
1126
+ var attributes = def.attributes;
1127
+ var styles = CKEDITOR.style.getStyleText( def );
1128
+
1129
+ // Assign all defined attributes.
1130
+ if ( attributes )
1131
+ {
1132
+ for ( var att in attributes )
1133
+ {
1134
+ el.setAttribute( att, attributes[ att ] );
1135
+ }
1136
+ }
1137
+
1138
+ // Assign all defined styles.
1139
+ if ( styles )
1140
+ el.setAttribute( 'style', styles );
1141
+
1142
+ return el;
1143
+ }
1144
+
1145
+ var varRegex = /#\((.+?)\)/g;
1146
+ function replaceVariables( list, variablesValues )
1147
+ {
1148
+ for ( var item in list )
1149
+ {
1150
+ list[ item ] = list[ item ].replace( varRegex, function( match, varName )
1151
+ {
1152
+ return variablesValues[ varName ];
1153
+ });
1154
+ }
1155
+ }
1156
+
1157
+
1158
+ // Returns an object that can be used for style matching comparison.
1159
+ // Attributes names and values are all lowercased, and the styles get
1160
+ // merged with the style attribute.
1161
+ function getAttributesForComparison( styleDefinition )
1162
+ {
1163
+ // If we have already computed it, just return it.
1164
+ var attribs = styleDefinition._AC;
1165
+ if ( attribs )
1166
+ return attribs;
1167
+
1168
+ attribs = {};
1169
+
1170
+ var length = 0;
1171
+
1172
+ // Loop through all defined attributes.
1173
+ var styleAttribs = styleDefinition.attributes;
1174
+ if ( styleAttribs )
1175
+ {
1176
+ for ( var styleAtt in styleAttribs )
1177
+ {
1178
+ length++;
1179
+ attribs[ styleAtt ] = styleAttribs[ styleAtt ];
1180
+ }
1181
+ }
1182
+
1183
+ // Includes the style definitions.
1184
+ var styleText = CKEDITOR.style.getStyleText( styleDefinition );
1185
+ if ( styleText )
1186
+ {
1187
+ if ( !attribs[ 'style' ] )
1188
+ length++;
1189
+ attribs[ 'style' ] = styleText;
1190
+ }
1191
+
1192
+ // Appends the "length" information to the object.
1193
+ attribs._length = length;
1194
+
1195
+ // Return it, saving it to the next request.
1196
+ return ( styleDefinition._AC = attribs );
1197
+ }
1198
+
1199
+ /**
1200
+ * Get the the collection used to compare the elements and attributes,
1201
+ * defined in this style overrides, with other element. All information in
1202
+ * it is lowercased.
1203
+ * @param {CKEDITOR.style} style
1204
+ */
1205
+ function getOverrides( style )
1206
+ {
1207
+ if ( style._.overrides )
1208
+ return style._.overrides;
1209
+
1210
+ var overrides = ( style._.overrides = {} ),
1211
+ definition = style._.definition.overrides;
1212
+
1213
+ if ( definition )
1214
+ {
1215
+ // The override description can be a string, object or array.
1216
+ // Internally, well handle arrays only, so transform it if needed.
1217
+ if ( !CKEDITOR.tools.isArray( definition ) )
1218
+ definition = [ definition ];
1219
+
1220
+ // Loop through all override definitions.
1221
+ for ( var i = 0 ; i < definition.length ; i++ )
1222
+ {
1223
+ var override = definition[i];
1224
+ var elementName;
1225
+ var overrideEl;
1226
+ var attrs;
1227
+
1228
+ // If can be a string with the element name.
1229
+ if ( typeof override == 'string' )
1230
+ elementName = override.toLowerCase();
1231
+ // Or an object.
1232
+ else
1233
+ {
1234
+ elementName = override.element ? override.element.toLowerCase() : style.element;
1235
+ attrs = override.attributes;
1236
+ }
1237
+
1238
+ // We can have more than one override definition for the same
1239
+ // element name, so we attempt to simply append information to
1240
+ // it if it already exists.
1241
+ overrideEl = overrides[ elementName ] || ( overrides[ elementName ] = {} );
1242
+
1243
+ if ( attrs )
1244
+ {
1245
+ // The returning attributes list is an array, because we
1246
+ // could have different override definitions for the same
1247
+ // attribute name.
1248
+ var overrideAttrs = ( overrideEl.attributes = overrideEl.attributes || new Array() );
1249
+ for ( var attName in attrs )
1250
+ {
1251
+ // Each item in the attributes array is also an array,
1252
+ // where [0] is the attribute name and [1] is the
1253
+ // override value.
1254
+ overrideAttrs.push( [ attName.toLowerCase(), attrs[ attName ] ] );
1255
+ }
1256
+ }
1257
+ }
1258
+ }
1259
+
1260
+ return overrides;
1261
+ }
1262
+
1263
+ function normalizeProperty( name, value, isStyle )
1264
+ {
1265
+ var temp = new CKEDITOR.dom.element( 'span' );
1266
+ temp [ isStyle ? 'setStyle' : 'setAttribute' ]( name, value );
1267
+ return temp[ isStyle ? 'getStyle' : 'getAttribute' ]( name );
1268
+ }
1269
+
1270
+ function normalizeCssText( unparsedCssText, nativeNormalize )
1271
+ {
1272
+ var styleText;
1273
+ if ( nativeNormalize !== false )
1274
+ {
1275
+ // Injects the style in a temporary span object, so the browser parses it,
1276
+ // retrieving its final format.
1277
+ var temp = new CKEDITOR.dom.element( 'span' );
1278
+ temp.setAttribute( 'style', unparsedCssText );
1279
+ styleText = temp.getAttribute( 'style' ) || '';
1280
+ }
1281
+ else
1282
+ styleText = unparsedCssText;
1283
+
1284
+ // Shrinking white-spaces around colon and semi-colon (#4147).
1285
+ // Compensate tail semi-colon.
1286
+ return styleText.replace( /\s*([;:])\s*/, '$1' )
1287
+ .replace( /([^\s;])$/, '$1;')
1288
+ .replace( /,\s+/g, ',' ) // Trimming spaces after comma (e.g. font-family name)(#4107).
1289
+ .toLowerCase();
1290
+ }
1291
+
1292
+ // Turn inline style text properties into one hash.
1293
+ function parseStyleText( styleText )
1294
+ {
1295
+ var retval = {};
1296
+ styleText
1297
+ .replace( /&quot;/g, '"' )
1298
+ .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value )
1299
+ {
1300
+ retval[ name ] = value;
1301
+ } );
1302
+ return retval;
1303
+ }
1304
+
1305
+ function compareCssText( source, target )
1306
+ {
1307
+ typeof source == 'string' && ( source = parseStyleText( source ) );
1308
+ typeof target == 'string' && ( target = parseStyleText( target ) );
1309
+ for( var name in source )
1310
+ {
1311
+ // Value 'inherit' is treated as a wildcard,
1312
+ // which will match any value.
1313
+ if ( !( name in target &&
1314
+ ( target[ name ] == source[ name ]
1315
+ || source[ name ] == 'inherit'
1316
+ || target[ name ] == 'inherit' ) ) )
1317
+ {
1318
+ return false;
1319
+ }
1320
+ }
1321
+ return true;
1322
+ }
1323
+
1324
+ function applyStyle( document, remove )
1325
+ {
1326
+ // Get all ranges from the selection.
1327
+ var selection = document.getSelection();
1328
+ var ranges = selection.getRanges();
1329
+ var func = remove ? this.removeFromRange : this.applyToRange;
1330
+
1331
+ // Apply the style to the ranges.
1332
+ for ( var i = 0 ; i < ranges.length ; i++ )
1333
+ func.call( this, ranges[ i ] );
1334
+
1335
+ // Select the ranges again.
1336
+ selection.selectRanges( ranges );
1337
+ }
1338
+ })();
1339
+
1340
+ CKEDITOR.styleCommand = function( style )
1341
+ {
1342
+ this.style = style;
1343
+ };
1344
+
1345
+ CKEDITOR.styleCommand.prototype.exec = function( editor )
1346
+ {
1347
+ editor.focus();
1348
+
1349
+ var doc = editor.document;
1350
+
1351
+ if ( doc )
1352
+ {
1353
+ if ( this.state == CKEDITOR.TRISTATE_OFF )
1354
+ this.style.apply( doc );
1355
+ else if ( this.state == CKEDITOR.TRISTATE_ON )
1356
+ this.style.remove( doc );
1357
+ }
1358
+
1359
+ return !!doc;
1360
+ };
1361
+
1362
+ CKEDITOR.stylesSet = new CKEDITOR.resourceManager( '', 'stylesSet' );
1363
+
1364
+ // Backward compatibility (#5025).
1365
+ CKEDITOR.addStylesSet = CKEDITOR.tools.bind( CKEDITOR.stylesSet.add, CKEDITOR.stylesSet );
1366
+ CKEDITOR.loadStylesSet = function( name, url, callback )
1367
+ {
1368
+ CKEDITOR.stylesSet.addExternal( name, url, '' );
1369
+ CKEDITOR.stylesSet.load( name, callback );
1370
+ };
1371
+
1372
+
1373
+ /**
1374
+ * Gets the current styleSet for this instance
1375
+ * @param {Function} The function to be called with the styles data.
1376
+ * @example
1377
+ * editor.getStylesSet( function( stylesDefinitions ) {} );
1378
+ */
1379
+ CKEDITOR.editor.prototype.getStylesSet = function( callback )
1380
+ {
1381
+ if ( !this._.stylesDefinitions )
1382
+ {
1383
+ var editor = this,
1384
+ // Respect the backwards compatible definition entry
1385
+ configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet || 'default';
1386
+
1387
+ // #5352 Allow to define the styles directly in the config object
1388
+ if ( configStyleSet instanceof Array )
1389
+ {
1390
+ editor._.stylesDefinitions = configStyleSet;
1391
+ callback( configStyleSet );
1392
+ return;
1393
+ }
1394
+
1395
+ var partsStylesSet = configStyleSet.split( ':' ),
1396
+ styleSetName = partsStylesSet[ 0 ],
1397
+ externalPath = partsStylesSet[ 1 ],
1398
+ pluginPath = CKEDITOR.plugins.registered.styles.path;
1399
+
1400
+ CKEDITOR.stylesSet.addExternal( styleSetName,
1401
+ externalPath ?
1402
+ partsStylesSet.slice( 1 ).join( ':' ) :
1403
+ pluginPath + 'styles/' + styleSetName + '.js', '' );
1404
+
1405
+ CKEDITOR.stylesSet.load( styleSetName, function( stylesSet )
1406
+ {
1407
+ editor._.stylesDefinitions = stylesSet[ styleSetName ];
1408
+ callback( editor._.stylesDefinitions );
1409
+ } ) ;
1410
+ }
1411
+ else
1412
+ callback( this._.stylesDefinitions );
1413
+ };
1414
+
1415
+ /**
1416
+ * The "styles definition set" to use in the editor. They will be used in the
1417
+ * styles combo and the Style selector of the div container. <br>
1418
+ * The styles may be defined in the page containing the editor, or can be
1419
+ * loaded on demand from an external file. In the second case, if this setting
1420
+ * contains only a name, the styles definition file will be loaded from the
1421
+ * "styles" folder inside the styles plugin folder.
1422
+ * Otherwise, this setting has the "name:url" syntax, making it
1423
+ * possible to set the URL from which loading the styles file.<br>
1424
+ * Previously this setting was available as config.stylesCombo_stylesSet<br>
1425
+ * @type String|Array
1426
+ * @default 'default'
1427
+ * @since 3.3
1428
+ * @example
1429
+ * // Load from the styles' styles folder (mystyles.js file).
1430
+ * config.stylesSet = 'mystyles';
1431
+ * @example
1432
+ * // Load from a relative URL.
1433
+ * config.stylesSet = 'mystyles:/editorstyles/styles.js';
1434
+ * @example
1435
+ * // Load from a full URL.
1436
+ * config.stylesSet = 'mystyles:http://www.example.com/editorstyles/styles.js';
1437
+ * @example
1438
+ * // Load from a list of definitions.
1439
+ * config.stylesSet = [
1440
+ * { name : 'Strong Emphasis', element : 'strong' },
1441
+ * { name : 'Emphasis', element : 'em' }, ... ];
1442
+ */