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,147 @@
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( 'panelbutton',
7
+ {
8
+ requires : [ 'button' ],
9
+ beforeInit : function( editor )
10
+ {
11
+ editor.ui.addHandler( CKEDITOR.UI_PANELBUTTON, CKEDITOR.ui.panelButton.handler );
12
+ }
13
+ });
14
+
15
+ /**
16
+ * Button UI element.
17
+ * @constant
18
+ * @example
19
+ */
20
+ CKEDITOR.UI_PANELBUTTON = 4;
21
+
22
+ (function()
23
+ {
24
+ var clickFn = function( editor )
25
+ {
26
+ var _ = this._;
27
+
28
+ if ( _.state == CKEDITOR.TRISTATE_DISABLED )
29
+ return;
30
+
31
+ this.createPanel( editor );
32
+
33
+ if ( _.on )
34
+ {
35
+ _.panel.hide();
36
+ return;
37
+ }
38
+
39
+ _.panel.showBlock( this._.id, this.document.getById( this._.id ), 4 );
40
+ };
41
+
42
+
43
+ CKEDITOR.ui.panelButton = CKEDITOR.tools.createClass(
44
+ {
45
+ base : CKEDITOR.ui.button,
46
+
47
+ $ : function( definition )
48
+ {
49
+ // We don't want the panel definition in this object.
50
+ var panelDefinition = definition.panel;
51
+ delete definition.panel;
52
+
53
+ this.base( definition );
54
+
55
+ this.document = ( panelDefinition
56
+ && panelDefinition.parent
57
+ && panelDefinition.parent.getDocument() )
58
+ || CKEDITOR.document;
59
+
60
+ panelDefinition.block =
61
+ {
62
+ attributes : panelDefinition.attributes
63
+ };
64
+
65
+ this.hasArrow = true;
66
+
67
+ this.click = clickFn;
68
+
69
+ this._ =
70
+ {
71
+ panelDefinition : panelDefinition
72
+ };
73
+ },
74
+
75
+ statics :
76
+ {
77
+ handler :
78
+ {
79
+ create : function( definition )
80
+ {
81
+ return new CKEDITOR.ui.panelButton( definition );
82
+ }
83
+ }
84
+ },
85
+
86
+ proto :
87
+ {
88
+ createPanel : function( editor )
89
+ {
90
+ var _ = this._;
91
+
92
+ if ( _.panel )
93
+ return;
94
+
95
+ var panelDefinition = this._.panelDefinition || {},
96
+ panelBlockDefinition = this._.panelDefinition.block,
97
+ panelParentElement = panelDefinition.parent || CKEDITOR.document.getBody(),
98
+ panel = this._.panel = new CKEDITOR.ui.floatPanel( editor, panelParentElement, panelDefinition ),
99
+ block = panel.addBlock( _.id, panelBlockDefinition ),
100
+ me = this;
101
+
102
+ panel.onShow = function()
103
+ {
104
+ if ( me.className )
105
+ this.element.getFirst().addClass( me.className + '_panel' );
106
+
107
+ _.oldState = me._.state;
108
+ me.setState( CKEDITOR.TRISTATE_ON );
109
+
110
+ _.on = 1;
111
+
112
+ if ( me.onOpen )
113
+ me.onOpen();
114
+ };
115
+
116
+ panel.onHide = function()
117
+ {
118
+ if ( me.className )
119
+ this.element.getFirst().removeClass( me.className + '_panel' );
120
+
121
+ me.setState( _.oldState );
122
+
123
+ _.on = 0;
124
+
125
+ if ( me.onClose )
126
+ me.onClose();
127
+ };
128
+
129
+ panel.onEscape = function()
130
+ {
131
+ panel.hide();
132
+ me.document.getById( _.id ).focus();
133
+ };
134
+
135
+ if ( this.onBlock )
136
+ this.onBlock( panel, block );
137
+
138
+ block.onHide = function()
139
+ {
140
+ _.on = 0;
141
+ me.setState( CKEDITOR.TRISTATE_OFF );
142
+ };
143
+ }
144
+ }
145
+ });
146
+
147
+ })();
@@ -0,0 +1,1179 @@
1
+ /*
2
+ Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ (function()
7
+ {
8
+ var fragmentPrototype = CKEDITOR.htmlParser.fragment.prototype,
9
+ elementPrototype = CKEDITOR.htmlParser.element.prototype;
10
+
11
+ fragmentPrototype.onlyChild = elementPrototype.onlyChild = function()
12
+ {
13
+ var children = this.children,
14
+ count = children.length,
15
+ firstChild = ( count == 1 ) && children[ 0 ];
16
+ return firstChild || null;
17
+ };
18
+
19
+ elementPrototype.removeAnyChildWithName = function( tagName )
20
+ {
21
+ var children = this.children,
22
+ childs = [],
23
+ child;
24
+
25
+ for ( var i = 0; i < children.length; i++ )
26
+ {
27
+ child = children[ i ];
28
+ if ( !child.name )
29
+ continue;
30
+
31
+ if ( child.name == tagName )
32
+ {
33
+ childs.push( child );
34
+ children.splice( i--, 1 );
35
+ }
36
+ childs = childs.concat( child.removeAnyChildWithName( tagName ) );
37
+ }
38
+ return childs;
39
+ };
40
+
41
+ elementPrototype.getAncestor = function( tagNameRegex )
42
+ {
43
+ var parent = this.parent;
44
+ while ( parent && !( parent.name && parent.name.match( tagNameRegex ) ) )
45
+ parent = parent.parent;
46
+ return parent;
47
+ };
48
+
49
+ fragmentPrototype.firstChild = elementPrototype.firstChild = function( evaluator )
50
+ {
51
+ var child;
52
+
53
+ for ( var i = 0 ; i < this.children.length ; i++ )
54
+ {
55
+ child = this.children[ i ];
56
+ if ( evaluator( child ) )
57
+ return child;
58
+ else if ( child.name )
59
+ {
60
+ child = child.firstChild( evaluator );
61
+ if ( child )
62
+ return child;
63
+ else
64
+ continue;
65
+ }
66
+ }
67
+
68
+ return null;
69
+ };
70
+
71
+ // Adding a (set) of styles to the element's attributes.
72
+ elementPrototype.addStyle = function( name, value, isPrepend )
73
+ {
74
+ var styleText, addingStyleText = '';
75
+ // name/value pair.
76
+ if ( typeof value == 'string' )
77
+ addingStyleText += name + ':' + value + ';';
78
+ else
79
+ {
80
+ // style literal.
81
+ if ( typeof name == 'object' )
82
+ {
83
+ for ( var style in name )
84
+ {
85
+ if ( name.hasOwnProperty( style ) )
86
+ addingStyleText += style + ':' + name[ style ] + ';';
87
+ }
88
+ }
89
+ // raw style text form.
90
+ else
91
+ addingStyleText += name;
92
+
93
+ isPrepend = value;
94
+ }
95
+
96
+ if ( !this.attributes )
97
+ this.attributes = {};
98
+
99
+ styleText = this.attributes.style || '';
100
+
101
+ styleText = ( isPrepend ?
102
+ [ addingStyleText, styleText ]
103
+ : [ styleText, addingStyleText ] ).join( ';' );
104
+
105
+ this.attributes.style = styleText.replace( /^;|;(?=;)/, '' );
106
+ };
107
+
108
+ /**
109
+ * Return the DTD-valid parent tag names of the specified one.
110
+ * @param tagName
111
+ */
112
+ CKEDITOR.dtd.parentOf = function( tagName )
113
+ {
114
+ var result = {};
115
+ for ( var tag in this )
116
+ {
117
+ if ( tag.indexOf( '$' ) == -1 && this[ tag ][ tagName ] )
118
+ result[ tag ] = 1;
119
+ }
120
+ return result;
121
+ };
122
+
123
+ var cssLengthRelativeUnit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i;
124
+ var emptyMarginRegex = /^(?:\b0[^\s]*\s*){1,4}$/;
125
+
126
+ var listBaseIndent = 0,
127
+ previousListItemMargin;
128
+
129
+ CKEDITOR.plugins.pastefromword =
130
+ {
131
+ utils :
132
+ {
133
+ // Create a <cke:listbullet> which indicate an list item type.
134
+ createListBulletMarker : function ( bulletStyle, bulletText )
135
+ {
136
+ var marker = new CKEDITOR.htmlParser.element( 'cke:listbullet' ),
137
+ listType;
138
+
139
+ // TODO: Support more list style type from MS-Word.
140
+ if ( !bulletStyle )
141
+ {
142
+ bulletStyle = 'decimal';
143
+ listType = 'ol';
144
+ }
145
+ else if ( bulletStyle[ 2 ] )
146
+ {
147
+ if ( !isNaN( bulletStyle[ 1 ] ) )
148
+ bulletStyle = 'decimal';
149
+ // No way to distinguish between Roman numerals and Alphas,
150
+ // detect them as a whole.
151
+ else if ( /^[a-z]+$/.test( bulletStyle[ 1 ] ) )
152
+ bulletStyle = 'lower-alpha';
153
+ else if ( /^[A-Z]+$/.test( bulletStyle[ 1 ] ) )
154
+ bulletStyle = 'upper-alpha';
155
+ // Simply use decimal for the rest forms of unrepresentable
156
+ // numerals, e.g. Chinese...
157
+ else
158
+ bulletStyle = 'decimal';
159
+
160
+ listType = 'ol';
161
+ }
162
+ else
163
+ {
164
+ if ( /[l\u00B7\u2002]/.test( bulletStyle[ 1 ] ) ) //l·•
165
+ bulletStyle = 'disc';
166
+ else if ( /[\u006F\u00D8]/.test( bulletStyle[ 1 ] ) ) //oØ
167
+ bulletStyle = 'circle';
168
+ else if ( /[\u006E\u25C6]/.test( bulletStyle[ 1 ] ) ) //n◆
169
+ bulletStyle = 'square';
170
+ else
171
+ bulletStyle = 'disc';
172
+
173
+ listType = 'ul';
174
+ }
175
+
176
+ // Represent list type as CSS style.
177
+ marker.attributes =
178
+ {
179
+ 'cke:listtype' : listType,
180
+ 'style' : 'list-style-type:' + bulletStyle + ';'
181
+ };
182
+ marker.add( new CKEDITOR.htmlParser.text( bulletText ) );
183
+ return marker;
184
+ },
185
+
186
+ isListBulletIndicator : function( element )
187
+ {
188
+ var styleText = element.attributes && element.attributes.style;
189
+ if ( /mso-list\s*:\s*Ignore/i.test( styleText ) )
190
+ return true;
191
+ },
192
+
193
+ isContainingOnlySpaces : function( element )
194
+ {
195
+ var text;
196
+ return ( ( text = element.onlyChild() )
197
+ && ( /^(:?\s|&nbsp;)+$/ ).test( text.value ) );
198
+ },
199
+
200
+ resolveList : function( element )
201
+ {
202
+ // <cke:listbullet> indicate a list item.
203
+ var children = element.children,
204
+ attrs = element.attributes,
205
+ listMarker;
206
+
207
+ if ( ( listMarker = element.removeAnyChildWithName( 'cke:listbullet' ) )
208
+ && listMarker.length
209
+ && ( listMarker = listMarker[ 0 ] ) )
210
+ {
211
+ element.name = 'cke:li';
212
+
213
+ if ( attrs.style )
214
+ {
215
+ attrs.style = CKEDITOR.plugins.pastefromword.filters.stylesFilter(
216
+ [
217
+ // Text-indent is not representing list item level any more.
218
+ [ 'text-indent' ],
219
+ [ 'line-height' ],
220
+ // Resolve indent level from 'margin-left' value.
221
+ [ ( /^margin(:?-left)?$/ ), null, function( margin )
222
+ {
223
+ // Be able to deal with component/short-hand form style.
224
+ var values = margin.split( ' ' );
225
+ margin = values[ 3 ] || values[ 1 ] || values [ 0 ];
226
+ margin = parseInt( margin, 10 );
227
+
228
+ // Figure out the indent unit by looking at the first increament.
229
+ if ( !listBaseIndent && previousListItemMargin && margin > previousListItemMargin )
230
+ listBaseIndent = margin - previousListItemMargin;
231
+
232
+ attrs[ 'cke:margin' ] = previousListItemMargin = margin;
233
+ } ]
234
+ ] )( attrs.style, element ) || '' ;
235
+ }
236
+
237
+ // Inherit list-type-style from bullet.
238
+ var listBulletAttrs = listMarker.attributes,
239
+ listBulletStyle = listBulletAttrs.style;
240
+
241
+ element.addStyle( listBulletStyle );
242
+ CKEDITOR.tools.extend( attrs, listBulletAttrs );
243
+ return true;
244
+ }
245
+
246
+ return false;
247
+ },
248
+
249
+ // Convert various length units to 'px' in ignorance of DPI.
250
+ convertToPx : ( function ()
251
+ {
252
+ var calculator = CKEDITOR.dom.element.createFromHtml(
253
+ '<div style="position:absolute;left:-9999px;' +
254
+ 'top:-9999px;margin:0px;padding:0px;border:0px;"' +
255
+ '></div>', CKEDITOR.document );
256
+ CKEDITOR.document.getBody().append( calculator );
257
+
258
+ return function( cssLength )
259
+ {
260
+ if ( cssLengthRelativeUnit.test( cssLength ) )
261
+ {
262
+ calculator.setStyle( 'width', cssLength );
263
+ return calculator.$.clientWidth + 'px';
264
+ }
265
+
266
+ return cssLength;
267
+ };
268
+ } )(),
269
+
270
+ // Providing a shorthand style then retrieve one or more style component values.
271
+ getStyleComponents : ( function()
272
+ {
273
+ var calculator = CKEDITOR.dom.element.createFromHtml(
274
+ '<div style="position:absolute;left:-9999px;top:-9999px;"></div>',
275
+ CKEDITOR.document );
276
+ CKEDITOR.document.getBody().append( calculator );
277
+
278
+ return function( name, styleValue, fetchList )
279
+ {
280
+ calculator.setStyle( name, styleValue );
281
+ var styles = {},
282
+ count = fetchList.length;
283
+ for ( var i = 0; i < count; i++ )
284
+ styles[ fetchList[ i ] ] = calculator.getStyle( fetchList[ i ] );
285
+
286
+ return styles;
287
+ };
288
+ } )(),
289
+
290
+ listDtdParents : CKEDITOR.dtd.parentOf( 'ol' )
291
+ },
292
+
293
+ filters :
294
+ {
295
+ // Transform a normal list into flat list items only presentation.
296
+ // E.g. <ul><li>level1<ol><li>level2</li></ol></li> =>
297
+ // <cke:li cke:listtype="ul" cke:indent="1">level1</cke:li>
298
+ // <cke:li cke:listtype="ol" cke:indent="2">level2</cke:li>
299
+ flattenList : function( element )
300
+ {
301
+ var attrs = element.attributes,
302
+ parent = element.parent;
303
+
304
+ var listStyleType,
305
+ indentLevel = 1;
306
+
307
+ // Resolve how many level nested.
308
+ while ( parent )
309
+ {
310
+ parent.attributes && parent.attributes[ 'cke:list'] && indentLevel++;
311
+ parent = parent.parent;
312
+ }
313
+
314
+ // All list items are of the same type.
315
+ switch ( attrs.type )
316
+ {
317
+ case 'a' :
318
+ listStyleType = 'lower-alpha';
319
+ break;
320
+ // TODO: Support more list style type from MS-Word.
321
+ }
322
+
323
+ var children = element.children,
324
+ child;
325
+
326
+ for ( var i = 0; i < children.length; i++ )
327
+ {
328
+ child = children[ i ];
329
+ var attributes = child.attributes;
330
+
331
+ if ( child.name in CKEDITOR.dtd.$listItem )
332
+ {
333
+ var listItemChildren = child.children,
334
+ count = listItemChildren.length,
335
+ last = listItemChildren[ count - 1 ];
336
+
337
+ // Move out nested list.
338
+ if ( last.name in CKEDITOR.dtd.$list )
339
+ {
340
+ children.splice( i + 1, 0, last );
341
+ last.parent = element;
342
+
343
+ // Remove the parent list item if it's just a holder.
344
+ if ( !--listItemChildren.length )
345
+ children.splice( i, 1 );
346
+ }
347
+
348
+ child.name = 'cke:li';
349
+ attributes[ 'cke:indent' ] = indentLevel;
350
+ previousListItemMargin = 0;
351
+ attributes[ 'cke:listtype' ] = element.name;
352
+ listStyleType && child.addStyle( 'list-style-type', listStyleType, true );
353
+ }
354
+ }
355
+
356
+ delete element.name;
357
+
358
+ // We're loosing tag name here, signalize this element as a list.
359
+ attrs[ 'cke:list' ] = 1;
360
+ },
361
+
362
+ /**
363
+ * Try to collect all list items among the children and establish one
364
+ * or more HTML list structures for them.
365
+ * @param element
366
+ */
367
+ assembleList : function( element )
368
+ {
369
+ var children = element.children, child,
370
+ listItem, // The current processing cke:li element.
371
+ listItemAttrs,
372
+ listType, // Determine the root type of the list.
373
+ listItemIndent, // Indent level of current list item.
374
+ lastListItem, // The previous one just been added to the list.
375
+ list, parentList, // Current staging list and it's parent list if any.
376
+ indent;
377
+
378
+ for ( var i = 0; i < children.length; i++ )
379
+ {
380
+ child = children[ i ];
381
+
382
+ if ( 'cke:li' == child.name )
383
+ {
384
+ child.name = 'li';
385
+ listItem = child;
386
+ listItemAttrs = listItem.attributes;
387
+ listType = listItem.attributes[ 'cke:listtype' ];
388
+
389
+ // List item indent level might come from a real list indentation or
390
+ // been resolved from a pseudo list item's margin value, even get
391
+ // no indentation at all.
392
+ listItemIndent = parseInt( listItemAttrs[ 'cke:indent' ], 10 )
393
+ || listBaseIndent && ( Math.ceil( listItemAttrs[ 'cke:margin' ] / listBaseIndent ) )
394
+ || 1;
395
+
396
+ // Ignore the 'list-style-type' attribute if it's matched with
397
+ // the list root element's default style type.
398
+ listItemAttrs.style && ( listItemAttrs.style =
399
+ CKEDITOR.plugins.pastefromword.filters.stylesFilter(
400
+ [
401
+ [ 'list-style-type', listType == 'ol' ? 'decimal' : 'disc' ]
402
+ ] )( listItemAttrs.style )
403
+ || '' );
404
+
405
+ if ( !list )
406
+ {
407
+ list = new CKEDITOR.htmlParser.element( listType );
408
+ list.add( listItem );
409
+ children[ i ] = list;
410
+ }
411
+ else
412
+ {
413
+ if ( listItemIndent > indent )
414
+ {
415
+ list = new CKEDITOR.htmlParser.element( listType );
416
+ list.add( listItem );
417
+ lastListItem.add( list );
418
+ }
419
+ else if ( listItemIndent < indent )
420
+ {
421
+ // There might be a negative gap between two list levels. (#4944)
422
+ var diff = indent - listItemIndent,
423
+ parent;
424
+ while ( diff-- && ( parent = list.parent ) )
425
+ list = parent.parent;
426
+
427
+ list.add( listItem );
428
+ }
429
+ else
430
+ list.add( listItem );
431
+
432
+ children.splice( i--, 1 );
433
+ }
434
+
435
+ lastListItem = listItem;
436
+ indent = listItemIndent;
437
+ }
438
+ else
439
+ list = null;
440
+ }
441
+
442
+ listBaseIndent = 0;
443
+ },
444
+
445
+ /**
446
+ * A simple filter which always rejecting.
447
+ */
448
+ falsyFilter : function( value )
449
+ {
450
+ return false;
451
+ },
452
+
453
+ /**
454
+ * A filter dedicated on the 'style' attribute filtering, e.g. dropping/replacing style properties.
455
+ * @param styles {Array} in form of [ styleNameRegexp, styleValueRegexp,
456
+ * newStyleValue/newStyleGenerator, newStyleName ] where only the first
457
+ * parameter is mandatory.
458
+ * @param whitelist {Boolean} Whether the {@param styles} will be considered as a white-list.
459
+ */
460
+ stylesFilter : function( styles, whitelist )
461
+ {
462
+ return function( styleText, element )
463
+ {
464
+ var rules = [];
465
+ // html-encoded quote might be introduced by 'font-family'
466
+ // from MS-Word which confused the following regexp. e.g.
467
+ //'font-family: &quot;Lucida, Console&quot;'
468
+ styleText
469
+ .replace( /&quot;/g, '"' )
470
+ .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
471
+ function( match, name, value )
472
+ {
473
+ name = name.toLowerCase();
474
+ name == 'font-family' && ( value = value.replace( /["']/g, '' ) );
475
+
476
+ var namePattern,
477
+ valuePattern,
478
+ newValue,
479
+ newName;
480
+ for ( var i = 0 ; i < styles.length; i++ )
481
+ {
482
+ if ( styles[ i ] )
483
+ {
484
+ namePattern = styles[ i ][ 0 ];
485
+ valuePattern = styles[ i ][ 1 ];
486
+ newValue = styles[ i ][ 2 ];
487
+ newName = styles[ i ][ 3 ];
488
+
489
+ if ( name.match( namePattern )
490
+ && ( !valuePattern || value.match( valuePattern ) ) )
491
+ {
492
+ name = newName || name;
493
+ whitelist && ( newValue = newValue || value );
494
+
495
+ if ( typeof newValue == 'function' )
496
+ newValue = newValue( value, element, name );
497
+
498
+ // Return an couple indicate both name and value
499
+ // changed.
500
+ if ( newValue && newValue.push )
501
+ name = newValue[ 0 ], newValue = newValue[ 1 ];
502
+
503
+ if ( typeof newValue == 'string' )
504
+ rules.push( [ name, newValue ] );
505
+ return;
506
+ }
507
+ }
508
+ }
509
+
510
+ !whitelist && rules.push( [ name, value ] );
511
+
512
+ });
513
+
514
+ for ( var i = 0 ; i < rules.length ; i++ )
515
+ rules[ i ] = rules[ i ].join( ':' );
516
+ return rules.length ?
517
+ ( rules.join( ';' ) + ';' ) : false;
518
+ };
519
+ },
520
+
521
+ /**
522
+ * Migrate the element by decorate styles on it.
523
+ * @param styleDefiniton
524
+ * @param variables
525
+ */
526
+ elementMigrateFilter : function ( styleDefiniton, variables )
527
+ {
528
+ return function( element )
529
+ {
530
+ var styleDef =
531
+ variables ?
532
+ new CKEDITOR.style( styleDefiniton, variables )._.definition
533
+ : styleDefiniton;
534
+ element.name = styleDef.element;
535
+ CKEDITOR.tools.extend( element.attributes, CKEDITOR.tools.clone( styleDef.attributes ) );
536
+ element.addStyle( CKEDITOR.style.getStyleText( styleDef ) );
537
+ };
538
+ },
539
+
540
+ /**
541
+ * Migrate styles by creating a new nested stylish element.
542
+ * @param styleDefinition
543
+ */
544
+ styleMigrateFilter : function( styleDefinition, variableName )
545
+ {
546
+
547
+ var elementMigrateFilter = this.elementMigrateFilter;
548
+ return function( value, element )
549
+ {
550
+ // Build an stylish element first.
551
+ var styleElement = new CKEDITOR.htmlParser.element( null ),
552
+ variables = {};
553
+
554
+ variables[ variableName ] = value;
555
+ elementMigrateFilter( styleDefinition, variables )( styleElement );
556
+ // Place the new element inside the existing span.
557
+ styleElement.children = element.children;
558
+ element.children = [ styleElement ];
559
+ };
560
+ },
561
+
562
+ /**
563
+ * A filter which remove cke-namespaced-attribute on
564
+ * all none-cke-namespaced elements.
565
+ * @param value
566
+ * @param element
567
+ */
568
+ bogusAttrFilter : function( value, element )
569
+ {
570
+ if ( element.name.indexOf( 'cke:' ) == -1 )
571
+ return false;
572
+ },
573
+
574
+ /**
575
+ * A filter which will be used to apply inline css style according the stylesheet
576
+ * definition rules, is generated lazily when filtering.
577
+ */
578
+ applyStyleFilter : null
579
+
580
+ },
581
+
582
+ getRules : function( editor )
583
+ {
584
+ var dtd = CKEDITOR.dtd,
585
+ blockLike = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ),
586
+ config = editor.config,
587
+ filters = this.filters,
588
+ falsyFilter = filters.falsyFilter,
589
+ stylesFilter = filters.stylesFilter,
590
+ elementMigrateFilter = filters.elementMigrateFilter,
591
+ styleMigrateFilter = CKEDITOR.tools.bind( this.filters.styleMigrateFilter, this.filters ),
592
+ bogusAttrFilter = filters.bogusAttrFilter,
593
+ createListBulletMarker = this.utils.createListBulletMarker,
594
+ flattenList = filters.flattenList,
595
+ assembleList = filters.assembleList,
596
+ isListBulletIndicator = this.utils.isListBulletIndicator,
597
+ containsNothingButSpaces = this.utils.isContainingOnlySpaces,
598
+ resolveListItem = this.utils.resolveList,
599
+ convertToPx = this.utils.convertToPx,
600
+ getStyleComponents = this.utils.getStyleComponents,
601
+ listDtdParents = this.utils.listDtdParents,
602
+ removeFontStyles = config.pasteFromWordRemoveFontStyles !== false,
603
+ removeStyles = config.pasteFromWordRemoveStyles !== false;
604
+
605
+ return {
606
+
607
+ elementNames :
608
+ [
609
+ // Remove script, meta and link elements.
610
+ [ ( /meta|link|script/ ), '' ]
611
+ ],
612
+
613
+ root : function( element )
614
+ {
615
+ element.filterChildren();
616
+ assembleList( element );
617
+ },
618
+
619
+ elements :
620
+ {
621
+ '^' : function( element )
622
+ {
623
+ // Transform CSS style declaration to inline style.
624
+ var applyStyleFilter;
625
+ if ( CKEDITOR.env.gecko && ( applyStyleFilter = filters.applyStyleFilter ) )
626
+ applyStyleFilter( element );
627
+ },
628
+
629
+ $ : function( element )
630
+ {
631
+ var tagName = element.name || '',
632
+ attrs = element.attributes;
633
+
634
+ // Convert length unit of width/height on blocks to
635
+ // a more editor-friendly way (px).
636
+ if ( tagName in blockLike
637
+ && attrs.style )
638
+ {
639
+ attrs.style = stylesFilter(
640
+ [ [ ( /^(:?width|height)$/ ), null, convertToPx ] ] )( attrs.style ) || '';
641
+ }
642
+
643
+ // Processing headings.
644
+ if ( tagName.match( /h\d/ ) )
645
+ {
646
+ element.filterChildren();
647
+ // Is the heading actually a list item?
648
+ if ( resolveListItem( element ) )
649
+ return;
650
+
651
+ // Adapt heading styles to editor's convention.
652
+ elementMigrateFilter( config[ 'format_' + tagName ] )( element );
653
+ }
654
+ // Remove inline elements which contain only empty spaces.
655
+ else if ( tagName in dtd.$inline )
656
+ {
657
+ element.filterChildren();
658
+ if ( containsNothingButSpaces( element ) )
659
+ delete element.name;
660
+ }
661
+ // Remove element with ms-office namespace,
662
+ // with it's content preserved, e.g. 'o:p'.
663
+ else if ( tagName.indexOf( ':' ) != -1
664
+ && tagName.indexOf( 'cke' ) == -1 )
665
+ {
666
+ element.filterChildren();
667
+
668
+ // Restore image real link from vml.
669
+ if ( tagName == 'v:imagedata' )
670
+ {
671
+ var href = element.attributes[ 'o:href' ];
672
+ if ( href )
673
+ element.attributes.src = href;
674
+ element.name = 'img';
675
+ return;
676
+ }
677
+ delete element.name;
678
+ }
679
+
680
+ // Assembling list items into a whole list.
681
+ if ( tagName in listDtdParents )
682
+ {
683
+ element.filterChildren();
684
+ assembleList( element );
685
+ }
686
+ },
687
+
688
+ // We'll drop any style sheet, but Firefox conclude
689
+ // certain styles in a single style element, which are
690
+ // required to be changed into inline ones.
691
+ 'style' : function( element )
692
+ {
693
+ if ( CKEDITOR.env.gecko )
694
+ {
695
+ // Grab only the style definition section.
696
+ var styleDefSection = element.onlyChild().value.match( /\/\* Style Definitions \*\/([\s\S]*?)\/\*/ ),
697
+ styleDefText = styleDefSection && styleDefSection[ 1 ],
698
+ rules = {}; // Storing the parsed result.
699
+
700
+ if ( styleDefText )
701
+ {
702
+ styleDefText
703
+ // Remove line-breaks.
704
+ .replace(/[\n\r]/g,'')
705
+ // Extract selectors and style properties.
706
+ .replace( /(.+?)\{(.+?)\}/g,
707
+ function( rule, selectors, styleBlock )
708
+ {
709
+ selectors = selectors.split( ',' );
710
+ var length = selectors.length, selector;
711
+ for ( var i = 0; i < length; i++ )
712
+ {
713
+ // Assume MS-Word mostly generate only simple
714
+ // selector( [Type selector][Class selector]).
715
+ CKEDITOR.tools.trim( selectors[ i ] )
716
+ .replace( /^(\w+)(\.[\w-]+)?$/g,
717
+ function( match, tagName, className )
718
+ {
719
+ tagName = tagName || '*';
720
+ className = className.substring( 1, className.length );
721
+
722
+ // Reject MS-Word Normal styles.
723
+ if ( className.match( /MsoNormal/ ) )
724
+ return;
725
+
726
+ if ( !rules[ tagName ] )
727
+ rules[ tagName ] = {};
728
+ if ( className )
729
+ rules[ tagName ][ className ] = styleBlock;
730
+ else
731
+ rules[ tagName ] = styleBlock;
732
+ } );
733
+ }
734
+ });
735
+
736
+ filters.applyStyleFilter = function( element )
737
+ {
738
+ var name = rules[ '*' ] ? '*' : element.name,
739
+ className = element.attributes && element.attributes[ 'class' ],
740
+ style;
741
+ if ( name in rules )
742
+ {
743
+ style = rules[ name ];
744
+ if ( typeof style == 'object' )
745
+ style = style[ className ];
746
+ // Maintain style rules priorities.
747
+ style && element.addStyle( style, true );
748
+ }
749
+ };
750
+ }
751
+ }
752
+ return false;
753
+ },
754
+
755
+ 'p' : function( element )
756
+ {
757
+ element.filterChildren();
758
+
759
+ var attrs = element.attributes,
760
+ parent = element.parent,
761
+ children = element.children;
762
+
763
+ // Is the paragraph actually a list item?
764
+ if ( resolveListItem( element ) )
765
+ return;
766
+
767
+ // Adapt paragraph formatting to editor's convention
768
+ // according to enter-mode.
769
+ if ( config.enterMode == CKEDITOR.ENTER_BR )
770
+ {
771
+ // We suffer from attribute/style lost in this situation.
772
+ delete element.name;
773
+ element.add( new CKEDITOR.htmlParser.element( 'br' ) );
774
+ }
775
+ else
776
+ elementMigrateFilter( config[ 'format_' + ( config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) ] )( element );
777
+ },
778
+
779
+ 'div' : function( element )
780
+ {
781
+ // Aligned table with no text surrounded is represented by a wrapper div, from which
782
+ // table cells inherit as text-align styles, which is wrong.
783
+ // Instead we use a clear-float div after the table to properly achieve the same layout.
784
+ var singleChild = element.onlyChild();
785
+ if ( singleChild && singleChild.name == 'table' )
786
+ {
787
+ var attrs = element.attributes;
788
+ singleChild.attributes = CKEDITOR.tools.extend( singleChild.attributes, attrs );
789
+ attrs.style && singleChild.addStyle( attrs.style );
790
+
791
+ var clearFloatDiv = new CKEDITOR.htmlParser.element( 'div' );
792
+ clearFloatDiv.addStyle( 'clear' ,'both' );
793
+ element.add( clearFloatDiv );
794
+ delete element.name;
795
+ }
796
+ },
797
+
798
+ 'td' : function ( element )
799
+ {
800
+ // 'td' in 'thead' is actually <th>.
801
+ if ( element.getAncestor( 'thead') )
802
+ element.name = 'th';
803
+ },
804
+
805
+ // MS-Word sometimes present list as a mixing of normal list
806
+ // and pseudo-list, normalize the previous ones into pseudo form.
807
+ 'ol' : flattenList,
808
+ 'ul' : flattenList,
809
+ 'dl' : flattenList,
810
+
811
+ 'font' : function( element )
812
+ {
813
+ // IE/Safari: drop the font tag if it comes from list bullet text.
814
+ if ( !CKEDITOR.env.gecko && isListBulletIndicator( element.parent ) )
815
+ {
816
+ delete element.name;
817
+ return;
818
+ }
819
+
820
+ element.filterChildren();
821
+
822
+ var attrs = element.attributes,
823
+ styleText = attrs.style,
824
+ parent = element.parent;
825
+
826
+ if ( 'font' == parent.name ) // Merge nested <font> tags.
827
+ {
828
+ CKEDITOR.tools.extend( parent.attributes,
829
+ element.attributes );
830
+ styleText && parent.addStyle( styleText );
831
+ delete element.name;
832
+ return;
833
+ }
834
+ // Convert the merged into a span with all attributes preserved.
835
+ else
836
+ {
837
+ styleText = styleText || '';
838
+ // IE's having those deprecated attributes, normalize them.
839
+ if ( attrs.color )
840
+ {
841
+ attrs.color != '#000000' && ( styleText += 'color:' + attrs.color + ';' );
842
+ delete attrs.color;
843
+ }
844
+ if ( attrs.face )
845
+ {
846
+ styleText += 'font-family:' + attrs.face + ';';
847
+ delete attrs.face;
848
+ }
849
+ // TODO: Mapping size in ranges of xx-small,
850
+ // x-small, small, medium, large, x-large, xx-large.
851
+ if ( attrs.size )
852
+ {
853
+ styleText += 'font-size:' +
854
+ ( attrs.size > 3 ? 'large'
855
+ : ( attrs.size < 3 ? 'small' : 'medium' ) ) + ';';
856
+ delete attrs.size;
857
+ }
858
+
859
+ element.name = 'span';
860
+ element.addStyle( styleText );
861
+ }
862
+ },
863
+
864
+ 'span' : function( element )
865
+ {
866
+ // IE/Safari: remove the span if it comes from list bullet text.
867
+ if ( !CKEDITOR.env.gecko && isListBulletIndicator( element.parent ) )
868
+ return false;
869
+
870
+ element.filterChildren();
871
+ if ( containsNothingButSpaces( element ) )
872
+ {
873
+ delete element.name;
874
+ return null;
875
+ }
876
+
877
+ // For IE/Safari: List item bullet type is supposed to be indicated by
878
+ // the text of a span with style 'mso-list : Ignore' or an image.
879
+ if ( !CKEDITOR.env.gecko && isListBulletIndicator( element ) )
880
+ {
881
+ var listSymbolNode = element.firstChild( function( node )
882
+ {
883
+ return node.value || node.name == 'img';
884
+ });
885
+
886
+ var listSymbol = listSymbolNode && ( listSymbolNode.value || 'l.' ),
887
+ listType = listSymbol.match( /^([^\s]+?)([.)]?)$/ );
888
+ return createListBulletMarker( listType, listSymbol );
889
+ }
890
+
891
+ // Update the src attribute of image element with href.
892
+ var children = element.children,
893
+ attrs = element.attributes,
894
+ styleText = attrs && attrs.style,
895
+ firstChild = children && children[ 0 ];
896
+
897
+ // Assume MS-Word mostly carry font related styles on <span>,
898
+ // adapting them to editor's convention.
899
+ if ( styleText )
900
+ {
901
+ attrs.style = stylesFilter(
902
+ [
903
+ // Drop 'inline-height' style which make lines overlapping.
904
+ [ 'line-height' ],
905
+ [ ( /^font-family$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'font_style' ], 'family' ) : null ] ,
906
+ [ ( /^font-size$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'fontSize_style' ], 'size' ) : null ] ,
907
+ [ ( /^color$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'colorButton_foreStyle' ], 'color' ) : null ] ,
908
+ [ ( /^background-color$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'colorButton_backStyle' ], 'color' ) : null ]
909
+ ] )( styleText, element ) || '';
910
+ }
911
+
912
+ return null;
913
+ },
914
+
915
+ // Migrate basic style formats to editor configured ones.
916
+ 'b' : elementMigrateFilter( config[ 'coreStyles_bold' ] ),
917
+ 'i' : elementMigrateFilter( config[ 'coreStyles_italic' ] ),
918
+ 'u' : elementMigrateFilter( config[ 'coreStyles_underline' ] ),
919
+ 's' : elementMigrateFilter( config[ 'coreStyles_strike' ] ),
920
+ 'sup' : elementMigrateFilter( config[ 'coreStyles_superscript' ] ),
921
+ 'sub' : elementMigrateFilter( config[ 'coreStyles_subscript' ] ),
922
+ // Editor doesn't support anchor with content currently (#3582),
923
+ // drop such anchors with content preserved.
924
+ 'a' : function( element )
925
+ {
926
+ var attrs = element.attributes;
927
+ if ( attrs && !attrs.href && attrs.name )
928
+ delete element.name;
929
+ },
930
+ 'cke:listbullet' : function( element )
931
+ {
932
+ if ( element.getAncestor( /h\d/ ) && !config.pasteFromWordNumberedHeadingToList )
933
+ delete element.name;
934
+ }
935
+ },
936
+
937
+ attributeNames :
938
+ [
939
+ // Remove onmouseover and onmouseout events (from MS Word comments effect)
940
+ [ ( /^onmouse(:?out|over)/ ), '' ],
941
+ // Onload on image element.
942
+ [ ( /^onload$/ ), '' ],
943
+ // Remove office and vml attribute from elements.
944
+ [ ( /(?:v|o):\w+/ ), '' ],
945
+ // Remove lang/language attributes.
946
+ [ ( /^lang/ ), '' ]
947
+ ],
948
+
949
+ attributes :
950
+ {
951
+ 'style' : stylesFilter(
952
+ removeStyles ?
953
+ // Provide a white-list of styles that we preserve, those should
954
+ // be the ones that could later be altered with editor tools.
955
+ [
956
+ // Preserve margin-left/right which used as default indent style in the editor.
957
+ [ ( /^margin$|^margin-(?!bottom|top)/ ), null, function( value, element, name )
958
+ {
959
+ if ( element.name in { p : 1, div : 1 } )
960
+ {
961
+ var indentStyleName = config.contentsLangDirection == 'ltr' ?
962
+ 'margin-left' : 'margin-right';
963
+
964
+ // Extract component value from 'margin' shorthand.
965
+ if ( name == 'margin' )
966
+ {
967
+ value = getStyleComponents( name, value,
968
+ [ indentStyleName ] )[ indentStyleName ];
969
+ }
970
+ else if ( name != indentStyleName )
971
+ return null;
972
+
973
+ if ( value && !emptyMarginRegex.test( value ) )
974
+ return [ indentStyleName, value ];
975
+ }
976
+
977
+ return null;
978
+ } ],
979
+
980
+ // Preserve clear float style.
981
+ [ ( /^clear$/ ) ],
982
+
983
+ [ ( /^border.*|margin.*|vertical-align|float$/ ), null,
984
+ function( value, element )
985
+ {
986
+ if ( element.name == 'img' )
987
+ return value;
988
+ } ],
989
+
990
+ [ (/^width|height$/ ), null,
991
+ function( value, element )
992
+ {
993
+ if ( element.name in { table : 1, td : 1, th : 1, img : 1 } )
994
+ return value;
995
+ } ]
996
+ ] :
997
+ // Otherwise provide a black-list of styles that we remove.
998
+ [
999
+ [ ( /^mso-/ ) ],
1000
+ // Fixing color values.
1001
+ [ ( /-color$/ ), null, function( value )
1002
+ {
1003
+ if ( value == 'transparent' )
1004
+ return false;
1005
+ if ( CKEDITOR.env.gecko )
1006
+ return value.replace( /-moz-use-text-color/g, 'transparent' );
1007
+ } ],
1008
+ // Remove empty margin values, e.g. 0.00001pt 0em 0pt
1009
+ [ ( /^margin$/ ), emptyMarginRegex ],
1010
+ [ 'text-indent', '0cm' ],
1011
+ [ 'page-break-before' ],
1012
+ [ 'tab-stops' ],
1013
+ [ 'display', 'none' ],
1014
+ removeFontStyles ? [ ( /font-?/ ) ] : null
1015
+ ], removeStyles ),
1016
+
1017
+ // Prefer width styles over 'width' attributes.
1018
+ 'width' : function( value, element )
1019
+ {
1020
+ if ( element.name in dtd.$tableContent )
1021
+ return false;
1022
+ },
1023
+ // Prefer border styles over table 'border' attributes.
1024
+ 'border' : function( value, element )
1025
+ {
1026
+ if ( element.name in dtd.$tableContent )
1027
+ return false;
1028
+ },
1029
+
1030
+ // Only Firefox carry style sheet from MS-Word, which
1031
+ // will be applied by us manually. For other browsers
1032
+ // the css className is useless.
1033
+ 'class' : falsyFilter,
1034
+
1035
+ // MS-Word always generate 'background-color' along with 'bgcolor',
1036
+ // simply drop the deprecated attributes.
1037
+ 'bgcolor' : falsyFilter,
1038
+
1039
+ // Deprecate 'valign' attribute in favor of 'vertical-align'.
1040
+ 'valign' : removeStyles ? falsyFilter : function( value, element )
1041
+ {
1042
+ element.addStyle( 'vertical-align', value );
1043
+ return false;
1044
+ }
1045
+ },
1046
+
1047
+ // Fore none-IE, some useful data might be buried under these IE-conditional
1048
+ // comments where RegExp were the right approach to dig them out where usual approach
1049
+ // is transform it into a fake element node which hold the desired data.
1050
+ comment :
1051
+ !CKEDITOR.env.ie ?
1052
+ function( value, node )
1053
+ {
1054
+ var imageInfo = value.match( /<img.*?>/ ),
1055
+ listInfo = value.match( /^\[if !supportLists\]([\s\S]*?)\[endif\]$/ );
1056
+
1057
+ // Seek for list bullet indicator.
1058
+ if ( listInfo )
1059
+ {
1060
+ // Bullet symbol could be either text or an image.
1061
+ var listSymbol = listInfo[ 1 ] || ( imageInfo && 'l.' ),
1062
+ listType = listSymbol && listSymbol.match( />([^\s]+?)([.)]?)</ );
1063
+ return createListBulletMarker( listType, listSymbol );
1064
+ }
1065
+
1066
+ // Reveal the <img> element in conditional comments for Firefox.
1067
+ if ( CKEDITOR.env.gecko && imageInfo )
1068
+ {
1069
+ var img = CKEDITOR.htmlParser.fragment.fromHtml( imageInfo[ 0 ] ).children[ 0 ],
1070
+ previousComment = node.previous,
1071
+ // Try to dig the real image link from vml markup from previous comment text.
1072
+ imgSrcInfo = previousComment && previousComment.value.match( /<v:imagedata[^>]*o:href=['"](.*?)['"]/ ),
1073
+ imgSrc = imgSrcInfo && imgSrcInfo[ 1 ];
1074
+
1075
+ // Is there a real 'src' url to be used?
1076
+ imgSrc && ( img.attributes.src = imgSrc );
1077
+ return img;
1078
+ }
1079
+
1080
+ return false;
1081
+ }
1082
+ : falsyFilter
1083
+ };
1084
+ }
1085
+ };
1086
+
1087
+ // The paste processor here is just a reduced copy of html data processor.
1088
+ var pasteProcessor = function()
1089
+ {
1090
+ this.dataFilter = new CKEDITOR.htmlParser.filter();
1091
+ };
1092
+
1093
+ pasteProcessor.prototype =
1094
+ {
1095
+ toHtml : function( data )
1096
+ {
1097
+ var fragment = CKEDITOR.htmlParser.fragment.fromHtml( data, false ),
1098
+ writer = new CKEDITOR.htmlParser.basicWriter();
1099
+
1100
+ fragment.writeHtml( writer, this.dataFilter );
1101
+ return writer.getHtml( true );
1102
+ }
1103
+ };
1104
+
1105
+ CKEDITOR.cleanWord = function( data, editor )
1106
+ {
1107
+ // Firefox will be confused by those downlevel-revealed IE conditional
1108
+ // comments, fixing them first( convert it to upperlevel-revealed one ).
1109
+ // e.g. <![if !vml]>...<![endif]>
1110
+ if ( CKEDITOR.env.gecko )
1111
+ data = data.replace( /(<!--\[if[^<]*?\])-->([\S\s]*?)<!--(\[endif\]-->)/gi, '$1$2$3' );
1112
+
1113
+ var dataProcessor = new pasteProcessor(),
1114
+ dataFilter = dataProcessor.dataFilter;
1115
+
1116
+ // These rules will have higher priorities than default ones.
1117
+ dataFilter.addRules( CKEDITOR.plugins.pastefromword.getRules( editor ) );
1118
+
1119
+ // Allow extending data filter rules.
1120
+ editor.fire( 'beforeCleanWord', { filter : dataFilter } );
1121
+
1122
+ try
1123
+ {
1124
+ data = dataProcessor.toHtml( data, false );
1125
+ }
1126
+ catch ( e )
1127
+ {
1128
+ alert( editor.lang.pastefromword.error );
1129
+ }
1130
+
1131
+ /* Below post processing those things that are unable to delivered by filter rules. */
1132
+
1133
+ // Remove 'cke' namespaced attribute used in filter rules as marker.
1134
+ data = data.replace( /cke:.*?".*?"/g, '' );
1135
+
1136
+ // Remove empty style attribute.
1137
+ data = data.replace( /style=""/g, '' );
1138
+
1139
+ // Remove the dummy spans ( having no inline style ).
1140
+ data = data.replace( /<span>/g, '' );
1141
+
1142
+ return data;
1143
+ };
1144
+ })();
1145
+
1146
+ /**
1147
+ * Whether to ignore all font related formatting styles, including:
1148
+ * <ul> <li>font size;</li>
1149
+ * <li>font family;</li>
1150
+ * <li>font foreground/background color.</li></ul>
1151
+ * @name CKEDITOR.config.pasteFromWordRemoveFontStyles
1152
+ * @since 3.1
1153
+ * @type Boolean
1154
+ * @default true
1155
+ * @example
1156
+ * config.pasteFromWordRemoveFontStyles = false;
1157
+ */
1158
+
1159
+ /**
1160
+ * Whether to transform MS Word outline numbered headings into lists.
1161
+ * @name CKEDITOR.config.pasteFromWordNumberedHeadingToList
1162
+ * @since 3.1
1163
+ * @type Boolean
1164
+ * @default false
1165
+ * @example
1166
+ * config.pasteFromWordNumberedHeadingToList = true;
1167
+ */
1168
+
1169
+ /**
1170
+ * Whether to remove element styles that can't be managed with the editor. Note
1171
+ * that this doesn't handle the font specific styles, which depends on the
1172
+ * {@link CKEDITOR.config.pasteFromWordRemoveFontStyles} setting instead.
1173
+ * @name CKEDITOR.config.pasteFromWordRemoveStyles
1174
+ * @since 3.1
1175
+ * @type Boolean
1176
+ * @default true
1177
+ * @example
1178
+ * config.pasteFromWordRemoveStyles = false;
1179
+ */