ckeditor-rails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (708) hide show
  1. data/README.md +17 -14
  2. data/lib/ckeditor-rails/version.rb +1 -1
  3. data/vendor/assets/ckeditor/ckeditor/.htaccess +1 -1
  4. data/vendor/assets/ckeditor/ckeditor/CHANGES.html +139 -3
  5. data/vendor/assets/ckeditor/ckeditor/INSTALL.html +92 -92
  6. data/vendor/assets/ckeditor/ckeditor/LICENSE.html +2 -2
  7. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/application.xml +32 -32
  8. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/run.bat +9 -9
  9. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/run.sh +1 -1
  10. data/vendor/assets/ckeditor/ckeditor/_samples/adobeair/sample.html +45 -45
  11. data/vendor/assets/ckeditor/ckeditor/_samples/ajax.html +98 -98
  12. data/vendor/assets/ckeditor/ckeditor/_samples/api.html +192 -192
  13. data/vendor/assets/ckeditor/ckeditor/_samples/api_dialog.html +198 -198
  14. data/vendor/assets/ckeditor/ckeditor/_samples/api_dialog/my_dialog.js +28 -28
  15. data/vendor/assets/ckeditor/ckeditor/_samples/asp/advanced.asp +105 -105
  16. data/vendor/assets/ckeditor/ckeditor/_samples/asp/events.asp +136 -136
  17. data/vendor/assets/ckeditor/ckeditor/_samples/asp/index.html +103 -103
  18. data/vendor/assets/ckeditor/ckeditor/_samples/asp/replace.asp +72 -72
  19. data/vendor/assets/ckeditor/ckeditor/_samples/asp/replaceall.asp +77 -77
  20. data/vendor/assets/ckeditor/ckeditor/_samples/asp/sample_posteddata.asp +46 -46
  21. data/vendor/assets/ckeditor/ckeditor/_samples/asp/standalone.asp +72 -72
  22. data/vendor/assets/ckeditor/ckeditor/_samples/assets/_posteddata.php +59 -59
  23. data/vendor/assets/ckeditor/ckeditor/_samples/assets/output_xhtml.css +204 -204
  24. data/vendor/assets/ckeditor/ckeditor/_samples/assets/parsesample.css +70 -70
  25. data/vendor/assets/ckeditor/ckeditor/_samples/assets/swfobject.js +18 -18
  26. data/vendor/assets/ckeditor/ckeditor/_samples/autogrow.html +108 -107
  27. data/vendor/assets/ckeditor/ckeditor/_samples/bbcode.html +125 -125
  28. data/vendor/assets/ckeditor/ckeditor/_samples/devtools.html +94 -94
  29. data/vendor/assets/ckeditor/ckeditor/_samples/divreplace.html +154 -154
  30. data/vendor/assets/ckeditor/ckeditor/_samples/enterkey.html +115 -115
  31. data/vendor/assets/ckeditor/ckeditor/_samples/fullpage.html +82 -82
  32. data/vendor/assets/ckeditor/ckeditor/_samples/index.html +116 -116
  33. data/vendor/assets/ckeditor/ckeditor/_samples/jqueryadapter.html +99 -99
  34. data/vendor/assets/ckeditor/ckeditor/_samples/output_for_flash.html +275 -275
  35. data/vendor/assets/ckeditor/ckeditor/_samples/output_html.html +285 -285
  36. data/vendor/assets/ckeditor/ckeditor/_samples/output_xhtml.html +181 -177
  37. data/vendor/assets/ckeditor/ckeditor/_samples/php/advanced.php +120 -120
  38. data/vendor/assets/ckeditor/ckeditor/_samples/php/events.php +153 -153
  39. data/vendor/assets/ckeditor/ckeditor/_samples/php/index.html +47 -47
  40. data/vendor/assets/ckeditor/ckeditor/_samples/php/replace.php +87 -87
  41. data/vendor/assets/ckeditor/ckeditor/_samples/php/replaceall.php +88 -88
  42. data/vendor/assets/ckeditor/ckeditor/_samples/php/standalone.php +83 -83
  43. data/vendor/assets/ckeditor/ckeditor/_samples/placeholder.html +81 -81
  44. data/vendor/assets/ckeditor/ckeditor/_samples/readonly.html +91 -91
  45. data/vendor/assets/ckeditor/ckeditor/_samples/replacebyclass.html +64 -64
  46. data/vendor/assets/ckeditor/ckeditor/_samples/replacebycode.html +97 -97
  47. data/vendor/assets/ckeditor/ckeditor/_samples/sample.css +163 -163
  48. data/vendor/assets/ckeditor/ckeditor/_samples/sample.js +65 -65
  49. data/vendor/assets/ckeditor/ckeditor/_samples/sample_posteddata.php +21 -21
  50. data/vendor/assets/ckeditor/ckeditor/_samples/sharedspaces.html +153 -153
  51. data/vendor/assets/ckeditor/ckeditor/_samples/skins.html +110 -110
  52. data/vendor/assets/ckeditor/ckeditor/_samples/stylesheetparser.html +93 -93
  53. data/vendor/assets/ckeditor/ckeditor/_samples/tableresize.html +115 -115
  54. data/vendor/assets/ckeditor/ckeditor/_samples/ui_color.html +129 -129
  55. data/vendor/assets/ckeditor/ckeditor/_samples/ui_languages.html +134 -134
  56. data/vendor/assets/ckeditor/ckeditor/_source/adapters/jquery.js +306 -306
  57. data/vendor/assets/ckeditor/ckeditor/_source/core/_bootstrap.js +87 -87
  58. data/vendor/assets/ckeditor/ckeditor/_source/core/ckeditor.js +141 -141
  59. data/vendor/assets/ckeditor/ckeditor/_source/core/ckeditor_base.js +235 -227
  60. data/vendor/assets/ckeditor/ckeditor/_source/core/ckeditor_basic.js +238 -238
  61. data/vendor/assets/ckeditor/ckeditor/_source/core/command.js +225 -209
  62. data/vendor/assets/ckeditor/ckeditor/_source/core/commanddefinition.js +129 -129
  63. data/vendor/assets/ckeditor/ckeditor/_source/core/config.js +447 -431
  64. data/vendor/assets/ckeditor/ckeditor/_source/core/dataprocessor.js +65 -65
  65. data/vendor/assets/ckeditor/ckeditor/_source/core/dom.js +20 -20
  66. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/comment.js +44 -32
  67. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/document.js +251 -251
  68. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/documentfragment.js +49 -49
  69. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/domobject.js +258 -258
  70. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/element.js +1796 -1681
  71. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/elementpath.js +117 -119
  72. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/event.js +145 -145
  73. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/node.js +691 -695
  74. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/nodelist.js +26 -26
  75. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/range.js +2068 -2032
  76. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/rangelist.js +213 -213
  77. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/text.js +128 -128
  78. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/walker.js +496 -462
  79. data/vendor/assets/ckeditor/ckeditor/_source/core/dom/window.js +96 -96
  80. data/vendor/assets/ckeditor/ckeditor/_source/core/dtd.js +266 -266
  81. data/vendor/assets/ckeditor/ckeditor/_source/core/editor.js +1059 -1059
  82. data/vendor/assets/ckeditor/ckeditor/_source/core/editor_basic.js +186 -186
  83. data/vendor/assets/ckeditor/ckeditor/_source/core/env.js +305 -291
  84. data/vendor/assets/ckeditor/ckeditor/_source/core/event.js +342 -342
  85. data/vendor/assets/ckeditor/ckeditor/_source/core/eventInfo.js +120 -120
  86. data/vendor/assets/ckeditor/ckeditor/_source/core/focusmanager.js +152 -152
  87. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser.js +224 -224
  88. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/basicwriter.js +145 -145
  89. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/cdata.js +43 -43
  90. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/comment.js +60 -60
  91. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/element.js +308 -308
  92. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/filter.js +288 -288
  93. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/fragment.js +537 -497
  94. data/vendor/assets/ckeditor/ckeditor/_source/core/htmlparser/text.js +53 -55
  95. data/vendor/assets/ckeditor/ckeditor/_source/core/lang.js +157 -157
  96. data/vendor/assets/ckeditor/ckeditor/_source/core/loader.js +240 -240
  97. data/vendor/assets/ckeditor/ckeditor/_source/core/plugindefinition.js +83 -83
  98. data/vendor/assets/ckeditor/ckeditor/_source/core/plugins.js +103 -103
  99. data/vendor/assets/ckeditor/ckeditor/_source/core/resourcemanager.js +238 -238
  100. data/vendor/assets/ckeditor/ckeditor/_source/core/scriptloader.js +180 -180
  101. data/vendor/assets/ckeditor/ckeditor/_source/core/skins.js +184 -184
  102. data/vendor/assets/ckeditor/ckeditor/_source/core/themes.js +19 -19
  103. data/vendor/assets/ckeditor/ckeditor/_source/core/tools.js +763 -763
  104. data/vendor/assets/ckeditor/ckeditor/_source/core/ui.js +128 -128
  105. data/vendor/assets/ckeditor/ckeditor/_source/lang/_languages.js +84 -84
  106. data/vendor/assets/ckeditor/ckeditor/_source/lang/_translationstatus.txt +63 -61
  107. data/vendor/assets/ckeditor/ckeditor/_source/lang/af.js +815 -812
  108. data/vendor/assets/ckeditor/ckeditor/_source/lang/ar.js +815 -812
  109. data/vendor/assets/ckeditor/ckeditor/_source/lang/bg.js +815 -812
  110. data/vendor/assets/ckeditor/ckeditor/_source/lang/bn.js +815 -812
  111. data/vendor/assets/ckeditor/ckeditor/_source/lang/bs.js +815 -812
  112. data/vendor/assets/ckeditor/ckeditor/_source/lang/ca.js +815 -812
  113. data/vendor/assets/ckeditor/ckeditor/_source/lang/cs.js +815 -812
  114. data/vendor/assets/ckeditor/ckeditor/_source/lang/cy.js +815 -812
  115. data/vendor/assets/ckeditor/ckeditor/_source/lang/da.js +815 -812
  116. data/vendor/assets/ckeditor/ckeditor/_source/lang/de.js +815 -812
  117. data/vendor/assets/ckeditor/ckeditor/_source/lang/el.js +815 -812
  118. data/vendor/assets/ckeditor/ckeditor/_source/lang/en-au.js +815 -812
  119. data/vendor/assets/ckeditor/ckeditor/_source/lang/en-ca.js +815 -812
  120. data/vendor/assets/ckeditor/ckeditor/_source/lang/en-gb.js +815 -812
  121. data/vendor/assets/ckeditor/ckeditor/_source/lang/en.js +815 -812
  122. data/vendor/assets/ckeditor/ckeditor/_source/lang/eo.js +815 -812
  123. data/vendor/assets/ckeditor/ckeditor/_source/lang/es.js +815 -812
  124. data/vendor/assets/ckeditor/ckeditor/_source/lang/et.js +815 -812
  125. data/vendor/assets/ckeditor/ckeditor/_source/lang/eu.js +815 -812
  126. data/vendor/assets/ckeditor/ckeditor/_source/lang/fa.js +815 -812
  127. data/vendor/assets/ckeditor/ckeditor/_source/lang/fi.js +815 -812
  128. data/vendor/assets/ckeditor/ckeditor/_source/lang/fo.js +815 -812
  129. data/vendor/assets/ckeditor/ckeditor/_source/lang/fr-ca.js +815 -812
  130. data/vendor/assets/ckeditor/ckeditor/_source/lang/fr.js +815 -812
  131. data/vendor/assets/ckeditor/ckeditor/_source/lang/gl.js +815 -812
  132. data/vendor/assets/ckeditor/ckeditor/_source/lang/gu.js +815 -812
  133. data/vendor/assets/ckeditor/ckeditor/_source/lang/he.js +815 -812
  134. data/vendor/assets/ckeditor/ckeditor/_source/lang/hi.js +815 -812
  135. data/vendor/assets/ckeditor/ckeditor/_source/lang/hr.js +815 -812
  136. data/vendor/assets/ckeditor/ckeditor/_source/lang/hu.js +815 -812
  137. data/vendor/assets/ckeditor/ckeditor/_source/lang/is.js +815 -812
  138. data/vendor/assets/ckeditor/ckeditor/_source/lang/it.js +815 -812
  139. data/vendor/assets/ckeditor/ckeditor/_source/lang/ja.js +815 -812
  140. data/vendor/assets/ckeditor/ckeditor/_source/lang/ka.js +815 -812
  141. data/vendor/assets/ckeditor/ckeditor/_source/lang/km.js +815 -812
  142. data/vendor/assets/ckeditor/ckeditor/_source/lang/ko.js +815 -812
  143. data/vendor/assets/ckeditor/ckeditor/_source/lang/lt.js +815 -812
  144. data/vendor/assets/ckeditor/ckeditor/_source/lang/lv.js +815 -812
  145. data/vendor/assets/ckeditor/ckeditor/_source/lang/mk.js +814 -0
  146. data/vendor/assets/ckeditor/ckeditor/_source/lang/mn.js +815 -812
  147. data/vendor/assets/ckeditor/ckeditor/_source/lang/ms.js +815 -812
  148. data/vendor/assets/ckeditor/ckeditor/_source/lang/nb.js +815 -812
  149. data/vendor/assets/ckeditor/ckeditor/_source/lang/nl.js +815 -812
  150. data/vendor/assets/ckeditor/ckeditor/_source/lang/no.js +815 -812
  151. data/vendor/assets/ckeditor/ckeditor/_source/lang/pl.js +815 -812
  152. data/vendor/assets/ckeditor/ckeditor/_source/lang/pt-br.js +814 -811
  153. data/vendor/assets/ckeditor/ckeditor/_source/lang/pt.js +815 -812
  154. data/vendor/assets/ckeditor/ckeditor/_source/lang/ro.js +815 -812
  155. data/vendor/assets/ckeditor/ckeditor/_source/lang/ru.js +815 -812
  156. data/vendor/assets/ckeditor/ckeditor/_source/lang/sk.js +815 -812
  157. data/vendor/assets/ckeditor/ckeditor/_source/lang/sl.js +815 -812
  158. data/vendor/assets/ckeditor/ckeditor/_source/lang/sr-latn.js +815 -812
  159. data/vendor/assets/ckeditor/ckeditor/_source/lang/sr.js +815 -812
  160. data/vendor/assets/ckeditor/ckeditor/_source/lang/sv.js +814 -811
  161. data/vendor/assets/ckeditor/ckeditor/_source/lang/th.js +815 -812
  162. data/vendor/assets/ckeditor/ckeditor/_source/lang/tr.js +814 -811
  163. data/vendor/assets/ckeditor/ckeditor/_source/lang/ug.js +814 -0
  164. data/vendor/assets/ckeditor/ckeditor/_source/lang/uk.js +815 -812
  165. data/vendor/assets/ckeditor/ckeditor/_source/lang/vi.js +815 -812
  166. data/vendor/assets/ckeditor/ckeditor/_source/lang/zh-cn.js +815 -812
  167. data/vendor/assets/ckeditor/ckeditor/_source/lang/zh.js +815 -812
  168. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js +222 -222
  169. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/_translationstatus.txt +23 -0
  170. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/cs.js +89 -0
  171. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/cy.js +89 -0
  172. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/da.js +89 -0
  173. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/de.js +89 -0
  174. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/el.js +89 -0
  175. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/en.js +108 -108
  176. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/eo.js +89 -0
  177. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/fa.js +89 -0
  178. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/fi.js +89 -0
  179. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/fr.js +89 -0
  180. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/gu.js +89 -0
  181. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/he.js +89 -216
  182. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/it.js +89 -0
  183. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/mk.js +89 -0
  184. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/nb.js +89 -0
  185. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/nl.js +89 -0
  186. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/no.js +89 -0
  187. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/tr.js +89 -0
  188. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/ug.js +89 -0
  189. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/vi.js +89 -0
  190. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/lang/zh-cn.js +89 -0
  191. data/vendor/assets/ckeditor/ckeditor/_source/plugins/a11yhelp/plugin.js +47 -47
  192. data/vendor/assets/ckeditor/ckeditor/_source/plugins/about/dialogs/about.js +76 -76
  193. data/vendor/assets/ckeditor/ckeditor/_source/plugins/about/plugin.js +24 -24
  194. data/vendor/assets/ckeditor/ckeditor/_source/plugins/adobeair/plugin.js +228 -228
  195. data/vendor/assets/ckeditor/ckeditor/_source/plugins/ajax/plugin.js +152 -152
  196. data/vendor/assets/ckeditor/ckeditor/_source/plugins/autogrow/plugin.js +141 -88
  197. data/vendor/assets/ckeditor/ckeditor/_source/plugins/basicstyles/plugin.js +129 -101
  198. data/vendor/assets/ckeditor/ckeditor/_source/plugins/bbcode/plugin.js +931 -931
  199. data/vendor/assets/ckeditor/ckeditor/_source/plugins/bidi/plugin.js +334 -334
  200. data/vendor/assets/ckeditor/ckeditor/_source/plugins/blockquote/plugin.js +305 -305
  201. data/vendor/assets/ckeditor/ckeditor/_source/plugins/button/plugin.js +290 -290
  202. data/vendor/assets/ckeditor/ckeditor/_source/plugins/clipboard/dialogs/paste.js +223 -223
  203. data/vendor/assets/ckeditor/ckeditor/_source/plugins/clipboard/plugin.js +479 -453
  204. data/vendor/assets/ckeditor/ckeditor/_source/plugins/colorbutton/plugin.js +300 -294
  205. data/vendor/assets/ckeditor/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js +387 -340
  206. data/vendor/assets/ckeditor/ckeditor/_source/plugins/colordialog/plugin.js +15 -15
  207. data/vendor/assets/ckeditor/ckeditor/_source/plugins/contextmenu/plugin.js +179 -177
  208. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/_translationstatus.txt +27 -0
  209. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/bg.js +16 -0
  210. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/cs.js +16 -0
  211. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/cy.js +16 -0
  212. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/da.js +16 -0
  213. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/de.js +16 -0
  214. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/el.js +16 -0
  215. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/en.js +16 -16
  216. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/eo.js +16 -0
  217. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/et.js +16 -0
  218. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/fa.js +16 -0
  219. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/fi.js +16 -0
  220. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/fr.js +16 -0
  221. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/gu.js +16 -0
  222. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/he.js +16 -0
  223. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/hr.js +16 -0
  224. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/it.js +16 -0
  225. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/nb.js +16 -0
  226. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/nl.js +16 -0
  227. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/no.js +16 -0
  228. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/pl.js +16 -0
  229. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/tr.js +16 -0
  230. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/ug.js +16 -0
  231. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/uk.js +16 -0
  232. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/vi.js +16 -0
  233. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/lang/zh-cn.js +16 -0
  234. data/vendor/assets/ckeditor/ckeditor/_source/plugins/devtools/plugin.js +173 -173
  235. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialog/dialogDefinition.js +1166 -1166
  236. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialog/plugin.js +3319 -3289
  237. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialogadvtab/plugin.js +208 -207
  238. data/vendor/assets/ckeditor/ckeditor/_source/plugins/dialogui/plugin.js +1549 -1541
  239. data/vendor/assets/ckeditor/ckeditor/_source/plugins/div/dialogs/div.js +535 -535
  240. data/vendor/assets/ckeditor/ckeditor/_source/plugins/div/plugin.js +121 -121
  241. data/vendor/assets/ckeditor/ckeditor/_source/plugins/docprops/dialogs/docprops.js +674 -686
  242. data/vendor/assets/ckeditor/ckeditor/_source/plugins/docprops/plugin.js +22 -22
  243. data/vendor/assets/ckeditor/ckeditor/_source/plugins/domiterator/plugin.js +366 -361
  244. data/vendor/assets/ckeditor/ckeditor/_source/plugins/editingblock/plugin.js +278 -275
  245. data/vendor/assets/ckeditor/ckeditor/_source/plugins/elementspath/plugin.js +218 -218
  246. data/vendor/assets/ckeditor/ckeditor/_source/plugins/enterkey/plugin.js +433 -413
  247. data/vendor/assets/ckeditor/ckeditor/_source/plugins/entities/plugin.js +254 -250
  248. data/vendor/assets/ckeditor/ckeditor/_source/plugins/fakeobjects/plugin.js +175 -175
  249. data/vendor/assets/ckeditor/ckeditor/_source/plugins/filebrowser/plugin.js +533 -524
  250. data/vendor/assets/ckeditor/ckeditor/_source/plugins/find/dialogs/find.js +915 -903
  251. data/vendor/assets/ckeditor/ckeditor/_source/plugins/find/plugin.js +47 -47
  252. data/vendor/assets/ckeditor/ckeditor/_source/plugins/flash/dialogs/flash.js +674 -673
  253. data/vendor/assets/ckeditor/ckeditor/_source/plugins/flash/plugin.js +154 -154
  254. data/vendor/assets/ckeditor/ckeditor/_source/plugins/floatpanel/plugin.js +476 -428
  255. data/vendor/assets/ckeditor/ckeditor/_source/plugins/font/plugin.js +234 -234
  256. data/vendor/assets/ckeditor/ckeditor/_source/plugins/format/plugin.js +197 -197
  257. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/button.js +118 -118
  258. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/checkbox.js +153 -153
  259. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/form.js +177 -177
  260. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/hiddenfield.js +100 -100
  261. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/radio.js +135 -135
  262. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/select.js +558 -558
  263. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/textarea.js +135 -114
  264. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/dialogs/textfield.js +199 -199
  265. data/vendor/assets/ckeditor/ckeditor/_source/plugins/forms/plugin.js +288 -288
  266. data/vendor/assets/ckeditor/ckeditor/_source/plugins/horizontalrule/plugin.js +48 -48
  267. data/vendor/assets/ckeditor/ckeditor/_source/plugins/htmldataprocessor/plugin.js +600 -595
  268. data/vendor/assets/ckeditor/ckeditor/_source/plugins/htmlwriter/plugin.js +319 -319
  269. data/vendor/assets/ckeditor/ckeditor/_source/plugins/iframe/dialogs/iframe.js +229 -229
  270. data/vendor/assets/ckeditor/ckeditor/_source/plugins/iframe/plugin.js +87 -87
  271. data/vendor/assets/ckeditor/ckeditor/_source/plugins/iframedialog/plugin.js +188 -188
  272. data/vendor/assets/ckeditor/ckeditor/_source/plugins/image/dialogs/image.js +1406 -1406
  273. data/vendor/assets/ckeditor/ckeditor/_source/plugins/image/plugin.js +164 -81
  274. data/vendor/assets/ckeditor/ckeditor/_source/plugins/indent/plugin.js +480 -461
  275. data/vendor/assets/ckeditor/ckeditor/_source/plugins/justify/plugin.js +251 -253
  276. data/vendor/assets/ckeditor/ckeditor/_source/plugins/keystrokes/plugin.js +225 -225
  277. data/vendor/assets/ckeditor/ckeditor/_source/plugins/link/dialogs/anchor.js +144 -144
  278. data/vendor/assets/ckeditor/ckeditor/_source/plugins/link/dialogs/link.js +1427 -1424
  279. data/vendor/assets/ckeditor/ckeditor/_source/plugins/link/plugin.js +374 -374
  280. data/vendor/assets/ckeditor/ckeditor/_source/plugins/list/plugin.js +967 -734
  281. data/vendor/assets/ckeditor/ckeditor/_source/plugins/listblock/plugin.js +260 -268
  282. data/vendor/assets/ckeditor/ckeditor/_source/plugins/liststyle/dialogs/liststyle.js +225 -225
  283. data/vendor/assets/ckeditor/ckeditor/_source/plugins/liststyle/plugin.js +66 -66
  284. data/vendor/assets/ckeditor/ckeditor/_source/plugins/maximize/plugin.js +353 -352
  285. data/vendor/assets/ckeditor/ckeditor/_source/plugins/menu/plugin.js +542 -541
  286. data/vendor/assets/ckeditor/ckeditor/_source/plugins/menubutton/plugin.js +98 -98
  287. data/vendor/assets/ckeditor/ckeditor/_source/plugins/newpage/plugin.js +55 -54
  288. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pagebreak/plugin.js +164 -164
  289. data/vendor/assets/ckeditor/ckeditor/_source/plugins/panel/plugin.js +396 -403
  290. data/vendor/assets/ckeditor/ckeditor/_source/plugins/panelbutton/plugin.js +144 -144
  291. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastefromword/filter/default.js +1367 -1367
  292. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastefromword/plugin.js +141 -141
  293. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastetext/dialogs/pastetext.js +67 -67
  294. data/vendor/assets/ckeditor/ckeditor/_source/plugins/pastetext/plugin.js +98 -98
  295. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js +71 -71
  296. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/_translationstatus.txt +26 -0
  297. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/bg.js +16 -0
  298. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/cs.js +16 -0
  299. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/cy.js +16 -0
  300. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/da.js +16 -0
  301. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/de.js +16 -0
  302. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/el.js +16 -0
  303. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/en.js +16 -16
  304. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/eo.js +16 -0
  305. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/et.js +16 -0
  306. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/fa.js +16 -0
  307. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/fi.js +16 -0
  308. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/fr.js +16 -0
  309. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/he.js +16 -16
  310. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/hr.js +16 -0
  311. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/it.js +16 -0
  312. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/nb.js +16 -0
  313. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/nl.js +16 -0
  314. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/no.js +16 -0
  315. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/pl.js +16 -0
  316. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/tr.js +16 -0
  317. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/ug.js +16 -0
  318. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/uk.js +16 -0
  319. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/vi.js +16 -0
  320. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/lang/zh-cn.js +16 -0
  321. data/vendor/assets/ckeditor/ckeditor/_source/plugins/placeholder/plugin.js +171 -171
  322. data/vendor/assets/ckeditor/ckeditor/_source/plugins/popup/plugin.js +69 -64
  323. data/vendor/assets/ckeditor/ckeditor/_source/plugins/preview/plugin.js +113 -109
  324. data/vendor/assets/ckeditor/ckeditor/_source/plugins/print/plugin.js +42 -42
  325. data/vendor/assets/ckeditor/ckeditor/_source/plugins/removeformat/plugin.js +185 -185
  326. data/vendor/assets/ckeditor/ckeditor/_source/plugins/resize/plugin.js +169 -168
  327. data/vendor/assets/ckeditor/ckeditor/_source/plugins/richcombo/plugin.js +381 -381
  328. data/vendor/assets/ckeditor/ckeditor/_source/plugins/save/plugin.js +56 -56
  329. data/vendor/assets/ckeditor/ckeditor/_source/plugins/scayt/dialogs/options.js +537 -537
  330. data/vendor/assets/ckeditor/ckeditor/_source/plugins/scayt/dialogs/toolbar.css +71 -71
  331. data/vendor/assets/ckeditor/ckeditor/_source/plugins/scayt/plugin.js +973 -964
  332. data/vendor/assets/ckeditor/ckeditor/_source/plugins/selection/plugin.js +1855 -1601
  333. data/vendor/assets/ckeditor/ckeditor/_source/plugins/showblocks/plugin.js +160 -160
  334. data/vendor/assets/ckeditor/ckeditor/_source/plugins/showborders/plugin.js +207 -207
  335. data/vendor/assets/ckeditor/ckeditor/_source/plugins/smiley/dialogs/smiley.js +224 -224
  336. data/vendor/assets/ckeditor/ckeditor/_source/plugins/smiley/plugin.js +94 -94
  337. data/vendor/assets/ckeditor/ckeditor/_source/plugins/sourcearea/plugin.js +209 -209
  338. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/dialogs/specialchar.js +350 -350
  339. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/_translationstatus.txt +19 -0
  340. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/cs.js +126 -0
  341. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/cy.js +126 -0
  342. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/de.js +126 -0
  343. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/en.js +126 -89
  344. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/eo.js +126 -0
  345. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/et.js +126 -0
  346. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/fa.js +126 -0
  347. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/fi.js +126 -0
  348. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/fr.js +126 -0
  349. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/hr.js +126 -0
  350. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/it.js +126 -0
  351. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/nb.js +126 -0
  352. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/nl.js +126 -0
  353. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/no.js +126 -0
  354. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/tr.js +126 -0
  355. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/ug.js +126 -0
  356. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/lang/zh-cn.js +126 -0
  357. data/vendor/assets/ckeditor/ckeditor/_source/plugins/specialchar/plugin.js +70 -70
  358. data/vendor/assets/ckeditor/ckeditor/_source/plugins/styles/plugin.js +1706 -1696
  359. data/vendor/assets/ckeditor/ckeditor/_source/plugins/styles/styles/default.js +88 -88
  360. data/vendor/assets/ckeditor/ckeditor/_source/plugins/stylescombo/plugin.js +218 -218
  361. data/vendor/assets/ckeditor/ckeditor/_source/plugins/stylesheetparser/plugin.js +148 -148
  362. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tab/plugin.js +367 -367
  363. data/vendor/assets/ckeditor/ckeditor/_source/plugins/table/dialogs/table.js +618 -602
  364. data/vendor/assets/ckeditor/ckeditor/_source/plugins/table/plugin.js +78 -78
  365. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tableresize/plugin.js +443 -443
  366. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tabletools/dialogs/tableCell.js +520 -525
  367. data/vendor/assets/ckeditor/ckeditor/_source/plugins/tabletools/plugin.js +1185 -1194
  368. data/vendor/assets/ckeditor/ckeditor/_source/plugins/templates/dialogs/templates.js +234 -234
  369. data/vendor/assets/ckeditor/ckeditor/_source/plugins/templates/plugin.js +100 -99
  370. data/vendor/assets/ckeditor/ckeditor/_source/plugins/templates/templates/default.js +94 -94
  371. data/vendor/assets/ckeditor/ckeditor/_source/plugins/toolbar/plugin.js +545 -545
  372. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/dialogs/uicolor.js +205 -205
  373. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/_translationstatus.txt +27 -0
  374. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/bg.js +15 -0
  375. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/cs.js +15 -0
  376. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/cy.js +15 -0
  377. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/da.js +15 -0
  378. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/de.js +15 -0
  379. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/el.js +15 -0
  380. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/en.js +15 -15
  381. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/eo.js +15 -0
  382. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/et.js +15 -0
  383. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/fa.js +15 -0
  384. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/fi.js +15 -0
  385. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/fr.js +15 -0
  386. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/he.js +15 -15
  387. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/hr.js +15 -0
  388. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/it.js +15 -0
  389. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/mk.js +15 -0
  390. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/nb.js +15 -0
  391. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/nl.js +15 -0
  392. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/no.js +15 -0
  393. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/pl.js +15 -0
  394. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/tr.js +15 -0
  395. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/ug.js +15 -0
  396. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/uk.js +15 -0
  397. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/vi.js +15 -0
  398. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/lang/zh-cn.js +15 -0
  399. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/plugin.js +37 -37
  400. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/yui/assets/yui.css +15 -15
  401. data/vendor/assets/ckeditor/ckeditor/_source/plugins/uicolor/yui/yui.js +71 -71
  402. data/vendor/assets/ckeditor/ckeditor/_source/plugins/undo/plugin.js +593 -580
  403. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/ciframe.html +49 -49
  404. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/tmpFrameset.html +52 -52
  405. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/wsc.css +82 -82
  406. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/dialogs/wsc.js +192 -192
  407. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wsc/plugin.js +33 -33
  408. data/vendor/assets/ckeditor/ckeditor/_source/plugins/wysiwygarea/plugin.js +1346 -1351
  409. data/vendor/assets/ckeditor/ckeditor/_source/plugins/xml/plugin.js +170 -170
  410. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/dialog.css +989 -943
  411. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/editor.css +25 -25
  412. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/elementspath.css +73 -73
  413. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/icons.css +366 -366
  414. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/mainui.css +206 -203
  415. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/menu.css +232 -232
  416. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/panel.css +217 -217
  417. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/presets.css +49 -49
  418. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/reset.css +85 -84
  419. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/richcombo.css +287 -287
  420. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/skin.js +236 -236
  421. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/templates.css +88 -88
  422. data/vendor/assets/ckeditor/ckeditor/_source/skins/kama/toolbar.css +408 -407
  423. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/dialog.css +891 -844
  424. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/editor.css +25 -25
  425. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/elementspath.css +74 -74
  426. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/icons.css +363 -363
  427. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/mainui.css +153 -153
  428. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/menu.css +229 -229
  429. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/panel.css +212 -212
  430. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/presets.css +49 -49
  431. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/reset.css +85 -84
  432. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/richcombo.css +309 -309
  433. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/skin.js +74 -74
  434. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/templates.css +87 -87
  435. data/vendor/assets/ckeditor/ckeditor/_source/skins/office2003/toolbar.css +522 -522
  436. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/dialog.css +907 -861
  437. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/editor.css +25 -25
  438. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/elementspath.css +74 -74
  439. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/icons.css +363 -363
  440. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/mainui.css +162 -162
  441. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/menu.css +232 -232
  442. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/panel.css +212 -212
  443. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/presets.css +50 -50
  444. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/reset.css +85 -84
  445. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/richcombo.css +302 -302
  446. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/skin.js +70 -70
  447. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/templates.css +87 -87
  448. data/vendor/assets/ckeditor/ckeditor/_source/skins/v2/toolbar.css +465 -465
  449. data/vendor/assets/ckeditor/ckeditor/_source/themes/default/theme.js +407 -395
  450. data/vendor/assets/ckeditor/ckeditor/adapters/jquery.js +6 -6
  451. data/vendor/assets/ckeditor/ckeditor/ckeditor.asp +955 -955
  452. data/vendor/assets/ckeditor/ckeditor/ckeditor.js +134 -130
  453. data/vendor/assets/ckeditor/ckeditor/ckeditor.pack +211 -211
  454. data/vendor/assets/ckeditor/ckeditor/ckeditor.php +29 -29
  455. data/vendor/assets/ckeditor/ckeditor/ckeditor_basic.js +8 -8
  456. data/vendor/assets/ckeditor/ckeditor/ckeditor_basic_source.js +20 -20
  457. data/vendor/assets/ckeditor/ckeditor/ckeditor_php4.php +566 -566
  458. data/vendor/assets/ckeditor/ckeditor/ckeditor_php5.php +556 -556
  459. data/vendor/assets/ckeditor/ckeditor/ckeditor_source.js +14 -4
  460. data/vendor/assets/ckeditor/ckeditor/config.js +11 -11
  461. data/vendor/assets/ckeditor/ckeditor/contents.css +25 -25
  462. data/vendor/assets/ckeditor/ckeditor/lang/_languages.js +1 -1
  463. data/vendor/assets/ckeditor/ckeditor/lang/_translationstatus.txt +61 -59
  464. data/vendor/assets/ckeditor/ckeditor/lang/af.js +2 -2
  465. data/vendor/assets/ckeditor/ckeditor/lang/ar.js +2 -2
  466. data/vendor/assets/ckeditor/ckeditor/lang/bg.js +2 -2
  467. data/vendor/assets/ckeditor/ckeditor/lang/bn.js +2 -2
  468. data/vendor/assets/ckeditor/ckeditor/lang/bs.js +2 -2
  469. data/vendor/assets/ckeditor/ckeditor/lang/ca.js +2 -2
  470. data/vendor/assets/ckeditor/ckeditor/lang/cs.js +2 -2
  471. data/vendor/assets/ckeditor/ckeditor/lang/cy.js +2 -2
  472. data/vendor/assets/ckeditor/ckeditor/lang/da.js +2 -2
  473. data/vendor/assets/ckeditor/ckeditor/lang/de.js +2 -2
  474. data/vendor/assets/ckeditor/ckeditor/lang/el.js +2 -2
  475. data/vendor/assets/ckeditor/ckeditor/lang/en-au.js +2 -2
  476. data/vendor/assets/ckeditor/ckeditor/lang/en-ca.js +2 -2
  477. data/vendor/assets/ckeditor/ckeditor/lang/en-gb.js +2 -2
  478. data/vendor/assets/ckeditor/ckeditor/lang/en.js +2 -2
  479. data/vendor/assets/ckeditor/ckeditor/lang/eo.js +2 -2
  480. data/vendor/assets/ckeditor/ckeditor/lang/es.js +2 -2
  481. data/vendor/assets/ckeditor/ckeditor/lang/et.js +2 -2
  482. data/vendor/assets/ckeditor/ckeditor/lang/eu.js +2 -2
  483. data/vendor/assets/ckeditor/ckeditor/lang/fa.js +2 -2
  484. data/vendor/assets/ckeditor/ckeditor/lang/fi.js +2 -2
  485. data/vendor/assets/ckeditor/ckeditor/lang/fo.js +2 -2
  486. data/vendor/assets/ckeditor/ckeditor/lang/fr-ca.js +2 -2
  487. data/vendor/assets/ckeditor/ckeditor/lang/fr.js +2 -2
  488. data/vendor/assets/ckeditor/ckeditor/lang/gl.js +2 -2
  489. data/vendor/assets/ckeditor/ckeditor/lang/gu.js +2 -2
  490. data/vendor/assets/ckeditor/ckeditor/lang/he.js +2 -2
  491. data/vendor/assets/ckeditor/ckeditor/lang/hi.js +2 -2
  492. data/vendor/assets/ckeditor/ckeditor/lang/hr.js +2 -2
  493. data/vendor/assets/ckeditor/ckeditor/lang/hu.js +2 -2
  494. data/vendor/assets/ckeditor/ckeditor/lang/is.js +2 -2
  495. data/vendor/assets/ckeditor/ckeditor/lang/it.js +2 -2
  496. data/vendor/assets/ckeditor/ckeditor/lang/ja.js +2 -2
  497. data/vendor/assets/ckeditor/ckeditor/lang/ka.js +2 -2
  498. data/vendor/assets/ckeditor/ckeditor/lang/km.js +2 -2
  499. data/vendor/assets/ckeditor/ckeditor/lang/ko.js +2 -2
  500. data/vendor/assets/ckeditor/ckeditor/lang/lt.js +2 -2
  501. data/vendor/assets/ckeditor/ckeditor/lang/lv.js +2 -2
  502. data/vendor/assets/ckeditor/ckeditor/lang/mk.js +6 -0
  503. data/vendor/assets/ckeditor/ckeditor/lang/mn.js +2 -2
  504. data/vendor/assets/ckeditor/ckeditor/lang/ms.js +2 -2
  505. data/vendor/assets/ckeditor/ckeditor/lang/nb.js +2 -2
  506. data/vendor/assets/ckeditor/ckeditor/lang/nl.js +2 -2
  507. data/vendor/assets/ckeditor/ckeditor/lang/no.js +2 -2
  508. data/vendor/assets/ckeditor/ckeditor/lang/pl.js +2 -2
  509. data/vendor/assets/ckeditor/ckeditor/lang/pt-br.js +2 -2
  510. data/vendor/assets/ckeditor/ckeditor/lang/pt.js +2 -2
  511. data/vendor/assets/ckeditor/ckeditor/lang/ro.js +2 -2
  512. data/vendor/assets/ckeditor/ckeditor/lang/ru.js +2 -2
  513. data/vendor/assets/ckeditor/ckeditor/lang/sk.js +2 -2
  514. data/vendor/assets/ckeditor/ckeditor/lang/sl.js +2 -2
  515. data/vendor/assets/ckeditor/ckeditor/lang/sr-latn.js +2 -2
  516. data/vendor/assets/ckeditor/ckeditor/lang/sr.js +2 -2
  517. data/vendor/assets/ckeditor/ckeditor/lang/sv.js +2 -2
  518. data/vendor/assets/ckeditor/ckeditor/lang/th.js +2 -2
  519. data/vendor/assets/ckeditor/ckeditor/lang/tr.js +2 -2
  520. data/vendor/assets/ckeditor/ckeditor/lang/ug.js +6 -0
  521. data/vendor/assets/ckeditor/ckeditor/lang/uk.js +2 -2
  522. data/vendor/assets/ckeditor/ckeditor/lang/vi.js +2 -2
  523. data/vendor/assets/ckeditor/ckeditor/lang/zh-cn.js +2 -2
  524. data/vendor/assets/ckeditor/ckeditor/lang/zh.js +2 -2
  525. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -1
  526. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/_translationstatus.txt +23 -0
  527. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/cs.js +6 -0
  528. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/cy.js +6 -0
  529. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/da.js +6 -0
  530. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/de.js +6 -0
  531. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/el.js +6 -0
  532. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/en.js +2 -2
  533. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/eo.js +6 -0
  534. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/fa.js +6 -0
  535. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/fi.js +6 -0
  536. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/fr.js +6 -0
  537. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/gu.js +6 -0
  538. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/he.js +2 -2
  539. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/it.js +6 -0
  540. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/mk.js +6 -0
  541. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/nb.js +6 -0
  542. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/nl.js +6 -0
  543. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/no.js +6 -0
  544. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/tr.js +6 -0
  545. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/ug.js +6 -0
  546. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/vi.js +6 -0
  547. data/vendor/assets/ckeditor/ckeditor/plugins/a11yhelp/lang/zh-cn.js +6 -0
  548. data/vendor/assets/ckeditor/ckeditor/plugins/about/dialogs/about.js +1 -1
  549. data/vendor/assets/ckeditor/ckeditor/plugins/adobeair/plugin.js +1 -1
  550. data/vendor/assets/ckeditor/ckeditor/plugins/ajax/plugin.js +1 -1
  551. data/vendor/assets/ckeditor/ckeditor/plugins/autogrow/plugin.js +2 -2
  552. data/vendor/assets/ckeditor/ckeditor/plugins/bbcode/plugin.js +1 -1
  553. data/vendor/assets/ckeditor/ckeditor/plugins/clipboard/dialogs/paste.js +2 -2
  554. data/vendor/assets/ckeditor/ckeditor/plugins/colordialog/dialogs/colordialog.js +3 -3
  555. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/_translationstatus.txt +27 -0
  556. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/bg.js +6 -0
  557. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/cs.js +6 -0
  558. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/cy.js +6 -0
  559. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/da.js +6 -0
  560. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/de.js +6 -0
  561. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/el.js +6 -0
  562. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/en.js +1 -1
  563. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/eo.js +6 -0
  564. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/et.js +6 -0
  565. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/fa.js +6 -0
  566. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/fi.js +6 -0
  567. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/fr.js +6 -0
  568. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/gu.js +6 -0
  569. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/he.js +6 -0
  570. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/hr.js +6 -0
  571. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/it.js +6 -0
  572. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/nb.js +6 -0
  573. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/nl.js +6 -0
  574. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/no.js +6 -0
  575. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/pl.js +6 -0
  576. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/tr.js +6 -0
  577. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/ug.js +6 -0
  578. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/uk.js +6 -0
  579. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/vi.js +6 -0
  580. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/lang/zh-cn.js +6 -0
  581. data/vendor/assets/ckeditor/ckeditor/plugins/devtools/plugin.js +2 -2
  582. data/vendor/assets/ckeditor/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
  583. data/vendor/assets/ckeditor/ckeditor/plugins/div/dialogs/div.js +1 -1
  584. data/vendor/assets/ckeditor/ckeditor/plugins/docprops/dialogs/docprops.js +3 -3
  585. data/vendor/assets/ckeditor/ckeditor/plugins/docprops/plugin.js +1 -1
  586. data/vendor/assets/ckeditor/ckeditor/plugins/find/dialogs/find.js +6 -6
  587. data/vendor/assets/ckeditor/ckeditor/plugins/flash/dialogs/flash.js +2 -2
  588. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/button.js +1 -1
  589. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
  590. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/form.js +1 -1
  591. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
  592. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/radio.js +1 -1
  593. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/select.js +1 -1
  594. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/textarea.js +2 -2
  595. data/vendor/assets/ckeditor/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
  596. data/vendor/assets/ckeditor/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
  597. data/vendor/assets/ckeditor/ckeditor/plugins/iframedialog/plugin.js +1 -1
  598. data/vendor/assets/ckeditor/ckeditor/plugins/image/dialogs/image.js +9 -9
  599. data/vendor/assets/ckeditor/ckeditor/plugins/link/dialogs/anchor.js +1 -1
  600. data/vendor/assets/ckeditor/ckeditor/plugins/link/dialogs/link.js +6 -6
  601. data/vendor/assets/ckeditor/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
  602. data/vendor/assets/ckeditor/ckeditor/plugins/pastefromword/filter/default.js +1 -1
  603. data/vendor/assets/ckeditor/ckeditor/plugins/pastetext/dialogs/pastetext.js +1 -1
  604. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/dialogs/placeholder.js +1 -1
  605. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/_translationstatus.txt +26 -0
  606. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/bg.js +6 -0
  607. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/cs.js +6 -0
  608. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/cy.js +6 -0
  609. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/da.js +6 -0
  610. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/de.js +6 -0
  611. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/el.js +6 -0
  612. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/en.js +1 -1
  613. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/eo.js +6 -0
  614. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/et.js +6 -0
  615. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/fa.js +6 -0
  616. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/fi.js +6 -0
  617. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/fr.js +6 -0
  618. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/he.js +1 -1
  619. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/hr.js +6 -0
  620. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/it.js +6 -0
  621. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/nb.js +6 -0
  622. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/nl.js +6 -0
  623. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/no.js +6 -0
  624. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/pl.js +6 -0
  625. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/tr.js +6 -0
  626. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/ug.js +6 -0
  627. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/uk.js +6 -0
  628. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/vi.js +6 -0
  629. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/lang/zh-cn.js +6 -0
  630. data/vendor/assets/ckeditor/ckeditor/plugins/placeholder/plugin.js +2 -2
  631. data/vendor/assets/ckeditor/ckeditor/plugins/scayt/dialogs/options.js +1 -1
  632. data/vendor/assets/ckeditor/ckeditor/plugins/scayt/dialogs/toolbar.css +1 -1
  633. data/vendor/assets/ckeditor/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
  634. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/dialogs/specialchar.js +2 -2
  635. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/_translationstatus.txt +19 -0
  636. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/cs.js +6 -0
  637. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/cy.js +6 -0
  638. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/de.js +6 -0
  639. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/en.js +2 -2
  640. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/eo.js +6 -0
  641. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/et.js +6 -0
  642. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/fa.js +6 -0
  643. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/fi.js +6 -0
  644. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/fr.js +6 -0
  645. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/hr.js +6 -0
  646. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/it.js +6 -0
  647. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/nb.js +6 -0
  648. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/nl.js +6 -0
  649. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/no.js +6 -0
  650. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/tr.js +6 -0
  651. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/ug.js +6 -0
  652. data/vendor/assets/ckeditor/ckeditor/plugins/specialchar/lang/zh-cn.js +6 -0
  653. data/vendor/assets/ckeditor/ckeditor/plugins/styles/styles/default.js +1 -1
  654. data/vendor/assets/ckeditor/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
  655. data/vendor/assets/ckeditor/ckeditor/plugins/table/dialogs/table.js +5 -5
  656. data/vendor/assets/ckeditor/ckeditor/plugins/tableresize/plugin.js +1 -1
  657. data/vendor/assets/ckeditor/ckeditor/plugins/tabletools/dialogs/tableCell.js +3 -3
  658. data/vendor/assets/ckeditor/ckeditor/plugins/templates/dialogs/templates.js +1 -1
  659. data/vendor/assets/ckeditor/ckeditor/plugins/templates/templates/default.js +1 -1
  660. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/dialogs/uicolor.js +1 -1
  661. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/_translationstatus.txt +27 -0
  662. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/bg.js +6 -0
  663. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/cs.js +6 -0
  664. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/cy.js +6 -0
  665. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/da.js +6 -0
  666. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/de.js +6 -0
  667. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/el.js +6 -0
  668. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/en.js +1 -1
  669. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/eo.js +6 -0
  670. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/et.js +6 -0
  671. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/fa.js +6 -0
  672. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/fi.js +6 -0
  673. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/fr.js +6 -0
  674. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/he.js +1 -1
  675. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/hr.js +6 -0
  676. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/it.js +6 -0
  677. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/mk.js +6 -0
  678. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/nb.js +6 -0
  679. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/nl.js +6 -0
  680. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/no.js +6 -0
  681. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/pl.js +6 -0
  682. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/tr.js +6 -0
  683. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/ug.js +6 -0
  684. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/uk.js +6 -0
  685. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/vi.js +6 -0
  686. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/lang/zh-cn.js +6 -0
  687. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/plugin.js +2 -2
  688. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/yui/assets/yui.css +1 -1
  689. data/vendor/assets/ckeditor/ckeditor/plugins/uicolor/yui/yui.js +1 -1
  690. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
  691. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
  692. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
  693. data/vendor/assets/ckeditor/ckeditor/plugins/wsc/dialogs/wsc.js +2 -2
  694. data/vendor/assets/ckeditor/ckeditor/plugins/xml/plugin.js +1 -1
  695. data/vendor/assets/ckeditor/ckeditor/skins/kama/dialog.css +2 -2
  696. data/vendor/assets/ckeditor/ckeditor/skins/kama/editor.css +4 -4
  697. data/vendor/assets/ckeditor/ckeditor/skins/kama/skin.js +1 -1
  698. data/vendor/assets/ckeditor/ckeditor/skins/kama/templates.css +1 -1
  699. data/vendor/assets/ckeditor/ckeditor/skins/office2003/dialog.css +2 -2
  700. data/vendor/assets/ckeditor/ckeditor/skins/office2003/editor.css +2 -2
  701. data/vendor/assets/ckeditor/ckeditor/skins/office2003/skin.js +1 -1
  702. data/vendor/assets/ckeditor/ckeditor/skins/office2003/templates.css +1 -1
  703. data/vendor/assets/ckeditor/ckeditor/skins/v2/dialog.css +2 -2
  704. data/vendor/assets/ckeditor/ckeditor/skins/v2/editor.css +2 -2
  705. data/vendor/assets/ckeditor/ckeditor/skins/v2/skin.js +1 -1
  706. data/vendor/assets/ckeditor/ckeditor/skins/v2/templates.css +1 -1
  707. data/vendor/assets/ckeditor/ckeditor/themes/default/theme.js +8 -8
  708. metadata +225 -3
@@ -0,0 +1,126 @@
1
+ /*
2
+ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ CKEDITOR.plugins.setLang( 'specialchar', 'zh-cn',
7
+ {
8
+ euro: '欧元符号',
9
+ lsquo: '左单引号',
10
+ rsquo: '右单引号',
11
+ ldquo: '左双引号',
12
+ rdquo: '右双引号',
13
+ ndash: '短划线',
14
+ mdash: '破折号',
15
+ iexcl: '竖翻叹号',
16
+ cent: '分币标记',
17
+ pound: '英镑标记',
18
+ curren: '货币标记',
19
+ yen: '日元标记',
20
+ brvbar: '间断条',
21
+ sect: '节标记',
22
+ uml: '分音符',
23
+ copy: '版权所有标记',
24
+ ordf: '阴性顺序指示符',
25
+ laquo: '左指双尖引号',
26
+ not: '非标记',
27
+ reg: '注册标记',
28
+ macr: '长音符',
29
+ deg: '度标记',
30
+ sup2: '上标二',
31
+ sup3: '上标三',
32
+ acute: '锐音符',
33
+ micro: '微符',
34
+ para: '段落标记',
35
+ middot: '中间点',
36
+ cedil: '下加符',
37
+ sup1: '上标一',
38
+ ordm: '阳性顺序指示符',
39
+ raquo: '右指双尖引号',
40
+ frac14: '普通分数四分之一',
41
+ frac12: '普通分数二分之一',
42
+ frac34: '普通分数四分之三',
43
+ iquest: '竖翻问号',
44
+ Agrave: '带抑音符的拉丁文大写字母 A',
45
+ Aacute: '带锐音符的拉丁文大写字母 A',
46
+ Acirc: '带扬抑符的拉丁文大写字母 A',
47
+ Atilde: '带颚化符的拉丁文大写字母 A',
48
+ Auml: '带分音符的拉丁文大写字母 A',
49
+ Aring: '带上圆圈的拉丁文大写字母 A',
50
+ AElig: '拉丁文大写字母 Ae',
51
+ Ccedil: '带下加符的拉丁文大写字母 C',
52
+ Egrave: '带抑音符的拉丁文大写字母 E',
53
+ Eacute: '带锐音符的拉丁文大写字母 E',
54
+ Ecirc: '带扬抑符的拉丁文大写字母 E',
55
+ Euml: '带分音符的拉丁文大写字母 E',
56
+ Igrave: '带抑音符的拉丁文大写字母 I',
57
+ Iacute: '带锐音符的拉丁文大写字母 I',
58
+ Icirc: '带扬抑符的拉丁文大写字母 I',
59
+ Iuml: '带分音符的拉丁文大写字母 I',
60
+ ETH: '拉丁文大写字母 Eth',
61
+ Ntilde: '带颚化符的拉丁文大写字母 N',
62
+ Ograve: '带抑音符的拉丁文大写字母 O',
63
+ Oacute: '带锐音符的拉丁文大写字母 O',
64
+ Ocirc: '带扬抑符的拉丁文大写字母 O',
65
+ Otilde: '带颚化符的拉丁文大写字母 O',
66
+ Ouml: '带分音符的拉丁文大写字母 O',
67
+ times: '乘号',
68
+ Oslash: '带粗线的拉丁文大写字母 O',
69
+ Ugrave: '带抑音符的拉丁文大写字母 U',
70
+ Uacute: '带锐音符的拉丁文大写字母 U',
71
+ Ucirc: '带扬抑符的拉丁文大写字母 U',
72
+ Uuml: '带分音符的拉丁文大写字母 U',
73
+ Yacute: '带抑音符的拉丁文大写字母 Y',
74
+ THORN: '拉丁文大写字母 Thorn',
75
+ szlig: '拉丁文小写字母清音 S',
76
+ agrave: '带抑音符的拉丁文小写字母 A',
77
+ aacute: '带锐音符的拉丁文小写字母 A',
78
+ acirc: '带扬抑符的拉丁文小写字母 A',
79
+ atilde: '带颚化符的拉丁文小写字母 A',
80
+ auml: '带分音符的拉丁文小写字母 A',
81
+ aring: '带上圆圈的拉丁文小写字母 A',
82
+ aelig: '拉丁文小写字母 Ae',
83
+ ccedil: '带下加符的拉丁文小写字母 C',
84
+ egrave: '带抑音符的拉丁文小写字母 E',
85
+ eacute: '带锐音符的拉丁文小写字母 E',
86
+ ecirc: '带扬抑符的拉丁文小写字母 E',
87
+ euml: '带分音符的拉丁文小写字母 E',
88
+ igrave: '带抑音符的拉丁文小写字母 I',
89
+ iacute: '带锐音符的拉丁文小写字母 I',
90
+ icirc: '带扬抑符的拉丁文小写字母 I',
91
+ iuml: '带分音符的拉丁文小写字母 I',
92
+ eth: '拉丁文小写字母 Eth',
93
+ ntilde: '带颚化符的拉丁文小写字母 N',
94
+ ograve: '带抑音符的拉丁文小写字母 O',
95
+ oacute: '带锐音符的拉丁文小写字母 O',
96
+ ocirc: '带扬抑符的拉丁文小写字母 O',
97
+ otilde: '带颚化符的拉丁文小写字母 O',
98
+ ouml: '带分音符的拉丁文小写字母 O',
99
+ divide: '除号',
100
+ oslash: '带粗线的拉丁文小写字母 O',
101
+ ugrave: '带抑音符的拉丁文小写字母 U',
102
+ uacute: '带锐音符的拉丁文小写字母 U',
103
+ ucirc: '带扬抑符的拉丁文小写字母 U',
104
+ uuml: '带分音符的拉丁文小写字母 U',
105
+ yacute: '带抑音符的拉丁文小写字母 Y',
106
+ thorn: '拉丁文小写字母 Thorn',
107
+ yuml: '带分音符的拉丁文小写字母 Y',
108
+ OElig: '拉丁文大写连字 Oe',
109
+ oelig: '拉丁文小写连字 Oe',
110
+ '372': '带扬抑符的拉丁文大写字母 W',
111
+ '374': '带扬抑符的拉丁文大写字母 Y',
112
+ '373': '带扬抑符的拉丁文小写字母 W',
113
+ '375': '带扬抑符的拉丁文小写字母 Y',
114
+ sbquo: '单下 9 形引号',
115
+ '8219': '单高横翻 9 形引号',
116
+ bdquo: '双下 9 形引号',
117
+ hellip: '水平省略号',
118
+ trade: '商标标志',
119
+ '9658': '实心右指指针',
120
+ bull: '加重号',
121
+ rarr: '向右箭头',
122
+ rArr: '向右双线箭头',
123
+ hArr: '左右双线箭头',
124
+ diams: '实心方块纸牌',
125
+ asymp: '约等于'
126
+ });
@@ -1,70 +1,70 @@
1
- /*
2
- Copyright (c) 2003-2011, 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
- // List of available localizations.
13
- availableLangs : { en:1 },
14
-
15
- init : function( editor )
16
- {
17
- var pluginName = 'specialchar',
18
- plugin = this;
19
-
20
- // Register the dialog.
21
- CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
22
-
23
- editor.addCommand( pluginName,
24
- {
25
- exec : function()
26
- {
27
- var langCode = editor.langCode;
28
- langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
29
-
30
- CKEDITOR.scriptLoader.load(
31
- CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),
32
- function()
33
- {
34
- CKEDITOR.tools.extend( editor.lang.specialChar, plugin.langEntries[ langCode ] );
35
- editor.openDialog( pluginName );
36
- });
37
- },
38
- modes : { wysiwyg:1 },
39
- canUndo : false
40
- });
41
-
42
- // Register the toolbar button.
43
- editor.ui.addButton( 'SpecialChar',
44
- {
45
- label : editor.lang.specialChar.toolbar,
46
- command : pluginName
47
- });
48
- }
49
- } );
50
-
51
- /**
52
- * The list of special characters visible in Special Character dialog.
53
- * @type Array
54
- * @example
55
- * config.specialChars = [ '"', '’', [ '&custom;', 'Custom label' ] ];
56
- * config.specialChars = config.specialChars.concat( [ '"', [ '’', 'Custom label' ] ] );
57
- */
58
- CKEDITOR.config.specialChars =
59
- [
60
- '!','"','#','$','%','&',"'",'(',')','*','+','-','.','/',
61
- '0','1','2','3','4','5','6','7','8','9',':',';',
62
- '<','=','>','?','@',
63
- 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
64
- 'P','Q','R','S','T','U','V','W','X','Y','Z',
65
- '[',']','^','_','`',
66
- 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
67
- 'q','r','s','t','u','v','w','x','y','z',
68
- '{','|','}','~',
69
- "€", "‘", "’", "“", "”", "–", "—", "¡", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "®", "¯", "°", "&", "²", "³", "´", "µ", "¶", "·", "¸", "¹", "º", "&", "¼", "½", "¾", "¿", "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ü", "ý", "þ", "ÿ", "Œ", "œ", "Ŵ", "&#374", "&#373", "ŷ", "‚", "‛", "„", "…", "™", "►", "•", "→", "⇒", "⇔", "♦", "≈"
70
- ];
1
+ /*
2
+ Copyright (c) 2003-2012, 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
+ // List of available localizations.
13
+ availableLangs : { cs:1, cy:1, de:1, en:1, eo:1, et:1, fa:1, fi:1, fr:1, hr:1, it:1, nb:1, nl:1, no:1, tr:1, ug:1, 'zh-cn':1 },
14
+
15
+ init : function( editor )
16
+ {
17
+ var pluginName = 'specialchar',
18
+ plugin = this;
19
+
20
+ // Register the dialog.
21
+ CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );
22
+
23
+ editor.addCommand( pluginName,
24
+ {
25
+ exec : function()
26
+ {
27
+ var langCode = editor.langCode;
28
+ langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
29
+
30
+ CKEDITOR.scriptLoader.load(
31
+ CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ),
32
+ function()
33
+ {
34
+ CKEDITOR.tools.extend( editor.lang.specialChar, plugin.langEntries[ langCode ] );
35
+ editor.openDialog( pluginName );
36
+ });
37
+ },
38
+ modes : { wysiwyg:1 },
39
+ canUndo : false
40
+ });
41
+
42
+ // Register the toolbar button.
43
+ editor.ui.addButton( 'SpecialChar',
44
+ {
45
+ label : editor.lang.specialChar.toolbar,
46
+ command : pluginName
47
+ });
48
+ }
49
+ } );
50
+
51
+ /**
52
+ * The list of special characters visible in the Special Character dialog window.
53
+ * @type Array
54
+ * @example
55
+ * config.specialChars = [ '"', '’', [ '&custom;', 'Custom label' ] ];
56
+ * config.specialChars = config.specialChars.concat( [ '"', [ '’', 'Custom label' ] ] );
57
+ */
58
+ CKEDITOR.config.specialChars =
59
+ [
60
+ '!','"','#','$','%','&',"'",'(',')','*','+','-','.','/',
61
+ '0','1','2','3','4','5','6','7','8','9',':',';',
62
+ '<','=','>','?','@',
63
+ 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
64
+ 'P','Q','R','S','T','U','V','W','X','Y','Z',
65
+ '[',']','^','_','`',
66
+ 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
67
+ 'q','r','s','t','u','v','w','x','y','z',
68
+ '{','|','}','~',
69
+ "€", "‘", "’", "“", "”", "–", "—", "¡", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "®", "¯", "°", "²", "³", "´", "µ", "¶", "·", "¸", "¹", "º", "»", "¼", "½", "¾", "¿", "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ", "Œ", "œ", "Ŵ", "&#374", "&#373", "ŷ", "‚", "‛", "„", "…", "™", "►", "•", "→", "⇒", "⇔", "♦", "≈"
70
+ ];
@@ -1,1696 +1,1706 @@
1
- /*
2
- Copyright (c) 2003-2011, 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
- init : function( editor )
10
- {
11
- // This doesn't look like correct, but it's the safest way to proper
12
- // pass the disableReadonlyStyling configuration to the style system
13
- // without having to change any method signature in the API. (#6103)
14
- editor.on( 'contentDom', function()
15
- {
16
- editor.document.setCustomData( 'cke_includeReadonly', !editor.config.disableReadonlyStyling );
17
- });
18
- }
19
- });
20
-
21
- /**
22
- * Registers a function to be called whenever the selection position changes in the
23
- * editing area. The current state is passed to the function. The possible
24
- * states are {@link CKEDITOR.TRISTATE_ON} and {@link CKEDITOR.TRISTATE_OFF}.
25
- * @param {CKEDITOR.style} style The style to be watched.
26
- * @param {Function} callback The function to be called.
27
- * @example
28
- * // Create a style object for the <b> element.
29
- * var style = new CKEDITOR.style( { element : 'b' } );
30
- * var editor = CKEDITOR.instances.editor1;
31
- * editor.attachStyleStateChange( style, function( state )
32
- * {
33
- * if ( state == CKEDITOR.TRISTATE_ON )
34
- * alert( 'The current state for the B element is ON' );
35
- * else
36
- * alert( 'The current state for the B element is OFF' );
37
- * });
38
- */
39
- CKEDITOR.editor.prototype.attachStyleStateChange = function( style, callback )
40
- {
41
- // Try to get the list of attached callbacks.
42
- var styleStateChangeCallbacks = this._.styleStateChangeCallbacks;
43
-
44
- // If it doesn't exist, it means this is the first call. So, let's create
45
- // all the structure to manage the style checks and the callback calls.
46
- if ( !styleStateChangeCallbacks )
47
- {
48
- // Create the callbacks array.
49
- styleStateChangeCallbacks = this._.styleStateChangeCallbacks = [];
50
-
51
- // Attach to the selectionChange event, so we can check the styles at
52
- // that point.
53
- this.on( 'selectionChange', function( ev )
54
- {
55
- // Loop throw all registered callbacks.
56
- for ( var i = 0 ; i < styleStateChangeCallbacks.length ; i++ )
57
- {
58
- var callback = styleStateChangeCallbacks[ i ];
59
-
60
- // Check the current state for the style defined for that
61
- // callback.
62
- var currentState = callback.style.checkActive( ev.data.path ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
63
-
64
- // Call the callback function, passing the current
65
- // state to it.
66
- callback.fn.call( this, currentState );
67
- }
68
- });
69
- }
70
-
71
- // Save the callback info, so it can be checked on the next occurrence of
72
- // selectionChange.
73
- styleStateChangeCallbacks.push( { style : style, fn : callback } );
74
- };
75
-
76
- CKEDITOR.STYLE_BLOCK = 1;
77
- CKEDITOR.STYLE_INLINE = 2;
78
- CKEDITOR.STYLE_OBJECT = 3;
79
-
80
- (function()
81
- {
82
- var blockElements = { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1 },
83
- 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,audio:1,video:1 };
84
-
85
- var semicolonFixRegex = /\s*(?:;\s*|$)/,
86
- varRegex = /#\((.+?)\)/g;
87
-
88
- var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ),
89
- nonWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 );
90
-
91
- CKEDITOR.style = function( styleDefinition, variablesValues )
92
- {
93
- if ( variablesValues )
94
- {
95
- styleDefinition = CKEDITOR.tools.clone( styleDefinition );
96
-
97
- replaceVariables( styleDefinition.attributes, variablesValues );
98
- replaceVariables( styleDefinition.styles, variablesValues );
99
- }
100
-
101
- var element = this.element = styleDefinition.element ?
102
- ( typeof styleDefinition.element == 'string' ? styleDefinition.element.toLowerCase() : styleDefinition.element )
103
- : '*';
104
-
105
- this.type =
106
- blockElements[ element ] ?
107
- CKEDITOR.STYLE_BLOCK
108
- : objectElements[ element ] ?
109
- CKEDITOR.STYLE_OBJECT
110
- :
111
- CKEDITOR.STYLE_INLINE;
112
-
113
- // If the 'element' property is an object with a set of possible element, it will be applied like an object style: only to existing elements
114
- if ( typeof this.element == 'object' )
115
- this.type = CKEDITOR.STYLE_OBJECT;
116
-
117
- this._ =
118
- {
119
- definition : styleDefinition
120
- };
121
- };
122
-
123
- CKEDITOR.style.prototype =
124
- {
125
- apply : function( document )
126
- {
127
- applyStyle.call( this, document, false );
128
- },
129
-
130
- remove : function( document )
131
- {
132
- applyStyle.call( this, document, true );
133
- },
134
-
135
- applyToRange : function( range )
136
- {
137
- return ( this.applyToRange =
138
- this.type == CKEDITOR.STYLE_INLINE ?
139
- applyInlineStyle
140
- : this.type == CKEDITOR.STYLE_BLOCK ?
141
- applyBlockStyle
142
- : this.type == CKEDITOR.STYLE_OBJECT ?
143
- applyObjectStyle
144
- : null ).call( this, range );
145
- },
146
-
147
- removeFromRange : function( range )
148
- {
149
- return ( this.removeFromRange =
150
- this.type == CKEDITOR.STYLE_INLINE ?
151
- removeInlineStyle
152
- : this.type == CKEDITOR.STYLE_BLOCK ?
153
- removeBlockStyle
154
- : this.type == CKEDITOR.STYLE_OBJECT ?
155
- removeObjectStyle
156
- : null ).call( this, range );
157
- },
158
-
159
- applyToObject : function( element )
160
- {
161
- setupElement( element, this );
162
- },
163
-
164
- /**
165
- * Get the style state inside an element path. Returns "true" if the
166
- * element is active in the path.
167
- */
168
- checkActive : function( elementPath )
169
- {
170
- switch ( this.type )
171
- {
172
- case CKEDITOR.STYLE_BLOCK :
173
- return this.checkElementRemovable( elementPath.block || elementPath.blockLimit, true );
174
-
175
- case CKEDITOR.STYLE_OBJECT :
176
- case CKEDITOR.STYLE_INLINE :
177
-
178
- var elements = elementPath.elements;
179
-
180
- for ( var i = 0, element ; i < elements.length ; i++ )
181
- {
182
- element = elements[ i ];
183
-
184
- if ( this.type == CKEDITOR.STYLE_INLINE
185
- && ( element == elementPath.block || element == elementPath.blockLimit ) )
186
- continue;
187
-
188
- if( this.type == CKEDITOR.STYLE_OBJECT )
189
- {
190
- var name = element.getName();
191
- if ( !( typeof this.element == 'string' ? name == this.element : name in this.element ) )
192
- continue;
193
- }
194
-
195
- if ( this.checkElementRemovable( element, true ) )
196
- return true;
197
- }
198
- }
199
- return false;
200
- },
201
-
202
- /**
203
- * Whether this style can be applied at the element path.
204
- * @param elementPath
205
- */
206
- checkApplicable : function( elementPath )
207
- {
208
- switch ( this.type )
209
- {
210
- case CKEDITOR.STYLE_INLINE :
211
- case CKEDITOR.STYLE_BLOCK :
212
- break;
213
-
214
- case CKEDITOR.STYLE_OBJECT :
215
- return elementPath.lastElement.getAscendant( this.element, true );
216
- }
217
-
218
- return true;
219
- },
220
-
221
- // Checks if an element, or any of its attributes, is removable by the
222
- // current style definition.
223
- checkElementRemovable : function( element, fullMatch )
224
- {
225
- if ( !element || element.isReadOnly() )
226
- return false;
227
-
228
- var def = this._.definition,
229
- attribs,
230
- name = element.getName();
231
-
232
- // If the element name is the same as the style name.
233
- if ( typeof this.element == 'string' ? name == this.element : name in this.element )
234
- {
235
- // If no attributes are defined in the element.
236
- if ( !fullMatch && !element.hasAttributes() )
237
- return true;
238
-
239
- attribs = getAttributesForComparison( def );
240
-
241
- if ( attribs._length )
242
- {
243
- for ( var attName in attribs )
244
- {
245
- if ( attName == '_length' )
246
- continue;
247
-
248
- var elementAttr = element.getAttribute( attName ) || '';
249
-
250
- // Special treatment for 'style' attribute is required.
251
- if ( attName == 'style' ?
252
- compareCssText( attribs[ attName ], normalizeCssText( elementAttr, false ) )
253
- : attribs[ attName ] == elementAttr )
254
- {
255
- if ( !fullMatch )
256
- return true;
257
- }
258
- else if ( fullMatch )
259
- return false;
260
- }
261
- if ( fullMatch )
262
- return true;
263
- }
264
- else
265
- return true;
266
- }
267
-
268
- // Check if the element can be somehow overriden.
269
- var override = getOverrides( this )[ element.getName() ] ;
270
- if ( override )
271
- {
272
- // If no attributes have been defined, remove the element.
273
- if ( !( attribs = override.attributes ) )
274
- return true;
275
-
276
- for ( var i = 0 ; i < attribs.length ; i++ )
277
- {
278
- attName = attribs[i][0];
279
- var actualAttrValue = element.getAttribute( attName );
280
- if ( actualAttrValue )
281
- {
282
- var attValue = attribs[i][1];
283
-
284
- // Remove the attribute if:
285
- // - The override definition value is null;
286
- // - The override definition value is a string that
287
- // matches the attribute value exactly.
288
- // - The override definition value is a regex that
289
- // has matches in the attribute value.
290
- if ( attValue === null ||
291
- ( typeof attValue == 'string' && actualAttrValue == attValue ) ||
292
- attValue.test( actualAttrValue ) )
293
- return true;
294
- }
295
- }
296
- }
297
- return false;
298
- },
299
-
300
- // Builds the preview HTML based on the styles definition.
301
- buildPreview : function( label )
302
- {
303
- var styleDefinition = this._.definition,
304
- html = [],
305
- elementName = styleDefinition.element;
306
-
307
- // Avoid <bdo> in the preview.
308
- if ( elementName == 'bdo' )
309
- elementName = 'span';
310
-
311
- html = [ '<', elementName ];
312
-
313
- // Assign all defined attributes.
314
- var attribs = styleDefinition.attributes;
315
- if ( attribs )
316
- {
317
- for ( var att in attribs )
318
- {
319
- html.push( ' ', att, '="', attribs[ att ], '"' );
320
- }
321
- }
322
-
323
- // Assign the style attribute.
324
- var cssStyle = CKEDITOR.style.getStyleText( styleDefinition );
325
- if ( cssStyle )
326
- html.push( ' style="', cssStyle, '"' );
327
-
328
- html.push( '>', ( label || styleDefinition.name ), '</', elementName, '>' );
329
-
330
- return html.join( '' );
331
- }
332
- };
333
-
334
- // Build the cssText based on the styles definition.
335
- CKEDITOR.style.getStyleText = function( styleDefinition )
336
- {
337
- // If we have already computed it, just return it.
338
- var stylesDef = styleDefinition._ST;
339
- if ( stylesDef )
340
- return stylesDef;
341
-
342
- stylesDef = styleDefinition.styles;
343
-
344
- // Builds the StyleText.
345
- var stylesText = ( styleDefinition.attributes && styleDefinition.attributes[ 'style' ] ) || '',
346
- specialStylesText = '';
347
-
348
- if ( stylesText.length )
349
- stylesText = stylesText.replace( semicolonFixRegex, ';' );
350
-
351
- for ( var style in stylesDef )
352
- {
353
- var styleVal = stylesDef[ style ],
354
- text = ( style + ':' + styleVal ).replace( semicolonFixRegex, ';' );
355
-
356
- // Some browsers don't support 'inherit' property value, leave them intact. (#5242)
357
- if ( styleVal == 'inherit' )
358
- specialStylesText += text;
359
- else
360
- stylesText += text;
361
- }
362
-
363
- // Browsers make some changes to the style when applying them. So, here
364
- // we normalize it to the browser format.
365
- if ( stylesText.length )
366
- stylesText = normalizeCssText( stylesText );
367
-
368
- stylesText += specialStylesText;
369
-
370
- // Return it, saving it to the next request.
371
- return ( styleDefinition._ST = stylesText );
372
- };
373
-
374
- // Gets the parent element which blocks the styling for an element. This
375
- // can be done through read-only elements (contenteditable=false) or
376
- // elements with the "data-nostyle" attribute.
377
- function getUnstylableParent( element )
378
- {
379
- var unstylable,
380
- editable;
381
-
382
- while ( ( element = element.getParent() ) )
383
- {
384
- if ( element.getName() == 'body' )
385
- break;
386
-
387
- if ( element.getAttribute( 'data-nostyle' ) )
388
- unstylable = element;
389
- else if ( !editable )
390
- {
391
- var contentEditable = element.getAttribute( 'contentEditable' );
392
-
393
- if ( contentEditable == 'false' )
394
- unstylable = element;
395
- else if ( contentEditable == 'true' )
396
- editable = 1;
397
- }
398
- }
399
-
400
- return unstylable;
401
- }
402
-
403
- function applyInlineStyle( range )
404
- {
405
- var document = range.document;
406
-
407
- if ( range.collapsed )
408
- {
409
- // Create the element to be inserted in the DOM.
410
- var collapsedElement = getElement( this, document );
411
-
412
- // Insert the empty element into the DOM at the range position.
413
- range.insertNode( collapsedElement );
414
-
415
- // Place the selection right inside the empty element.
416
- range.moveToPosition( collapsedElement, CKEDITOR.POSITION_BEFORE_END );
417
-
418
- return;
419
- }
420
-
421
- var elementName = this.element;
422
- var def = this._.definition;
423
- var isUnknownElement;
424
-
425
- // Indicates that fully selected read-only elements are to be included in the styling range.
426
- var includeReadonly = def.includeReadonly;
427
-
428
- // If the read-only inclusion is not available in the definition, try
429
- // to get it from the document data.
430
- if ( includeReadonly == undefined )
431
- includeReadonly = document.getCustomData( 'cke_includeReadonly' );
432
-
433
- // Get the DTD definition for the element. Defaults to "span".
434
- var dtd = CKEDITOR.dtd[ elementName ] || ( isUnknownElement = true, CKEDITOR.dtd.span );
435
-
436
- // Expand the range.
437
- range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 );
438
- range.trim();
439
-
440
- // Get the first node to be processed and the last, which concludes the
441
- // processing.
442
- var boundaryNodes = range.createBookmark(),
443
- firstNode = boundaryNodes.startNode,
444
- lastNode = boundaryNodes.endNode;
445
-
446
- var currentNode = firstNode;
447
-
448
- var styleRange;
449
-
450
- // Check if the boundaries are inside non stylable elements.
451
- var firstUnstylable = getUnstylableParent( firstNode ),
452
- lastUnstylable = getUnstylableParent( lastNode );
453
-
454
- // If the first element can't be styled, we'll start processing right
455
- // after its unstylable root.
456
- if ( firstUnstylable )
457
- currentNode = firstUnstylable.getNextSourceNode( true );
458
-
459
- // If the last element can't be styled, we'll stop processing on its
460
- // unstylable root.
461
- if ( lastUnstylable )
462
- lastNode = lastUnstylable;
463
-
464
- // Do nothing if the current node now follows the last node to be processed.
465
- if ( currentNode.getPosition( lastNode ) == CKEDITOR.POSITION_FOLLOWING )
466
- currentNode = 0;
467
-
468
- while ( currentNode )
469
- {
470
- var applyStyle = false;
471
-
472
- if ( currentNode.equals( lastNode ) )
473
- {
474
- currentNode = null;
475
- applyStyle = true;
476
- }
477
- else
478
- {
479
- var nodeType = currentNode.type;
480
- var nodeName = nodeType == CKEDITOR.NODE_ELEMENT ? currentNode.getName() : null;
481
- var nodeIsReadonly = nodeName && ( currentNode.getAttribute( 'contentEditable' ) == 'false' );
482
- var nodeIsNoStyle = nodeName && currentNode.getAttribute( 'data-nostyle' );
483
-
484
- if ( nodeName && currentNode.data( 'cke-bookmark' ) )
485
- {
486
- currentNode = currentNode.getNextSourceNode( true );
487
- continue;
488
- }
489
-
490
- // Check if the current node can be a child of the style element.
491
- if ( !nodeName || ( dtd[ nodeName ]
492
- && !nodeIsNoStyle
493
- && ( !nodeIsReadonly || includeReadonly )
494
- && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
495
- && ( !def.childRule || def.childRule( currentNode ) ) ) )
496
- {
497
- var currentParent = currentNode.getParent();
498
-
499
- // Check if the style element can be a child of the current
500
- // node parent or if the element is not defined in the DTD.
501
- if ( currentParent
502
- && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement )
503
- && ( !def.parentRule || def.parentRule( currentParent ) ) )
504
- {
505
- // This node will be part of our range, so if it has not
506
- // been started, place its start right before the node.
507
- // In the case of an element node, it will be included
508
- // only if it is entirely inside the range.
509
- 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 ) ) )
510
- {
511
- styleRange = new CKEDITOR.dom.range( document );
512
- styleRange.setStartBefore( currentNode );
513
- }
514
-
515
- // Non element nodes, readonly elements, or empty
516
- // elements can be added completely to the range.
517
- if ( nodeType == CKEDITOR.NODE_TEXT || nodeIsReadonly || ( nodeType == CKEDITOR.NODE_ELEMENT && !currentNode.getChildCount() ) )
518
- {
519
- var includedNode = currentNode;
520
- var parentNode;
521
-
522
- // This node is about to be included completelly, but,
523
- // if this is the last node in its parent, we must also
524
- // check if the parent itself can be added completelly
525
- // to the range, otherwise apply the style immediately.
526
- while ( ( applyStyle = !includedNode.getNext( notBookmark ) )
527
- && ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] )
528
- && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
529
- && ( !def.childRule || def.childRule( parentNode ) ) )
530
- {
531
- includedNode = parentNode;
532
- }
533
-
534
- styleRange.setEndAfter( includedNode );
535
-
536
- }
537
- }
538
- else
539
- applyStyle = true;
540
- }
541
- else
542
- applyStyle = true;
543
-
544
- // Get the next node to be processed.
545
- currentNode = currentNode.getNextSourceNode( nodeIsNoStyle || nodeIsReadonly );
546
- }
547
-
548
- // Apply the style if we have something to which apply it.
549
- if ( applyStyle && styleRange && !styleRange.collapsed )
550
- {
551
- // Build the style element, based on the style object definition.
552
- var styleNode = getElement( this, document ),
553
- styleHasAttrs = styleNode.hasAttributes();
554
-
555
- // Get the element that holds the entire range.
556
- var parent = styleRange.getCommonAncestor();
557
-
558
- var removeList = {
559
- styles : {},
560
- attrs : {},
561
- // Styles cannot be removed.
562
- blockedStyles : {},
563
- // Attrs cannot be removed.
564
- blockedAttrs : {}
565
- };
566
-
567
- var attName, styleName, value;
568
-
569
- // Loop through the parents, removing the redundant attributes
570
- // from the element to be applied.
571
- while ( styleNode && parent )
572
- {
573
- if ( parent.getName() == elementName )
574
- {
575
- for ( attName in def.attributes )
576
- {
577
- if ( removeList.blockedAttrs[ attName ] || !( value = parent.getAttribute( styleName ) ) )
578
- continue;
579
-
580
- if ( styleNode.getAttribute( attName ) == value )
581
- removeList.attrs[ attName ] = 1;
582
- else
583
- removeList.blockedAttrs[ attName ] = 1;
584
- }
585
-
586
- for ( styleName in def.styles )
587
- {
588
- if ( removeList.blockedStyles[ styleName ] || !( value = parent.getStyle( styleName ) ) )
589
- continue;
590
-
591
- if ( styleNode.getStyle( styleName ) == value )
592
- removeList.styles[ styleName ] = 1;
593
- else
594
- removeList.blockedStyles[ styleName ] = 1;
595
- }
596
- }
597
-
598
- parent = parent.getParent();
599
- }
600
-
601
- for ( attName in removeList.attrs )
602
- styleNode.removeAttribute( attName );
603
-
604
- for ( styleName in removeList.styles )
605
- styleNode.removeStyle( styleName );
606
-
607
- if ( styleHasAttrs && !styleNode.hasAttributes() )
608
- styleNode = null;
609
-
610
- if ( styleNode )
611
- {
612
- // Move the contents of the range to the style element.
613
- styleRange.extractContents().appendTo( styleNode );
614
-
615
- // Here we do some cleanup, removing all duplicated
616
- // elements from the style element.
617
- removeFromInsideElement( this, styleNode );
618
-
619
- // Insert it into the range position (it is collapsed after
620
- // extractContents.
621
- styleRange.insertNode( styleNode );
622
-
623
- // Let's merge our new style with its neighbors, if possible.
624
- styleNode.mergeSiblings();
625
-
626
- // As the style system breaks text nodes constantly, let's normalize
627
- // things for performance.
628
- // With IE, some paragraphs get broken when calling normalize()
629
- // repeatedly. Also, for IE, we must normalize body, not documentElement.
630
- // IE is also known for having a "crash effect" with normalize().
631
- // We should try to normalize with IE too in some way, somewhere.
632
- if ( !CKEDITOR.env.ie )
633
- styleNode.$.normalize();
634
- }
635
- // Style already inherit from parents, left just to clear up any internal overrides. (#5931)
636
- else
637
- {
638
- styleNode = new CKEDITOR.dom.element( 'span' );
639
- styleRange.extractContents().appendTo( styleNode );
640
- styleRange.insertNode( styleNode );
641
- removeFromInsideElement( this, styleNode );
642
- styleNode.remove( true );
643
- }
644
-
645
- // Style applied, let's release the range, so it gets
646
- // re-initialization in the next loop.
647
- styleRange = null;
648
- }
649
- }
650
-
651
- // Remove the bookmark nodes.
652
- range.moveToBookmark( boundaryNodes );
653
-
654
- // Minimize the result range to exclude empty text nodes. (#5374)
655
- range.shrink( CKEDITOR.SHRINK_TEXT );
656
- }
657
-
658
- function removeInlineStyle( range )
659
- {
660
- /*
661
- * Make sure our range has included all "collpased" parent inline nodes so
662
- * that our operation logic can be simpler.
663
- */
664
- range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 );
665
-
666
- var bookmark = range.createBookmark(),
667
- startNode = bookmark.startNode;
668
-
669
- if ( range.collapsed )
670
- {
671
-
672
- var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ),
673
- // The topmost element in elementspatch which we should jump out of.
674
- boundaryElement;
675
-
676
-
677
- for ( var i = 0, element ; i < startPath.elements.length
678
- && ( element = startPath.elements[i] ) ; i++ )
679
- {
680
- /*
681
- * 1. If it's collaped inside text nodes, try to remove the style from the whole element.
682
- *
683
- * 2. Otherwise if it's collapsed on element boundaries, moving the selection
684
- * outside the styles instead of removing the whole tag,
685
- * also make sure other inner styles were well preserverd.(#3309)
686
- */
687
- if ( element == startPath.block || element == startPath.blockLimit )
688
- break;
689
-
690
- if ( this.checkElementRemovable( element ) )
691
- {
692
- var isStart;
693
-
694
- if ( range.collapsed && (
695
- range.checkBoundaryOfElement( element, CKEDITOR.END ) ||
696
- ( isStart = range.checkBoundaryOfElement( element, CKEDITOR.START ) ) ) )
697
- {
698
- boundaryElement = element;
699
- boundaryElement.match = isStart ? 'start' : 'end';
700
- }
701
- else
702
- {
703
- /*
704
- * Before removing the style node, there may be a sibling to the style node
705
- * that's exactly the same to the one to be removed. To the user, it makes
706
- * no difference that they're separate entities in the DOM tree. So, merge
707
- * them before removal.
708
- */
709
- element.mergeSiblings();
710
- if ( element.getName() == this.element )
711
- removeFromElement( this, element );
712
- else
713
- removeOverrides( element, getOverrides( this )[ element.getName() ] );
714
- }
715
- }
716
- }
717
-
718
- // Re-create the style tree after/before the boundary element,
719
- // the replication start from bookmark start node to define the
720
- // new range.
721
- if ( boundaryElement )
722
- {
723
- var clonedElement = startNode;
724
- for ( i = 0 ;; i++ )
725
- {
726
- var newElement = startPath.elements[ i ];
727
- if ( newElement.equals( boundaryElement ) )
728
- break;
729
- // Avoid copying any matched element.
730
- else if ( newElement.match )
731
- continue;
732
- else
733
- newElement = newElement.clone();
734
- newElement.append( clonedElement );
735
- clonedElement = newElement;
736
- }
737
- clonedElement[ boundaryElement.match == 'start' ?
738
- 'insertBefore' : 'insertAfter' ]( boundaryElement );
739
- }
740
- }
741
- else
742
- {
743
- /*
744
- * Now our range isn't collapsed. Lets walk from the start node to the end
745
- * node via DFS and remove the styles one-by-one.
746
- */
747
- var endNode = bookmark.endNode,
748
- me = this;
749
-
750
- /*
751
- * Find out the style ancestor that needs to be broken down at startNode
752
- * and endNode.
753
- */
754
- function breakNodes()
755
- {
756
- var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ),
757
- endPath = new CKEDITOR.dom.elementPath( endNode.getParent() ),
758
- breakStart = null,
759
- breakEnd = null;
760
- for ( var i = 0 ; i < startPath.elements.length ; i++ )
761
- {
762
- var element = startPath.elements[ i ];
763
-
764
- if ( element == startPath.block || element == startPath.blockLimit )
765
- break;
766
-
767
- if ( me.checkElementRemovable( element ) )
768
- breakStart = element;
769
- }
770
- for ( i = 0 ; i < endPath.elements.length ; i++ )
771
- {
772
- element = endPath.elements[ i ];
773
-
774
- if ( element == endPath.block || element == endPath.blockLimit )
775
- break;
776
-
777
- if ( me.checkElementRemovable( element ) )
778
- breakEnd = element;
779
- }
780
-
781
- if ( breakEnd )
782
- endNode.breakParent( breakEnd );
783
- if ( breakStart )
784
- startNode.breakParent( breakStart );
785
- }
786
- breakNodes();
787
-
788
- // Now, do the DFS walk.
789
- var currentNode = startNode.getNext();
790
- while ( !currentNode.equals( endNode ) )
791
- {
792
- /*
793
- * Need to get the next node first because removeFromElement() can remove
794
- * the current node from DOM tree.
795
- */
796
- var nextNode = currentNode.getNextSourceNode();
797
- if ( currentNode.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable( currentNode ) )
798
- {
799
- // Remove style from element or overriding element.
800
- if ( currentNode.getName() == this.element )
801
- removeFromElement( this, currentNode );
802
- else
803
- removeOverrides( currentNode, getOverrides( this )[ currentNode.getName() ] );
804
-
805
- /*
806
- * removeFromElement() may have merged the next node with something before
807
- * the startNode via mergeSiblings(). In that case, the nextNode would
808
- * contain startNode and we'll have to call breakNodes() again and also
809
- * reassign the nextNode to something after startNode.
810
- */
811
- if ( nextNode.type == CKEDITOR.NODE_ELEMENT && nextNode.contains( startNode ) )
812
- {
813
- breakNodes();
814
- nextNode = startNode.getNext();
815
- }
816
- }
817
- currentNode = nextNode;
818
- }
819
- }
820
-
821
- range.moveToBookmark( bookmark );
822
- }
823
-
824
- function applyObjectStyle( range )
825
- {
826
- var root = range.getCommonAncestor( true, true ),
827
- element = root.getAscendant( this.element, true );
828
- element && !element.isReadOnly() && setupElement( element, this );
829
- }
830
-
831
- function removeObjectStyle( range )
832
- {
833
- var root = range.getCommonAncestor( true, true ),
834
- element = root.getAscendant( this.element, true );
835
-
836
- if ( !element )
837
- return;
838
-
839
- var style = this,
840
- def = style._.definition,
841
- attributes = def.attributes;
842
- var styles = CKEDITOR.style.getStyleText( def );
843
-
844
- // Remove all defined attributes.
845
- if ( attributes )
846
- {
847
- for ( var att in attributes )
848
- {
849
- element.removeAttribute( att, attributes[ att ] );
850
- }
851
- }
852
-
853
- // Assign all defined styles.
854
- if ( def.styles )
855
- {
856
- for ( var i in def.styles )
857
- {
858
- if ( !def.styles.hasOwnProperty( i ) )
859
- continue;
860
-
861
- element.removeStyle( i );
862
- }
863
- }
864
- }
865
-
866
- function applyBlockStyle( range )
867
- {
868
- // Serializible bookmarks is needed here since
869
- // elements may be merged.
870
- var bookmark = range.createBookmark( true );
871
-
872
- var iterator = range.createIterator();
873
- iterator.enforceRealBlocks = true;
874
-
875
- // make recognize <br /> tag as a separator in ENTER_BR mode (#5121)
876
- if ( this._.enterMode )
877
- iterator.enlargeBr = ( this._.enterMode != CKEDITOR.ENTER_BR );
878
-
879
- var block;
880
- var doc = range.document;
881
- var previousPreBlock;
882
-
883
- while ( ( block = iterator.getNextParagraph() ) ) // Only one =
884
- {
885
- if ( !block.isReadOnly() )
886
- {
887
- var newBlock = getElement( this, doc, block );
888
- replaceBlock( block, newBlock );
889
- }
890
- }
891
-
892
- range.moveToBookmark( bookmark );
893
- }
894
-
895
- function removeBlockStyle( range )
896
- {
897
- // Serializible bookmarks is needed here since
898
- // elements may be merged.
899
- var bookmark = range.createBookmark( 1 );
900
-
901
- var iterator = range.createIterator();
902
- iterator.enforceRealBlocks = true;
903
- iterator.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
904
-
905
- var block;
906
- while ( ( block = iterator.getNextParagraph() ) )
907
- {
908
- if ( this.checkElementRemovable( block ) )
909
- {
910
- // <pre> get special treatment.
911
- if ( block.is( 'pre' ) )
912
- {
913
- var newBlock = this._.enterMode == CKEDITOR.ENTER_BR ?
914
- null : range.document.createElement(
915
- this._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
916
-
917
- newBlock && block.copyAttributes( newBlock );
918
- replaceBlock( block, newBlock );
919
- }
920
- else
921
- removeFromElement( this, block, 1 );
922
- }
923
- }
924
-
925
- range.moveToBookmark( bookmark );
926
- }
927
-
928
- // Replace the original block with new one, with special treatment
929
- // for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent
930
- // when necessary.(#3188)
931
- function replaceBlock( block, newBlock )
932
- {
933
- // Block is to be removed, create a temp element to
934
- // save contents.
935
- var removeBlock = !newBlock;
936
- if ( removeBlock )
937
- {
938
- newBlock = block.getDocument().createElement( 'div' );
939
- block.copyAttributes( newBlock );
940
- }
941
-
942
- var newBlockIsPre = newBlock && newBlock.is( 'pre' );
943
- var blockIsPre = block.is( 'pre' );
944
-
945
- var isToPre = newBlockIsPre && !blockIsPre;
946
- var isFromPre = !newBlockIsPre && blockIsPre;
947
-
948
- if ( isToPre )
949
- newBlock = toPre( block, newBlock );
950
- else if ( isFromPre )
951
- // Split big <pre> into pieces before start to convert.
952
- newBlock = fromPres( removeBlock ?
953
- [ block.getHtml() ] : splitIntoPres( block ), newBlock );
954
- else
955
- block.moveChildren( newBlock );
956
-
957
- newBlock.replace( block );
958
-
959
- if ( newBlockIsPre )
960
- {
961
- // Merge previous <pre> blocks.
962
- mergePre( newBlock );
963
- }
964
- else if ( removeBlock )
965
- removeNoAttribsElement( newBlock );
966
- }
967
-
968
- /**
969
- * Merge a <pre> block with a previous sibling if available.
970
- */
971
- function mergePre( preBlock )
972
- {
973
- var previousBlock;
974
- if ( !( ( previousBlock = preBlock.getPrevious( nonWhitespaces ) )
975
- && previousBlock.is
976
- && previousBlock.is( 'pre') ) )
977
- return;
978
-
979
- // Merge the previous <pre> block contents into the current <pre>
980
- // block.
981
- //
982
- // Another thing to be careful here is that currentBlock might contain
983
- // a '\n' at the beginning, and previousBlock might contain a '\n'
984
- // towards the end. These new lines are not normally displayed but they
985
- // become visible after merging.
986
- var mergedHtml = replace( previousBlock.getHtml(), /\n$/, '' ) + '\n\n' +
987
- replace( preBlock.getHtml(), /^\n/, '' ) ;
988
-
989
- // Krugle: IE normalizes innerHTML from <pre>, breaking whitespaces.
990
- if ( CKEDITOR.env.ie )
991
- preBlock.$.outerHTML = '<pre>' + mergedHtml + '</pre>';
992
- else
993
- preBlock.setHtml( mergedHtml );
994
-
995
- previousBlock.remove();
996
- }
997
-
998
- /**
999
- * Split into multiple <pre> blocks separated by double line-break.
1000
- * @param preBlock
1001
- */
1002
- function splitIntoPres( preBlock )
1003
- {
1004
- // Exclude the ones at header OR at tail,
1005
- // and ignore bookmark content between them.
1006
- var duoBrRegex = /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,
1007
- blockName = preBlock.getName(),
1008
- splitedHtml = replace( preBlock.getOuterHtml(),
1009
- duoBrRegex,
1010
- function( match, charBefore, bookmark )
1011
- {
1012
- return charBefore + '</pre>' + bookmark + '<pre>';
1013
- } );
1014
-
1015
- var pres = [];
1016
- splitedHtml.replace( /<pre\b.*?>([\s\S]*?)<\/pre>/gi, function( match, preContent ){
1017
- pres.push( preContent );
1018
- } );
1019
- return pres;
1020
- }
1021
-
1022
- // Wrapper function of String::replace without considering of head/tail bookmarks nodes.
1023
- function replace( str, regexp, replacement )
1024
- {
1025
- var headBookmark = '',
1026
- tailBookmark = '';
1027
-
1028
- str = str.replace( /(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,
1029
- function( str, m1, m2 ){
1030
- m1 && ( headBookmark = m1 );
1031
- m2 && ( tailBookmark = m2 );
1032
- return '';
1033
- } );
1034
- return headBookmark + str.replace( regexp, replacement ) + tailBookmark;
1035
- }
1036
-
1037
- /**
1038
- * Converting a list of <pre> into blocks with format well preserved.
1039
- */
1040
- function fromPres( preHtmls, newBlock )
1041
- {
1042
- var docFrag;
1043
- if ( preHtmls.length > 1 )
1044
- docFrag = new CKEDITOR.dom.documentFragment( newBlock.getDocument() );
1045
-
1046
- for ( var i = 0 ; i < preHtmls.length ; i++ )
1047
- {
1048
- var blockHtml = preHtmls[ i ];
1049
-
1050
- // 1. Trim the first and last line-breaks immediately after and before <pre>,
1051
- // they're not visible.
1052
- blockHtml = blockHtml.replace( /(\r\n|\r)/g, '\n' ) ;
1053
- blockHtml = replace( blockHtml, /^[ \t]*\n/, '' ) ;
1054
- blockHtml = replace( blockHtml, /\n$/, '' ) ;
1055
- // 2. Convert spaces or tabs at the beginning or at the end to &nbsp;
1056
- blockHtml = replace( blockHtml, /^[ \t]+|[ \t]+$/g, function( match, offset, s )
1057
- {
1058
- if ( match.length == 1 ) // one space, preserve it
1059
- return '&nbsp;' ;
1060
- else if ( !offset ) // beginning of block
1061
- return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ';
1062
- else // end of block
1063
- return ' ' + CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 );
1064
- } ) ;
1065
-
1066
- // 3. Convert \n to <BR>.
1067
- // 4. Convert contiguous (i.e. non-singular) spaces or tabs to &nbsp;
1068
- blockHtml = blockHtml.replace( /\n/g, '<br>' ) ;
1069
- blockHtml = blockHtml.replace( /[ \t]{2,}/g,
1070
- function ( match )
1071
- {
1072
- return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ' ;
1073
- } ) ;
1074
-
1075
- if ( docFrag )
1076
- {
1077
- var newBlockClone = newBlock.clone();
1078
- newBlockClone.setHtml( blockHtml );
1079
- docFrag.append( newBlockClone );
1080
- }
1081
- else
1082
- newBlock.setHtml( blockHtml );
1083
- }
1084
-
1085
- return docFrag || newBlock;
1086
- }
1087
-
1088
- /**
1089
- * Converting from a non-PRE block to a PRE block in formatting operations.
1090
- */
1091
- function toPre( block, newBlock )
1092
- {
1093
- var bogus = block.getBogus();
1094
- bogus && bogus.remove();
1095
-
1096
- // First trim the block content.
1097
- var preHtml = block.getHtml();
1098
-
1099
- // 1. Trim head/tail spaces, they're not visible.
1100
- preHtml = replace( preHtml, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '' );
1101
- // 2. Delete ANSI whitespaces immediately before and after <BR> because
1102
- // they are not visible.
1103
- preHtml = preHtml.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '$1' );
1104
- // 3. Compress other ANSI whitespaces since they're only visible as one
1105
- // single space previously.
1106
- // 4. Convert &nbsp; to spaces since &nbsp; is no longer needed in <PRE>.
1107
- preHtml = preHtml.replace( /([ \t\n\r]+|&nbsp;)/g, ' ' );
1108
- // 5. Convert any <BR /> to \n. This must not be done earlier because
1109
- // the \n would then get compressed.
1110
- preHtml = preHtml.replace( /<br\b[^>]*>/gi, '\n' );
1111
-
1112
- // Krugle: IE normalizes innerHTML to <pre>, breaking whitespaces.
1113
- if ( CKEDITOR.env.ie )
1114
- {
1115
- var temp = block.getDocument().createElement( 'div' );
1116
- temp.append( newBlock );
1117
- newBlock.$.outerHTML = '<pre>' + preHtml + '</pre>';
1118
- newBlock.copyAttributes( temp.getFirst() );
1119
- newBlock = temp.getFirst().remove();
1120
- }
1121
- else
1122
- newBlock.setHtml( preHtml );
1123
-
1124
- return newBlock;
1125
- }
1126
-
1127
- // Removes a style from an element itself, don't care about its subtree.
1128
- function removeFromElement( style, element )
1129
- {
1130
- var def = style._.definition,
1131
- attributes = CKEDITOR.tools.extend( {}, def.attributes, getOverrides( style )[ element.getName() ] ),
1132
- styles = def.styles,
1133
- // If the style is only about the element itself, we have to remove the element.
1134
- removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles );
1135
-
1136
- // Remove definition attributes/style from the elemnt.
1137
- for ( var attName in attributes )
1138
- {
1139
- // The 'class' element value must match (#1318).
1140
- if ( ( attName == 'class' || style._.definition.fullMatch )
1141
- && element.getAttribute( attName ) != normalizeProperty( attName, attributes[ attName ] ) )
1142
- continue;
1143
- removeEmpty = element.hasAttribute( attName );
1144
- element.removeAttribute( attName );
1145
- }
1146
-
1147
- for ( var styleName in styles )
1148
- {
1149
- // Full match style insist on having fully equivalence. (#5018)
1150
- if ( style._.definition.fullMatch
1151
- && element.getStyle( styleName ) != normalizeProperty( styleName, styles[ styleName ], true ) )
1152
- continue;
1153
-
1154
- removeEmpty = removeEmpty || !!element.getStyle( styleName );
1155
- element.removeStyle( styleName );
1156
- }
1157
-
1158
- if ( removeEmpty )
1159
- {
1160
- !CKEDITOR.dtd.$block[ element.getName() ] || style._.enterMode == CKEDITOR.ENTER_BR && !element.hasAttributes() ?
1161
- removeNoAttribsElement( element ) :
1162
- element.renameNode( style._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
1163
- }
1164
- }
1165
-
1166
- // Removes a style from inside an element.
1167
- function removeFromInsideElement( style, element )
1168
- {
1169
- var def = style._.definition,
1170
- attribs = def.attributes,
1171
- styles = def.styles,
1172
- overrides = getOverrides( style ),
1173
- innerElements = element.getElementsByTag( style.element );
1174
-
1175
- for ( var i = innerElements.count(); --i >= 0 ; )
1176
- removeFromElement( style, innerElements.getItem( i ) );
1177
-
1178
- // Now remove any other element with different name that is
1179
- // defined to be overriden.
1180
- for ( var overrideElement in overrides )
1181
- {
1182
- if ( overrideElement != style.element )
1183
- {
1184
- innerElements = element.getElementsByTag( overrideElement ) ;
1185
- for ( i = innerElements.count() - 1 ; i >= 0 ; i-- )
1186
- {
1187
- var innerElement = innerElements.getItem( i );
1188
- removeOverrides( innerElement, overrides[ overrideElement ] ) ;
1189
- }
1190
- }
1191
- }
1192
- }
1193
-
1194
- /**
1195
- * Remove overriding styles/attributes from the specific element.
1196
- * Note: Remove the element if no attributes remain.
1197
- * @param {Object} element
1198
- * @param {Object} overrides
1199
- */
1200
- function removeOverrides( element, overrides )
1201
- {
1202
- var attributes = overrides && overrides.attributes ;
1203
-
1204
- if ( attributes )
1205
- {
1206
- for ( var i = 0 ; i < attributes.length ; i++ )
1207
- {
1208
- var attName = attributes[i][0], actualAttrValue ;
1209
-
1210
- if ( ( actualAttrValue = element.getAttribute( attName ) ) )
1211
- {
1212
- var attValue = attributes[i][1] ;
1213
-
1214
- // Remove the attribute if:
1215
- // - The override definition value is null ;
1216
- // - The override definition valie is a string that
1217
- // matches the attribute value exactly.
1218
- // - The override definition value is a regex that
1219
- // has matches in the attribute value.
1220
- if ( attValue === null ||
1221
- ( attValue.test && attValue.test( actualAttrValue ) ) ||
1222
- ( typeof attValue == 'string' && actualAttrValue == attValue ) )
1223
- element.removeAttribute( attName ) ;
1224
- }
1225
- }
1226
- }
1227
-
1228
- removeNoAttribsElement( element );
1229
- }
1230
-
1231
- // If the element has no more attributes, remove it.
1232
- function removeNoAttribsElement( element )
1233
- {
1234
- // If no more attributes remained in the element, remove it,
1235
- // leaving its children.
1236
- if ( !element.hasAttributes() )
1237
- {
1238
- if ( CKEDITOR.dtd.$block[ element.getName() ] )
1239
- {
1240
- var previous = element.getPrevious( nonWhitespaces ),
1241
- next = element.getNext( nonWhitespaces );
1242
-
1243
- if ( previous && ( previous.type == CKEDITOR.NODE_TEXT || !previous.isBlockBoundary( { br : 1 } ) ) )
1244
- element.append( 'br', 1 );
1245
- if ( next && ( next.type == CKEDITOR.NODE_TEXT || !next.isBlockBoundary( { br : 1 } ) ) )
1246
- element.append( 'br' );
1247
-
1248
- element.remove( true );
1249
- }
1250
- else
1251
- {
1252
- // Removing elements may open points where merging is possible,
1253
- // so let's cache the first and last nodes for later checking.
1254
- var firstChild = element.getFirst();
1255
- var lastChild = element.getLast();
1256
-
1257
- element.remove( true );
1258
-
1259
- if ( firstChild )
1260
- {
1261
- // Check the cached nodes for merging.
1262
- firstChild.type == CKEDITOR.NODE_ELEMENT && firstChild.mergeSiblings();
1263
-
1264
- if ( lastChild && !firstChild.equals( lastChild )
1265
- && lastChild.type == CKEDITOR.NODE_ELEMENT )
1266
- lastChild.mergeSiblings();
1267
- }
1268
-
1269
- }
1270
- }
1271
- }
1272
-
1273
- function getElement( style, targetDocument, element )
1274
- {
1275
- var el,
1276
- def = style._.definition,
1277
- elementName = style.element;
1278
-
1279
- // The "*" element name will always be a span for this function.
1280
- if ( elementName == '*' )
1281
- elementName = 'span';
1282
-
1283
- // Create the element.
1284
- el = new CKEDITOR.dom.element( elementName, targetDocument );
1285
-
1286
- // #6226: attributes should be copied before the new ones are applied
1287
- if ( element )
1288
- element.copyAttributes( el );
1289
-
1290
- el = setupElement( el, style );
1291
-
1292
- // Avoid ID duplication.
1293
- if ( targetDocument.getCustomData( 'doc_processing_style' ) && el.hasAttribute( 'id' ) )
1294
- el.removeAttribute( 'id' );
1295
- else
1296
- targetDocument.setCustomData( 'doc_processing_style', 1 );
1297
-
1298
- return el;
1299
- }
1300
-
1301
- function setupElement( el, style )
1302
- {
1303
- var def = style._.definition,
1304
- attributes = def.attributes,
1305
- styles = CKEDITOR.style.getStyleText( def );
1306
-
1307
- // Assign all defined attributes.
1308
- if ( attributes )
1309
- {
1310
- for ( var att in attributes )
1311
- {
1312
- el.setAttribute( att, attributes[ att ] );
1313
- }
1314
- }
1315
-
1316
- // Assign all defined styles.
1317
- if( styles )
1318
- el.setAttribute( 'style', styles );
1319
-
1320
- return el;
1321
- }
1322
-
1323
- function replaceVariables( list, variablesValues )
1324
- {
1325
- for ( var item in list )
1326
- {
1327
- list[ item ] = list[ item ].replace( varRegex, function( match, varName )
1328
- {
1329
- return variablesValues[ varName ];
1330
- });
1331
- }
1332
- }
1333
-
1334
- // Returns an object that can be used for style matching comparison.
1335
- // Attributes names and values are all lowercased, and the styles get
1336
- // merged with the style attribute.
1337
- function getAttributesForComparison( styleDefinition )
1338
- {
1339
- // If we have already computed it, just return it.
1340
- var attribs = styleDefinition._AC;
1341
- if ( attribs )
1342
- return attribs;
1343
-
1344
- attribs = {};
1345
-
1346
- var length = 0;
1347
-
1348
- // Loop through all defined attributes.
1349
- var styleAttribs = styleDefinition.attributes;
1350
- if ( styleAttribs )
1351
- {
1352
- for ( var styleAtt in styleAttribs )
1353
- {
1354
- length++;
1355
- attribs[ styleAtt ] = styleAttribs[ styleAtt ];
1356
- }
1357
- }
1358
-
1359
- // Includes the style definitions.
1360
- var styleText = CKEDITOR.style.getStyleText( styleDefinition );
1361
- if ( styleText )
1362
- {
1363
- if ( !attribs[ 'style' ] )
1364
- length++;
1365
- attribs[ 'style' ] = styleText;
1366
- }
1367
-
1368
- // Appends the "length" information to the object.
1369
- attribs._length = length;
1370
-
1371
- // Return it, saving it to the next request.
1372
- return ( styleDefinition._AC = attribs );
1373
- }
1374
-
1375
- /**
1376
- * Get the the collection used to compare the elements and attributes,
1377
- * defined in this style overrides, with other element. All information in
1378
- * it is lowercased.
1379
- * @param {CKEDITOR.style} style
1380
- */
1381
- function getOverrides( style )
1382
- {
1383
- if ( style._.overrides )
1384
- return style._.overrides;
1385
-
1386
- var overrides = ( style._.overrides = {} ),
1387
- definition = style._.definition.overrides;
1388
-
1389
- if ( definition )
1390
- {
1391
- // The override description can be a string, object or array.
1392
- // Internally, well handle arrays only, so transform it if needed.
1393
- if ( !CKEDITOR.tools.isArray( definition ) )
1394
- definition = [ definition ];
1395
-
1396
- // Loop through all override definitions.
1397
- for ( var i = 0 ; i < definition.length ; i++ )
1398
- {
1399
- var override = definition[i];
1400
- var elementName;
1401
- var overrideEl;
1402
- var attrs;
1403
-
1404
- // If can be a string with the element name.
1405
- if ( typeof override == 'string' )
1406
- elementName = override.toLowerCase();
1407
- // Or an object.
1408
- else
1409
- {
1410
- elementName = override.element ? override.element.toLowerCase() : style.element;
1411
- attrs = override.attributes;
1412
- }
1413
-
1414
- // We can have more than one override definition for the same
1415
- // element name, so we attempt to simply append information to
1416
- // it if it already exists.
1417
- overrideEl = overrides[ elementName ] || ( overrides[ elementName ] = {} );
1418
-
1419
- if ( attrs )
1420
- {
1421
- // The returning attributes list is an array, because we
1422
- // could have different override definitions for the same
1423
- // attribute name.
1424
- var overrideAttrs = ( overrideEl.attributes = overrideEl.attributes || new Array() );
1425
- for ( var attName in attrs )
1426
- {
1427
- // Each item in the attributes array is also an array,
1428
- // where [0] is the attribute name and [1] is the
1429
- // override value.
1430
- overrideAttrs.push( [ attName.toLowerCase(), attrs[ attName ] ] );
1431
- }
1432
- }
1433
- }
1434
- }
1435
-
1436
- return overrides;
1437
- }
1438
-
1439
- // Make the comparison of attribute value easier by standardizing it.
1440
- function normalizeProperty( name, value, isStyle )
1441
- {
1442
- var temp = new CKEDITOR.dom.element( 'span' );
1443
- temp [ isStyle ? 'setStyle' : 'setAttribute' ]( name, value );
1444
- return temp[ isStyle ? 'getStyle' : 'getAttribute' ]( name );
1445
- }
1446
-
1447
- // Make the comparison of style text easier by standardizing it.
1448
- function normalizeCssText( unparsedCssText, nativeNormalize )
1449
- {
1450
- var styleText;
1451
- if ( nativeNormalize !== false )
1452
- {
1453
- // Injects the style in a temporary span object, so the browser parses it,
1454
- // retrieving its final format.
1455
- var temp = new CKEDITOR.dom.element( 'span' );
1456
- temp.setAttribute( 'style', unparsedCssText );
1457
- styleText = temp.getAttribute( 'style' ) || '';
1458
- }
1459
- else
1460
- styleText = unparsedCssText;
1461
-
1462
- // Normalize font-family property, ignore quotes and being case insensitive. (#7322)
1463
- // http://www.w3.org/TR/css3-fonts/#font-family-the-font-family-property
1464
- styleText = styleText.replace( /(font-family:)(.*?)(?=;|$)/, function ( match, prop, val )
1465
- {
1466
- var names = val.split( ',' );
1467
- for ( var i = 0; i < names.length; i++ )
1468
- names[ i ] = CKEDITOR.tools.trim( names[ i ].replace( /["']/g, '' ) );
1469
- return prop + names.join( ',' );
1470
- });
1471
-
1472
- // Shrinking white-spaces around colon and semi-colon (#4147).
1473
- // Compensate tail semi-colon.
1474
- return styleText.replace( /\s*([;:])\s*/, '$1' )
1475
- .replace( /([^\s;])$/, '$1;')
1476
- // Trimming spaces after comma(#4107),
1477
- // remove quotations(#6403),
1478
- // mostly for differences on "font-family".
1479
- .replace( /,\s+/g, ',' )
1480
- .replace( /\"/g,'' )
1481
- .toLowerCase();
1482
- }
1483
-
1484
- // Turn inline style text properties into one hash.
1485
- function parseStyleText( styleText )
1486
- {
1487
- var retval = {};
1488
- styleText
1489
- .replace( /&quot;/g, '"' )
1490
- .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value )
1491
- {
1492
- retval[ name ] = value;
1493
- } );
1494
- return retval;
1495
- }
1496
-
1497
- /**
1498
- * Compare two bunch of styles, with the speciality that value 'inherit'
1499
- * is treated as a wildcard which will match any value.
1500
- * @param {Object|String} source
1501
- * @param {Object|String} target
1502
- */
1503
- function compareCssText( source, target )
1504
- {
1505
- typeof source == 'string' && ( source = parseStyleText( source ) );
1506
- typeof target == 'string' && ( target = parseStyleText( target ) );
1507
- for( var name in source )
1508
- {
1509
- if ( !( name in target &&
1510
- ( target[ name ] == source[ name ]
1511
- || source[ name ] == 'inherit'
1512
- || target[ name ] == 'inherit' ) ) )
1513
- {
1514
- return false;
1515
- }
1516
- }
1517
- return true;
1518
- }
1519
-
1520
- function applyStyle( document, remove )
1521
- {
1522
- var selection = document.getSelection(),
1523
- // Bookmark the range so we can re-select it after processing.
1524
- bookmarks = selection.createBookmarks( 1 ),
1525
- ranges = selection.getRanges(),
1526
- func = remove ? this.removeFromRange : this.applyToRange,
1527
- range;
1528
-
1529
- var iterator = ranges.createIterator();
1530
- while ( ( range = iterator.getNextRange() ) )
1531
- func.call( this, range );
1532
-
1533
- if ( bookmarks.length == 1 && bookmarks[ 0 ].collapsed )
1534
- {
1535
- selection.selectRanges( ranges );
1536
- document.getById( bookmarks[ 0 ].startNode ).remove();
1537
- }
1538
- else
1539
- selection.selectBookmarks( bookmarks );
1540
-
1541
- document.removeCustomData( 'doc_processing_style' );
1542
- }
1543
- })();
1544
-
1545
- CKEDITOR.styleCommand = function( style )
1546
- {
1547
- this.style = style;
1548
- };
1549
-
1550
- CKEDITOR.styleCommand.prototype.exec = function( editor )
1551
- {
1552
- editor.focus();
1553
-
1554
- var doc = editor.document;
1555
-
1556
- if ( doc )
1557
- {
1558
- if ( this.state == CKEDITOR.TRISTATE_OFF )
1559
- this.style.apply( doc );
1560
- else if ( this.state == CKEDITOR.TRISTATE_ON )
1561
- this.style.remove( doc );
1562
- }
1563
-
1564
- return !!doc;
1565
- };
1566
-
1567
- /**
1568
- * Manages styles registration and loading. See also {@link CKEDITOR.config.stylesSet}.
1569
- * @namespace
1570
- * @augments CKEDITOR.resourceManager
1571
- * @constructor
1572
- * @since 3.2
1573
- * @example
1574
- * // The set of styles for the <b>Styles</b> combo
1575
- * CKEDITOR.stylesSet.add( 'default',
1576
- * [
1577
- * // Block Styles
1578
- * { name : 'Blue Title' , element : 'h3', styles : { 'color' : 'Blue' } },
1579
- * { name : 'Red Title' , element : 'h3', styles : { 'color' : 'Red' } },
1580
- *
1581
- * // Inline Styles
1582
- * { name : 'Marker: Yellow' , element : 'span', styles : { 'background-color' : 'Yellow' } },
1583
- * { name : 'Marker: Green' , element : 'span', styles : { 'background-color' : 'Lime' } },
1584
- *
1585
- * // Object Styles
1586
- * {
1587
- * name : 'Image on Left',
1588
- * element : 'img',
1589
- * attributes :
1590
- * {
1591
- * 'style' : 'padding: 5px; margin-right: 5px',
1592
- * 'border' : '2',
1593
- * 'align' : 'left'
1594
- * }
1595
- * }
1596
- * ]);
1597
- */
1598
- CKEDITOR.stylesSet = new CKEDITOR.resourceManager( '', 'stylesSet' );
1599
-
1600
- // Backward compatibility (#5025).
1601
- CKEDITOR.addStylesSet = CKEDITOR.tools.bind( CKEDITOR.stylesSet.add, CKEDITOR.stylesSet );
1602
- CKEDITOR.loadStylesSet = function( name, url, callback )
1603
- {
1604
- CKEDITOR.stylesSet.addExternal( name, url, '' );
1605
- CKEDITOR.stylesSet.load( name, callback );
1606
- };
1607
-
1608
-
1609
- /**
1610
- * Gets the current styleSet for this instance
1611
- * @param {Function} callback The function to be called with the styles data.
1612
- * @example
1613
- * editor.getStylesSet( function( stylesDefinitions ) {} );
1614
- */
1615
- CKEDITOR.editor.prototype.getStylesSet = function( callback )
1616
- {
1617
- if ( !this._.stylesDefinitions )
1618
- {
1619
- var editor = this,
1620
- // Respect the backwards compatible definition entry
1621
- configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet || 'default';
1622
-
1623
- // #5352 Allow to define the styles directly in the config object
1624
- if ( configStyleSet instanceof Array )
1625
- {
1626
- editor._.stylesDefinitions = configStyleSet;
1627
- callback( configStyleSet );
1628
- return;
1629
- }
1630
-
1631
- var partsStylesSet = configStyleSet.split( ':' ),
1632
- styleSetName = partsStylesSet[ 0 ],
1633
- externalPath = partsStylesSet[ 1 ],
1634
- pluginPath = CKEDITOR.plugins.registered.styles.path;
1635
-
1636
- CKEDITOR.stylesSet.addExternal( styleSetName,
1637
- externalPath ?
1638
- partsStylesSet.slice( 1 ).join( ':' ) :
1639
- pluginPath + 'styles/' + styleSetName + '.js', '' );
1640
-
1641
- CKEDITOR.stylesSet.load( styleSetName, function( stylesSet )
1642
- {
1643
- editor._.stylesDefinitions = stylesSet[ styleSetName ];
1644
- callback( editor._.stylesDefinitions );
1645
- } ) ;
1646
- }
1647
- else
1648
- callback( this._.stylesDefinitions );
1649
- };
1650
-
1651
- /**
1652
- * Indicates that fully selected read-only elements will be included when
1653
- * applying the style (for inline styles only).
1654
- * @name CKEDITOR.style.includeReadonly
1655
- * @type Boolean
1656
- * @default false
1657
- * @since 3.5
1658
- */
1659
-
1660
- /**
1661
- * Disables inline styling on read-only elements.
1662
- * @name CKEDITOR.config.disableReadonlyStyling
1663
- * @type Boolean
1664
- * @default false
1665
- * @since 3.5
1666
- */
1667
-
1668
- /**
1669
- * The "styles definition set" to use in the editor. They will be used in the
1670
- * styles combo and the Style selector of the div container. <br>
1671
- * The styles may be defined in the page containing the editor, or can be
1672
- * loaded on demand from an external file. In the second case, if this setting
1673
- * contains only a name, the styles definition file will be loaded from the
1674
- * "styles" folder inside the styles plugin folder.
1675
- * Otherwise, this setting has the "name:url" syntax, making it
1676
- * possible to set the URL from which loading the styles file.<br>
1677
- * Previously this setting was available as config.stylesCombo_stylesSet<br>
1678
- * @name CKEDITOR.config.stylesSet
1679
- * @type String|Array
1680
- * @default 'default'
1681
- * @since 3.3
1682
- * @example
1683
- * // Load from the styles' styles folder (mystyles.js file).
1684
- * config.stylesSet = 'mystyles';
1685
- * @example
1686
- * // Load from a relative URL.
1687
- * config.stylesSet = 'mystyles:/editorstyles/styles.js';
1688
- * @example
1689
- * // Load from a full URL.
1690
- * config.stylesSet = 'mystyles:http://www.example.com/editorstyles/styles.js';
1691
- * @example
1692
- * // Load from a list of definitions.
1693
- * config.stylesSet = [
1694
- * { name : 'Strong Emphasis', element : 'strong' },
1695
- * { name : 'Emphasis', element : 'em' }, ... ];
1696
- */
1
+ /*
2
+ Copyright (c) 2003-2012, 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
+ init : function( editor )
10
+ {
11
+ // This doesn't look like correct, but it's the safest way to proper
12
+ // pass the disableReadonlyStyling configuration to the style system
13
+ // without having to change any method signature in the API. (#6103)
14
+ editor.on( 'contentDom', function()
15
+ {
16
+ editor.document.setCustomData( 'cke_includeReadonly', !editor.config.disableReadonlyStyling );
17
+ });
18
+ }
19
+ });
20
+
21
+ /**
22
+ * Registers a function to be called whenever the selection position changes in the
23
+ * editing area. The current state is passed to the function. The possible
24
+ * states are {@link CKEDITOR.TRISTATE_ON} and {@link CKEDITOR.TRISTATE_OFF}.
25
+ * @param {CKEDITOR.style} style The style to be watched.
26
+ * @param {Function} callback The function to be called.
27
+ * @example
28
+ * // Create a style object for the &lt;b&gt; element.
29
+ * var style = new CKEDITOR.style( { element : 'b' } );
30
+ * var editor = CKEDITOR.instances.editor1;
31
+ * editor.attachStyleStateChange( style, function( state )
32
+ * {
33
+ * if ( state == CKEDITOR.TRISTATE_ON )
34
+ * alert( 'The current state for the B element is ON' );
35
+ * else
36
+ * alert( 'The current state for the B element is OFF' );
37
+ * });
38
+ */
39
+ CKEDITOR.editor.prototype.attachStyleStateChange = function( style, callback )
40
+ {
41
+ // Try to get the list of attached callbacks.
42
+ var styleStateChangeCallbacks = this._.styleStateChangeCallbacks;
43
+
44
+ // If it doesn't exist, it means this is the first call. So, let's create
45
+ // all the structure to manage the style checks and the callback calls.
46
+ if ( !styleStateChangeCallbacks )
47
+ {
48
+ // Create the callbacks array.
49
+ styleStateChangeCallbacks = this._.styleStateChangeCallbacks = [];
50
+
51
+ // Attach to the selectionChange event, so we can check the styles at
52
+ // that point.
53
+ this.on( 'selectionChange', function( ev )
54
+ {
55
+ // Loop throw all registered callbacks.
56
+ for ( var i = 0 ; i < styleStateChangeCallbacks.length ; i++ )
57
+ {
58
+ var callback = styleStateChangeCallbacks[ i ];
59
+
60
+ // Check the current state for the style defined for that
61
+ // callback.
62
+ var currentState = callback.style.checkActive( ev.data.path ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
63
+
64
+ // Call the callback function, passing the current
65
+ // state to it.
66
+ callback.fn.call( this, currentState );
67
+ }
68
+ });
69
+ }
70
+
71
+ // Save the callback info, so it can be checked on the next occurrence of
72
+ // selectionChange.
73
+ styleStateChangeCallbacks.push( { style : style, fn : callback } );
74
+ };
75
+
76
+ CKEDITOR.STYLE_BLOCK = 1;
77
+ CKEDITOR.STYLE_INLINE = 2;
78
+ CKEDITOR.STYLE_OBJECT = 3;
79
+
80
+ (function()
81
+ {
82
+ var blockElements = { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1 },
83
+ 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,audio:1,video:1 };
84
+
85
+ var semicolonFixRegex = /\s*(?:;\s*|$)/,
86
+ varRegex = /#\((.+?)\)/g;
87
+
88
+ var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ),
89
+ nonWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 );
90
+
91
+ CKEDITOR.style = function( styleDefinition, variablesValues )
92
+ {
93
+ if ( variablesValues )
94
+ {
95
+ styleDefinition = CKEDITOR.tools.clone( styleDefinition );
96
+
97
+ replaceVariables( styleDefinition.attributes, variablesValues );
98
+ replaceVariables( styleDefinition.styles, variablesValues );
99
+ }
100
+
101
+ var element = this.element = styleDefinition.element ?
102
+ ( typeof styleDefinition.element == 'string' ? styleDefinition.element.toLowerCase() : styleDefinition.element )
103
+ : '*';
104
+
105
+ this.type =
106
+ blockElements[ element ] ?
107
+ CKEDITOR.STYLE_BLOCK
108
+ : objectElements[ element ] ?
109
+ CKEDITOR.STYLE_OBJECT
110
+ :
111
+ CKEDITOR.STYLE_INLINE;
112
+
113
+ // If the 'element' property is an object with a set of possible element, it will be applied like an object style: only to existing elements
114
+ if ( typeof this.element == 'object' )
115
+ this.type = CKEDITOR.STYLE_OBJECT;
116
+
117
+ this._ =
118
+ {
119
+ definition : styleDefinition
120
+ };
121
+ };
122
+
123
+ CKEDITOR.style.prototype =
124
+ {
125
+ apply : function( document )
126
+ {
127
+ applyStyle.call( this, document, false );
128
+ },
129
+
130
+ remove : function( document )
131
+ {
132
+ applyStyle.call( this, document, true );
133
+ },
134
+
135
+ applyToRange : function( range )
136
+ {
137
+ return ( this.applyToRange =
138
+ this.type == CKEDITOR.STYLE_INLINE ?
139
+ applyInlineStyle
140
+ : this.type == CKEDITOR.STYLE_BLOCK ?
141
+ applyBlockStyle
142
+ : this.type == CKEDITOR.STYLE_OBJECT ?
143
+ applyObjectStyle
144
+ : null ).call( this, range );
145
+ },
146
+
147
+ removeFromRange : function( range )
148
+ {
149
+ return ( this.removeFromRange =
150
+ this.type == CKEDITOR.STYLE_INLINE ?
151
+ removeInlineStyle
152
+ : this.type == CKEDITOR.STYLE_BLOCK ?
153
+ removeBlockStyle
154
+ : this.type == CKEDITOR.STYLE_OBJECT ?
155
+ removeObjectStyle
156
+ : null ).call( this, range );
157
+ },
158
+
159
+ applyToObject : function( element )
160
+ {
161
+ setupElement( element, this );
162
+ },
163
+
164
+ /**
165
+ * Get the style state inside an element path. Returns "true" if the
166
+ * element is active in the path.
167
+ */
168
+ checkActive : function( elementPath )
169
+ {
170
+ switch ( this.type )
171
+ {
172
+ case CKEDITOR.STYLE_BLOCK :
173
+ return this.checkElementRemovable( elementPath.block || elementPath.blockLimit, true );
174
+
175
+ case CKEDITOR.STYLE_OBJECT :
176
+ case CKEDITOR.STYLE_INLINE :
177
+
178
+ var elements = elementPath.elements;
179
+
180
+ for ( var i = 0, element ; i < elements.length ; i++ )
181
+ {
182
+ element = elements[ i ];
183
+
184
+ if ( this.type == CKEDITOR.STYLE_INLINE
185
+ && ( element == elementPath.block || element == elementPath.blockLimit ) )
186
+ continue;
187
+
188
+ if( this.type == CKEDITOR.STYLE_OBJECT )
189
+ {
190
+ var name = element.getName();
191
+ if ( !( typeof this.element == 'string' ? name == this.element : name in this.element ) )
192
+ continue;
193
+ }
194
+
195
+ if ( this.checkElementRemovable( element, true ) )
196
+ return true;
197
+ }
198
+ }
199
+ return false;
200
+ },
201
+
202
+ /**
203
+ * Whether this style can be applied at the element path.
204
+ * @param elementPath
205
+ */
206
+ checkApplicable : function( elementPath )
207
+ {
208
+ switch ( this.type )
209
+ {
210
+ case CKEDITOR.STYLE_INLINE :
211
+ case CKEDITOR.STYLE_BLOCK :
212
+ break;
213
+
214
+ case CKEDITOR.STYLE_OBJECT :
215
+ return elementPath.lastElement.getAscendant( this.element, true );
216
+ }
217
+
218
+ return true;
219
+ },
220
+
221
+ // Checks if an element, or any of its attributes, is removable by the
222
+ // current style definition.
223
+ checkElementRemovable : function( element, fullMatch )
224
+ {
225
+ var def = this._.definition;
226
+
227
+ if ( !element || !def.ignoreReadonly && element.isReadOnly() )
228
+ return false;
229
+
230
+ var attribs,
231
+ name = element.getName();
232
+
233
+ // If the element name is the same as the style name.
234
+ if ( typeof this.element == 'string' ? name == this.element : name in this.element )
235
+ {
236
+ // If no attributes are defined in the element.
237
+ if ( !fullMatch && !element.hasAttributes() )
238
+ return true;
239
+
240
+ attribs = getAttributesForComparison( def );
241
+
242
+ if ( attribs._length )
243
+ {
244
+ for ( var attName in attribs )
245
+ {
246
+ if ( attName == '_length' )
247
+ continue;
248
+
249
+ var elementAttr = element.getAttribute( attName ) || '';
250
+
251
+ // Special treatment for 'style' attribute is required.
252
+ if ( attName == 'style' ?
253
+ compareCssText( attribs[ attName ], normalizeCssText( elementAttr, false ) )
254
+ : attribs[ attName ] == elementAttr )
255
+ {
256
+ if ( !fullMatch )
257
+ return true;
258
+ }
259
+ else if ( fullMatch )
260
+ return false;
261
+ }
262
+ if ( fullMatch )
263
+ return true;
264
+ }
265
+ else
266
+ return true;
267
+ }
268
+
269
+ // Check if the element can be somehow overriden.
270
+ var override = getOverrides( this )[ element.getName() ] ;
271
+ if ( override )
272
+ {
273
+ // If no attributes have been defined, remove the element.
274
+ if ( !( attribs = override.attributes ) )
275
+ return true;
276
+
277
+ for ( var i = 0 ; i < attribs.length ; i++ )
278
+ {
279
+ attName = attribs[i][0];
280
+ var actualAttrValue = element.getAttribute( attName );
281
+ if ( actualAttrValue )
282
+ {
283
+ var attValue = attribs[i][1];
284
+
285
+ // Remove the attribute if:
286
+ // - The override definition value is null;
287
+ // - The override definition value is a string that
288
+ // matches the attribute value exactly.
289
+ // - The override definition value is a regex that
290
+ // has matches in the attribute value.
291
+ if ( attValue === null ||
292
+ ( typeof attValue == 'string' && actualAttrValue == attValue ) ||
293
+ attValue.test( actualAttrValue ) )
294
+ return true;
295
+ }
296
+ }
297
+ }
298
+ return false;
299
+ },
300
+
301
+ // Builds the preview HTML based on the styles definition.
302
+ buildPreview : function( label )
303
+ {
304
+ var styleDefinition = this._.definition,
305
+ html = [],
306
+ elementName = styleDefinition.element;
307
+
308
+ // Avoid <bdo> in the preview.
309
+ if ( elementName == 'bdo' )
310
+ elementName = 'span';
311
+
312
+ html = [ '<', elementName ];
313
+
314
+ // Assign all defined attributes.
315
+ var attribs = styleDefinition.attributes;
316
+ if ( attribs )
317
+ {
318
+ for ( var att in attribs )
319
+ {
320
+ html.push( ' ', att, '="', attribs[ att ], '"' );
321
+ }
322
+ }
323
+
324
+ // Assign the style attribute.
325
+ var cssStyle = CKEDITOR.style.getStyleText( styleDefinition );
326
+ if ( cssStyle )
327
+ html.push( ' style="', cssStyle, '"' );
328
+
329
+ html.push( '>', ( label || styleDefinition.name ), '</', elementName, '>' );
330
+
331
+ return html.join( '' );
332
+ }
333
+ };
334
+
335
+ // Build the cssText based on the styles definition.
336
+ CKEDITOR.style.getStyleText = function( styleDefinition )
337
+ {
338
+ // If we have already computed it, just return it.
339
+ var stylesDef = styleDefinition._ST;
340
+ if ( stylesDef )
341
+ return stylesDef;
342
+
343
+ stylesDef = styleDefinition.styles;
344
+
345
+ // Builds the StyleText.
346
+ var stylesText = ( styleDefinition.attributes && styleDefinition.attributes[ 'style' ] ) || '',
347
+ specialStylesText = '';
348
+
349
+ if ( stylesText.length )
350
+ stylesText = stylesText.replace( semicolonFixRegex, ';' );
351
+
352
+ for ( var style in stylesDef )
353
+ {
354
+ var styleVal = stylesDef[ style ],
355
+ text = ( style + ':' + styleVal ).replace( semicolonFixRegex, ';' );
356
+
357
+ // Some browsers don't support 'inherit' property value, leave them intact. (#5242)
358
+ if ( styleVal == 'inherit' )
359
+ specialStylesText += text;
360
+ else
361
+ stylesText += text;
362
+ }
363
+
364
+ // Browsers make some changes to the style when applying them. So, here
365
+ // we normalize it to the browser format.
366
+ if ( stylesText.length )
367
+ stylesText = normalizeCssText( stylesText );
368
+
369
+ stylesText += specialStylesText;
370
+
371
+ // Return it, saving it to the next request.
372
+ return ( styleDefinition._ST = stylesText );
373
+ };
374
+
375
+ // Gets the parent element which blocks the styling for an element. This
376
+ // can be done through read-only elements (contenteditable=false) or
377
+ // elements with the "data-nostyle" attribute.
378
+ function getUnstylableParent( element )
379
+ {
380
+ var unstylable,
381
+ editable;
382
+
383
+ while ( ( element = element.getParent() ) )
384
+ {
385
+ if ( element.getName() == 'body' )
386
+ break;
387
+
388
+ if ( element.getAttribute( 'data-nostyle' ) )
389
+ unstylable = element;
390
+ else if ( !editable )
391
+ {
392
+ var contentEditable = element.getAttribute( 'contentEditable' );
393
+
394
+ if ( contentEditable == 'false' )
395
+ unstylable = element;
396
+ else if ( contentEditable == 'true' )
397
+ editable = 1;
398
+ }
399
+ }
400
+
401
+ return unstylable;
402
+ }
403
+
404
+ function applyInlineStyle( range )
405
+ {
406
+ var document = range.document;
407
+
408
+ if ( range.collapsed )
409
+ {
410
+ // Create the element to be inserted in the DOM.
411
+ var collapsedElement = getElement( this, document );
412
+
413
+ // Insert the empty element into the DOM at the range position.
414
+ range.insertNode( collapsedElement );
415
+
416
+ // Place the selection right inside the empty element.
417
+ range.moveToPosition( collapsedElement, CKEDITOR.POSITION_BEFORE_END );
418
+
419
+ return;
420
+ }
421
+
422
+ var elementName = this.element;
423
+ var def = this._.definition;
424
+ var isUnknownElement;
425
+
426
+ // Indicates that fully selected read-only elements are to be included in the styling range.
427
+ var ignoreReadonly = def.ignoreReadonly,
428
+ includeReadonly = ignoreReadonly || def.includeReadonly;
429
+
430
+ // If the read-only inclusion is not available in the definition, try
431
+ // to get it from the document data.
432
+ if ( includeReadonly == undefined )
433
+ includeReadonly = document.getCustomData( 'cke_includeReadonly' );
434
+
435
+ // Get the DTD definition for the element. Defaults to "span".
436
+ var dtd = CKEDITOR.dtd[ elementName ] || ( isUnknownElement = true, CKEDITOR.dtd.span );
437
+
438
+ // Expand the range.
439
+ range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 );
440
+ range.trim();
441
+
442
+ // Get the first node to be processed and the last, which concludes the
443
+ // processing.
444
+ var boundaryNodes = range.createBookmark(),
445
+ firstNode = boundaryNodes.startNode,
446
+ lastNode = boundaryNodes.endNode;
447
+
448
+ var currentNode = firstNode;
449
+
450
+ var styleRange;
451
+
452
+ if ( !ignoreReadonly )
453
+ {
454
+ // Check if the boundaries are inside non stylable elements.
455
+ var firstUnstylable = getUnstylableParent( firstNode ),
456
+ lastUnstylable = getUnstylableParent( lastNode );
457
+
458
+ // If the first element can't be styled, we'll start processing right
459
+ // after its unstylable root.
460
+ if ( firstUnstylable )
461
+ currentNode = firstUnstylable.getNextSourceNode( true );
462
+
463
+ // If the last element can't be styled, we'll stop processing on its
464
+ // unstylable root.
465
+ if ( lastUnstylable )
466
+ lastNode = lastUnstylable;
467
+ }
468
+
469
+ // Do nothing if the current node now follows the last node to be processed.
470
+ if ( currentNode.getPosition( lastNode ) == CKEDITOR.POSITION_FOLLOWING )
471
+ currentNode = 0;
472
+
473
+ while ( currentNode )
474
+ {
475
+ var applyStyle = false;
476
+
477
+ if ( currentNode.equals( lastNode ) )
478
+ {
479
+ currentNode = null;
480
+ applyStyle = true;
481
+ }
482
+ else
483
+ {
484
+ var nodeType = currentNode.type;
485
+ var nodeName = nodeType == CKEDITOR.NODE_ELEMENT ? currentNode.getName() : null;
486
+ var nodeIsReadonly = nodeName && ( currentNode.getAttribute( 'contentEditable' ) == 'false' );
487
+ var nodeIsNoStyle = nodeName && currentNode.getAttribute( 'data-nostyle' );
488
+
489
+ if ( nodeName && currentNode.data( 'cke-bookmark' ) )
490
+ {
491
+ currentNode = currentNode.getNextSourceNode( true );
492
+ continue;
493
+ }
494
+
495
+ // Check if the current node can be a child of the style element.
496
+ if ( !nodeName || ( dtd[ nodeName ]
497
+ && !nodeIsNoStyle
498
+ && ( !nodeIsReadonly || includeReadonly )
499
+ && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
500
+ && ( !def.childRule || def.childRule( currentNode ) ) ) )
501
+ {
502
+ var currentParent = currentNode.getParent();
503
+
504
+ // Check if the style element can be a child of the current
505
+ // node parent or if the element is not defined in the DTD.
506
+ if ( currentParent
507
+ && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement )
508
+ && ( !def.parentRule || def.parentRule( currentParent ) ) )
509
+ {
510
+ // This node will be part of our range, so if it has not
511
+ // been started, place its start right before the node.
512
+ // In the case of an element node, it will be included
513
+ // only if it is entirely inside the range.
514
+ 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 ) ) )
515
+ {
516
+ styleRange = new CKEDITOR.dom.range( document );
517
+ styleRange.setStartBefore( currentNode );
518
+ }
519
+
520
+ // Non element nodes, readonly elements, or empty
521
+ // elements can be added completely to the range.
522
+ if ( nodeType == CKEDITOR.NODE_TEXT || nodeIsReadonly || ( nodeType == CKEDITOR.NODE_ELEMENT && !currentNode.getChildCount() ) )
523
+ {
524
+ var includedNode = currentNode;
525
+ var parentNode;
526
+
527
+ // This node is about to be included completelly, but,
528
+ // if this is the last node in its parent, we must also
529
+ // check if the parent itself can be added completelly
530
+ // to the range, otherwise apply the style immediately.
531
+ while ( ( applyStyle = !includedNode.getNext( notBookmark ) )
532
+ && ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] )
533
+ && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
534
+ && ( !def.childRule || def.childRule( parentNode ) ) )
535
+ {
536
+ includedNode = parentNode;
537
+ }
538
+
539
+ styleRange.setEndAfter( includedNode );
540
+
541
+ }
542
+ }
543
+ else
544
+ applyStyle = true;
545
+ }
546
+ else
547
+ applyStyle = true;
548
+
549
+ // Get the next node to be processed.
550
+ currentNode = currentNode.getNextSourceNode( nodeIsNoStyle || nodeIsReadonly );
551
+ }
552
+
553
+ // Apply the style if we have something to which apply it.
554
+ if ( applyStyle && styleRange && !styleRange.collapsed )
555
+ {
556
+ // Build the style element, based on the style object definition.
557
+ var styleNode = getElement( this, document ),
558
+ styleHasAttrs = styleNode.hasAttributes();
559
+
560
+ // Get the element that holds the entire range.
561
+ var parent = styleRange.getCommonAncestor();
562
+
563
+ var removeList = {
564
+ styles : {},
565
+ attrs : {},
566
+ // Styles cannot be removed.
567
+ blockedStyles : {},
568
+ // Attrs cannot be removed.
569
+ blockedAttrs : {}
570
+ };
571
+
572
+ var attName, styleName, value;
573
+
574
+ // Loop through the parents, removing the redundant attributes
575
+ // from the element to be applied.
576
+ while ( styleNode && parent )
577
+ {
578
+ if ( parent.getName() == elementName )
579
+ {
580
+ for ( attName in def.attributes )
581
+ {
582
+ if ( removeList.blockedAttrs[ attName ] || !( value = parent.getAttribute( styleName ) ) )
583
+ continue;
584
+
585
+ if ( styleNode.getAttribute( attName ) == value )
586
+ removeList.attrs[ attName ] = 1;
587
+ else
588
+ removeList.blockedAttrs[ attName ] = 1;
589
+ }
590
+
591
+ for ( styleName in def.styles )
592
+ {
593
+ if ( removeList.blockedStyles[ styleName ] || !( value = parent.getStyle( styleName ) ) )
594
+ continue;
595
+
596
+ if ( styleNode.getStyle( styleName ) == value )
597
+ removeList.styles[ styleName ] = 1;
598
+ else
599
+ removeList.blockedStyles[ styleName ] = 1;
600
+ }
601
+ }
602
+
603
+ parent = parent.getParent();
604
+ }
605
+
606
+ for ( attName in removeList.attrs )
607
+ styleNode.removeAttribute( attName );
608
+
609
+ for ( styleName in removeList.styles )
610
+ styleNode.removeStyle( styleName );
611
+
612
+ if ( styleHasAttrs && !styleNode.hasAttributes() )
613
+ styleNode = null;
614
+
615
+ if ( styleNode )
616
+ {
617
+ // Move the contents of the range to the style element.
618
+ styleRange.extractContents().appendTo( styleNode );
619
+
620
+ // Here we do some cleanup, removing all duplicated
621
+ // elements from the style element.
622
+ removeFromInsideElement( this, styleNode );
623
+
624
+ // Insert it into the range position (it is collapsed after
625
+ // extractContents.
626
+ styleRange.insertNode( styleNode );
627
+
628
+ // Let's merge our new style with its neighbors, if possible.
629
+ styleNode.mergeSiblings();
630
+
631
+ // As the style system breaks text nodes constantly, let's normalize
632
+ // things for performance.
633
+ // With IE, some paragraphs get broken when calling normalize()
634
+ // repeatedly. Also, for IE, we must normalize body, not documentElement.
635
+ // IE is also known for having a "crash effect" with normalize().
636
+ // We should try to normalize with IE too in some way, somewhere.
637
+ if ( !CKEDITOR.env.ie )
638
+ styleNode.$.normalize();
639
+ }
640
+ // Style already inherit from parents, left just to clear up any internal overrides. (#5931)
641
+ else
642
+ {
643
+ styleNode = new CKEDITOR.dom.element( 'span' );
644
+ styleRange.extractContents().appendTo( styleNode );
645
+ styleRange.insertNode( styleNode );
646
+ removeFromInsideElement( this, styleNode );
647
+ styleNode.remove( true );
648
+ }
649
+
650
+ // Style applied, let's release the range, so it gets
651
+ // re-initialization in the next loop.
652
+ styleRange = null;
653
+ }
654
+ }
655
+
656
+ // Remove the bookmark nodes.
657
+ range.moveToBookmark( boundaryNodes );
658
+
659
+ // Minimize the result range to exclude empty text nodes. (#5374)
660
+ range.shrink( CKEDITOR.SHRINK_TEXT );
661
+ }
662
+
663
+ function removeInlineStyle( range )
664
+ {
665
+ /*
666
+ * Make sure our range has included all "collpased" parent inline nodes so
667
+ * that our operation logic can be simpler.
668
+ */
669
+ range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 );
670
+
671
+ var bookmark = range.createBookmark(),
672
+ startNode = bookmark.startNode;
673
+
674
+ if ( range.collapsed )
675
+ {
676
+
677
+ var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ),
678
+ // The topmost element in elementspatch which we should jump out of.
679
+ boundaryElement;
680
+
681
+
682
+ for ( var i = 0, element ; i < startPath.elements.length
683
+ && ( element = startPath.elements[i] ) ; i++ )
684
+ {
685
+ /*
686
+ * 1. If it's collaped inside text nodes, try to remove the style from the whole element.
687
+ *
688
+ * 2. Otherwise if it's collapsed on element boundaries, moving the selection
689
+ * outside the styles instead of removing the whole tag,
690
+ * also make sure other inner styles were well preserverd.(#3309)
691
+ */
692
+ if ( element == startPath.block || element == startPath.blockLimit )
693
+ break;
694
+
695
+ if ( this.checkElementRemovable( element ) )
696
+ {
697
+ var isStart;
698
+
699
+ if ( range.collapsed && (
700
+ range.checkBoundaryOfElement( element, CKEDITOR.END ) ||
701
+ ( isStart = range.checkBoundaryOfElement( element, CKEDITOR.START ) ) ) )
702
+ {
703
+ boundaryElement = element;
704
+ boundaryElement.match = isStart ? 'start' : 'end';
705
+ }
706
+ else
707
+ {
708
+ /*
709
+ * Before removing the style node, there may be a sibling to the style node
710
+ * that's exactly the same to the one to be removed. To the user, it makes
711
+ * no difference that they're separate entities in the DOM tree. So, merge
712
+ * them before removal.
713
+ */
714
+ element.mergeSiblings();
715
+ if ( element.getName() == this.element )
716
+ removeFromElement( this, element );
717
+ else
718
+ removeOverrides( element, getOverrides( this )[ element.getName() ] );
719
+ }
720
+ }
721
+ }
722
+
723
+ // Re-create the style tree after/before the boundary element,
724
+ // the replication start from bookmark start node to define the
725
+ // new range.
726
+ if ( boundaryElement )
727
+ {
728
+ var clonedElement = startNode;
729
+ for ( i = 0 ;; i++ )
730
+ {
731
+ var newElement = startPath.elements[ i ];
732
+ if ( newElement.equals( boundaryElement ) )
733
+ break;
734
+ // Avoid copying any matched element.
735
+ else if ( newElement.match )
736
+ continue;
737
+ else
738
+ newElement = newElement.clone();
739
+ newElement.append( clonedElement );
740
+ clonedElement = newElement;
741
+ }
742
+ clonedElement[ boundaryElement.match == 'start' ?
743
+ 'insertBefore' : 'insertAfter' ]( boundaryElement );
744
+ }
745
+ }
746
+ else
747
+ {
748
+ /*
749
+ * Now our range isn't collapsed. Lets walk from the start node to the end
750
+ * node via DFS and remove the styles one-by-one.
751
+ */
752
+ var endNode = bookmark.endNode,
753
+ me = this;
754
+
755
+ /*
756
+ * Find out the style ancestor that needs to be broken down at startNode
757
+ * and endNode.
758
+ */
759
+ function breakNodes()
760
+ {
761
+ var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ),
762
+ endPath = new CKEDITOR.dom.elementPath( endNode.getParent() ),
763
+ breakStart = null,
764
+ breakEnd = null;
765
+ for ( var i = 0 ; i < startPath.elements.length ; i++ )
766
+ {
767
+ var element = startPath.elements[ i ];
768
+
769
+ if ( element == startPath.block || element == startPath.blockLimit )
770
+ break;
771
+
772
+ if ( me.checkElementRemovable( element ) )
773
+ breakStart = element;
774
+ }
775
+ for ( i = 0 ; i < endPath.elements.length ; i++ )
776
+ {
777
+ element = endPath.elements[ i ];
778
+
779
+ if ( element == endPath.block || element == endPath.blockLimit )
780
+ break;
781
+
782
+ if ( me.checkElementRemovable( element ) )
783
+ breakEnd = element;
784
+ }
785
+
786
+ if ( breakEnd )
787
+ endNode.breakParent( breakEnd );
788
+ if ( breakStart )
789
+ startNode.breakParent( breakStart );
790
+ }
791
+ breakNodes();
792
+
793
+ // Now, do the DFS walk.
794
+ var currentNode = startNode;
795
+ while ( !currentNode.equals( endNode ) )
796
+ {
797
+ /*
798
+ * Need to get the next node first because removeFromElement() can remove
799
+ * the current node from DOM tree.
800
+ */
801
+ var nextNode = currentNode.getNextSourceNode();
802
+ if ( currentNode.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable( currentNode ) )
803
+ {
804
+ // Remove style from element or overriding element.
805
+ if ( currentNode.getName() == this.element )
806
+ removeFromElement( this, currentNode );
807
+ else
808
+ removeOverrides( currentNode, getOverrides( this )[ currentNode.getName() ] );
809
+
810
+ /*
811
+ * removeFromElement() may have merged the next node with something before
812
+ * the startNode via mergeSiblings(). In that case, the nextNode would
813
+ * contain startNode and we'll have to call breakNodes() again and also
814
+ * reassign the nextNode to something after startNode.
815
+ */
816
+ if ( nextNode.type == CKEDITOR.NODE_ELEMENT && nextNode.contains( startNode ) )
817
+ {
818
+ breakNodes();
819
+ nextNode = startNode.getNext();
820
+ }
821
+ }
822
+ currentNode = nextNode;
823
+ }
824
+ }
825
+
826
+ range.moveToBookmark( bookmark );
827
+ }
828
+
829
+ function applyObjectStyle( range )
830
+ {
831
+ var root = range.getCommonAncestor( true, true ),
832
+ element = root.getAscendant( this.element, true );
833
+ element && !element.isReadOnly() && setupElement( element, this );
834
+ }
835
+
836
+ function removeObjectStyle( range )
837
+ {
838
+ var root = range.getCommonAncestor( true, true ),
839
+ element = root.getAscendant( this.element, true );
840
+
841
+ if ( !element )
842
+ return;
843
+
844
+ var style = this,
845
+ def = style._.definition,
846
+ attributes = def.attributes;
847
+
848
+ // Remove all defined attributes.
849
+ if ( attributes )
850
+ {
851
+ for ( var att in attributes )
852
+ {
853
+ element.removeAttribute( att, attributes[ att ] );
854
+ }
855
+ }
856
+
857
+ // Assign all defined styles.
858
+ if ( def.styles )
859
+ {
860
+ for ( var i in def.styles )
861
+ {
862
+ if ( !def.styles.hasOwnProperty( i ) )
863
+ continue;
864
+
865
+ element.removeStyle( i );
866
+ }
867
+ }
868
+ }
869
+
870
+ function applyBlockStyle( range )
871
+ {
872
+ // Serializible bookmarks is needed here since
873
+ // elements may be merged.
874
+ var bookmark = range.createBookmark( true );
875
+
876
+ var iterator = range.createIterator();
877
+ iterator.enforceRealBlocks = true;
878
+
879
+ // make recognize <br /> tag as a separator in ENTER_BR mode (#5121)
880
+ if ( this._.enterMode )
881
+ iterator.enlargeBr = ( this._.enterMode != CKEDITOR.ENTER_BR );
882
+
883
+ var block;
884
+ var doc = range.document;
885
+ var previousPreBlock;
886
+
887
+ while ( ( block = iterator.getNextParagraph() ) ) // Only one =
888
+ {
889
+ if ( !block.isReadOnly() )
890
+ {
891
+ var newBlock = getElement( this, doc, block );
892
+ replaceBlock( block, newBlock );
893
+ }
894
+ }
895
+
896
+ range.moveToBookmark( bookmark );
897
+ }
898
+
899
+ function removeBlockStyle( range )
900
+ {
901
+ // Serializible bookmarks is needed here since
902
+ // elements may be merged.
903
+ var bookmark = range.createBookmark( 1 );
904
+
905
+ var iterator = range.createIterator();
906
+ iterator.enforceRealBlocks = true;
907
+ iterator.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
908
+
909
+ var block;
910
+ while ( ( block = iterator.getNextParagraph() ) )
911
+ {
912
+ if ( this.checkElementRemovable( block ) )
913
+ {
914
+ // <pre> get special treatment.
915
+ if ( block.is( 'pre' ) )
916
+ {
917
+ var newBlock = this._.enterMode == CKEDITOR.ENTER_BR ?
918
+ null : range.document.createElement(
919
+ this._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
920
+
921
+ newBlock && block.copyAttributes( newBlock );
922
+ replaceBlock( block, newBlock );
923
+ }
924
+ else
925
+ removeFromElement( this, block, 1 );
926
+ }
927
+ }
928
+
929
+ range.moveToBookmark( bookmark );
930
+ }
931
+
932
+ // Replace the original block with new one, with special treatment
933
+ // for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent
934
+ // when necessary.(#3188)
935
+ function replaceBlock( block, newBlock )
936
+ {
937
+ // Block is to be removed, create a temp element to
938
+ // save contents.
939
+ var removeBlock = !newBlock;
940
+ if ( removeBlock )
941
+ {
942
+ newBlock = block.getDocument().createElement( 'div' );
943
+ block.copyAttributes( newBlock );
944
+ }
945
+
946
+ var newBlockIsPre = newBlock && newBlock.is( 'pre' );
947
+ var blockIsPre = block.is( 'pre' );
948
+
949
+ var isToPre = newBlockIsPre && !blockIsPre;
950
+ var isFromPre = !newBlockIsPre && blockIsPre;
951
+
952
+ if ( isToPre )
953
+ newBlock = toPre( block, newBlock );
954
+ else if ( isFromPre )
955
+ // Split big <pre> into pieces before start to convert.
956
+ newBlock = fromPres( removeBlock ?
957
+ [ block.getHtml() ] : splitIntoPres( block ), newBlock );
958
+ else
959
+ block.moveChildren( newBlock );
960
+
961
+ newBlock.replace( block );
962
+
963
+ if ( newBlockIsPre )
964
+ {
965
+ // Merge previous <pre> blocks.
966
+ mergePre( newBlock );
967
+ }
968
+ else if ( removeBlock )
969
+ removeNoAttribsElement( newBlock );
970
+ }
971
+
972
+ /**
973
+ * Merge a <pre> block with a previous sibling if available.
974
+ */
975
+ function mergePre( preBlock )
976
+ {
977
+ var previousBlock;
978
+ if ( !( ( previousBlock = preBlock.getPrevious( nonWhitespaces ) )
979
+ && previousBlock.is
980
+ && previousBlock.is( 'pre') ) )
981
+ return;
982
+
983
+ // Merge the previous <pre> block contents into the current <pre>
984
+ // block.
985
+ //
986
+ // Another thing to be careful here is that currentBlock might contain
987
+ // a '\n' at the beginning, and previousBlock might contain a '\n'
988
+ // towards the end. These new lines are not normally displayed but they
989
+ // become visible after merging.
990
+ var mergedHtml = replace( previousBlock.getHtml(), /\n$/, '' ) + '\n\n' +
991
+ replace( preBlock.getHtml(), /^\n/, '' ) ;
992
+
993
+ // Krugle: IE normalizes innerHTML from <pre>, breaking whitespaces.
994
+ if ( CKEDITOR.env.ie )
995
+ preBlock.$.outerHTML = '<pre>' + mergedHtml + '</pre>';
996
+ else
997
+ preBlock.setHtml( mergedHtml );
998
+
999
+ previousBlock.remove();
1000
+ }
1001
+
1002
+ /**
1003
+ * Split into multiple <pre> blocks separated by double line-break.
1004
+ * @param preBlock
1005
+ */
1006
+ function splitIntoPres( preBlock )
1007
+ {
1008
+ // Exclude the ones at header OR at tail,
1009
+ // and ignore bookmark content between them.
1010
+ var duoBrRegex = /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,
1011
+ blockName = preBlock.getName(),
1012
+ splitedHtml = replace( preBlock.getOuterHtml(),
1013
+ duoBrRegex,
1014
+ function( match, charBefore, bookmark )
1015
+ {
1016
+ return charBefore + '</pre>' + bookmark + '<pre>';
1017
+ } );
1018
+
1019
+ var pres = [];
1020
+ splitedHtml.replace( /<pre\b.*?>([\s\S]*?)<\/pre>/gi, function( match, preContent ){
1021
+ pres.push( preContent );
1022
+ } );
1023
+ return pres;
1024
+ }
1025
+
1026
+ // Wrapper function of String::replace without considering of head/tail bookmarks nodes.
1027
+ function replace( str, regexp, replacement )
1028
+ {
1029
+ var headBookmark = '',
1030
+ tailBookmark = '';
1031
+
1032
+ str = str.replace( /(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,
1033
+ function( str, m1, m2 ){
1034
+ m1 && ( headBookmark = m1 );
1035
+ m2 && ( tailBookmark = m2 );
1036
+ return '';
1037
+ } );
1038
+ return headBookmark + str.replace( regexp, replacement ) + tailBookmark;
1039
+ }
1040
+
1041
+ /**
1042
+ * Converting a list of <pre> into blocks with format well preserved.
1043
+ */
1044
+ function fromPres( preHtmls, newBlock )
1045
+ {
1046
+ var docFrag;
1047
+ if ( preHtmls.length > 1 )
1048
+ docFrag = new CKEDITOR.dom.documentFragment( newBlock.getDocument() );
1049
+
1050
+ for ( var i = 0 ; i < preHtmls.length ; i++ )
1051
+ {
1052
+ var blockHtml = preHtmls[ i ];
1053
+
1054
+ // 1. Trim the first and last line-breaks immediately after and before <pre>,
1055
+ // they're not visible.
1056
+ blockHtml = blockHtml.replace( /(\r\n|\r)/g, '\n' ) ;
1057
+ blockHtml = replace( blockHtml, /^[ \t]*\n/, '' ) ;
1058
+ blockHtml = replace( blockHtml, /\n$/, '' ) ;
1059
+ // 2. Convert spaces or tabs at the beginning or at the end to &nbsp;
1060
+ blockHtml = replace( blockHtml, /^[ \t]+|[ \t]+$/g, function( match, offset, s )
1061
+ {
1062
+ if ( match.length == 1 ) // one space, preserve it
1063
+ return '&nbsp;' ;
1064
+ else if ( !offset ) // beginning of block
1065
+ return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ';
1066
+ else // end of block
1067
+ return ' ' + CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 );
1068
+ } ) ;
1069
+
1070
+ // 3. Convert \n to <BR>.
1071
+ // 4. Convert contiguous (i.e. non-singular) spaces or tabs to &nbsp;
1072
+ blockHtml = blockHtml.replace( /\n/g, '<br>' ) ;
1073
+ blockHtml = blockHtml.replace( /[ \t]{2,}/g,
1074
+ function ( match )
1075
+ {
1076
+ return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ' ;
1077
+ } ) ;
1078
+
1079
+ if ( docFrag )
1080
+ {
1081
+ var newBlockClone = newBlock.clone();
1082
+ newBlockClone.setHtml( blockHtml );
1083
+ docFrag.append( newBlockClone );
1084
+ }
1085
+ else
1086
+ newBlock.setHtml( blockHtml );
1087
+ }
1088
+
1089
+ return docFrag || newBlock;
1090
+ }
1091
+
1092
+ /**
1093
+ * Converting from a non-PRE block to a PRE block in formatting operations.
1094
+ */
1095
+ function toPre( block, newBlock )
1096
+ {
1097
+ var bogus = block.getBogus();
1098
+ bogus && bogus.remove();
1099
+
1100
+ // First trim the block content.
1101
+ var preHtml = block.getHtml();
1102
+
1103
+ // 1. Trim head/tail spaces, they're not visible.
1104
+ preHtml = replace( preHtml, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '' );
1105
+ // 2. Delete ANSI whitespaces immediately before and after <BR> because
1106
+ // they are not visible.
1107
+ preHtml = preHtml.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '$1' );
1108
+ // 3. Compress other ANSI whitespaces since they're only visible as one
1109
+ // single space previously.
1110
+ // 4. Convert &nbsp; to spaces since &nbsp; is no longer needed in <PRE>.
1111
+ preHtml = preHtml.replace( /([ \t\n\r]+|&nbsp;)/g, ' ' );
1112
+ // 5. Convert any <BR /> to \n. This must not be done earlier because
1113
+ // the \n would then get compressed.
1114
+ preHtml = preHtml.replace( /<br\b[^>]*>/gi, '\n' );
1115
+
1116
+ // Krugle: IE normalizes innerHTML to <pre>, breaking whitespaces.
1117
+ if ( CKEDITOR.env.ie )
1118
+ {
1119
+ var temp = block.getDocument().createElement( 'div' );
1120
+ temp.append( newBlock );
1121
+ newBlock.$.outerHTML = '<pre>' + preHtml + '</pre>';
1122
+ newBlock.copyAttributes( temp.getFirst() );
1123
+ newBlock = temp.getFirst().remove();
1124
+ }
1125
+ else
1126
+ newBlock.setHtml( preHtml );
1127
+
1128
+ return newBlock;
1129
+ }
1130
+
1131
+ // Removes a style from an element itself, don't care about its subtree.
1132
+ function removeFromElement( style, element )
1133
+ {
1134
+ var def = style._.definition,
1135
+ attributes = def.attributes,
1136
+ styles = def.styles,
1137
+ overrides = getOverrides( style )[ element.getName() ],
1138
+ // If the style is only about the element itself, we have to remove the element.
1139
+ removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles );
1140
+
1141
+ // Remove definition attributes/style from the elemnt.
1142
+ for ( var attName in attributes )
1143
+ {
1144
+ // The 'class' element value must match (#1318).
1145
+ if ( ( attName == 'class' || style._.definition.fullMatch )
1146
+ && element.getAttribute( attName ) != normalizeProperty( attName, attributes[ attName ] ) )
1147
+ continue;
1148
+ removeEmpty = element.hasAttribute( attName );
1149
+ element.removeAttribute( attName );
1150
+ }
1151
+
1152
+ for ( var styleName in styles )
1153
+ {
1154
+ // Full match style insist on having fully equivalence. (#5018)
1155
+ if ( style._.definition.fullMatch
1156
+ && element.getStyle( styleName ) != normalizeProperty( styleName, styles[ styleName ], true ) )
1157
+ continue;
1158
+
1159
+ removeEmpty = removeEmpty || !!element.getStyle( styleName );
1160
+ element.removeStyle( styleName );
1161
+ }
1162
+
1163
+ // Remove overrides, but don't remove the element if it's a block element
1164
+ removeOverrides( element, overrides, blockElements[ element.getName() ] ) ;
1165
+
1166
+ if ( removeEmpty )
1167
+ {
1168
+ !CKEDITOR.dtd.$block[ element.getName() ] || style._.enterMode == CKEDITOR.ENTER_BR && !element.hasAttributes() ?
1169
+ removeNoAttribsElement( element ) :
1170
+ element.renameNode( style._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
1171
+ }
1172
+ }
1173
+
1174
+ // Removes a style from inside an element.
1175
+ function removeFromInsideElement( style, element )
1176
+ {
1177
+ var def = style._.definition,
1178
+ attribs = def.attributes,
1179
+ styles = def.styles,
1180
+ overrides = getOverrides( style ),
1181
+ innerElements = element.getElementsByTag( style.element );
1182
+
1183
+ for ( var i = innerElements.count(); --i >= 0 ; )
1184
+ removeFromElement( style, innerElements.getItem( i ) );
1185
+
1186
+ // Now remove any other element with different name that is
1187
+ // defined to be overriden.
1188
+ for ( var overrideElement in overrides )
1189
+ {
1190
+ if ( overrideElement != style.element )
1191
+ {
1192
+ innerElements = element.getElementsByTag( overrideElement ) ;
1193
+ for ( i = innerElements.count() - 1 ; i >= 0 ; i-- )
1194
+ {
1195
+ var innerElement = innerElements.getItem( i );
1196
+ removeOverrides( innerElement, overrides[ overrideElement ] ) ;
1197
+ }
1198
+ }
1199
+ }
1200
+ }
1201
+
1202
+ /**
1203
+ * Remove overriding styles/attributes from the specific element.
1204
+ * Note: Remove the element if no attributes remain.
1205
+ * @param {Object} element
1206
+ * @param {Object} overrides
1207
+ * @param {Boolean} Don't remove the element
1208
+ */
1209
+ function removeOverrides( element, overrides, dontRemove )
1210
+ {
1211
+ var attributes = overrides && overrides.attributes ;
1212
+
1213
+ if ( attributes )
1214
+ {
1215
+ for ( var i = 0 ; i < attributes.length ; i++ )
1216
+ {
1217
+ var attName = attributes[i][0], actualAttrValue ;
1218
+
1219
+ if ( ( actualAttrValue = element.getAttribute( attName ) ) )
1220
+ {
1221
+ var attValue = attributes[i][1] ;
1222
+
1223
+ // Remove the attribute if:
1224
+ // - The override definition value is null ;
1225
+ // - The override definition valie is a string that
1226
+ // matches the attribute value exactly.
1227
+ // - The override definition value is a regex that
1228
+ // has matches in the attribute value.
1229
+ if ( attValue === null ||
1230
+ ( attValue.test && attValue.test( actualAttrValue ) ) ||
1231
+ ( typeof attValue == 'string' && actualAttrValue == attValue ) )
1232
+ element.removeAttribute( attName ) ;
1233
+ }
1234
+ }
1235
+ }
1236
+
1237
+ if ( !dontRemove )
1238
+ removeNoAttribsElement( element );
1239
+ }
1240
+
1241
+ // If the element has no more attributes, remove it.
1242
+ function removeNoAttribsElement( element )
1243
+ {
1244
+ // If no more attributes remained in the element, remove it,
1245
+ // leaving its children.
1246
+ if ( !element.hasAttributes() )
1247
+ {
1248
+ if ( CKEDITOR.dtd.$block[ element.getName() ] )
1249
+ {
1250
+ var previous = element.getPrevious( nonWhitespaces ),
1251
+ next = element.getNext( nonWhitespaces );
1252
+
1253
+ if ( previous && ( previous.type == CKEDITOR.NODE_TEXT || !previous.isBlockBoundary( { br : 1 } ) ) )
1254
+ element.append( 'br', 1 );
1255
+ if ( next && ( next.type == CKEDITOR.NODE_TEXT || !next.isBlockBoundary( { br : 1 } ) ) )
1256
+ element.append( 'br' );
1257
+
1258
+ element.remove( true );
1259
+ }
1260
+ else
1261
+ {
1262
+ // Removing elements may open points where merging is possible,
1263
+ // so let's cache the first and last nodes for later checking.
1264
+ var firstChild = element.getFirst();
1265
+ var lastChild = element.getLast();
1266
+
1267
+ element.remove( true );
1268
+
1269
+ if ( firstChild )
1270
+ {
1271
+ // Check the cached nodes for merging.
1272
+ firstChild.type == CKEDITOR.NODE_ELEMENT && firstChild.mergeSiblings();
1273
+
1274
+ if ( lastChild && !firstChild.equals( lastChild )
1275
+ && lastChild.type == CKEDITOR.NODE_ELEMENT )
1276
+ lastChild.mergeSiblings();
1277
+ }
1278
+
1279
+ }
1280
+ }
1281
+ }
1282
+
1283
+ function getElement( style, targetDocument, element )
1284
+ {
1285
+ var el,
1286
+ def = style._.definition,
1287
+ elementName = style.element;
1288
+
1289
+ // The "*" element name will always be a span for this function.
1290
+ if ( elementName == '*' )
1291
+ elementName = 'span';
1292
+
1293
+ // Create the element.
1294
+ el = new CKEDITOR.dom.element( elementName, targetDocument );
1295
+
1296
+ // #6226: attributes should be copied before the new ones are applied
1297
+ if ( element )
1298
+ element.copyAttributes( el );
1299
+
1300
+ el = setupElement( el, style );
1301
+
1302
+ // Avoid ID duplication.
1303
+ if ( targetDocument.getCustomData( 'doc_processing_style' ) && el.hasAttribute( 'id' ) )
1304
+ el.removeAttribute( 'id' );
1305
+ else
1306
+ targetDocument.setCustomData( 'doc_processing_style', 1 );
1307
+
1308
+ return el;
1309
+ }
1310
+
1311
+ function setupElement( el, style )
1312
+ {
1313
+ var def = style._.definition,
1314
+ attributes = def.attributes,
1315
+ styles = CKEDITOR.style.getStyleText( def );
1316
+
1317
+ // Assign all defined attributes.
1318
+ if ( attributes )
1319
+ {
1320
+ for ( var att in attributes )
1321
+ {
1322
+ el.setAttribute( att, attributes[ att ] );
1323
+ }
1324
+ }
1325
+
1326
+ // Assign all defined styles.
1327
+ if( styles )
1328
+ el.setAttribute( 'style', styles );
1329
+
1330
+ return el;
1331
+ }
1332
+
1333
+ function replaceVariables( list, variablesValues )
1334
+ {
1335
+ for ( var item in list )
1336
+ {
1337
+ list[ item ] = list[ item ].replace( varRegex, function( match, varName )
1338
+ {
1339
+ return variablesValues[ varName ];
1340
+ });
1341
+ }
1342
+ }
1343
+
1344
+ // Returns an object that can be used for style matching comparison.
1345
+ // Attributes names and values are all lowercased, and the styles get
1346
+ // merged with the style attribute.
1347
+ function getAttributesForComparison( styleDefinition )
1348
+ {
1349
+ // If we have already computed it, just return it.
1350
+ var attribs = styleDefinition._AC;
1351
+ if ( attribs )
1352
+ return attribs;
1353
+
1354
+ attribs = {};
1355
+
1356
+ var length = 0;
1357
+
1358
+ // Loop through all defined attributes.
1359
+ var styleAttribs = styleDefinition.attributes;
1360
+ if ( styleAttribs )
1361
+ {
1362
+ for ( var styleAtt in styleAttribs )
1363
+ {
1364
+ length++;
1365
+ attribs[ styleAtt ] = styleAttribs[ styleAtt ];
1366
+ }
1367
+ }
1368
+
1369
+ // Includes the style definitions.
1370
+ var styleText = CKEDITOR.style.getStyleText( styleDefinition );
1371
+ if ( styleText )
1372
+ {
1373
+ if ( !attribs[ 'style' ] )
1374
+ length++;
1375
+ attribs[ 'style' ] = styleText;
1376
+ }
1377
+
1378
+ // Appends the "length" information to the object.
1379
+ attribs._length = length;
1380
+
1381
+ // Return it, saving it to the next request.
1382
+ return ( styleDefinition._AC = attribs );
1383
+ }
1384
+
1385
+ /**
1386
+ * Get the the collection used to compare the elements and attributes,
1387
+ * defined in this style overrides, with other element. All information in
1388
+ * it is lowercased.
1389
+ * @param {CKEDITOR.style} style
1390
+ */
1391
+ function getOverrides( style )
1392
+ {
1393
+ if ( style._.overrides )
1394
+ return style._.overrides;
1395
+
1396
+ var overrides = ( style._.overrides = {} ),
1397
+ definition = style._.definition.overrides;
1398
+
1399
+ if ( definition )
1400
+ {
1401
+ // The override description can be a string, object or array.
1402
+ // Internally, well handle arrays only, so transform it if needed.
1403
+ if ( !CKEDITOR.tools.isArray( definition ) )
1404
+ definition = [ definition ];
1405
+
1406
+ // Loop through all override definitions.
1407
+ for ( var i = 0 ; i < definition.length ; i++ )
1408
+ {
1409
+ var override = definition[i];
1410
+ var elementName;
1411
+ var overrideEl;
1412
+ var attrs;
1413
+
1414
+ // If can be a string with the element name.
1415
+ if ( typeof override == 'string' )
1416
+ elementName = override.toLowerCase();
1417
+ // Or an object.
1418
+ else
1419
+ {
1420
+ elementName = override.element ? override.element.toLowerCase() : style.element;
1421
+ attrs = override.attributes;
1422
+ }
1423
+
1424
+ // We can have more than one override definition for the same
1425
+ // element name, so we attempt to simply append information to
1426
+ // it if it already exists.
1427
+ overrideEl = overrides[ elementName ] || ( overrides[ elementName ] = {} );
1428
+
1429
+ if ( attrs )
1430
+ {
1431
+ // The returning attributes list is an array, because we
1432
+ // could have different override definitions for the same
1433
+ // attribute name.
1434
+ var overrideAttrs = ( overrideEl.attributes = overrideEl.attributes || new Array() );
1435
+ for ( var attName in attrs )
1436
+ {
1437
+ // Each item in the attributes array is also an array,
1438
+ // where [0] is the attribute name and [1] is the
1439
+ // override value.
1440
+ overrideAttrs.push( [ attName.toLowerCase(), attrs[ attName ] ] );
1441
+ }
1442
+ }
1443
+ }
1444
+ }
1445
+
1446
+ return overrides;
1447
+ }
1448
+
1449
+ // Make the comparison of attribute value easier by standardizing it.
1450
+ function normalizeProperty( name, value, isStyle )
1451
+ {
1452
+ var temp = new CKEDITOR.dom.element( 'span' );
1453
+ temp [ isStyle ? 'setStyle' : 'setAttribute' ]( name, value );
1454
+ return temp[ isStyle ? 'getStyle' : 'getAttribute' ]( name );
1455
+ }
1456
+
1457
+ // Make the comparison of style text easier by standardizing it.
1458
+ function normalizeCssText( unparsedCssText, nativeNormalize )
1459
+ {
1460
+ var styleText;
1461
+ if ( nativeNormalize !== false )
1462
+ {
1463
+ // Injects the style in a temporary span object, so the browser parses it,
1464
+ // retrieving its final format.
1465
+ var temp = new CKEDITOR.dom.element( 'span' );
1466
+ temp.setAttribute( 'style', unparsedCssText );
1467
+ styleText = temp.getAttribute( 'style' ) || '';
1468
+ }
1469
+ else
1470
+ styleText = unparsedCssText;
1471
+
1472
+ // Normalize font-family property, ignore quotes and being case insensitive. (#7322)
1473
+ // http://www.w3.org/TR/css3-fonts/#font-family-the-font-family-property
1474
+ styleText = styleText.replace( /(font-family:)(.*?)(?=;|$)/, function ( match, prop, val )
1475
+ {
1476
+ var names = val.split( ',' );
1477
+ for ( var i = 0; i < names.length; i++ )
1478
+ names[ i ] = CKEDITOR.tools.trim( names[ i ].replace( /["']/g, '' ) );
1479
+ return prop + names.join( ',' );
1480
+ });
1481
+
1482
+ // Shrinking white-spaces around colon and semi-colon (#4147).
1483
+ // Compensate tail semi-colon.
1484
+ return styleText.replace( /\s*([;:])\s*/, '$1' )
1485
+ .replace( /([^\s;])$/, '$1;')
1486
+ // Trimming spaces after comma(#4107),
1487
+ // remove quotations(#6403),
1488
+ // mostly for differences on "font-family".
1489
+ .replace( /,\s+/g, ',' )
1490
+ .replace( /\"/g,'' )
1491
+ .toLowerCase();
1492
+ }
1493
+
1494
+ // Turn inline style text properties into one hash.
1495
+ function parseStyleText( styleText )
1496
+ {
1497
+ var retval = {};
1498
+ styleText
1499
+ .replace( /&quot;/g, '"' )
1500
+ .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value )
1501
+ {
1502
+ retval[ name ] = value;
1503
+ } );
1504
+ return retval;
1505
+ }
1506
+
1507
+ /**
1508
+ * Compare two bunch of styles, with the speciality that value 'inherit'
1509
+ * is treated as a wildcard which will match any value.
1510
+ * @param {Object|String} source
1511
+ * @param {Object|String} target
1512
+ */
1513
+ function compareCssText( source, target )
1514
+ {
1515
+ typeof source == 'string' && ( source = parseStyleText( source ) );
1516
+ typeof target == 'string' && ( target = parseStyleText( target ) );
1517
+ for( var name in source )
1518
+ {
1519
+ if ( !( name in target &&
1520
+ ( target[ name ] == source[ name ]
1521
+ || source[ name ] == 'inherit'
1522
+ || target[ name ] == 'inherit' ) ) )
1523
+ {
1524
+ return false;
1525
+ }
1526
+ }
1527
+ return true;
1528
+ }
1529
+
1530
+ function applyStyle( document, remove )
1531
+ {
1532
+ var selection = document.getSelection(),
1533
+ // Bookmark the range so we can re-select it after processing.
1534
+ bookmarks = selection.createBookmarks( 1 ),
1535
+ ranges = selection.getRanges(),
1536
+ func = remove ? this.removeFromRange : this.applyToRange,
1537
+ range;
1538
+
1539
+ var iterator = ranges.createIterator();
1540
+ while ( ( range = iterator.getNextRange() ) )
1541
+ func.call( this, range );
1542
+
1543
+ if ( bookmarks.length == 1 && bookmarks[ 0 ].collapsed )
1544
+ {
1545
+ selection.selectRanges( ranges );
1546
+ document.getById( bookmarks[ 0 ].startNode ).remove();
1547
+ }
1548
+ else
1549
+ selection.selectBookmarks( bookmarks );
1550
+
1551
+ document.removeCustomData( 'doc_processing_style' );
1552
+ }
1553
+ })();
1554
+
1555
+ CKEDITOR.styleCommand = function( style )
1556
+ {
1557
+ this.style = style;
1558
+ };
1559
+
1560
+ CKEDITOR.styleCommand.prototype.exec = function( editor )
1561
+ {
1562
+ editor.focus();
1563
+
1564
+ var doc = editor.document;
1565
+
1566
+ if ( doc )
1567
+ {
1568
+ if ( this.state == CKEDITOR.TRISTATE_OFF )
1569
+ this.style.apply( doc );
1570
+ else if ( this.state == CKEDITOR.TRISTATE_ON )
1571
+ this.style.remove( doc );
1572
+ }
1573
+
1574
+ return !!doc;
1575
+ };
1576
+
1577
+ /**
1578
+ * Manages styles registration and loading. See also {@link CKEDITOR.config.stylesSet}.
1579
+ * @namespace
1580
+ * @augments CKEDITOR.resourceManager
1581
+ * @constructor
1582
+ * @since 3.2
1583
+ * @example
1584
+ * // The set of styles for the <b>Styles</b> combo
1585
+ * CKEDITOR.stylesSet.add( 'default',
1586
+ * [
1587
+ * // Block Styles
1588
+ * { name : 'Blue Title' , element : 'h3', styles : { 'color' : 'Blue' } },
1589
+ * { name : 'Red Title' , element : 'h3', styles : { 'color' : 'Red' } },
1590
+ *
1591
+ * // Inline Styles
1592
+ * { name : 'Marker: Yellow' , element : 'span', styles : { 'background-color' : 'Yellow' } },
1593
+ * { name : 'Marker: Green' , element : 'span', styles : { 'background-color' : 'Lime' } },
1594
+ *
1595
+ * // Object Styles
1596
+ * {
1597
+ * name : 'Image on Left',
1598
+ * element : 'img',
1599
+ * attributes :
1600
+ * {
1601
+ * 'style' : 'padding: 5px; margin-right: 5px',
1602
+ * 'border' : '2',
1603
+ * 'align' : 'left'
1604
+ * }
1605
+ * }
1606
+ * ]);
1607
+ */
1608
+ CKEDITOR.stylesSet = new CKEDITOR.resourceManager( '', 'stylesSet' );
1609
+
1610
+ // Backward compatibility (#5025).
1611
+ CKEDITOR.addStylesSet = CKEDITOR.tools.bind( CKEDITOR.stylesSet.add, CKEDITOR.stylesSet );
1612
+ CKEDITOR.loadStylesSet = function( name, url, callback )
1613
+ {
1614
+ CKEDITOR.stylesSet.addExternal( name, url, '' );
1615
+ CKEDITOR.stylesSet.load( name, callback );
1616
+ };
1617
+
1618
+
1619
+ /**
1620
+ * Gets the current styleSet for this instance
1621
+ * @param {Function} callback The function to be called with the styles data.
1622
+ * @example
1623
+ * editor.getStylesSet( function( stylesDefinitions ) {} );
1624
+ */
1625
+ CKEDITOR.editor.prototype.getStylesSet = function( callback )
1626
+ {
1627
+ if ( !this._.stylesDefinitions )
1628
+ {
1629
+ var editor = this,
1630
+ // Respect the backwards compatible definition entry
1631
+ configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet || 'default';
1632
+
1633
+ // #5352 Allow to define the styles directly in the config object
1634
+ if ( configStyleSet instanceof Array )
1635
+ {
1636
+ editor._.stylesDefinitions = configStyleSet;
1637
+ callback( configStyleSet );
1638
+ return;
1639
+ }
1640
+
1641
+ var partsStylesSet = configStyleSet.split( ':' ),
1642
+ styleSetName = partsStylesSet[ 0 ],
1643
+ externalPath = partsStylesSet[ 1 ],
1644
+ pluginPath = CKEDITOR.plugins.registered.styles.path;
1645
+
1646
+ CKEDITOR.stylesSet.addExternal( styleSetName,
1647
+ externalPath ?
1648
+ partsStylesSet.slice( 1 ).join( ':' ) :
1649
+ pluginPath + 'styles/' + styleSetName + '.js', '' );
1650
+
1651
+ CKEDITOR.stylesSet.load( styleSetName, function( stylesSet )
1652
+ {
1653
+ editor._.stylesDefinitions = stylesSet[ styleSetName ];
1654
+ callback( editor._.stylesDefinitions );
1655
+ } ) ;
1656
+ }
1657
+ else
1658
+ callback( this._.stylesDefinitions );
1659
+ };
1660
+
1661
+ /**
1662
+ * Indicates that fully selected read-only elements will be included when
1663
+ * applying the style (for inline styles only).
1664
+ * @name CKEDITOR.style.includeReadonly
1665
+ * @type Boolean
1666
+ * @default false
1667
+ * @since 3.5
1668
+ */
1669
+
1670
+ /**
1671
+ * Disables inline styling on read-only elements.
1672
+ * @name CKEDITOR.config.disableReadonlyStyling
1673
+ * @type Boolean
1674
+ * @default false
1675
+ * @since 3.5
1676
+ */
1677
+
1678
+ /**
1679
+ * The "styles definition set" to use in the editor. They will be used in the
1680
+ * styles combo and the Style selector of the div container. <br>
1681
+ * The styles may be defined in the page containing the editor, or can be
1682
+ * loaded on demand from an external file. In the second case, if this setting
1683
+ * contains only a name, the styles definition file will be loaded from the
1684
+ * "styles" folder inside the styles plugin folder.
1685
+ * Otherwise, this setting has the "name:url" syntax, making it
1686
+ * possible to set the URL from which loading the styles file.<br>
1687
+ * Previously this setting was available as config.stylesCombo_stylesSet<br>
1688
+ * @name CKEDITOR.config.stylesSet
1689
+ * @type String|Array
1690
+ * @default 'default'
1691
+ * @since 3.3
1692
+ * @example
1693
+ * // Load from the styles' styles folder (mystyles.js file).
1694
+ * config.stylesSet = 'mystyles';
1695
+ * @example
1696
+ * // Load from a relative URL.
1697
+ * config.stylesSet = 'mystyles:/editorstyles/styles.js';
1698
+ * @example
1699
+ * // Load from a full URL.
1700
+ * config.stylesSet = 'mystyles:http://www.example.com/editorstyles/styles.js';
1701
+ * @example
1702
+ * // Load from a list of definitions.
1703
+ * config.stylesSet = [
1704
+ * { name : 'Strong Emphasis', element : 'strong' },
1705
+ * { name : 'Emphasis', element : 'em' }, ... ];
1706
+ */