glebtv-ckeditor 4.7.3.1 → 4.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +0 -9
  3. data/app/assets/javascripts/ckeditor/config.js.erb +3 -3
  4. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +317 -313
  5. data/config/locales/bg.ckeditor.yml +9 -0
  6. data/config/locales/cs.ckeditor.yml +9 -0
  7. data/config/locales/de.ckeditor.yml +9 -0
  8. data/config/locales/el-GR.cdkeditor.yml +9 -0
  9. data/config/locales/es.ckeditor.yml +9 -0
  10. data/config/locales/fr.ckeditor.yml +9 -0
  11. data/config/locales/hu.ckeditor.yml +9 -0
  12. data/config/locales/it.ckeditor.yml +9 -0
  13. data/config/locales/ja.ckeditor.yml +9 -0
  14. data/config/locales/nb.ckeditor.yml +9 -0
  15. data/config/locales/nl.ckeditor.yml +9 -0
  16. data/config/locales/pl.ckeditor.yml +9 -0
  17. data/config/locales/pt-BR.ckeditor.yml +9 -0
  18. data/config/locales/pt-PT.ckeditor.yml +9 -0
  19. data/config/locales/pt.ckeditor.yml +9 -0
  20. data/config/locales/sq.ckeditor.yml +9 -0
  21. data/config/locales/sv-SE.ckeditor.yml +9 -0
  22. data/config/locales/tr.ckeditor.yml +9 -0
  23. data/config/locales/uk.ckeditor.yml +9 -0
  24. data/config/locales/zh-CN.ckeditor.yml +9 -0
  25. data/config/locales/zh-TW.ckeditor.yml +9 -0
  26. data/lib/ckeditor/asset_response.rb +6 -2
  27. data/lib/ckeditor/http.rb +5 -7
  28. data/lib/ckeditor/utils/content_type_detector.rb +3 -3
  29. data/lib/ckeditor/version.rb +2 -2
  30. data/vendor/assets/javascripts/ckeditor/CHANGES.md +1128 -849
  31. data/vendor/assets/javascripts/ckeditor/LICENSE.md +3 -3
  32. data/vendor/assets/javascripts/ckeditor/README.md +6 -6
  33. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +2 -2
  34. data/vendor/assets/javascripts/ckeditor/build-config.js +11 -6
  35. data/vendor/assets/javascripts/ckeditor/ckeditor.js +825 -688
  36. data/vendor/assets/javascripts/ckeditor/config.js +2 -2
  37. data/vendor/assets/javascripts/ckeditor/contents.css +7 -7
  38. data/vendor/assets/javascripts/ckeditor/lang/af.js +5 -0
  39. data/vendor/assets/javascripts/ckeditor/lang/ar.js +5 -0
  40. data/vendor/assets/javascripts/ckeditor/lang/az.js +5 -0
  41. data/vendor/assets/javascripts/ckeditor/lang/bg.js +5 -0
  42. data/vendor/assets/javascripts/ckeditor/lang/bn.js +5 -0
  43. data/vendor/assets/javascripts/ckeditor/lang/bs.js +5 -0
  44. data/vendor/assets/javascripts/ckeditor/lang/ca.js +5 -0
  45. data/vendor/assets/javascripts/ckeditor/lang/cs.js +5 -0
  46. data/vendor/assets/javascripts/ckeditor/lang/cy.js +5 -0
  47. data/vendor/assets/javascripts/ckeditor/lang/da.js +5 -0
  48. data/vendor/assets/javascripts/ckeditor/lang/de-ch.js +5 -0
  49. data/vendor/assets/javascripts/ckeditor/lang/de.js +5 -0
  50. data/vendor/assets/javascripts/ckeditor/lang/el.js +5 -0
  51. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +5 -0
  52. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +5 -0
  53. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +5 -0
  54. data/vendor/assets/javascripts/ckeditor/lang/en.js +3 -3
  55. data/vendor/assets/javascripts/ckeditor/lang/eo.js +5 -0
  56. data/vendor/assets/javascripts/ckeditor/lang/es-mx.js +5 -0
  57. data/vendor/assets/javascripts/ckeditor/lang/es.js +5 -0
  58. data/vendor/assets/javascripts/ckeditor/lang/et.js +5 -0
  59. data/vendor/assets/javascripts/ckeditor/lang/eu.js +5 -0
  60. data/vendor/assets/javascripts/ckeditor/lang/fa.js +5 -0
  61. data/vendor/assets/javascripts/ckeditor/lang/fi.js +5 -0
  62. data/vendor/assets/javascripts/ckeditor/lang/fo.js +5 -0
  63. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +5 -0
  64. data/vendor/assets/javascripts/ckeditor/lang/fr.js +5 -0
  65. data/vendor/assets/javascripts/ckeditor/lang/gl.js +5 -0
  66. data/vendor/assets/javascripts/ckeditor/lang/gu.js +5 -0
  67. data/vendor/assets/javascripts/ckeditor/lang/he.js +5 -0
  68. data/vendor/assets/javascripts/ckeditor/lang/hi.js +5 -0
  69. data/vendor/assets/javascripts/ckeditor/lang/hr.js +5 -0
  70. data/vendor/assets/javascripts/ckeditor/lang/hu.js +5 -0
  71. data/vendor/assets/javascripts/ckeditor/lang/id.js +5 -0
  72. data/vendor/assets/javascripts/ckeditor/lang/is.js +5 -0
  73. data/vendor/assets/javascripts/ckeditor/lang/it.js +5 -0
  74. data/vendor/assets/javascripts/ckeditor/lang/ja.js +5 -0
  75. data/vendor/assets/javascripts/ckeditor/lang/ka.js +5 -0
  76. data/vendor/assets/javascripts/ckeditor/lang/km.js +5 -0
  77. data/vendor/assets/javascripts/ckeditor/lang/ko.js +5 -0
  78. data/vendor/assets/javascripts/ckeditor/lang/ku.js +5 -0
  79. data/vendor/assets/javascripts/ckeditor/lang/lt.js +5 -0
  80. data/vendor/assets/javascripts/ckeditor/lang/lv.js +5 -0
  81. data/vendor/assets/javascripts/ckeditor/lang/mk.js +5 -0
  82. data/vendor/assets/javascripts/ckeditor/lang/mn.js +5 -0
  83. data/vendor/assets/javascripts/ckeditor/lang/ms.js +5 -0
  84. data/vendor/assets/javascripts/ckeditor/lang/nb.js +5 -0
  85. data/vendor/assets/javascripts/ckeditor/lang/nl.js +5 -0
  86. data/vendor/assets/javascripts/ckeditor/lang/no.js +5 -0
  87. data/vendor/assets/javascripts/ckeditor/lang/oc.js +5 -0
  88. data/vendor/assets/javascripts/ckeditor/lang/pl.js +5 -0
  89. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +5 -0
  90. data/vendor/assets/javascripts/ckeditor/lang/pt.js +5 -0
  91. data/vendor/assets/javascripts/ckeditor/lang/ro.js +5 -0
  92. data/vendor/assets/javascripts/ckeditor/lang/ru.js +3 -3
  93. data/vendor/assets/javascripts/ckeditor/lang/si.js +5 -0
  94. data/vendor/assets/javascripts/ckeditor/lang/sk.js +5 -0
  95. data/vendor/assets/javascripts/ckeditor/lang/sl.js +5 -0
  96. data/vendor/assets/javascripts/ckeditor/lang/sq.js +5 -0
  97. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +5 -0
  98. data/vendor/assets/javascripts/ckeditor/lang/sr.js +5 -0
  99. data/vendor/assets/javascripts/ckeditor/lang/sv.js +5 -0
  100. data/vendor/assets/javascripts/ckeditor/lang/th.js +5 -0
  101. data/vendor/assets/javascripts/ckeditor/lang/tr.js +5 -0
  102. data/vendor/assets/javascripts/ckeditor/lang/tt.js +5 -0
  103. data/vendor/assets/javascripts/ckeditor/lang/ug.js +5 -0
  104. data/vendor/assets/javascripts/ckeditor/lang/uk.js +5 -0
  105. data/vendor/assets/javascripts/ckeditor/lang/vi.js +5 -0
  106. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +5 -0
  107. data/vendor/assets/javascripts/ckeditor/lang/zh.js +5 -0
  108. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -7
  109. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +2 -2
  110. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  111. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +5 -5
  112. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
  113. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  114. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  116. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  117. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  118. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  119. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autocomplete.png +0 -0
  120. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autoformat.png +0 -0
  121. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/commentselectedrange.png +0 -0
  122. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/searchcode.png +0 -0
  123. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/uncommentselectedrange.png +0 -0
  124. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -2
  125. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -2
  126. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  127. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -6
  128. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  129. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -0
  130. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
  131. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  132. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
  133. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
  134. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +231 -217
  135. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +46 -0
  136. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +34 -0
  137. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +42 -0
  138. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
  139. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -0
  140. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -0
  141. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -0
  142. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -0
  143. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -1
  144. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +2 -2
  146. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +11 -11
  147. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +2 -2
  148. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +23 -23
  149. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +5 -5
  150. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +2 -2
  151. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +3 -3
  152. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +2 -2
  153. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +2 -2
  154. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +7 -7
  155. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +4 -3
  156. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +3 -3
  157. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +3 -3
  158. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +3 -3
  161. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +1259 -44
  162. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/hidpi/image.png +0 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/image.png +0 -0
  164. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/en.js +25 -0
  165. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/ru.js +25 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/image/plugin.js +184 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +35 -0
  170. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +339 -0
  171. data/vendor/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +553 -0
  172. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/image.png +0 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/en.js +21 -0
  175. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +21 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/image2/plugin.js +1720 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
  179. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +68 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +1 -1
  181. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +2 -2
  182. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +28 -26
  183. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -7
  184. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
  185. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +53 -51
  186. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +31 -32
  187. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +2 -2
  188. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
  189. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +2 -2
  190. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +2 -2
  191. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -6
  192. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +6 -6
  193. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +4 -4
  194. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -15
  195. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +2 -2
  196. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +2 -2
  197. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
  198. data/vendor/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
  199. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -0
  200. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +2 -1
  201. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +468 -377
  202. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/maxParagraphs.html +26 -0
  203. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +82 -82
  204. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +449 -448
  205. data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +28 -23
  206. data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  207. data/vendor/assets/javascripts/ckeditor/samples/img/logo.svg +13 -0
  208. data/vendor/assets/javascripts/ckeditor/samples/index.html +16 -16
  209. data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +4 -4
  210. data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +2 -2
  211. data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +5 -5
  212. data/vendor/assets/javascripts/ckeditor/samples/old/api.html +14 -14
  213. data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +7 -7
  214. data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +2 -2
  215. data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +4 -4
  216. data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +2 -2
  217. data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +14 -14
  218. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +2 -2
  219. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +8 -8
  220. data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +5 -5
  221. data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +8 -8
  222. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +6 -6
  223. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +7 -7
  224. data/vendor/assets/javascripts/ckeditor/samples/old/index.html +8 -5
  225. data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +10 -10
  226. data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +6 -6
  227. data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +6 -6
  228. data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +6 -6
  229. data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +5 -5
  230. data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +8 -8
  231. data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +5 -5
  232. data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +5 -5
  233. data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +2 -2
  234. data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +2 -2
  235. data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +2 -2
  236. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/assets/sample.css +70 -0
  237. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/stylesheetparser.html +85 -0
  238. data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +5 -5
  239. data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +8 -8
  240. data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +6 -6
  241. data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +8 -8
  242. data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +5 -5
  243. data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +6 -6
  244. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +12 -12
  245. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +123 -1
  246. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +1 -1
  247. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +1 -1
  248. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +1 -1
  249. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +1 -1
  250. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +1 -1
  251. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  252. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  253. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +3 -3
  254. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +3 -3
  255. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +3 -3
  256. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +3 -3
  257. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +3 -3
  258. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +3 -3
  259. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +3 -3
  260. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +3 -3
  261. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +3 -3
  262. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons.png +0 -0
  263. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
  264. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +3 -3
  265. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +2 -2
  266. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +3 -3
  267. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +3 -3
  268. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +3 -3
  269. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +3 -3
  270. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +3 -3
  271. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +3 -3
  272. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +3 -3
  273. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +3 -3
  274. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +3 -3
  275. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +3 -3
  276. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +3 -3
  277. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +4 -4
  278. data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +2 -2
  279. data/vendor/assets/javascripts/ckeditor/styles.js +4 -4
  280. metadata +179 -56
  281. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -169
  282. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +0 -7
  283. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +0 -7
  284. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +0 -929
@@ -1,6 +1,6 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  (function(){function v(a){for(var f=0,n=0,l=0,p,e=a.$.rows.length;l<e;l++){p=a.$.rows[l];for(var d=f=0,b,c=p.cells.length;d<c;d++)b=p.cells[d],f+=b.colSpan;f>n&&(n=f)}return n}function r(a){return function(){var f=this.getValue(),f=!!(CKEDITOR.dialog.validate.integer()(f)&&0<f);f||(alert(a),this.select());return f}}function q(a,f){var n=function(e){return new CKEDITOR.dom.element(e,a.document)},q=a.editable(),p=a.plugins.dialogadvtab;return{title:a.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?
6
6
  310:280,onLoad:function(){var e=this,a=e.getContentElement("advanced","advStyles");if(a)a.on("change",function(){var a=this.getStyle("width",""),c=e.getContentElement("info","txtWidth");c&&c.setValue(a,!0);a=this.getStyle("height","");(c=e.getContentElement("info","txtHeight"))&&c.setValue(a,!0)})},onShow:function(){var e=a.getSelection(),d=e.getRanges(),b,c=this.getContentElement("info","txtRows"),g=this.getContentElement("info","txtCols"),t=this.getContentElement("info","txtWidth"),m=this.getContentElement("info",
@@ -11,8 +11,8 @@ f))for(h=0;h<b.$.rows.length;h++)g=new CKEDITOR.dom.element(b.$.rows[h].cells[0]
11
11
  b.getAttribute("style")||b.removeAttribute("style")}if(this._.selectedElement)try{e.selectBookmarks(d)}catch(p){}else a.insertElement(b),setTimeout(function(){var e=new CKEDITOR.dom.element(b.$.rows[0].cells[0]),c=a.createRange();c.moveToPosition(e,CKEDITOR.POSITION_AFTER_START);c.select()},0)},contents:[{id:"info",label:a.lang.table.title,elements:[{type:"hbox",widths:[null,null],styles:["vertical-align:top"],children:[{type:"vbox",padding:0,children:[{type:"text",id:"txtRows","default":3,label:a.lang.table.rows,
12
12
  required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidRows),setup:function(e){this.setValue(e.$.rows.length)},commit:l},{type:"text",id:"txtCols","default":2,label:a.lang.table.columns,required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidCols),setup:function(e){this.setValue(v(e))},commit:l},{type:"html",html:"\x26nbsp;"},{type:"select",id:"selHeaders",requiredContent:"th","default":"",label:a.lang.table.headers,items:[[a.lang.table.headersNone,""],[a.lang.table.headersRow,
13
13
  "row"],[a.lang.table.headersColumn,"col"],[a.lang.table.headersBoth,"both"]],setup:function(e){var a=this.getDialog();a.hasColumnHeaders=!0;for(var b=0;b<e.$.rows.length;b++){var c=e.$.rows[b].cells[0];if(c&&"th"!=c.nodeName.toLowerCase()){a.hasColumnHeaders=!1;break}}null!==e.$.tHead?this.setValue(a.hasColumnHeaders?"both":"row"):this.setValue(a.hasColumnHeaders?"col":"")},commit:l},{type:"text",id:"txtBorder",requiredContent:"table[border]","default":a.filter.check("table[border]")?1:0,label:a.lang.table.border,
14
- controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||"")},commit:function(a,d){this.getValue()?d.setAttribute("border",this.getValue()):d.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align,items:[[a.lang.common.notSet,""],[a.lang.common.alignLeft,"left"],[a.lang.common.alignCenter,"center"],[a.lang.common.alignRight,"right"]],
15
- setup:function(a){this.setValue(a.getAttribute("align")||"")},commit:function(a,d){this.getValue()?d.setAttribute("align",this.getValue()):d.removeAttribute("align")}}]},{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip,"default":a.filter.check("table{width}")?500>q.getSize("width")?"100%":500:0,getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",
14
+ controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||"")},commit:function(a,d){this.getValue()?d.setAttribute("border",this.getValue()):d.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align,items:[[a.lang.common.notSet,""],[a.lang.common.left,"left"],[a.lang.common.center,"center"],[a.lang.common.right,"right"]],setup:function(a){this.setValue(a.getAttribute("align")||
15
+ "")},commit:function(a,d){this.getValue()?d.setAttribute("align",this.getValue()):d.removeAttribute("align")}}]},{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip,"default":a.filter.check("table{width}")?500>q.getSize("width")?"100%":500:0,getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",
16
16
  a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("width",this.getValue())},setup:function(a){a=a.getStyle("width");this.setValue(a)},commit:l}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",
17
17
  a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:l}]},{type:"html",html:"\x26nbsp;"},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),
18
18
  setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellSpacing",this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,
@@ -1,17 +1,18 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("cellProperties",function(g){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&"select"==this.type&&!c&&(this.getInputElement().$.selectedIndex=-1))}}function l(a){if(a=n.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=g.lang.table,c=h.cell,e=g.lang.common,k=CKEDITOR.dialog.validate,n=/^(\d+(?:\.\d+)?)(px|%)$/,f={type:"html",html:"\x26nbsp;"},p="rtl"==
6
- g.lang.dir,m=g.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:e.width,validate:k.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info",
7
- "widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10);a=parseInt(a.getStyle("width"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||l(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",
8
- label:g.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(l)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",label:e.height,width:"100px","default":"",validate:k.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=
9
- parseInt(a.getAttribute("height"),10);a=parseInt(a.getStyle("height"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"\x3cbr /\x3e"+h.widthPx}]},f,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==
10
- a.getStyle("white-space")||b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",
11
- b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign");a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");
12
- a.removeAttribute("vAlign")}}]},f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:k.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",
13
- this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:k.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},f,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");
14
- return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},m?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,
15
- {type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},m?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(p?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align",
16
- "bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:f]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells)},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()},
17
- onLoad:function(){var a={};this.foreach(function(b){b.setup&&b.commit&&(b.setup=CKEDITOR.tools.override(b.setup,function(c){return function(){c.apply(this,arguments);a[b.id]=b.getValue()}}),b.commit=CKEDITOR.tools.override(b.commit,function(c){return function(){a[b.id]!==b.getValue()&&c.apply(this,arguments)}}))})}}});
5
+ CKEDITOR.dialog.add("cellProperties",function(f){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&"select"==this.type&&!c&&(this.getInputElement().$.selectedIndex=-1))}}function l(a){if(a=n.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=f.lang.table,c=h.cell,e=f.lang.common,k=CKEDITOR.dialog.validate,n=/^(\d+(?:\.\d+)?)(px|%)$/,g={type:"html",html:"\x26nbsp;"},p="rtl"==
6
+ f.lang.dir,m=f.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",requiredContent:"td{width,height}",label:e.width,validate:k.number(c.invalidWidth),onLoad:function(){var a=
7
+ this.getDialog().getContentElement("info","widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10);a=parseInt(a.getStyle("width"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||l(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},
8
+ "default":""},{type:"select",id:"widthType",requiredContent:"td{width,height}",label:f.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(l)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",requiredContent:"td{width,height}",label:e.height,width:"100px","default":"",validate:k.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),
9
+ c=b.getAttribute("aria-labelledby");this.getDialog().getContentElement("info","height").isVisible()&&(a.setHtml("\x3cbr /\x3e"+h.widthPx),a.setStyle("display","block"),this.getDialog().getContentElement("info","hiddenSpacer").getElement().setStyle("display","block"));b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("height"),10);a=parseInt(a.getStyle("height"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),
10
+ 10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"",style:"display: none"}]},{type:"html",id:"hiddenSpacer",html:"\x26nbsp;",style:"display: none"},{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==a.getStyle("white-space")||b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space",
11
+ "nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},g,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.left,"left"],[e.center,"center"],[e.right,"right"],[e.justify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,
12
+ ""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign");a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},g,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,
13
+ "default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},g,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:k.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",
14
+ validate:k.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},g,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",
15
+ this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},m?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:g]},g,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",
16
+ setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},m?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(p?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&
17
+ this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:g]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells)},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()},onLoad:function(){var a={};this.foreach(function(b){b.setup&&
18
+ b.commit&&(b.setup=CKEDITOR.tools.override(b.setup,function(c){return function(){c.apply(this,arguments);a[b.id]=b.getValue()}}),b.commit=CKEDITOR.tools.override(b.commit,function(c){return function(){a[b.id]!==b.getValue()&&c.apply(this,arguments)}}))})}}});
@@ -1,6 +1,6 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
6
6
  .cke_tpl_list
@@ -1,6 +1,6 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  (function(){CKEDITOR.dialog.add("templates",function(c){function r(a,b){var m=CKEDITOR.dom.element.createFromHtml('\x3ca href\x3d"javascript:void(0)" tabIndex\x3d"-1" role\x3d"option" \x3e\x3cdiv class\x3d"cke_tpl_item"\x3e\x3c/div\x3e\x3c/a\x3e'),d='\x3ctable style\x3d"width:350px;" class\x3d"cke_tpl_preview" role\x3d"presentation"\x3e\x3ctr\x3e';a.image&&b&&(d+='\x3ctd class\x3d"cke_tpl_preview_img"\x3e\x3cimg src\x3d"'+CKEDITOR.getUrl(b+a.image)+'"'+(CKEDITOR.env.ie6Compat?' onload\x3d"this.width\x3dthis.width"':
6
6
  "")+' alt\x3d"" title\x3d""\x3e\x3c/td\x3e');d+='\x3ctd style\x3d"white-space:normal;"\x3e\x3cspan class\x3d"cke_tpl_title"\x3e'+a.title+"\x3c/span\x3e\x3cbr/\x3e";a.description&&(d+="\x3cspan\x3e"+a.description+"\x3c/span\x3e");d+="\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e";m.getFirst().setHtml(d);m.on("click",function(){t(a.html)});return m}function t(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();
@@ -1,6 +1,6 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  CKEDITOR.addTemplates("default",{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath("templates")+"templates/images/"),templates:[{title:"Image and Title",image:"template1.gif",description:"One main image with a title and text that surround the image.",html:'\x3ch3\x3e\x3cimg src\x3d" " alt\x3d"" style\x3d"margin-right: 10px" height\x3d"100" width\x3d"100" align\x3d"left" /\x3eType the title here\x3c/h3\x3e\x3cp\x3eType the text here\x3c/p\x3e'},{title:"Strange Template",image:"template2.gif",description:"A template that defines two columns, each one with a title, and some text.",
6
6
  html:'\x3ctable cellspacing\x3d"0" cellpadding\x3d"0" style\x3d"width:100%" border\x3d"0"\x3e\x3ctr\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 1\x3c/h3\x3e\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 2\x3c/h3\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3eText 1\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3eText 2\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cp\x3eMore text goes here.\x3c/p\x3e'},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.",
@@ -10,6 +10,7 @@ CKEDITOR.plugins.setLang('wordcount', 'en', {
10
10
  CharCountWithHTML: 'Characters (with HTML):',
11
11
  CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
12
12
  Paragraphs: 'Paragraphs:',
13
+ ParagraphsRemaining: 'Paragraphs remaining',
13
14
  pasteWarning: 'Content cannot be pasted because it is above the allowed limit',
14
15
  Selected: 'Selected: ',
15
16
  title: 'Statistics'
@@ -5,8 +5,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
5
5
  CKEDITOR.plugins.setLang('wordcount', 'ru', {
6
6
  WordCount: 'Слов:',
7
7
  CharCount: 'Символов:',
8
- CharCountWithHTML: ' (включая HTML разметку):',
8
+ CharCountWithHTML: ' (включая HTML-разметку):',
9
9
  Paragraphs: 'Параграфов:',
10
+ ParagraphsRemaining: 'Параграфов осталось',
10
11
  pasteWarning: 'Контент не может быть вставлен, т.к. привышает допустимый лимит',
11
12
  Selected: 'Выделено: ',
12
13
  title: 'Статистика'
@@ -3,195 +3,211 @@
3
3
  * For licensing, see LICENSE.html or http://ckeditor.com/license
4
4
  */
5
5
 
6
- CKEDITOR.plugins.add("wordcount", {
7
- lang: "en,ru", // %REMOVE_LINE_CORE%
8
- version: 1.17,
9
- requires: 'htmlwriter,notification,undo',
10
- bbcodePluginLoaded: false,
11
- onLoad: function(editor) {
12
- CKEDITOR.document.appendStyleSheet(this.path + "css/wordcount.css");
13
- },
14
- init: function (editor) {
15
- var defaultFormat = "",
16
- intervalId,
17
- lastWordCount = -1,
18
- lastCharCount = -1,
19
- limitReachedNotified = false,
20
- limitRestoredNotified = false,
21
- snapShot = editor.getSnapshot(),
22
- notification = null;
23
-
24
-
25
- var dispatchEvent = function (type, currentLength, maxLength) {
26
- if (typeof document.dispatchEvent == 'undefined') {
27
- return;
28
- }
6
+ CKEDITOR.plugins.add("wordcount",
7
+ {
8
+ lang: "ar,bg,ca,cs,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ko,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,uk,zh-cn,zh,ro", // %REMOVE_LINE_CORE%
9
+ version: "1.17.4",
10
+ requires: 'htmlwriter,notification,undo',
11
+ bbcodePluginLoaded: false,
12
+ onLoad: function() {
13
+ CKEDITOR.document.appendStyleSheet(this.path + "css/wordcount.css");
14
+ },
15
+ init: function(editor) {
16
+ var defaultFormat = "",
17
+ lastWordCount = -1,
18
+ lastCharCount = -1,
19
+ lastParagraphs = -1,
20
+ limitReachedNotified = false,
21
+ limitRestoredNotified = false,
22
+ timeoutId = 0,
23
+ notification = null;
24
+
25
+
26
+ var dispatchEvent = function(type, currentLength, maxLength) {
27
+ if (typeof document.dispatchEvent == 'undefined') {
28
+ return;
29
+ }
29
30
 
30
- type = 'ckeditor.wordcount.' + type;
31
+ type = 'ckeditor.wordcount.' + type;
31
32
 
32
- var cEvent;
33
- var eventInitDict = {
34
- bubbles: false,
35
- cancelable: true,
36
- detail: {
37
- currentLength: currentLength,
38
- maxLength: maxLength
33
+ var cEvent;
34
+ var eventInitDict = {
35
+ bubbles: false,
36
+ cancelable: true,
37
+ detail: {
38
+ currentLength: currentLength,
39
+ maxLength: maxLength
40
+ }
41
+ };
42
+
43
+ try {
44
+ cEvent = new CustomEvent(type, eventInitDict);
45
+ } catch (o_O) {
46
+ cEvent = document.createEvent('CustomEvent');
47
+ cEvent.initCustomEvent(
48
+ type,
49
+ eventInitDict.bubbles,
50
+ eventInitDict.cancelable,
51
+ eventInitDict.detail
52
+ );
39
53
  }
54
+
55
+ document.dispatchEvent(cEvent);
40
56
  };
41
57
 
42
- try {
43
- cEvent = new CustomEvent(type, eventInitDict);
44
- } catch (o_O) {
45
- cEvent = document.createEvent('CustomEvent');
46
- cEvent.initCustomEvent(
47
- type,
48
- eventInitDict.bubbles,
49
- eventInitDict.cancelable,
50
- eventInitDict.detail
51
- );
52
- }
58
+ // Default Config
59
+ var defaultConfig = {
60
+ showRemaining: false,
61
+ showParagraphs: true,
62
+ showWordCount: true,
63
+ showCharCount: false,
64
+ countBytesAsChars: false,
65
+ countSpacesAsChars: false,
66
+ countHTML: false,
67
+ countLineBreaks: false,
68
+ hardLimit: true,
69
+
70
+ //MAXLENGTH Properties
71
+ maxWordCount: -1,
72
+ maxCharCount: -1,
73
+ maxParagraphs: -1,
74
+
75
+ // Filter
76
+ filter: null,
77
+
78
+ // How long to show the 'paste' warning
79
+ pasteWarningDuration: 0,
80
+
81
+ //DisAllowed functions
82
+ wordCountGreaterThanMaxLengthEvent: function(currentLength, maxLength) {
83
+ dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
84
+ },
85
+ charCountGreaterThanMaxLengthEvent: function(currentLength, maxLength) {
86
+ dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
87
+ },
88
+
89
+ //Allowed Functions
90
+ wordCountLessThanMaxLengthEvent: function(currentLength, maxLength) {
91
+ dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
92
+ },
93
+ charCountLessThanMaxLengthEvent: function(currentLength, maxLength) {
94
+ dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
95
+ }
96
+ };
53
97
 
54
- document.dispatchEvent(cEvent);
55
- };
56
-
57
- // Default Config
58
- var defaultConfig = {
59
- showRemaining: false,
60
- showParagraphs: true,
61
- showWordCount: true,
62
- showCharCount: false,
63
- countBytesAsChars: false,
64
- countSpacesAsChars: false,
65
- countHTML: false,
66
- countLineBreaks: false,
67
- hardLimit: true,
68
-
69
- //MAXLENGTH Properties
70
- maxWordCount: -1,
71
- maxCharCount: -1,
72
-
73
- // Filter
74
- filter: null,
75
-
76
- // How long to show the 'paste' warning
77
- pasteWarningDuration: 0,
78
-
79
- //DisAllowed functions
80
- wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
81
- dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
82
- },
83
- charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
84
- dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
85
- },
86
-
87
- //Allowed Functions
88
- wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
89
- dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
90
- },
91
- charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
92
- dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
98
+ // Get Config & Lang
99
+ var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true);
100
+
101
+ if (config.showParagraphs) {
102
+ if (config.maxParagraphs > -1) {
103
+ if (config.showRemaining) {
104
+ defaultFormat += "%paragraphsCount% " + editor.lang.wordcount.ParagraphsRemaining;
105
+ } else {
106
+ defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphsCount%";
107
+
108
+ defaultFormat += "/" + config.maxParagraphs;
109
+ }
110
+ } else {
111
+ defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphsCount%";
112
+ }
93
113
  }
94
- };
95
-
96
- // Get Config & Lang
97
- var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true);
98
114
 
99
- if (config.showParagraphs) {
100
- defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphs%";
101
- }
115
+ if (config.showParagraphs && (config.showWordCount || config.showCharCount)) {
116
+ defaultFormat += ", ";
117
+ }
102
118
 
103
- if (config.showParagraphs && (config.showWordCount || config.showCharCount)) {
104
- defaultFormat += ", ";
105
- }
119
+ if (config.showWordCount) {
120
+ if (config.maxWordCount > -1) {
121
+ if (config.showRemaining) {
122
+ defaultFormat += "%wordCount% " + editor.lang.wordcount.WordCountRemaining;
123
+ } else {
124
+ defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
106
125
 
107
- if (config.showWordCount) {
108
- if (config.maxWordCount > -1) {
109
- if (config.showRemaining) {
110
- defaultFormat += "%wordCount% " + editor.lang.wordcount.WordCountRemaining;
126
+ defaultFormat += "/" + config.maxWordCount;
127
+ }
111
128
  } else {
112
129
  defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
113
-
114
- defaultFormat += "/" + config.maxWordCount;
115
130
  }
116
- } else {
117
- defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
118
131
  }
119
- }
120
132
 
121
- if (config.showCharCount && config.showWordCount) {
122
- defaultFormat += ", ";
123
- }
133
+ if (config.showCharCount && config.showWordCount) {
134
+ defaultFormat += ", ";
135
+ }
124
136
 
125
- if (config.showCharCount) {
126
- if (config.maxCharCount > -1) {
127
- if (config.showRemaining) {
128
- defaultFormat += "%charCount% " + editor.lang.wordcount[config.countHTML
129
- ? "CharCountWithHTMLRemaining"
130
- : "CharCountRemaining"];
137
+ if (config.showCharCount) {
138
+ if (config.maxCharCount > -1) {
139
+ if (config.showRemaining) {
140
+ defaultFormat += "%charCount% " +
141
+ editor.lang.wordcount[config.countHTML
142
+ ? "CharCountWithHTMLRemaining"
143
+ : "CharCountRemaining"];
144
+ } else {
145
+ defaultFormat += editor.lang.wordcount[config.countHTML
146
+ ? "CharCountWithHTML"
147
+ : "CharCount"] +
148
+ " %charCount%";
149
+
150
+ defaultFormat += "/" + config.maxCharCount;
151
+ }
131
152
  } else {
132
- defaultFormat += editor.lang.wordcount[config.countHTML
133
- ? "CharCountWithHTML"
134
- : "CharCount"] + " %charCount%";
135
-
136
- defaultFormat += "/" + config.maxCharCount;
153
+ defaultFormat += editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"] +
154
+ " %charCount%";
137
155
  }
138
- } else {
139
- defaultFormat += editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"] + " %charCount%";
140
156
  }
141
- }
142
-
143
- var format = defaultFormat;
144
157
 
145
- bbcodePluginLoaded = typeof editor.plugins.bbcode != 'undefined';
158
+ var format = defaultFormat;
146
159
 
147
- function counterId(editorInstance) {
148
- return "cke_wordcount_" + editorInstance.name;
149
- }
160
+ bbcodePluginLoaded = typeof editor.plugins.bbcode != 'undefined';
150
161
 
151
- function counterElement(editorInstance) {
152
- return document.getElementById(counterId(editorInstance));
153
- }
162
+ function counterId(editorInstance) {
163
+ return "cke_wordcount_" + editorInstance.name;
164
+ }
154
165
 
155
- function strip(html) {
156
- if (bbcodePluginLoaded) {
157
- // stripping out BBCode tags [...][/...]
158
- return html.replace(/\[.*?\]/gi, '');
166
+ function counterElement(editorInstance) {
167
+ return document.getElementById(counterId(editorInstance));
159
168
  }
160
169
 
161
- var tmp = document.createElement("div");
170
+ function strip(html) {
171
+ if (bbcodePluginLoaded) {
172
+ // stripping out BBCode tags [...][/...]
173
+ return html.replace(/\[.*?\]/gi, '');
174
+ }
162
175
 
163
- // Add filter before strip
164
- html = filter(html);
176
+ var tmp = document.createElement("div");
165
177
 
166
- tmp.innerHTML = html;
178
+ // Add filter before strip
179
+ html = filter(html);
167
180
 
168
- if (tmp.textContent == "" && typeof tmp.innerText == "undefined") {
169
- return "";
170
- }
181
+ tmp.innerHTML = html;
171
182
 
172
- return tmp.textContent || tmp.innerText;
173
- }
183
+ if (tmp.textContent == "" && typeof tmp.innerText == "undefined") {
184
+ return "";
185
+ }
174
186
 
175
- /**
176
- * Implement filter to add or remove before counting
177
- * @param html
178
- * @returns string
179
- */
180
- function filter(html) {
181
- if(config.filter instanceof CKEDITOR.htmlParser.filter) {
182
- var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html),
183
- writer = new CKEDITOR.htmlParser.basicWriter();
184
- config.filter.applyTo( fragment );
185
- fragment.writeHtml( writer );
186
- return writer.getHtml();
187
+ return tmp.textContent || tmp.innerText;
188
+ }
189
+
190
+ /**
191
+ * Implement filter to add or remove before counting
192
+ * @param html
193
+ * @returns string
194
+ */
195
+ function filter(html) {
196
+ if (config.filter instanceof CKEDITOR.htmlParser.filter) {
197
+ var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html),
198
+ writer = new CKEDITOR.htmlParser.basicWriter();
199
+ config.filter.applyTo(fragment);
200
+ fragment.writeHtml(writer);
201
+ return writer.getHtml();
202
+ }
203
+ return html;
187
204
  }
188
- return html;
189
- }
190
205
 
191
- function countCharacters(text, editorInstance) {
192
- if (config.countHTML) {
193
- return (filter(text).length);
194
- } else {
206
+ function countCharacters(text) {
207
+ if (config.countHTML) {
208
+ return (filter(text).length);
209
+ }
210
+
195
211
  var normalizedText;
196
212
 
197
213
  // strip body tags
@@ -211,7 +227,7 @@ CKEDITOR.plugins.add("wordcount", {
211
227
  }
212
228
 
213
229
  if (config.countLineBreaks) {
214
- normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "");
230
+ normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, " ");
215
231
  } else {
216
232
  normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "").replace(/&nbsp;/gi, " ");
217
233
  }
@@ -220,280 +236,355 @@ CKEDITOR.plugins.add("wordcount", {
220
236
 
221
237
  return config.countBytesAsChars ? (countBytes(normalizedText)) : (normalizedText.length);
222
238
  }
223
- }
224
-
225
- function countBytes(text) {
226
- var count = 0, stringLength = text.length, i;
227
- text = String(text || "");
228
- for (i = 0; i < stringLength; i++) {
229
- var partCount = encodeURI(text[i]).split("%").length;
230
- count += partCount == 1 ? 1 : partCount - 1;
231
- }
232
- return count;
233
- }
234
-
235
- function countParagraphs(text) {
236
- return (text.replace(/&nbsp;/g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++").split("++").length);
237
- }
238
-
239
- function countWords(text) {
240
- var normalizedText = text.
241
- replace(/(\r\n|\n|\r)/gm, " ").
242
- replace(/^\s+|\s+$/g, "").
243
- replace("&nbsp;", " ");
244
-
245
- normalizedText = strip(normalizedText);
246
239
 
247
- var words = normalizedText.split(/\s+/);
248
-
249
- for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
250
- if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
251
- words.splice(wordIndex, 1);
240
+ function countBytes(text) {
241
+ var count = 0, stringLength = text.length, i;
242
+ text = String(text || "");
243
+ for (i = 0; i < stringLength; i++) {
244
+ var partCount = encodeURI(text[i]).split("%").length;
245
+ count += partCount == 1 ? 1 : partCount - 1;
252
246
  }
247
+ return count;
253
248
  }
254
249
 
255
- return (words.length);
256
- }
257
-
258
- function limitReached(editorInstance, notify) {
259
- limitReachedNotified = true;
260
- limitRestoredNotified = false;
261
-
262
- if (config.hardLimit) {
263
- editorInstance.loadSnapshot(snapShot);
264
- // lock editor
265
- editorInstance.config.Locked = 1;
250
+ function countParagraphs(text) {
251
+ return (text.replace(/&nbsp;/g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++")
252
+ .split("++").length);
266
253
  }
267
254
 
268
- if (!notify) {
269
- counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
270
- editorInstance.fire("limitReached", {firedBy: "wordCount.limitReached"}, editor);
271
- }
272
- }
273
-
274
- function limitRestored(editorInstance) {
275
- limitRestoredNotified = true;
276
- limitReachedNotified = false;
277
- editorInstance.config.Locked = 0;
278
- snapShot = editor.getSnapshot();
255
+ function countWords(text) {
256
+ var normalizedText = text.replace(/(\r\n|\n|\r)/gm, " ").replace(/^\s+|\s+$/g, "")
257
+ .replace("&nbsp;", " ");
279
258
 
280
- counterElement(editorInstance).className = "cke_path_item";
281
- }
259
+ normalizedText = strip(normalizedText);
282
260
 
283
- function updateCounter(editorInstance) {
284
- var paragraphs = 0,
285
- wordCount = 0,
286
- charCount = 0,
287
- text;
288
-
289
- // BeforeGetData and getData events are fired when calling
290
- // getData(). We can prevent this by passing true as an
291
- // argument to getData(). This allows us to fire the events
292
- // manually with additional event data: firedBy. This additional
293
- // data helps differentiate calls to getData() made by
294
- // wordCount plugin from calls made by other plugins/code.
295
- editorInstance.fire("beforeGetData", {firedBy: "wordCount.updateCounter"}, editor);
296
- text = editorInstance.getData(true);
297
- editorInstance.fire("getData", {dataValue: text, firedBy: "wordCount.updateCounter"}, editor);
298
-
299
- if (text) {
300
- if (config.showCharCount) {
301
- charCount = countCharacters(text, editorInstance);
302
- }
261
+ var words = normalizedText.split(/\s+/);
303
262
 
304
- if (config.showParagraphs) {
305
- paragraphs = countParagraphs(text);
263
+ for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
264
+ if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
265
+ words.splice(wordIndex, 1);
266
+ }
306
267
  }
307
268
 
308
- if (config.showWordCount) {
309
- wordCount = countWords(text);
310
- }
269
+ return (words.length);
311
270
  }
312
271
 
272
+ function limitReached(editorInstance, notify) {
273
+ limitReachedNotified = true;
274
+ limitRestoredNotified = false;
313
275
 
314
- var html = format.replace("%paragraphs%", paragraphs);
315
-
316
- if (config.showRemaining) {
317
- if (config.maxCharCount >= 0) {
318
- html = html.replace("%charCount%", config.maxCharCount - charCount);
319
- } else {
320
- html = html.replace("%charCount%", charCount);
276
+ if (config.hardLimit) {
277
+ editorInstance.execCommand('undo');
321
278
  }
322
279
 
323
- if (config.maxWordCount >= 0) {
324
- html = html.replace("%wordCount%", config.maxWordCount - wordCount);
325
- } else {
326
- html = html.replace("%wordCount%", wordCount);
280
+ if (!notify) {
281
+ counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
282
+ editorInstance.fire("limitReached", { firedBy: "wordCount.limitReached" }, editor);
327
283
  }
328
- } else {
329
- html = html.replace("%wordCount%", wordCount).replace("%charCount%", charCount);
330
284
  }
331
285
 
332
- (editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).wordCount = wordCount;
333
- (editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).charCount = charCount;
286
+ function limitRestored(editorInstance) {
287
+ limitRestoredNotified = true;
288
+ limitReachedNotified = false;
289
+ editorInstance.fire('saveSnapshot');
334
290
 
335
- if (CKEDITOR.env.gecko) {
336
- counterElement(editorInstance).innerHTML = html;
337
- } else {
338
- counterElement(editorInstance).innerText = html;
291
+ counterElement(editorInstance).className = "cke_path_item";
339
292
  }
340
293
 
341
- if (charCount == lastCharCount && wordCount == lastWordCount) {
342
- if (charCount == config.maxCharCount || wordCount == config.maxWordCount) {
343
- snapShot = editor.getSnapshot();
294
+ function updateCounter(editorInstance) {
295
+ if (!counterElement(editorInstance)) {
296
+ return;
344
297
  }
345
- return true;
346
- }
347
298
 
348
- //If the limit is already over, allow the deletion of characters/words. Otherwise,
349
- //the user would have to delete at one go the number of offending characters
350
- var deltaWord = wordCount - lastWordCount;
351
- var deltaChar = charCount - lastCharCount;
299
+ var paragraphs = 0,
300
+ wordCount = 0,
301
+ charCount = 0,
302
+ text;
303
+
304
+ // BeforeGetData and getData events are fired when calling
305
+ // getData(). We can prevent this by passing true as an
306
+ // argument to getData(). This allows us to fire the events
307
+ // manually with additional event data: firedBy. This additional
308
+ // data helps differentiate calls to getData() made by
309
+ // wordCount plugin from calls made by other plugins/code.
310
+ editorInstance.fire("beforeGetData", { firedBy: "wordCount.updateCounter" }, editor);
311
+ text = editorInstance.getData(true);
312
+ editorInstance.fire("getData", { dataValue: text, firedBy: "wordCount.updateCounter" }, editor);
352
313
 
353
- lastWordCount = wordCount;
354
- lastCharCount = charCount;
314
+ if (text) {
315
+ if (config.showCharCount) {
316
+ charCount = countCharacters(text);
317
+ }
355
318
 
356
- if (lastWordCount == -1) {
357
- lastWordCount = wordCount;
358
- }
359
- if (lastCharCount == -1) {
360
- lastCharCount = charCount;
361
- }
319
+ if (config.showParagraphs) {
320
+ paragraphs = countParagraphs(text);
321
+ }
362
322
 
363
- // Check for word limit and/or char limit
364
- if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
365
- (config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
323
+ if (config.showWordCount) {
324
+ wordCount = countWords(text);
325
+ }
326
+ }
366
327
 
367
- limitReached(editorInstance, limitReachedNotified);
368
- } else if ((config.maxWordCount == -1 || wordCount <= config.maxWordCount) &&
369
- (config.maxCharCount == -1 || charCount <= config.maxCharCount)) {
328
+ var html = format;
329
+ if (config.showRemaining) {
330
+ if (config.maxCharCount >= 0) {
331
+ html = html.replace("%charCount%", config.maxCharCount - charCount);
332
+ } else {
333
+ html = html.replace("%charCount%", charCount);
334
+ }
370
335
 
371
- limitRestored(editorInstance);
372
- } else {
373
- snapShot = editorInstance.getSnapshot();
374
- }
336
+ if (config.maxWordCount >= 0) {
337
+ html = html.replace("%wordCount%", config.maxWordCount - wordCount);
338
+ } else {
339
+ html = html.replace("%wordCount%", wordCount);
340
+ }
375
341
 
376
- // Fire Custom Events
377
- if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
378
- if (charCount > config.maxCharCount && config.maxCharCount > -1) {
379
- config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
342
+ if (config.maxParagraphs >= 0) {
343
+ html = html.replace("%paragraphsCount%", config.maxParagraphs - paragraphs);
344
+ } else {
345
+ html = html.replace("%paragraphsCount%", paragraphs);
346
+ }
380
347
  } else {
381
- config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
348
+ html = html.replace("%wordCount%", wordCount).replace("%charCount%", charCount).replace("%paragraphsCount%", paragraphs);
382
349
  }
383
- }
384
350
 
385
- if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
386
- if (wordCount > config.maxWordCount && config.maxWordCount > -1) {
387
- config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
351
+ (editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).wordCount = wordCount;
352
+ (editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).charCount = charCount;
388
353
 
354
+ if (CKEDITOR.env.gecko) {
355
+ counterElement(editorInstance).innerHTML = html;
389
356
  } else {
390
- config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
357
+ counterElement(editorInstance).innerText = html;
391
358
  }
392
- }
393
359
 
394
- return true;
395
- }
396
-
397
- editor.on("key", function (event) {
398
- if (editor.mode === "source") {
399
- updateCounter(event.editor);
400
- }
401
- }, editor, null, 100);
402
-
403
- editor.on("change", function (event) {
404
- updateCounter(event.editor);
405
- }, editor, null, 100);
406
-
407
- editor.on("uiSpace", function (event) {
408
- if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
409
- if (event.data.space == "top") {
410
- event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
411
- " title=\"" +
412
- editor.lang.wordcount.title +
413
- "\"" +
414
- "><span id=\"" +
415
- counterId(event.editor) +
416
- "\" class=\"cke_path_item\">&nbsp;</span></div>";
417
- }
418
- } else {
419
- if (event.data.space == "bottom") {
420
- event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
421
- " title=\"" +
422
- editor.lang.wordcount.title +
423
- "\"" +
424
- "><span id=\"" +
425
- counterId(event.editor) +
426
- "\" class=\"cke_path_item\">&nbsp;</span></div>";
360
+ if (charCount == lastCharCount && wordCount == lastWordCount && paragraphs == lastParagraphs) {
361
+ if (charCount == config.maxCharCount || wordCount == config.maxWordCount || paragraphs > config.maxParagraphs) {
362
+ editorInstance.fire('saveSnapshot');
363
+ }
364
+ return true;
427
365
  }
428
- }
429
366
 
430
- }, editor, null, 100);
367
+ //If the limit is already over, allow the deletion of characters/words. Otherwise,
368
+ //the user would have to delete at one go the number of offending characters
369
+ var deltaWord = wordCount - lastWordCount;
370
+ var deltaChar = charCount - lastCharCount;
371
+ var deltaParagraphs = paragraphs - lastParagraphs;
431
372
 
432
- editor.on("dataReady", function (event) {
433
- updateCounter(event.editor);
434
- }, editor, null, 100);
373
+ lastWordCount = wordCount;
374
+ lastCharCount = charCount;
375
+ lastParagraphs = paragraphs;
435
376
 
436
- editor.on("paste", function(event) {
437
- if (config.maxWordCount > 0 || config.maxCharCount > 0) {
377
+ if (lastWordCount == -1) {
378
+ lastWordCount = wordCount;
379
+ }
380
+ if (lastCharCount == -1) {
381
+ lastCharCount = charCount;
382
+ }
383
+ if (lastParagraphs == -1) {
384
+ lastParagraphs = paragraphs;
385
+ }
438
386
 
439
- // Check if pasted content is above the limits
440
- var wordCount = -1,
441
- charCount = -1;
387
+ // Check for word limit and/or char limit
388
+ if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
389
+ (config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0) ||
390
+ (config.maxParagraphs > -1 && paragraphs > config.maxParagraphs && deltaParagraphs > 0)) {
442
391
 
443
- // BeforeGetData and getData events are fired when calling
444
- // getData(). We can prevent this by passing true as an
445
- // argument to getData(). This allows us to fire the events
446
- // manually with additional event data: firedBy. This additional
447
- // data helps differentiate calls to getData() made by
448
- // wordCount plugin from calls made by other plugins/code.
449
- event.editor.fire("beforeGetData", {firedBy: "wordCount.onPaste"}, event.editor);
450
- var text = event.editor.getData(true);
451
- event.editor.fire("getData", {dataValue: text, firedBy: "wordCount.onPaste"}, event.editor);
392
+ limitReached(editorInstance, limitReachedNotified);
393
+ } else if ((config.maxWordCount == -1 || wordCount <= config.maxWordCount) &&
394
+ (config.maxCharCount == -1 || charCount <= config.maxCharCount) &&
395
+ (config.maxParagraphs == -1 || paragraphs <= config.maxParagraphs)) {
452
396
 
453
- text += event.data.dataValue;
397
+ limitRestored(editorInstance);
398
+ } else {
399
+ editorInstance.fire('saveSnapshot');
400
+ }
454
401
 
455
- if (config.showCharCount) {
456
- charCount = countCharacters(text, event.editor);
402
+ // update instance
403
+ editorInstance.wordCount =
404
+ {
405
+ paragraphs: paragraphs,
406
+ wordCount: wordCount,
407
+ charCount: charCount
408
+ };
409
+
410
+
411
+ // Fire Custom Events
412
+ if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
413
+ if (charCount > config.maxCharCount && config.maxCharCount > -1) {
414
+ config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
415
+ } else {
416
+ config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
417
+ }
457
418
  }
458
419
 
459
- if (config.showWordCount) {
460
- wordCount = countWords(text);
420
+ if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
421
+ if (wordCount > config.maxWordCount && config.maxWordCount > -1) {
422
+ config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
423
+
424
+ } else {
425
+ config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
426
+ }
461
427
  }
462
428
 
429
+ return true;
430
+ }
463
431
 
464
- // Instantiate the notification when needed and only have one instance
465
- if(notification === null) {
466
- notification = new CKEDITOR.plugins.notification(event.editor, {
467
- message: event.editor.lang.wordcount.pasteWarning,
468
- type: 'warning',
469
- duration: config.pasteWarningDuration
470
- });
432
+ function isCloseToLimits() {
433
+ if (config.maxWordCount > -1 && config.maxWordCount - lastWordCount < 5) {
434
+ return true;
471
435
  }
472
436
 
473
- if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
474
- if(!notification.isVisible()) {
475
- notification.show();
476
- }
477
- event.cancel();
437
+ if (config.maxCharCount > -1 && config.maxCharCount - lastCharCount < 20) {
438
+ return true;
478
439
  }
479
440
 
480
- if (config.maxWordCount > 0 && wordCount > config.maxWordCount && config.hardLimit) {
481
- if(!notification.isVisible()) {
482
- notification.show();
483
- }
484
- event.cancel();
441
+ if (config.maxParagraphs > -1 && config.maxParagraphs - lastParagraphs < 1) {
442
+ return true;
485
443
  }
444
+
445
+ return false;
486
446
  }
487
- }, editor, null, 100);
488
447
 
489
- editor.on("afterPaste", function (event) {
490
- updateCounter(event.editor);
491
- }, editor, null, 100);
448
+ editor.on("key",
449
+ function(event) {
450
+ if (editor.mode === "source") {
451
+ clearTimeout(timeoutId);
452
+ timeoutId = setTimeout(
453
+ updateCounter.bind(this, event.editor),
454
+ 250
455
+ );
456
+ }
457
+ },
458
+ editor,
459
+ null,
460
+ 100);
461
+
462
+ editor.on("change",
463
+ function(event) {
464
+ var ms = isCloseToLimits() ? 5 : 250;
465
+ clearTimeout(timeoutId);
466
+ timeoutId = setTimeout(
467
+ updateCounter.bind(this, event.editor),
468
+ ms
469
+ );
470
+ },
471
+ editor,
472
+ null,
473
+ 100);
474
+
475
+ editor.on("uiSpace",
476
+ function(event) {
477
+ if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
478
+ if (event.data.space == "top") {
479
+ event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
480
+ " title=\"" +
481
+ editor.lang.wordcount.title +
482
+ "\"" +
483
+ "><span id=\"" +
484
+ counterId(event.editor) +
485
+ "\" class=\"cke_path_item\">&nbsp;</span></div>";
486
+ }
487
+ } else {
488
+ if (event.data.space == "bottom") {
489
+ event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
490
+ " title=\"" +
491
+ editor.lang.wordcount.title +
492
+ "\"" +
493
+ "><span id=\"" +
494
+ counterId(event.editor) +
495
+ "\" class=\"cke_path_item\">&nbsp;</span></div>";
496
+ }
497
+ }
492
498
 
493
- editor.on("blur", function () {
494
- if (intervalId) {
495
- window.clearInterval(intervalId);
496
- }
497
- }, editor, null, 300);
498
- }
499
- });
499
+ },
500
+ editor,
501
+ null,
502
+ 100);
503
+
504
+ editor.on("dataReady",
505
+ function(event) {
506
+ updateCounter(event.editor);
507
+ },
508
+ editor,
509
+ null,
510
+ 100);
511
+
512
+ editor.on("paste",
513
+ function(event) {
514
+ if (config.maxWordCount > 0 || config.maxCharCount > 0 || config.maxParagraphs > 0) {
515
+
516
+ // Check if pasted content is above the limits
517
+ var wordCount = -1,
518
+ charCount = -1,
519
+ paragraphs = -1;
520
+
521
+ // BeforeGetData and getData events are fired when calling
522
+ // getData(). We can prevent this by passing true as an
523
+ // argument to getData(). This allows us to fire the events
524
+ // manually with additional event data: firedBy. This additional
525
+ // data helps differentiate calls to getData() made by
526
+ // wordCount plugin from calls made by other plugins/code.
527
+ event.editor.fire("beforeGetData", { firedBy: "wordCount.onPaste" }, event.editor);
528
+ var text = event.editor.getData(true);
529
+ event.editor.fire("getData", { dataValue: text, firedBy: "wordCount.onPaste" }, event.editor);
530
+
531
+ text += event.data.dataValue;
532
+
533
+ if (config.showCharCount) {
534
+ charCount = countCharacters(text);
535
+ }
536
+
537
+ if (config.showWordCount) {
538
+ wordCount = countWords(text);
539
+ }
540
+
541
+ if (config.showParagraphs) {
542
+ paragraphs = countParagraphs(text);
543
+ }
544
+
545
+
546
+ // Instantiate the notification when needed and only have one instance
547
+ if (notification === null) {
548
+ notification = new CKEDITOR.plugins.notification(event.editor,
549
+ {
550
+ message: event.editor.lang.wordcount.pasteWarning,
551
+ type: 'warning',
552
+ duration: config.pasteWarningDuration
553
+ });
554
+ }
555
+
556
+ if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
557
+ if (!notification.isVisible()) {
558
+ notification.show();
559
+ }
560
+ event.cancel();
561
+ }
562
+
563
+ if (config.maxWordCount > 0 && wordCount > config.maxWordCount && config.hardLimit) {
564
+ if (!notification.isVisible()) {
565
+ notification.show();
566
+ }
567
+ event.cancel();
568
+ }
569
+
570
+ if (config.maxParagraphs > 0 && paragraphs > config.maxParagraphs && config.hardLimit) {
571
+ if (!notification.isVisible()) {
572
+ notification.show();
573
+ }
574
+ event.cancel();
575
+ }
576
+ }
577
+ },
578
+ editor,
579
+ null,
580
+ 100);
581
+
582
+ editor.on("afterPaste",
583
+ function(event) {
584
+ updateCounter(event.editor);
585
+ },
586
+ editor,
587
+ null,
588
+ 100);
589
+ }
590
+ });