glebtv-ckeditor 4.6.0 → 4.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (456) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +15 -22
  3. data/MIT-LICENSE +0 -0
  4. data/README.md +2 -325
  5. data/Rakefile +1 -2
  6. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.jpg +0 -0
  7. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.png +0 -0
  8. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_del.png +0 -0
  9. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_more.gif +0 -0
  10. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/preloader.gif +0 -0
  11. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/avi.gif +0 -0
  12. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/ckfnothumb.gif +0 -0
  13. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/doc.gif +0 -0
  14. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/docx.gif +0 -0
  15. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/exe.gif +0 -0
  16. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/gz.gif +0 -0
  17. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/htm.gif +0 -0
  18. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/jpg.gif +0 -0
  19. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mp3.gif +0 -0
  20. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mpg.gif +0 -0
  21. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/pdf.gif +0 -0
  22. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/psd.gif +0 -0
  23. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/rar.gif +0 -0
  24. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/swf.gif +0 -0
  25. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/tar.gif +0 -0
  26. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/txt.gif +0 -0
  27. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/unknown.gif +0 -0
  28. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/wmv.gif +0 -0
  29. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xls.gif +0 -0
  30. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xlsx.gif +0 -0
  31. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/zip.gif +0 -0
  32. data/app/assets/javascripts/ckeditor/application.js +0 -0
  33. data/app/assets/javascripts/ckeditor/config.js.erb +1 -2
  34. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/{application.js.erb → application.js} +4 -6
  35. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
  36. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.endless-scroll.js +0 -0
  37. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
  38. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
  39. data/app/assets/javascripts/ckeditor/init.js.erb +0 -0
  40. data/app/assets/stylesheets/ckeditor/application.css +1 -1
  41. data/app/assets/stylesheets/ckeditor/filebrowser/uploader.scss +172 -0
  42. data/app/controllers/ckeditor/application_controller.rb +9 -10
  43. data/app/controllers/ckeditor/attachment_files_controller.rb +11 -12
  44. data/app/controllers/ckeditor/pictures_controller.rb +10 -12
  45. data/app/helpers/ckeditor/application_helper.rb +1 -10
  46. data/app/views/ckeditor/attachment_files/index.html.erb +5 -5
  47. data/app/views/ckeditor/pictures/index.html.erb +5 -5
  48. data/app/views/ckeditor/shared/_asset.html.erb +18 -21
  49. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +17 -20
  50. data/app/views/layouts/ckeditor/application.html.erb +3 -3
  51. data/config/locales/en.ckeditor.yml +0 -0
  52. data/config/locales/ru.ckeditor.yml +0 -0
  53. data/config/routes.rb +2 -2
  54. data/lib/ckeditor.rb +42 -34
  55. data/lib/ckeditor/asset_response.rb +74 -25
  56. data/lib/ckeditor/backend/carrierwave.rb +8 -5
  57. data/lib/ckeditor/backend/dragonfly.rb +5 -3
  58. data/lib/ckeditor/backend/paperclip.rb +15 -22
  59. data/lib/ckeditor/backend/refile.rb +6 -4
  60. data/lib/ckeditor/helpers/controllers.rb +15 -20
  61. data/lib/ckeditor/helpers/form_builder.rb +1 -1
  62. data/lib/ckeditor/helpers/form_helper.rb +0 -0
  63. data/lib/ckeditor/helpers/view_helper.rb +0 -0
  64. data/lib/ckeditor/hooks/cancan.rb +0 -2
  65. data/lib/ckeditor/hooks/formtastic.rb +2 -2
  66. data/lib/ckeditor/hooks/pundit.rb +1 -4
  67. data/lib/ckeditor/hooks/simple_form.rb +9 -14
  68. data/lib/ckeditor/http.rb +9 -11
  69. data/lib/ckeditor/orm/active_record.rb +1 -3
  70. data/lib/ckeditor/orm/base.rb +5 -5
  71. data/lib/ckeditor/orm/mongoid.rb +4 -6
  72. data/lib/ckeditor/paginatable.rb +3 -1
  73. data/lib/ckeditor/rails.rb +39 -0
  74. data/lib/ckeditor/text_area.rb +16 -15
  75. data/lib/ckeditor/utils.rb +45 -39
  76. data/lib/ckeditor/utils/content_type_detector.rb +7 -10
  77. data/lib/ckeditor/utils/javascript_code.rb +8 -3
  78. data/lib/ckeditor/version.rb +2 -2
  79. data/lib/generators/ckeditor/install_generator.rb +52 -30
  80. data/lib/generators/ckeditor/pundit_policy_generator.rb +1 -3
  81. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -2
  82. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +1 -1
  83. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +1 -1
  84. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +6 -10
  85. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration_versioned.rb +22 -0
  86. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +1 -1
  87. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +1 -1
  88. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +4 -4
  89. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +6 -10
  90. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration_versioned.rb +23 -0
  91. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb +0 -0
  92. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +3 -3
  93. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +5 -5
  94. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +2 -5
  95. data/lib/generators/ckeditor/templates/active_record/paperclip/migration_versioned.rb +23 -0
  96. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/asset.rb +0 -0
  97. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/attachment_file.rb +0 -0
  98. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +0 -0
  99. data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +7 -12
  100. data/lib/generators/ckeditor/templates/active_record/refile/migration_versioned.rb +23 -0
  101. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +0 -0
  102. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +4 -4
  103. data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +4 -5
  104. data/lib/generators/ckeditor/templates/ckeditor.rb +16 -7
  105. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +2 -2
  106. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +1 -1
  107. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +1 -1
  108. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +0 -0
  109. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +5 -5
  110. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +5 -5
  111. data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +2 -2
  112. data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +2 -2
  113. data/lib/glebtv-ckeditor.rb +0 -0
  114. data/lib/tasks/ckeditor.rake +6 -14
  115. data/test/controllers/attachment_files_controller_test.rb +0 -0
  116. data/test/controllers/pictures_controller_test.rb +0 -0
  117. data/test/dummy/Rakefile +0 -0
  118. data/test/dummy/app/assets/javascripts/application.js +0 -0
  119. data/test/dummy/app/assets/stylesheets/application.css +0 -0
  120. data/test/dummy/app/assets/stylesheets/scaffold.css +0 -0
  121. data/test/dummy/app/controllers/application_controller.rb +0 -0
  122. data/test/dummy/app/controllers/posts_controller.rb +0 -0
  123. data/test/dummy/app/helpers/application_helper.rb +0 -0
  124. data/test/dummy/app/helpers/posts_helper.rb +0 -0
  125. data/test/dummy/app/models/post.rb +0 -0
  126. data/test/dummy/app/views/layouts/application.html.erb +0 -0
  127. data/test/dummy/app/views/posts/_form.html.erb +0 -0
  128. data/test/dummy/app/views/posts/edit.html.erb +0 -0
  129. data/test/dummy/app/views/posts/index.html.erb +0 -0
  130. data/test/dummy/app/views/posts/new.html.erb +0 -0
  131. data/test/dummy/app/views/posts/show.html.erb +0 -0
  132. data/test/dummy/config.ru +0 -0
  133. data/test/dummy/config/application.rb +0 -0
  134. data/test/dummy/config/boot.rb +0 -0
  135. data/test/dummy/config/database.yml +0 -0
  136. data/test/dummy/config/environment.rb +0 -0
  137. data/test/dummy/config/environments/development.rb +0 -0
  138. data/test/dummy/config/environments/production.rb +0 -0
  139. data/test/dummy/config/environments/test.rb +0 -0
  140. data/test/dummy/config/initializers/assets.rb +1 -0
  141. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -0
  142. data/test/dummy/config/initializers/ckeditor.rb +0 -0
  143. data/test/dummy/config/initializers/cookies_serializer.rb +0 -0
  144. data/test/dummy/config/initializers/inflections.rb +0 -0
  145. data/test/dummy/config/initializers/mime_types.rb +0 -0
  146. data/test/dummy/config/initializers/paperclip.rb +3 -0
  147. data/test/dummy/config/initializers/session_store.rb +0 -0
  148. data/test/dummy/config/initializers/wrap_parameters.rb +0 -0
  149. data/test/dummy/config/locales/en.yml +0 -0
  150. data/test/dummy/config/mongoid.yml +0 -0
  151. data/test/dummy/config/routes.rb +0 -0
  152. data/test/dummy/config/secrets.yml +0 -0
  153. data/test/dummy/db/migrate/20110623120047_create_posts.rb +0 -0
  154. data/test/dummy/public/404.html +0 -0
  155. data/test/dummy/public/422.html +0 -0
  156. data/test/dummy/public/500.html +0 -0
  157. data/test/dummy/public/favicon.ico +0 -0
  158. data/test/dummy/script/rails +0 -0
  159. data/test/dummy/test/fixtures/files/rails.png +0 -0
  160. data/test/dummy/test/fixtures/files/rails.tar.gz +0 -0
  161. data/test/functional/posts_controller_test.rb +2 -3
  162. data/test/generators/install_generator_test.rb +2 -2
  163. data/test/integration/navigation_test.rb +0 -0
  164. data/test/models/attachment_file_test.rb +3 -8
  165. data/test/models/ckeditor_test.rb +1 -1
  166. data/test/models/picture_test.rb +0 -0
  167. data/test/models/utils_test.rb +6 -6
  168. data/test/orm/active_record.rb +0 -0
  169. data/test/orm/mongoid.rb +0 -0
  170. data/test/support/helpers.rb +0 -0
  171. data/test/support/integration_case.rb +0 -0
  172. data/test/support/raw_post.rb +0 -0
  173. data/test/support/routes.txt +0 -0
  174. data/test/test_helper.rb +1 -1
  175. data/vendor/assets/javascripts/ckeditor/CHANGES.md +1358 -0
  176. data/vendor/assets/javascripts/ckeditor/README.md +39 -0
  177. data/vendor/assets/javascripts/ckeditor/build-config.js +31 -30
  178. data/vendor/assets/javascripts/ckeditor/ckeditor.js +709 -675
  179. data/vendor/assets/javascripts/ckeditor/config.js +10 -0
  180. data/vendor/assets/javascripts/ckeditor/contents.css +208 -0
  181. data/vendor/assets/javascripts/ckeditor/lang/en.js +4 -4
  182. data/vendor/assets/javascripts/ckeditor/lang/ru.js +4 -4
  183. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +5 -5
  184. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -2
  185. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  186. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  187. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -1
  188. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -1
  189. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  190. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +6 -1
  191. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  192. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -1
  193. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  194. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -1
  195. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -0
  196. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +230 -74
  197. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +1 -1
  198. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +1 -1
  199. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +1 -1
  200. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +1 -1
  201. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +2 -3
  202. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +1 -1
  203. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +1 -1
  204. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +1 -1
  205. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +1 -1
  206. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +1 -1
  207. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
  208. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +3 -3
  209. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +3 -3
  210. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +1 -1
  211. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +0 -2
  212. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +1 -1
  213. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +1 -1
  214. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +1 -1
  215. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +1 -1
  216. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +1 -1
  217. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +1 -1
  218. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +1 -1
  219. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +1 -1
  220. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +1 -1
  221. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +1 -1
  222. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +1 -1
  223. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +1 -1
  224. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +1 -1
  225. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +1 -1
  226. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +2 -2
  227. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
  228. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +2 -2
  229. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  230. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  231. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +1 -1
  232. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +4 -3
  233. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +23 -23
  234. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/hidpi/loremipsum.png +0 -0
  235. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/loremipsum.png +0 -0
  236. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/en.js +0 -0
  237. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/ru.js +2 -2
  238. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
  239. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +13 -7
  240. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +49 -39
  241. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/dialog.css +23 -0
  242. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +33 -19
  243. data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +6 -1
  244. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
  245. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +4 -1
  246. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +92 -23
  247. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +81 -82
  248. data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon-hdpi.png +0 -0
  249. data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
  250. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +2 -1
  251. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +448 -448
  252. data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +1632 -0
  253. data/vendor/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
  254. data/vendor/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
  255. data/vendor/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
  256. data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  257. data/vendor/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
  258. data/vendor/assets/javascripts/ckeditor/samples/index.html +128 -0
  259. data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +53 -0
  260. data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +17 -0
  261. data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +85 -0
  262. data/vendor/assets/javascripts/ckeditor/samples/old/api.html +210 -0
  263. data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +59 -0
  264. data/vendor/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
  265. data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
  266. data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +59 -0
  267. data/vendor/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
  268. data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
  269. data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +508 -0
  270. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
  271. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +190 -0
  272. data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +144 -0
  273. data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +106 -0
  274. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
  275. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
  276. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/swfobject.js +19 -0
  277. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +283 -0
  278. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +224 -0
  279. data/vendor/assets/javascripts/ckeditor/samples/old/index.html +131 -0
  280. data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +314 -0
  281. data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +124 -0
  282. data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +113 -0
  283. data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +103 -0
  284. data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +209 -0
  285. data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +76 -0
  286. data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +60 -0
  287. data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +59 -0
  288. data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +357 -0
  289. data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +50 -0
  290. data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +16 -0
  291. data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +78 -0
  292. data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +235 -0
  293. data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +72 -0
  294. data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +122 -0
  295. data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
  296. data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +234 -0
  297. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
  298. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
  299. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
  300. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
  301. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
  302. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
  303. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
  304. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +446 -0
  305. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
  306. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
  307. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
  308. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
  309. data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/LICENSE.md → samples/toolbarconfigurator/lib/codemirror/LICENSE} +19 -21
  310. data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/css → samples/toolbarconfigurator/lib/codemirror}/codemirror.css +325 -341
  311. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
  312. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
  313. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
  314. data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/js/addon/hint → samples/toolbarconfigurator/lib/codemirror}/show-hint.css +38 -36
  315. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
  316. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog.css +5 -0
  317. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie.css +5 -0
  318. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie7.css +5 -0
  319. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie8.css +5 -0
  320. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_iequirks.css +5 -0
  321. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +5 -0
  322. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +5 -0
  323. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +5 -0
  324. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +5 -0
  325. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +5 -0
  326. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +5 -0
  327. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  328. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  329. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/arrow.png +0 -0
  330. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/close.png +0 -0
  331. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/close.png +0 -0
  332. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock-open.png +0 -0
  333. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock.png +0 -0
  334. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/refresh.png +0 -0
  335. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock-open.png +0 -0
  336. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock.png +0 -0
  337. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/refresh.png +0 -0
  338. data/vendor/assets/javascripts/ckeditor/skins/minimalist/readme.md +7 -0
  339. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.png +0 -0
  340. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.svg +2374 -0
  341. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.png +0 -0
  342. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.svg +2722 -0
  343. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/locations.json +145 -0
  344. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
  345. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +1 -1
  346. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +1 -1
  347. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
  348. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +1 -1
  349. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +1 -1
  350. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  351. data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
  352. data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +10 -0
  353. data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
  354. metadata +182 -177
  355. data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.erb +0 -128
  356. data/app/views/rails_admin/main/_form_ck_editor.html.haml +0 -10
  357. data/app/views/rails_admin/main/_form_ck_editorml.html.haml +0 -11
  358. data/config/locales/bg.ckeditor.yml +0 -9
  359. data/config/locales/cs.ckeditor.yml +0 -9
  360. data/config/locales/de.ckeditor.yml +0 -9
  361. data/config/locales/el-GR.cdkeditor.yml +0 -9
  362. data/config/locales/es.ckeditor.yml +0 -9
  363. data/config/locales/fr.ckeditor.yml +0 -9
  364. data/config/locales/hu.ckeditor.yml +0 -9
  365. data/config/locales/it.ckeditor.yml +0 -9
  366. data/config/locales/ja.ckeditor.yml +0 -9
  367. data/config/locales/nb.ckeditor.yml +0 -9
  368. data/config/locales/nl.ckeditor.yml +0 -9
  369. data/config/locales/pl.ckeditor.yml +0 -9
  370. data/config/locales/pt-BR.ckeditor.yml +0 -9
  371. data/config/locales/pt-PT.ckeditor.yml +0 -9
  372. data/config/locales/sv-SE.ckeditor.yml +0 -9
  373. data/config/locales/tr.ckeditor.yml +0 -9
  374. data/config/locales/uk.ckeditor.yml +0 -9
  375. data/config/locales/zh-CN.ckeditor.yml +0 -9
  376. data/config/locales/zh-TW.ckeditor.yml +0 -9
  377. data/lib/ckeditor/engine.rb +0 -46
  378. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -12
  379. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +0 -183
  380. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/comment.js +0 -206
  381. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/continuecomment.js +0 -85
  382. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.css +0 -32
  383. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +0 -157
  384. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +0 -202
  385. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +0 -169
  386. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +0 -51
  387. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +0 -122
  388. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchtags.js +0 -66
  389. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/trailingspace.js +0 -27
  390. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +0 -105
  391. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/comment-fold.js +0 -59
  392. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +0 -150
  393. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.css +0 -20
  394. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.js +0 -146
  395. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/indent-fold.js +0 -44
  396. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/markdown-fold.js +0 -49
  397. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +0 -182
  398. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +0 -43
  399. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +0 -226
  400. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/anyword-hint.js +0 -41
  401. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/css-hint.js +0 -60
  402. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/html-hint.js +0 -348
  403. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/javascript-hint.js +0 -155
  404. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.js +0 -438
  405. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/sql-hint.js +0 -271
  406. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/xml-hint.js +0 -110
  407. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/loadmode.js +0 -64
  408. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex.js +0 -123
  409. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex_test.js +0 -33
  410. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/overlay.js +0 -85
  411. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/simple.js +0 -213
  412. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/jump-to-line.js +0 -49
  413. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +0 -165
  414. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.css +0 -8
  415. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.js +0 -97
  416. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +0 -252
  417. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +0 -189
  418. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/active-line.js +0 -74
  419. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/mark-selection.js +0 -118
  420. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/selection-pointer.js +0 -98
  421. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify-html.js +0 -952
  422. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.js +0 -2087
  423. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +0 -9109
  424. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/bbcode.js +0 -137
  425. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/index.html +0 -73
  426. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/bbcodemixed.js +0 -161
  427. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/index.html +0 -128
  428. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/clike.js +0 -785
  429. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/index.html +0 -360
  430. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/scala.html +0 -767
  431. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/test.js +0 -55
  432. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/css.js +0 -825
  433. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss.html +0 -103
  434. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss_test.js +0 -17
  435. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/index.html +0 -75
  436. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less.html +0 -152
  437. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less_test.js +0 -54
  438. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss.html +0 -157
  439. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss_test.js +0 -110
  440. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/test.js +0 -200
  441. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/htmlembedded.js +0 -28
  442. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/index.html +0 -60
  443. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/htmlmixed.js +0 -152
  444. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/index.html +0 -89
  445. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/index.html +0 -114
  446. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/javascript.js +0 -784
  447. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/json-ld.html +0 -72
  448. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/test.js +0 -247
  449. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/typescript.html +0 -61
  450. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/index.html +0 -64
  451. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/php.js +0 -234
  452. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/test.js +0 -154
  453. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/index.html +0 -61
  454. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/test.js +0 -51
  455. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/xml.js +0 -394
  456. data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +0 -15
@@ -11,8 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  CKEDITOR.plugins.add( 'notification', {
14
- lang: 'az,ca,cs,da,de,de-ch,en,eo,es,eu,fr,gl,id,it,ja,km,ko,ku,nb,nl,oc,pl,pt,pt-br,ru,sv,tr,ug,uk,zh,zh-cn', // %REMOVE_LINE_CORE%
15
- requires: 'toolbar',
14
+ lang: 'en,ru', // %REMOVE_LINE_CORE%
16
15
 
17
16
  init: function( editor ) {
18
17
  editor._.notificationArea = new Area( editor );
@@ -128,7 +127,7 @@ function Notification( editor, options ) {
128
127
 
129
128
  this.element = this._createElement();
130
129
 
131
- // Don't allow dragging on notification (#13184).
130
+ // Don't allow dragging on notification (http://dev.ckeditor.com/ticket/13184).
132
131
  editor.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement( this.element );
133
132
  }
134
133
 
@@ -356,7 +355,7 @@ Notification.prototype = {
356
355
  notificationElement.append( notificationCloseElement );
357
356
 
358
357
  notificationCloseElement.on( 'click', function() {
359
- // Focus editor on close (#12865)
358
+ // Focus editor on close (http://dev.ckeditor.com/ticket/12865)
360
359
  notification.editor.focus();
361
360
 
362
361
  notification.hide();
@@ -613,8 +612,8 @@ Area.prototype = {
613
612
  editor = this.editor,
614
613
  contentsRect = editor.ui.contentsElement.getClientRect(),
615
614
  contentsPos = editor.ui.contentsElement.getDocumentPosition(),
616
- top = editor.ui.space( 'top' ),
617
- topRect = top.getClientRect(),
615
+ top,
616
+ topRect,
618
617
  areaRect = area.getClientRect(),
619
618
  notification,
620
619
  notificationWidth = this._notificationWidth,
@@ -635,6 +634,13 @@ Area.prototype = {
635
634
  parseInt( notification.getComputedStyle( 'margin-right' ), 10 );
636
635
  }
637
636
 
637
+ // Check if toolbar exist and if so, then assign values to it (#491).
638
+ if ( editor.toolbar ) {
639
+ top = editor.ui.space( 'top' );
640
+ topRect = top.getClientRect();
641
+ }
642
+
643
+
638
644
  // --------------------------------------- Horizontal layout ----------------------------------------
639
645
 
640
646
  // +---Viewport-------------------------------+ +---Viewport-------------------------------+
@@ -651,7 +657,7 @@ Area.prototype = {
651
657
  // | | | | | | | |
652
658
  // | +--------------------------------------+ | | +--------------------------------------+ |
653
659
  // +------------------------------------------+ +------------------------------------------+
654
- if ( top.isVisible() &&
660
+ if ( top && top.isVisible() &&
655
661
  topRect.bottom > contentsRect.top &&
656
662
  topRect.bottom < contentsRect.bottom - areaRect.height ) {
657
663
  setBelowToolbar();
@@ -2,42 +2,52 @@
2
2
  Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.md or http://ckeditor.com/license
4
4
  */
5
- (function(){function t(){return!1}function x(a,b){var c,d=[];a.filterChildren(b);for(c=a.children.length-1;0<=c;c--)d.unshift(a.children[c]),a.children[c].remove();c=a.attributes;var e=a,h=!0,g;for(g in c)if(h)h=!1;else{var m=new CKEDITOR.htmlParser.element(a.name);m.attributes[g]=c[g];e.add(m);e=m;delete c[g]}for(c=0;c<d.length;c++)e.add(d[c])}var f,k,u,r,l=CKEDITOR.tools,y=["o:p","xml","script","meta","link"],w={},v=0;CKEDITOR.plugins.pastefromword={};CKEDITOR.cleanWord=function(a,b){var c=Boolean(a.match(/mso-list:\s*l\d+\s+level\d+\s+lfo\d+/));
6
- a=a.replace(/<!\[/g,"\x3c!--[").replace(/\]>/g,"]--\x3e");var d=CKEDITOR.htmlParser.fragment.fromHtml(a);r=new CKEDITOR.htmlParser.filter({root:function(a){a.filterChildren(r);CKEDITOR.plugins.pastefromword.lists.cleanup(f.createLists(a))},elementNames:[[/^\?xml:namespace$/,""],[/^v:shapetype/,""],[new RegExp(y.join("|")),""]],elements:{a:function(a){if(a.attributes.name){if("_GoBack"==a.attributes.name){delete a.name;return}if(a.attributes.name.match(/^OLE_LINK\d+$/)){delete a.name;return}}if(a.attributes.href&&
7
- a.attributes.href.match(/#.+$/)){var b=a.attributes.href.match(/#(.+)$/)[1];w[b]=a}a.attributes.name&&w[a.attributes.name]&&(a=w[a.attributes.name],a.attributes.href=a.attributes.href.replace(/.*#(.*)$/,"#$1"))},div:function(a){k.createStyleStack(a,r,b)},img:function(a){if(a.parent){var b=a.parent.attributes;(b=b.style||b.STYLE)&&b.match(/mso\-list:\s?Ignore/)&&(a.attributes["cke-ignored"]=!0)}k.mapStyles(a,{width:function(b){k.setStyle(a,"width",b+"px")},height:function(b){k.setStyle(a,"height",
8
- b+"px")}});a.attributes.src&&a.attributes.src.match(/^file:\/\//)&&a.attributes.alt&&a.attributes.alt.match(/^https?:\/\//)&&(a.attributes.src=a.attributes.alt)},p:function(a){a.filterChildren(r);if(a.attributes.style&&a.attributes.style.match(/display:\s*none/i))return!1;if(f.thisIsAListItem(b,a))f.convertToFakeListItem(b,a);else{var c=a.getAscendant(function(a){return"ul"==a.name||"ol"==a.name}),d=l.parseCssText(a.attributes.style);c&&!c.attributes["cke-list-level"]&&d["mso-list"]&&d["mso-list"].match(/level/)&&
9
- (c.attributes["cke-list-level"]=d["mso-list"].match(/level(\d+)/)[1])}k.createStyleStack(a,r,b)},pre:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,r,b)},h1:function(a){f.thisIsAListItem(b,a)&&f.convertToFakeListItem(b,a);k.createStyleStack(a,r,b)},font:function(a){if(a.getHtml().match(/^\s*$/))return(new CKEDITOR.htmlParser.text(" ")).insertAfter(a),!1;b&&!0===b.config.pasteFromWordRemoveFontStyles&&a.attributes.size&&delete a.attributes.size;x(a,r)},ul:function(a){if(c)return"li"==
10
- a.parent.name&&0===l.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),f.dissolveList(a),!1},li:function(a){c&&(a.attributes.style=k.normalizedStyles(a,b),k.pushStylesLower(a))},ol:function(a){if(c)return"li"==a.parent.name&&0===l.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),f.dissolveList(a),!1},span:function(a){a.filterChildren(r);a.attributes.style=k.normalizedStyles(a,b);if(!a.attributes.style||a.attributes.style.match(/^mso\-bookmark:OLE_LINK\d+$/)||
11
- a.getHtml().match(/^(\s|&nbsp;)+$/)){for(var c=a.children.length-1;0<=c;c--)a.children[c].insertAfter(a);return!1}k.createStyleStack(a,r,b)},table:function(a){a._tdBorders={};a.filterChildren(r);var b,c=0,d;for(d in a._tdBorders)a._tdBorders[d]>c&&(c=a._tdBorders[d],b=d);k.setStyle(a,"border",b)},td:function(a){var b=a.getAscendant("table"),c=b._tdBorders,d=["border","border-top","border-right","border-bottom","border-left"],b=l.parseCssText(b.attributes.style),e=b.background||b.BACKGROUND;e&&k.setStyle(a,
12
- "background",e,!0);(b=b["background-color"]||b["BACKGROUND-COLOR"])&&k.setStyle(a,"background-color",b,!0);var b=l.parseCssText(a.attributes.style),p;for(p in b)e=b[p],delete b[p],b[p.toLowerCase()]=e;for(p=0;p<d.length;p++)b[d[p]]&&(e=b[d[p]],c[e]=c[e]?c[e]+1:1);k.pushStylesLower(a,{background:!0})},"v:imagedata":t,"v:shape":function(a){var b=!1;a.parent.getFirst(function(c){"img"==c.name&&c.attributes&&c.attributes["v:shapes"]==a.attributes.id&&(b=!0)});if(b)return!1;var c="";a.forEach(function(a){a.attributes&&
13
- a.attributes.src&&(c=a.attributes.src)},CKEDITOR.NODE_ELEMENT,!0);a.filterChildren(r);a.name="img";a.attributes.src=a.attributes.src||c;delete a.attributes.type},style:function(){return!1}},attributes:{style:function(a,c){return k.normalizedStyles(c,b)||!1},"class":function(a){a=a.replace(/msonormal|msolistparagraph\w*/ig,"");return""===a?!1:a},cellspacing:t,cellpadding:t,border:t,valign:t,"v:shapes":t,"o:spid":t},comment:function(a){a.match(/\[if.* supportFields.*\]/)&&v++;"[endif]"==a&&(v=0<v?v-
14
- 1:0);return!1},text:function(a){return v?"":a.replace(/&nbsp;/g," ")}});var e=new CKEDITOR.htmlParser.basicWriter;r.applyTo(d);d.writeHtml(e);return e.getHtml()};CKEDITOR.plugins.pastefromword.styles={setStyle:function(a,b,c,d){var e=l.parseCssText(a.attributes.style);d&&e[b]||(""===c?delete e[b]:e[b]=c,a.attributes.style=CKEDITOR.tools.writeCssText(e))},mapStyles:function(a,b){for(var c in b)if(a.attributes[c]){if("function"===typeof b[c])b[c](a.attributes[c]);else k.setStyle(a,b[c],a.attributes[c]);
15
- delete a.attributes[c]}},normalizedStyles:function(a,b){var c="background-color:transparent border-image:none color:windowtext direction:ltr mso- text-indent visibility:visible div:border:none".split(" "),d="font-family font font-size color background-color line-height text-decoration".split(" "),e=function(){for(var a=[],b=0;b<arguments.length;b++)arguments[b]&&a.push(arguments[b]);return-1!==l.indexOf(c,a.join(":"))},h=b&&!0===b.config.pasteFromWordRemoveFontStyles,g=l.parseCssText(a.attributes.style);
16
- "cke:li"==a.name&&g["TEXT-INDENT"]&&g.MARGIN&&(a.attributes["cke-indentation"]=f.getElementIndentation(a),g.MARGIN=g.MARGIN.replace(/(([\w\.]+ ){3,3})[\d\.]+(\w+$)/,"$10$3"));for(var m=l.objectKeys(g),q=0;q<m.length;q++){var n=m[q].toLowerCase(),p=g[m[q]],k=CKEDITOR.tools.indexOf;(h&&-1!==k(d,n.toLowerCase())||e(null,n,p)||e(null,n.replace(/\-.*$/,"-"))||e(null,n)||e(a.name,n,p)||e(a.name,n.replace(/\-.*$/,"-"))||e(a.name,n)||e(p))&&delete g[m[q]]}return CKEDITOR.tools.writeCssText(g)},createStyleStack:function(a,
17
- b,c){var d=[];a.filterChildren(b);for(b=a.children.length-1;0<=b;b--)d.unshift(a.children[b]),a.children[b].remove();k.sortStyles(a);b=l.parseCssText(k.normalizedStyles(a,c));c=a;var e="span"===a.name,h;for(h in b)if(!h.match(/margin|text\-align|width|border|padding/i))if(e)e=!1;else{var g=new CKEDITOR.htmlParser.element("span");g.attributes.style=h+":"+b[h];c.add(g);c=g;delete b[h]}"{}"!==JSON.stringify(b)?a.attributes.style=CKEDITOR.tools.writeCssText(b):delete a.attributes.style;for(b=0;b<d.length;b++)c.add(d[b])},
18
- sortStyles:function(a){for(var b=["border","border-bottom","font-size","background"],c=l.parseCssText(a.attributes.style),d=l.objectKeys(c),e=[],h=[],g=0;g<d.length;g++)-1!==l.indexOf(b,d[g].toLowerCase())?e.push(d[g]):h.push(d[g]);e.sort(function(a,c){var d=l.indexOf(b,a.toLowerCase()),e=l.indexOf(b,c.toLowerCase());return d-e});d=[].concat(e,h);e={};for(g=0;g<d.length;g++)e[d[g]]=c[d[g]];a.attributes.style=CKEDITOR.tools.writeCssText(e)},pushStylesLower:function(a,b){if(!a.attributes.style||0===
19
- a.children.length)return!1;b=b||{};var c={"list-style-type":!0,width:!0,border:!0,"border-":!0},d=l.parseCssText(a.attributes.style),e;for(e in d)if(!(e.toLowerCase()in c||c[e.toLowerCase().replace(/\-.*$/,"-")]||e.toLowerCase()in b)){for(var h=!1,g=0;g<a.children.length;g++){var m=a.children[g];m.type===CKEDITOR.NODE_ELEMENT&&(h=!0,k.setStyle(m,e,d[e]))}h&&delete d[e]}a.attributes.style=CKEDITOR.tools.writeCssText(d);return!0}};k=CKEDITOR.plugins.pastefromword.styles;CKEDITOR.plugins.pastefromword.lists=
20
- {thisIsAListItem:function(a,b){return u.isEdgeListItem(a,b)||b.attributes.style&&b.attributes.style.match(/mso\-list:\s?l\d/)&&"li"!==b.parent.name||b.attributes["cke-dissolved"]||b.getHtml().match(/<!\-\-\[if !supportLists]\-\->/)||b.getHtml().match(/^( )*.*?[\.\)] ( ){2,700}/)?!0:!1},convertToFakeListItem:function(a,b){u.isEdgeListItem(a,b)&&u.assignListLevels(a,b);this.getListItemInfo(b);if(!b.attributes["cke-dissolved"]){var c;b.forEach(function(a){!c&&"img"==a.name&&a.attributes["cke-ignored"]&&
21
- "*"==a.attributes.alt&&(c="·",a.remove())},CKEDITOR.NODE_ELEMENT);b.forEach(function(a){c||a.value.match(/^ /)||(c=a.value)},CKEDITOR.NODE_TEXT);if("undefined"==typeof c)return;b.attributes["cke-symbol"]=c.replace(/ .*$/,"");f.removeSymbolText(b)}if(b.attributes.style){var d=l.parseCssText(b.attributes.style);d["margin-left"]&&(delete d["margin-left"],b.attributes.style=CKEDITOR.tools.writeCssText(d))}b.name="cke:li"},convertToRealListItems:function(a){var b=[];a.forEach(function(a){"cke:li"==a.name&&
22
- (a.name="li",b.push(a))},CKEDITOR.NODE_ELEMENT,!1);return b},removeSymbolText:function(a){var b,c=a.attributes["cke-symbol"];a.forEach(function(d){!b&&d.value.match(c.replace(")","\\)").replace("(",""))&&(d.value=d.value.replace(c,""),d.parent.getHtml().match(/^(\s|&nbsp;)*$/)&&(b=d.parent!==a?d.parent:null))},CKEDITOR.NODE_TEXT);b&&b.remove()},setListSymbol:function(a,b,c){c=c||1;var d=l.parseCssText(a.attributes.style);if("ol"==a.name){if(a.attributes.type||d["list-style-type"])return;var e={"[ivx]":"lower-roman",
23
- "[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"},h;for(h in e)if(f.getSubsectionSymbol(b).match(new RegExp(h))){d["list-style-type"]=e[h];break}a.attributes["cke-list-style-type"]=d["list-style-type"]}else e={"·":"disc",o:"circle","§":"square"},!d["list-style-type"]&&e[b]&&(d["list-style-type"]=e[b]);f.setListSymbol.removeRedundancies(d,c);(a.attributes.style=CKEDITOR.tools.writeCssText(d))||delete a.attributes.style},setListStart:function(a){for(var b=[],c=0,d=0;d<
24
- a.children.length;d++)b.push(a.children[d].attributes["cke-symbol"]||"");b[0]||c++;switch(a.attributes["cke-list-style-type"]){case "lower-roman":case "upper-roman":a.attributes.start=f.toArabic(f.getSubsectionSymbol(b[c]))-c;break;case "lower-alpha":case "upper-alpha":a.attributes.start=f.getSubsectionSymbol(b[c]).replace(/\W/g,"").toLowerCase().charCodeAt(0)-96-c;break;case "decimal":a.attributes.start=parseInt(f.getSubsectionSymbol(b[c]),10)-c||1}"1"==a.attributes.start&&delete a.attributes.start;
25
- delete a.attributes["cke-list-style-type"]},numbering:{toNumber:function(a,b){function c(a){a=a.toUpperCase();for(var b=1,c=1;0<a.length;c*=26)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.charAt(a.length-1))*c,a=a.substr(0,a.length-1);return b}function d(a){var b=[[1E3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];a=a.toUpperCase();for(var c=b.length,d=0,f=0;f<c;++f)for(var n=b[f],p=n[1].length;a.substr(0,p)==n[1];a=a.substr(p))d+=
26
- n[0];return d}return"decimal"==b?Number(a):"upper-roman"==b||"lower-roman"==b?d(a.toUpperCase()):"lower-alpha"==b||"upper-alpha"==b?c(a):1},getStyle:function(a){a=a.slice(0,1);var b={i:"lower-roman",v:"lower-roman",x:"lower-roman",l:"lower-roman",m:"lower-roman",I:"upper-roman",V:"upper-roman",X:"upper-roman",L:"upper-roman",M:"upper-roman"}[a];b||(b="decimal",a.match(/[a-z]/)&&(b="lower-alpha"),a.match(/[A-Z]/)&&(b="upper-alpha"));return b}},getSubsectionSymbol:function(a){return(a.match(/([\da-zA-Z]+).?$/)||
27
- ["placeholder",1])[1]},setListDir:function(a){var b=0,c=0;a.forEach(function(a){"li"==a.name&&("rtl"==(a.attributes.dir||a.attributes.DIR||"").toLowerCase()?c++:b++)},CKEDITOR.ELEMENT_NODE);c>b&&(a.attributes.dir="rtl")},createList:function(a){return(a.attributes["cke-symbol"].match(/([\da-np-zA-NP-Z]).?/)||[])[1]?new CKEDITOR.htmlParser.element("ol"):new CKEDITOR.htmlParser.element("ul")},createLists:function(a){var b,c,d,e=f.convertToRealListItems(a);if(0===e.length)return[];var h=f.groupLists(e);
28
- for(a=0;a<h.length;a++){var g=h[a],m=g[0];for(d=0;d<g.length;d++)if(1==g[d].attributes["cke-list-level"]){m=g[d];break}var m=[f.createList(m)],k=m[0],n=[m[0]];k.insertBefore(g[0]);for(d=0;d<g.length;d++){b=g[d];for(c=b.attributes["cke-list-level"];c>m.length;){var p=f.createList(b),l=k.children;0<l.length?l[l.length-1].add(p):(l=new CKEDITOR.htmlParser.element("li",{style:"list-style-type:none"}),l.add(p),k.add(l));m.push(p);n.push(p);k=p;c==m.length&&f.setListSymbol(p,b.attributes["cke-symbol"],
29
- c)}for(;c<m.length;)m.pop(),k=m[m.length-1],c==m.length&&f.setListSymbol(k,b.attributes["cke-symbol"],c);b.remove();k.add(b)}m[0].children.length&&(d=m[0].children[0].attributes["cke-symbol"],!d&&1<m[0].children.length&&(d=m[0].children[1].attributes["cke-symbol"]),d&&f.setListSymbol(m[0],d));for(d=0;d<n.length;d++)f.setListStart(n[d]);for(d=0;d<g.length;d++)this.determineListItemValue(g[d])}return e},cleanup:function(a){var b=["cke-list-level","cke-symbol","cke-list-id","cke-indentation","cke-dissolved"],
30
- c,d;for(c=0;c<a.length;c++)for(d=0;d<b.length;d++)delete a[c].attributes[b[d]]},determineListItemValue:function(a){if("ol"===a.parent.name){var b=this.calculateValue(a),c=a.attributes["cke-symbol"].match(/[a-z0-9]+/gi),d;c&&(c=c[c.length-1],d=a.parent.attributes["cke-list-style-type"]||this.numbering.getStyle(c),c=this.numbering.toNumber(c,d),c!==b&&(a.attributes.value=c))}},calculateValue:function(a){if(!a.parent)return 1;var b=a.parent;a=a.getIndex();var c=null,d,e,h;for(h=a;0<=h&&null===c;h--)e=
31
- b.children[h],e.attributes&&void 0!==e.attributes.value&&(d=h,c=parseInt(e.attributes.value,10));null===c&&(c=void 0!==b.attributes.start?parseInt(b.attributes.start,10):1,d=0);return c+(a-d)},dissolveList:function(a){function b(a){return 50<=a?"l"+b(a-50):40<=a?"xl"+b(a-40):10<=a?"x"+b(a-10):9==a?"ix":5<=a?"v"+b(a-5):4==a?"iv":1<=a?"i"+b(a-1):""}function c(a,b){function c(b,d){return b&&b.parent?a(b.parent)?c(b.parent,d+1):c(b.parent,d):d}return c(b,0)}var d=function(a){return function(b){return b.name==
32
- a}},e=function(a){return d("ul")(a)||d("ol")(a)},h=CKEDITOR.tools.array,g=[],f,q;a.forEach(function(a){g.push(a)},CKEDITOR.NODE_ELEMENT,!1);f=h.filter(g,d("li"));var n=h.filter(g,e);h.forEach(n,function(a){var g=a.attributes.type,f=parseInt(a.attributes.start,10)||1,k=c(e,a)+1;g||(g=l.parseCssText(a.attributes.style)["list-style-type"]);h.forEach(h.filter(a.children,d("li")),function(c,d){var e;switch(g){case "disc":e="·";break;case "circle":e="o";break;case "square":e="§";break;case "1":case "decimal":e=
33
- f+d+".";break;case "a":case "lower-alpha":e=String.fromCharCode(97+f-1+d)+".";break;case "A":case "upper-alpha":e=String.fromCharCode(65+f-1+d)+".";break;case "i":case "lower-roman":e=b(f+d)+".";break;case "I":case "upper-roman":e=b(f+d).toUpperCase()+".";break;default:e="ul"==a.name?"·":f+d+"."}c.attributes["cke-symbol"]=e;c.attributes["cke-list-level"]=k})});f=h.reduce(f,function(a,b){var c=b.children[0];if(c&&c.name&&c.attributes.style&&c.attributes.style.match(/mso-list:/i)){k.pushStylesLower(b,
34
- {"list-style-type":!0,display:!0});var d=l.parseCssText(c.attributes.style,!0);k.setStyle(b,"mso-list",d["mso-list"],!0);k.setStyle(c,"mso-list","");delete b["cke-list-level"];(c=d.display?"display":d.DISPLAY?"DISPLAY":"")&&k.setStyle(b,"display",d[c],!0)}if(1===b.children.length&&e(b.children[0]))return a;b.name="p";b.attributes["cke-dissolved"]=!0;a.push(b);return a},[]);for(q=f.length-1;0<=q;q--)f[q].insertAfter(a);for(q=n.length-1;0<=q;q--)delete n[q].name},groupLists:function(a){var b,c,d=[[a[0]]],
35
- e=d[0];c=a[0];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||f.getElementIndentation(c);for(b=1;b<a.length;b++){c=a[b];var h=a[b-1];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||f.getElementIndentation(c);c.previous!==h&&(f.chopDiscontinuousLists(e,d),d.push(e=[]));e.push(c)}f.chopDiscontinuousLists(e,d);return d},chopDiscontinuousLists:function(a,b){for(var c={},d=[[]],e,h=0;h<a.length;h++){var g=c[a[h].attributes["cke-list-level"]],k=this.getListItemInfo(a[h]),
36
- q,n;g?(n=g.type.match(/alpha/)&&7==g.index?"alpha":n,n="o"==a[h].attributes["cke-symbol"]&&14==g.index?"alpha":n,q=f.getSymbolInfo(a[h].attributes["cke-symbol"],n),k=this.getListItemInfo(a[h]),(g.type!=q.type||e&&k.id!=e.id&&!this.isAListContinuation(a[h]))&&d.push([])):q=f.getSymbolInfo(a[h].attributes["cke-symbol"]);for(e=parseInt(a[h].attributes["cke-list-level"],10)+1;20>e;e++)c[e]&&delete c[e];c[a[h].attributes["cke-list-level"]]=q;d[d.length-1].push(a[h]);e=k}[].splice.apply(b,[].concat([l.indexOf(b,
37
- a),1],d))},isAListContinuation:function(a){var b=a;do if((b=b.previous)&&b.type===CKEDITOR.NODE_ELEMENT){if(void 0===b.attributes["cke-list-level"])break;if(b.attributes["cke-list-level"]===a.attributes["cke-list-level"])return b.attributes["cke-list-id"]===a.attributes["cke-list-id"]}while(b);return!1},getElementIndentation:function(a){a=l.parseCssText(a.attributes.style);if(a.margin||a.MARGIN){a.margin=a.margin||a.MARGIN;var b={styles:{margin:a.margin}};CKEDITOR.filter.transformationsTools.splitMarginShorthand(b);
38
- a["margin-left"]=b.styles["margin-left"]}return parseInt(l.convertToPx(a["margin-left"]||"0px"),10)},toArabic:function(a){return a.match(/[ivxl]/i)?a.match(/^l/i)?50+f.toArabic(a.slice(1)):a.match(/^lx/i)?40+f.toArabic(a.slice(1)):a.match(/^x/i)?10+f.toArabic(a.slice(1)):a.match(/^ix/i)?9+f.toArabic(a.slice(2)):a.match(/^v/i)?5+f.toArabic(a.slice(1)):a.match(/^iv/i)?4+f.toArabic(a.slice(2)):a.match(/^i/i)?1+f.toArabic(a.slice(1)):f.toArabic(a.slice(1)):0},getSymbolInfo:function(a,b){var c=a.toUpperCase()==
39
- a?"upper-":"lower-",d={"·":["disc",-1],o:["circle",-2],"§":["square",-3]};if(a in d||b&&b.match(/(disc|circle|square)/))return{index:d[a][1],type:d[a][0]};if(a.match(/\d/))return{index:a?parseInt(f.getSubsectionSymbol(a),10):0,type:"decimal"};a=a.replace(/\W/g,"").toLowerCase();return!b&&a.match(/[ivxl]+/i)||b&&"alpha"!=b||"roman"==b?{index:f.toArabic(a),type:c+"roman"}:a.match(/[a-z]/i)?{index:a.charCodeAt(0)-97,type:c+"alpha"}:{index:-1,type:"disc"}},getListItemInfo:function(a){if(void 0!==a.attributes["cke-list-id"])return{id:a.attributes["cke-list-id"],
40
- level:a.attributes["cke-list-level"]};var b=l.parseCssText(a.attributes.style)["mso-list"],c={id:"0",level:"1"};b&&(b+=" ",c.level=b.match(/level(.+?)\s+/)[1],c.id=b.match(/l(\d+?)\s+/)[1]);a.attributes["cke-list-level"]=void 0!==a.attributes["cke-list-level"]?a.attributes["cke-list-level"]:c.level;a.attributes["cke-list-id"]=c.id;return c}};f=CKEDITOR.plugins.pastefromword.lists;CKEDITOR.plugins.pastefromword.heuristics={isEdgeListItem:function(a,b){return CKEDITOR.env.edge&&a.config.pasteFromWord_heuristicsEdgeList?
41
- b.attributes.style&&!b.attributes.style.match(/mso\-list/)&&!!b.find(function(a){var b=l.parseCssText(a.attributes&&a.attributes.style);if(!b)return!1;var e=b["font-family"]||"";return(b.font||b["font-size"]||"").match(/7pt/i)&&!!a.previous||e.match(/symbol/i)},!0).length:!1},assignListLevels:function(a,b){if(!b.attributes||void 0===b.attributes["cke-list-level"]){for(var c=[f.getElementIndentation(b)],d=[b],e=[],h=CKEDITOR.tools.array,g=h.map;b.next&&b.next.attributes&&!b.next.attributes["cke-list-level"]&&
42
- u.isEdgeListItem(a,b.next);)b=b.next,c.push(f.getElementIndentation(b)),d.push(b);var k=g(c,function(a,b){return 0===b?0:a-c[b-1]}),l=this.guessIndentationStep(h.filter(c,function(a){return 0!==a})),e=g(c,function(a){return Math.round(a/l)});-1!==h.indexOf(e,0)&&(e=g(e,function(a){return a+1}));h.forEach(d,function(a,b){a.attributes["cke-list-level"]=e[b]});return{indents:c,levels:e,diffs:k}}},guessIndentationStep:function(a){return a.length?Math.min.apply(null,a):null}};u=CKEDITOR.plugins.pastefromword.heuristics;
43
- f.setListSymbol.removeRedundancies=function(a,b){(1===b&&"disc"===a["list-style-type"]||"decimal"===a["list-style-type"])&&delete a["list-style-type"]};CKEDITOR.plugins.pastefromword.createAttributeStack=x;CKEDITOR.config.pasteFromWord_heuristicsEdgeList=!0})();
5
+ (function(){function u(){return!1}function x(a,b){var c,d=[];a.filterChildren(b);for(c=a.children.length-1;0<=c;c--)d.unshift(a.children[c]),a.children[c].remove();c=a.attributes;var f=a,e=!0,h;for(h in c)if(e)e=!1;else{var l=new CKEDITOR.htmlParser.element(a.name);l.attributes[h]=c[h];f.add(l);f=l;delete c[h]}for(c=0;c<d.length;c++)f.add(d[c])}var g,k,t,q,n=CKEDITOR.tools,y=["o:p","xml","script","meta","link"],w={},v=0;CKEDITOR.plugins.pastefromword={};CKEDITOR.cleanWord=function(a,b){var c=Boolean(a.match(/mso-list:\s*l\d+\s+level\d+\s+lfo\d+/));
6
+ CKEDITOR.plugins.clipboard.isCustomDataTypesSupported&&(a=CKEDITOR.plugins.pastefromword.styles.inliner.inline(a).getBody().getHtml());a=a.replace(/<!\[/g,"\x3c!--[").replace(/\]>/g,"]--\x3e");var d=CKEDITOR.htmlParser.fragment.fromHtml(a);q=new CKEDITOR.htmlParser.filter({root:function(e){e.filterChildren(q);CKEDITOR.plugins.pastefromword.lists.cleanup(g.createLists(e))},elementNames:[[/^\?xml:namespace$/,""],[/^v:shapetype/,""],[new RegExp(y.join("|")),""]],elements:{a:function(e){if(e.attributes.name){if("_GoBack"==
7
+ e.attributes.name){delete e.name;return}if(e.attributes.name.match(/^OLE_LINK\d+$/)){delete e.name;return}}if(e.attributes.href&&e.attributes.href.match(/#.+$/)){var a=e.attributes.href.match(/#(.+)$/)[1];w[a]=e}e.attributes.name&&w[e.attributes.name]&&(e=w[e.attributes.name],e.attributes.href=e.attributes.href.replace(/.*#(.*)$/,"#$1"))},div:function(e){k.createStyleStack(e,q,b)},img:function(e){if(e.parent&&e.parent.attributes){var a=e.parent.attributes;(a=a.style||a.STYLE)&&a.match(/mso\-list:\s?Ignore/)&&
8
+ (e.attributes["cke-ignored"]=!0)}k.mapStyles(e,{width:function(a){k.setStyle(e,"width",a+"px")},height:function(a){k.setStyle(e,"height",a+"px")}});e.attributes.src&&e.attributes.src.match(/^file:\/\//)&&e.attributes.alt&&e.attributes.alt.match(/^https?:\/\//)&&(e.attributes.src=e.attributes.alt)},p:function(a){a.filterChildren(q);if(a.attributes.style&&a.attributes.style.match(/display:\s*none/i))return!1;if(g.thisIsAListItem(b,a))t.isEdgeListItem(b,a)&&t.cleanupEdgeListItem(a),g.convertToFakeListItem(b,
9
+ a),n.array.reduce(a.children,function(a,b){"p"===b.name&&(0<a&&(new CKEDITOR.htmlParser.element("br")).insertBefore(b),b.replaceWithChildren(),a+=1);return a},0);else{var c=a.getAscendant(function(a){return"ul"==a.name||"ol"==a.name}),d=n.parseCssText(a.attributes.style);c&&!c.attributes["cke-list-level"]&&d["mso-list"]&&d["mso-list"].match(/level/)&&(c.attributes["cke-list-level"]=d["mso-list"].match(/level(\d+)/)[1]);b.config.enterMode==CKEDITOR.ENTER_BR&&(delete a.name,a.add(new CKEDITOR.htmlParser.element("br")))}k.createStyleStack(a,
10
+ q,b)},pre:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h1:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h2:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h3:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h4:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h5:function(a){g.thisIsAListItem(b,
11
+ a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h6:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},font:function(a){if(a.getHtml().match(/^\s*$/))return(new CKEDITOR.htmlParser.text(" ")).insertAfter(a),!1;b&&!0===b.config.pasteFromWordRemoveFontStyles&&a.attributes.size&&delete a.attributes.size;CKEDITOR.dtd.tr[a.parent.name]&&CKEDITOR.tools.arrayCompare(CKEDITOR.tools.objectKeys(a.attributes),["class","style"])?k.createStyleStack(a,q,b):x(a,
12
+ q)},ul:function(a){if(c)return"li"==a.parent.name&&0===n.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),g.dissolveList(a),!1},li:function(a){t.correctLevelShift(a);c&&(a.attributes.style=k.normalizedStyles(a,b),k.pushStylesLower(a))},ol:function(a){if(c)return"li"==a.parent.name&&0===n.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),g.dissolveList(a),!1},span:function(a){a.filterChildren(q);a.attributes.style=k.normalizedStyles(a,b);if(!a.attributes.style||
13
+ a.attributes.style.match(/^mso\-bookmark:OLE_LINK\d+$/)||a.getHtml().match(/^(\s|&nbsp;)+$/)){for(var c=a.children.length-1;0<=c;c--)a.children[c].insertAfter(a);return!1}a.attributes.style.match(/FONT-FAMILY:\s*Symbol/i)&&a.forEach(function(a){a.value=a.value.replace(/&nbsp;/g,"")},CKEDITOR.NODE_TEXT,!0);k.createStyleStack(a,q,b)},table:function(a){a._tdBorders={};a.filterChildren(q);var b,c=0,d;for(d in a._tdBorders)a._tdBorders[d]>c&&(c=a._tdBorders[d],b=d);k.setStyle(a,"border",b);c=(b=a.parent)&&
14
+ b.parent;if(b.name&&"div"===b.name&&b.attributes.align&&1===n.objectKeys(b.attributes).length&&1===b.children.length){a.attributes.align=b.attributes.align;d=b.children.splice(0);a.remove();for(a=d.length-1;0<=a;a--)c.add(d[a],b.getIndex());b.remove()}},td:function(a){var c=a.getAscendant("table"),d=c._tdBorders,f=["border","border-top","border-right","border-bottom","border-left"],c=n.parseCssText(c.attributes.style),m=c.background||c.BACKGROUND;m&&k.setStyle(a,"background",m,!0);(c=c["background-color"]||
15
+ c["BACKGROUND-COLOR"])&&k.setStyle(a,"background-color",c,!0);var c=n.parseCssText(a.attributes.style),p;for(p in c)m=c[p],delete c[p],c[p.toLowerCase()]=m;for(p=0;p<f.length;p++)c[f[p]]&&(m=c[f[p]],d[m]=d[m]?d[m]+1:1);k.createStyleStack(a,q,b,/margin|text\-align|padding|list\-style\-type|width|height|border|white\-space|vertical\-align|background/i)},"v:imagedata":u,"v:shape":function(a){var b=!1;a.parent.getFirst(function(c){"img"==c.name&&c.attributes&&c.attributes["v:shapes"]==a.attributes.id&&
16
+ (b=!0)});if(b)return!1;var c="";a.forEach(function(a){a.attributes&&a.attributes.src&&(c=a.attributes.src)},CKEDITOR.NODE_ELEMENT,!0);a.filterChildren(q);a.name="img";a.attributes.src=a.attributes.src||c;delete a.attributes.type},style:function(){return!1},object:function(a){return!(!a.attributes||!a.attributes.data)}},attributes:{style:function(a,c){return k.normalizedStyles(c,b)||!1},"class":function(a){a=a.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/ig,"");return""===a?!1:a},cellspacing:u,
17
+ cellpadding:u,border:u,"v:shapes":u,"o:spid":u},comment:function(a){a.match(/\[if.* supportFields.*\]/)&&v++;"[endif]"==a&&(v=0<v?v-1:0);return!1},text:function(a,b){if(v)return"";var c=b.parent&&b.parent.parent;return c&&c.attributes&&c.attributes.style&&c.attributes.style.match(/mso-list:\s*ignore/i)?a.replace(/&nbsp;/g," "):a}});var f=new CKEDITOR.htmlParser.basicWriter;q.applyTo(d);d.writeHtml(f);return f.getHtml()};CKEDITOR.plugins.pastefromword.styles={setStyle:function(a,b,c,d){var f=n.parseCssText(a.attributes.style);
18
+ d&&f[b]||(""===c?delete f[b]:f[b]=c,a.attributes.style=CKEDITOR.tools.writeCssText(f))},mapStyles:function(a,b){for(var c in b)if(a.attributes[c]){if("function"===typeof b[c])b[c](a.attributes[c]);else k.setStyle(a,b[c],a.attributes[c]);delete a.attributes[c]}},normalizedStyles:function(a,b){var c="background-color:transparent border-image:none color:windowtext direction:ltr mso- text-indent visibility:visible div:border:none".split(" "),d="font-family font font-size color background-color line-height text-decoration".split(" "),
19
+ f=function(){for(var a=[],b=0;b<arguments.length;b++)arguments[b]&&a.push(arguments[b]);return-1!==n.indexOf(c,a.join(":"))},e=b&&!0===b.config.pasteFromWordRemoveFontStyles,h=n.parseCssText(a.attributes.style);"cke:li"==a.name&&h["TEXT-INDENT"]&&h.MARGIN&&(a.attributes["cke-indentation"]=g.getElementIndentation(a),h.MARGIN=h.MARGIN.replace(/(([\w\.]+ ){3,3})[\d\.]+(\w+$)/,"$10$3"));for(var l=n.objectKeys(h),r=0;r<l.length;r++){var m=l[r].toLowerCase(),p=h[l[r]],k=CKEDITOR.tools.indexOf;(e&&-1!==
20
+ k(d,m.toLowerCase())||f(null,m,p)||f(null,m.replace(/\-.*$/,"-"))||f(null,m)||f(a.name,m,p)||f(a.name,m.replace(/\-.*$/,"-"))||f(a.name,m)||f(p))&&delete h[l[r]]}return CKEDITOR.tools.writeCssText(h)},createStyleStack:function(a,b,c,d){var f=[];a.filterChildren(b);for(b=a.children.length-1;0<=b;b--)f.unshift(a.children[b]),a.children[b].remove();k.sortStyles(a);b=n.parseCssText(k.normalizedStyles(a,c));c=a;var e="span"===a.name,h;for(h in b)if(!h.match(d||/margin|text\-align|width|border|padding/i))if(e)e=
21
+ !1;else{var l=new CKEDITOR.htmlParser.element("span");l.attributes.style=h+":"+b[h];c.add(l);c=l;delete b[h]}CKEDITOR.tools.isEmpty(b)?delete a.attributes.style:a.attributes.style=CKEDITOR.tools.writeCssText(b);for(b=0;b<f.length;b++)c.add(f[b])},sortStyles:function(a){for(var b=["border","border-bottom","font-size","background"],c=n.parseCssText(a.attributes.style),d=n.objectKeys(c),f=[],e=[],h=0;h<d.length;h++)-1!==n.indexOf(b,d[h].toLowerCase())?f.push(d[h]):e.push(d[h]);f.sort(function(a,c){var d=
22
+ n.indexOf(b,a.toLowerCase()),f=n.indexOf(b,c.toLowerCase());return d-f});d=[].concat(f,e);f={};for(h=0;h<d.length;h++)f[d[h]]=c[d[h]];a.attributes.style=CKEDITOR.tools.writeCssText(f)},pushStylesLower:function(a,b,c){if(!a.attributes.style||0===a.children.length)return!1;b=b||{};var d={"list-style-type":!0,width:!0,height:!0,border:!0,"border-":!0},f=n.parseCssText(a.attributes.style),e;for(e in f)if(!(e.toLowerCase()in d||d[e.toLowerCase().replace(/\-.*$/,"-")]||e.toLowerCase()in b)){for(var h=!1,
23
+ l=0;l<a.children.length;l++){var g=a.children[l];if(g.type===CKEDITOR.NODE_TEXT&&c){var m=new CKEDITOR.htmlParser.element("span");m.setHtml(g.value);g.replaceWith(m);g=m}g.type===CKEDITOR.NODE_ELEMENT&&(h=!0,k.setStyle(g,e,f[e]))}h&&delete f[e]}a.attributes.style=CKEDITOR.tools.writeCssText(f);return!0},inliner:{filtered:"break-before break-after break-inside page-break page-break-before page-break-after page-break-inside".split(" "),parse:function(a){function b(a){var b=new CKEDITOR.dom.element("style"),
24
+ c=new CKEDITOR.dom.element("iframe");c.hide();CKEDITOR.document.getBody().append(c);c.$.contentDocument.documentElement.appendChild(b.$);b.$.textContent=a;c.remove();return b.$.sheet}function c(a){var b=a.indexOf("{"),c=a.indexOf("}");return d(a.substring(b+1,c),!0)}var d=CKEDITOR.tools.parseCssText,f=CKEDITOR.plugins.pastefromword.styles.inliner.filter,e=a.is?a.$.sheet:b(a);a=[];var h;if(e)for(e=e.cssRules,h=0;h<e.length;h++)e[h].type===window.CSSRule.STYLE_RULE&&a.push({selector:e[h].selectorText,
25
+ styles:f(c(e[h].cssText))});return a},filter:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.filtered,c=n.array.indexOf,d={},f;for(f in a)-1===c(b,f)&&(d[f]=a[f]);return d},sort:function(a){return a.sort(function(a){var c=CKEDITOR.tools.array.map(a,function(a){return a.selector});return function(a,b){var e=-1!==(""+a.selector).indexOf(".")?1:0,e=(-1!==(""+b.selector).indexOf(".")?1:0)-e;return 0!==e?e:c.indexOf(b.selector)-c.indexOf(a.selector)}}(a))},inline:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.parse,
26
+ c=CKEDITOR.plugins.pastefromword.styles.inliner.sort,d=function(a){a=(new DOMParser).parseFromString(a,"text/html");return new CKEDITOR.dom.document(a)}(a);a=d.find("style");c=c(function(a){var c=[],d;for(d=0;d<a.count();d++)c=c.concat(b(a.getItem(d)));return c}(a));CKEDITOR.tools.array.forEach(c,function(a){var b=a.styles;a=d.find(a.selector);var c,g,r;for(r=0;r<a.count();r++)c=a.getItem(r),g=CKEDITOR.tools.parseCssText(c.getAttribute("style")),g=CKEDITOR.tools.extend({},g,b),c.setAttribute("style",
27
+ CKEDITOR.tools.writeCssText(g))});return d}}};k=CKEDITOR.plugins.pastefromword.styles;CKEDITOR.plugins.pastefromword.lists={thisIsAListItem:function(a,b){return t.isEdgeListItem(a,b)||b.attributes.style&&b.attributes.style.match(/mso\-list:\s?l\d/)&&"li"!==b.parent.name||b.attributes["cke-dissolved"]||b.getHtml().match(/<!\-\-\[if !supportLists]\-\->/)?!0:!1},convertToFakeListItem:function(a,b){t.isDegenerateListItem(a,b)&&t.assignListLevels(a,b);this.getListItemInfo(b);if(!b.attributes["cke-dissolved"]){var c;
28
+ b.forEach(function(a){!c&&"img"==a.name&&a.attributes["cke-ignored"]&&"*"==a.attributes.alt&&(c="·",a.remove())},CKEDITOR.NODE_ELEMENT);b.forEach(function(a){c||a.value.match(/^ /)||(c=a.value)},CKEDITOR.NODE_TEXT);if("undefined"==typeof c)return;b.attributes["cke-symbol"]=c.replace(/(?: |&nbsp;).*$/,"");g.removeSymbolText(b)}if(b.attributes.style){var d=n.parseCssText(b.attributes.style);d["margin-left"]&&(delete d["margin-left"],b.attributes.style=CKEDITOR.tools.writeCssText(d))}b.name="cke:li"},
29
+ convertToRealListItems:function(a){var b=[];a.forEach(function(a){"cke:li"==a.name&&(a.name="li",b.push(a))},CKEDITOR.NODE_ELEMENT,!1);return b},removeSymbolText:function(a){var b,c=a.attributes["cke-symbol"];a.forEach(function(d){!b&&d.value.match(c.replace(")","\\)").replace("(",""))&&(d.value=d.value.replace(c,""),d.parent.getHtml().match(/^(\s|&nbsp;)*$/)&&(b=d.parent!==a?d.parent:null))},CKEDITOR.NODE_TEXT);b&&b.remove()},setListSymbol:function(a,b,c){c=c||1;var d=n.parseCssText(a.attributes.style);
30
+ if("ol"==a.name){if(a.attributes.type||d["list-style-type"])return;var f={"[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"},e;for(e in f)if(g.getSubsectionSymbol(b).match(new RegExp(e))){d["list-style-type"]=f[e];break}a.attributes["cke-list-style-type"]=d["list-style-type"]}else f={"·":"disc",o:"circle","§":"square"},!d["list-style-type"]&&f[b]&&(d["list-style-type"]=f[b]);g.setListSymbol.removeRedundancies(d,c);(a.attributes.style=CKEDITOR.tools.writeCssText(d))||
31
+ delete a.attributes.style},setListStart:function(a){for(var b=[],c=0,d=0;d<a.children.length;d++)b.push(a.children[d].attributes["cke-symbol"]||"");b[0]||c++;switch(a.attributes["cke-list-style-type"]){case "lower-roman":case "upper-roman":a.attributes.start=g.toArabic(g.getSubsectionSymbol(b[c]))-c;break;case "lower-alpha":case "upper-alpha":a.attributes.start=g.getSubsectionSymbol(b[c]).replace(/\W/g,"").toLowerCase().charCodeAt(0)-96-c;break;case "decimal":a.attributes.start=parseInt(g.getSubsectionSymbol(b[c]),
32
+ 10)-c||1}"1"==a.attributes.start&&delete a.attributes.start;delete a.attributes["cke-list-style-type"]},numbering:{toNumber:function(a,b){function c(a){a=a.toUpperCase();for(var b=1,c=1;0<a.length;c*=26)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.charAt(a.length-1))*c,a=a.substr(0,a.length-1);return b}function d(a){var b=[[1E3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];a=a.toUpperCase();for(var c=b.length,d=0,g=0;g<c;++g)for(var m=
33
+ b[g],p=m[1].length;a.substr(0,p)==m[1];a=a.substr(p))d+=m[0];return d}return"decimal"==b?Number(a):"upper-roman"==b||"lower-roman"==b?d(a.toUpperCase()):"lower-alpha"==b||"upper-alpha"==b?c(a):1},getStyle:function(a){a=a.slice(0,1);var b={i:"lower-roman",v:"lower-roman",x:"lower-roman",l:"lower-roman",m:"lower-roman",I:"upper-roman",V:"upper-roman",X:"upper-roman",L:"upper-roman",M:"upper-roman"}[a];b||(b="decimal",a.match(/[a-z]/)&&(b="lower-alpha"),a.match(/[A-Z]/)&&(b="upper-alpha"));return b}},
34
+ getSubsectionSymbol:function(a){return(a.match(/([\da-zA-Z]+).?$/)||["placeholder","1"])[1]},setListDir:function(a){var b=0,c=0;a.forEach(function(a){"li"==a.name&&("rtl"==(a.attributes.dir||a.attributes.DIR||"").toLowerCase()?c++:b++)},CKEDITOR.ELEMENT_NODE);c>b&&(a.attributes.dir="rtl")},createList:function(a){return(a.attributes["cke-symbol"].match(/([\da-np-zA-NP-Z]).?/)||[])[1]?new CKEDITOR.htmlParser.element("ol"):new CKEDITOR.htmlParser.element("ul")},createLists:function(a){var b,c,d,f=g.convertToRealListItems(a);
35
+ if(0===f.length)return[];var e=g.groupLists(f);for(a=0;a<e.length;a++){var h=e[a],l=h[0];for(d=0;d<h.length;d++)if(1==h[d].attributes["cke-list-level"]){l=h[d];break}var l=[g.createList(l)],k=l[0],m=[l[0]];k.insertBefore(h[0]);for(d=0;d<h.length;d++){b=h[d];for(c=b.attributes["cke-list-level"];c>l.length;){var p=g.createList(b),n=k.children;0<n.length?n[n.length-1].add(p):(n=new CKEDITOR.htmlParser.element("li",{style:"list-style-type:none"}),n.add(p),k.add(n));l.push(p);m.push(p);k=p;c==l.length&&
36
+ g.setListSymbol(p,b.attributes["cke-symbol"],c)}for(;c<l.length;)l.pop(),k=l[l.length-1],c==l.length&&g.setListSymbol(k,b.attributes["cke-symbol"],c);b.remove();k.add(b)}l[0].children.length&&(d=l[0].children[0].attributes["cke-symbol"],!d&&1<l[0].children.length&&(d=l[0].children[1].attributes["cke-symbol"]),d&&g.setListSymbol(l[0],d));for(d=0;d<m.length;d++)g.setListStart(m[d]);for(d=0;d<h.length;d++)this.determineListItemValue(h[d])}return f},cleanup:function(a){var b=["cke-list-level","cke-symbol",
37
+ "cke-list-id","cke-indentation","cke-dissolved"],c,d;for(c=0;c<a.length;c++)for(d=0;d<b.length;d++)delete a[c].attributes[b[d]]},determineListItemValue:function(a){if("ol"===a.parent.name){var b=this.calculateValue(a),c=a.attributes["cke-symbol"].match(/[a-z0-9]+/gi),d;c&&(c=c[c.length-1],d=a.parent.attributes["cke-list-style-type"]||this.numbering.getStyle(c),c=this.numbering.toNumber(c,d),c!==b&&(a.attributes.value=c))}},calculateValue:function(a){if(!a.parent)return 1;var b=a.parent;a=a.getIndex();
38
+ var c=null,d,f,e;for(e=a;0<=e&&null===c;e--)f=b.children[e],f.attributes&&void 0!==f.attributes.value&&(d=e,c=parseInt(f.attributes.value,10));null===c&&(c=void 0!==b.attributes.start?parseInt(b.attributes.start,10):1,d=0);return c+(a-d)},dissolveList:function(a){function b(a){return 50<=a?"l"+b(a-50):40<=a?"xl"+b(a-40):10<=a?"x"+b(a-10):9==a?"ix":5<=a?"v"+b(a-5):4==a?"iv":1<=a?"i"+b(a-1):""}function c(a,b){function c(b,d){return b&&b.parent?a(b.parent)?c(b.parent,d+1):c(b.parent,d):d}return c(b,
39
+ 0)}var d=function(a){return function(b){return b.name==a}},f=function(a){return d("ul")(a)||d("ol")(a)},e=CKEDITOR.tools.array,g=[],l,r;a.forEach(function(a){g.push(a)},CKEDITOR.NODE_ELEMENT,!1);l=e.filter(g,d("li"));var m=e.filter(g,f);e.forEach(m,function(a){var g=a.attributes.type,h=parseInt(a.attributes.start,10)||1,m=c(f,a)+1;g||(g=n.parseCssText(a.attributes.style)["list-style-type"]);e.forEach(e.filter(a.children,d("li")),function(c,d){var e;switch(g){case "disc":e="·";break;case "circle":e=
40
+ "o";break;case "square":e="§";break;case "1":case "decimal":e=h+d+".";break;case "a":case "lower-alpha":e=String.fromCharCode(97+h-1+d)+".";break;case "A":case "upper-alpha":e=String.fromCharCode(65+h-1+d)+".";break;case "i":case "lower-roman":e=b(h+d)+".";break;case "I":case "upper-roman":e=b(h+d).toUpperCase()+".";break;default:e="ul"==a.name?"·":h+d+"."}c.attributes["cke-symbol"]=e;c.attributes["cke-list-level"]=m})});l=e.reduce(l,function(a,b){var c=b.children[0];if(c&&c.name&&c.attributes.style&&
41
+ c.attributes.style.match(/mso-list:/i)){k.pushStylesLower(b,{"list-style-type":!0,display:!0});var d=n.parseCssText(c.attributes.style,!0);k.setStyle(b,"mso-list",d["mso-list"],!0);k.setStyle(c,"mso-list","");delete b["cke-list-level"];(c=d.display?"display":d.DISPLAY?"DISPLAY":"")&&k.setStyle(b,"display",d[c],!0)}if(1===b.children.length&&f(b.children[0]))return a;b.name="p";b.attributes["cke-dissolved"]=!0;a.push(b);return a},[]);for(r=l.length-1;0<=r;r--)l[r].insertAfter(a);for(r=m.length-1;0<=
42
+ r;r--)delete m[r].name},groupLists:function(a){var b,c,d=[[a[0]]],f=d[0];c=a[0];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||g.getElementIndentation(c);for(b=1;b<a.length;b++){c=a[b];var e=a[b-1];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||g.getElementIndentation(c);c.previous!==e&&(g.chopDiscontinuousLists(f,d),d.push(f=[]));f.push(c)}g.chopDiscontinuousLists(f,d);return d},chopDiscontinuousLists:function(a,b){for(var c={},d=[[]],f,e=0;e<a.length;e++){var h=
43
+ c[a[e].attributes["cke-list-level"]],l=this.getListItemInfo(a[e]),k,m;h?(m=h.type.match(/alpha/)&&7==h.index?"alpha":m,m="o"==a[e].attributes["cke-symbol"]&&14==h.index?"alpha":m,k=g.getSymbolInfo(a[e].attributes["cke-symbol"],m),l=this.getListItemInfo(a[e]),(h.type!=k.type||f&&l.id!=f.id&&!this.isAListContinuation(a[e]))&&d.push([])):k=g.getSymbolInfo(a[e].attributes["cke-symbol"]);for(f=parseInt(a[e].attributes["cke-list-level"],10)+1;20>f;f++)c[f]&&delete c[f];c[a[e].attributes["cke-list-level"]]=
44
+ k;d[d.length-1].push(a[e]);f=l}[].splice.apply(b,[].concat([n.indexOf(b,a),1],d))},isAListContinuation:function(a){var b=a;do if((b=b.previous)&&b.type===CKEDITOR.NODE_ELEMENT){if(void 0===b.attributes["cke-list-level"])break;if(b.attributes["cke-list-level"]===a.attributes["cke-list-level"])return b.attributes["cke-list-id"]===a.attributes["cke-list-id"]}while(b);return!1},getElementIndentation:function(a){a=n.parseCssText(a.attributes.style);if(a.margin||a.MARGIN){a.margin=a.margin||a.MARGIN;var b=
45
+ {styles:{margin:a.margin}};CKEDITOR.filter.transformationsTools.splitMarginShorthand(b);a["margin-left"]=b.styles["margin-left"]}return parseInt(n.convertToPx(a["margin-left"]||"0px"),10)},toArabic:function(a){return a.match(/[ivxl]/i)?a.match(/^l/i)?50+g.toArabic(a.slice(1)):a.match(/^lx/i)?40+g.toArabic(a.slice(1)):a.match(/^x/i)?10+g.toArabic(a.slice(1)):a.match(/^ix/i)?9+g.toArabic(a.slice(2)):a.match(/^v/i)?5+g.toArabic(a.slice(1)):a.match(/^iv/i)?4+g.toArabic(a.slice(2)):a.match(/^i/i)?1+g.toArabic(a.slice(1)):
46
+ g.toArabic(a.slice(1)):0},getSymbolInfo:function(a,b){var c=a.toUpperCase()==a?"upper-":"lower-",d={"·":["disc",-1],o:["circle",-2],"§":["square",-3]};if(a in d||b&&b.match(/(disc|circle|square)/))return{index:d[a][1],type:d[a][0]};if(a.match(/\d/))return{index:a?parseInt(g.getSubsectionSymbol(a),10):0,type:"decimal"};a=a.replace(/\W/g,"").toLowerCase();return!b&&a.match(/[ivxl]+/i)||b&&"alpha"!=b||"roman"==b?{index:g.toArabic(a),type:c+"roman"}:a.match(/[a-z]/i)?{index:a.charCodeAt(0)-97,type:c+
47
+ "alpha"}:{index:-1,type:"disc"}},getListItemInfo:function(a){if(void 0!==a.attributes["cke-list-id"])return{id:a.attributes["cke-list-id"],level:a.attributes["cke-list-level"]};var b=n.parseCssText(a.attributes.style)["mso-list"],c={id:"0",level:"1"};b&&(b+=" ",c.level=b.match(/level(.+?)\s+/)[1],c.id=b.match(/l(\d+?)\s+/)[1]);a.attributes["cke-list-level"]=void 0!==a.attributes["cke-list-level"]?a.attributes["cke-list-level"]:c.level;a.attributes["cke-list-id"]=c.id;return c}};g=CKEDITOR.plugins.pastefromword.lists;
48
+ CKEDITOR.plugins.pastefromword.heuristics={isEdgeListItem:function(a,b){if(!CKEDITOR.env.edge||!a.config.pasteFromWord_heuristicsEdgeList)return!1;var c="";b.forEach&&b.forEach(function(a){c+=a.value},CKEDITOR.NODE_TEXT);return c.match(/^(?: |&nbsp;)*\(?[a-zA-Z0-9]+?[\.\)](?: |&nbsp;){2,}/)?!0:t.isDegenerateListItem(a,b)},cleanupEdgeListItem:function(a){var b=!1;a.forEach(function(a){b||(a.value=a.value.replace(/^(?:&nbsp;|[\s])+/,""),a.value.length&&(b=!0))},CKEDITOR.NODE_TEXT)},isDegenerateListItem:function(a,
49
+ b){return!!b.attributes["cke-list-level"]||b.attributes.style&&!b.attributes.style.match(/mso\-list/)&&!!b.find(function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&b.name.match(/h\d/i)&&a.getHtml().match(/^[a-zA-Z0-9]+?[\.\)]$/))return!0;var d=n.parseCssText(a.attributes&&a.attributes.style,!0);if(!d)return!1;var f=d["font-family"]||"";return(d.font||d["font-size"]||"").match(/7pt/i)&&!!a.previous||f.match(/symbol/i)},!0).length},assignListLevels:function(a,b){if(!b.attributes||void 0===b.attributes["cke-list-level"]){for(var c=
50
+ [g.getElementIndentation(b)],d=[b],f=[],e=CKEDITOR.tools.array,h=e.map;b.next&&b.next.attributes&&!b.next.attributes["cke-list-level"]&&t.isDegenerateListItem(a,b.next);)b=b.next,c.push(g.getElementIndentation(b)),d.push(b);var k=h(c,function(a,b){return 0===b?0:a-c[b-1]}),n=this.guessIndentationStep(e.filter(c,function(a){return 0!==a})),f=h(c,function(a){return Math.round(a/n)});-1!==e.indexOf(f,0)&&(f=h(f,function(a){return a+1}));e.forEach(d,function(a,b){a.attributes["cke-list-level"]=f[b]});
51
+ return{indents:c,levels:f,diffs:k}}},guessIndentationStep:function(a){return a.length?Math.min.apply(null,a):null},correctLevelShift:function(a){if(this.isShifted(a)){var b=CKEDITOR.tools.array.filter(a.children,function(a){return"ul"==a.name||"ol"==a.name}),c=CKEDITOR.tools.array.reduce(b,function(a,b){return(b.children&&1==b.children.length&&t.isShifted(b.children[0])?[b]:b.children).concat(a)},[]);CKEDITOR.tools.array.forEach(b,function(a){a.remove()});CKEDITOR.tools.array.forEach(c,function(b){a.add(b,
52
+ 0)});delete a.name}},isShifted:function(a){return"li"!==a.name?!1:0===CKEDITOR.tools.array.filter(a.children,function(a){return a.name&&("ul"==a.name||"ol"==a.name||"p"==a.name&&0===a.children.length)?!1:!0}).length}};t=CKEDITOR.plugins.pastefromword.heuristics;g.setListSymbol.removeRedundancies=function(a,b){(1===b&&"disc"===a["list-style-type"]||"decimal"===a["list-style-type"])&&delete a["list-style-type"]};CKEDITOR.plugins.pastefromword.createAttributeStack=x;CKEDITOR.config.pasteFromWord_heuristicsEdgeList=
53
+ !0})();
@@ -0,0 +1,23 @@
1
+ div.cke_dialog_ui_scaytItemList {
2
+ border: 1px solid #c9cccf;
3
+ }
4
+
5
+ .cke_scaytItemList-child {
6
+ position: relative;
7
+ padding: 6px 30px 6px 5px;
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ white-space: nowrap;
11
+ }
12
+
13
+ .cke_scaytItemList-child:hover {
14
+ background: #ebebeb;
15
+ }
16
+
17
+ .cke_scaytItemList-child .cke_scaytItemList_remove {
18
+ position: absolute;
19
+ top: 0;
20
+ right: 5px;
21
+ width: 26px;
22
+ height: 26px;
23
+ }
@@ -1,19 +1,33 @@
1
- CKEDITOR.dialog.add("scaytDialog",function(d){var f=d.scayt,p='\x3cp\x3e\x3cimg src\x3d"'+f.getLogo()+'" /\x3e\x3c/p\x3e\x3cp\x3e'+f.getLocal("version")+f.getVersion()+"\x3c/p\x3e\x3cp\x3e"+f.getLocal("text_copyrights")+"\x3c/p\x3e",q=CKEDITOR.document,l={isChanged:function(){return null===this.newLang||this.currentLang===this.newLang?!1:!0},currentLang:f.getLang(),newLang:null,reset:function(){this.currentLang=f.getLang();this.newLang=null},id:"lang"},p=[{id:"options",label:f.getLocal("tab_options"),
2
- onShow:function(){},elements:[{type:"vbox",id:"scaytOptions",children:function(){var a=f.getApplicationConfig(),b=[],e={"ignore-all-caps-words":"label_allCaps","ignore-domain-names":"label_ignoreDomainNames","ignore-words-with-mixed-cases":"label_mixedCase","ignore-words-with-numbers":"label_mixedWithDigits"},h;for(h in a)a={type:"checkbox"},a.id=h,a.label=f.getLocal(e[h]),b.push(a);return b}(),onShow:function(){this.getChild();for(var a=d.scayt,b=0;b<this.getChild().length;b++)this.getChild()[b].setValue(a.getApplicationConfig()[this.getChild()[b].id])}}]},
3
- {id:"langs",label:f.getLocal("tab_languages"),elements:[{id:"leftLangColumn",type:"vbox",align:"left",widths:["100"],children:[{type:"html",id:"langBox",style:"overflow: hidden; white-space: normal;margin-bottom:15px;",html:'\x3cdiv\x3e\x3cdiv style\x3d"float:left;width:45%;margin-left:5px;" id\x3d"left-col-'+d.name+'" class\x3d"scayt-lang-list"\x3e\x3c/div\x3e\x3cdiv style\x3d"float:left;width:45%;margin-left:15px;" id\x3d"right-col-'+d.name+'" class\x3d"scayt-lang-list"\x3e\x3c/div\x3e\x3c/div\x3e',
4
- onShow:function(){var a=d.scayt.getLang();q.getById("scaytLang_"+d.name+"_"+a).$.checked=!0}},{type:"html",id:"graytLanguagesHint",html:'\x3cdiv style\x3d"margin:5px auto; width:95%;white-space:normal;" id\x3d"'+d.name+'graytLanguagesHint"\x3e\x3cspan style\x3d"width:10px;height:10px;display: inline-block; background:#02b620;vertical-align:top;margin-top:2px;"\x3e\x3c/span\x3e - This languages are supported by Grammar As You Type(GRAYT).\x3c/div\x3e',onShow:function(){var a=q.getById(d.name+"graytLanguagesHint");
5
- d.config.grayt_autoStartup||(a.$.style.display="none")}}]}]},{id:"dictionaries",label:f.getLocal("tab_dictionaries"),elements:[{type:"vbox",id:"rightCol_col__left",children:[{type:"html",id:"dictionaryNote",html:""},{type:"text",id:"dictionaryName",label:f.getLocal("label_fieldNameDic")||"Dictionary name",onShow:function(a){var b=a.sender,e=d.scayt;setTimeout(function(){b.getContentElement("dictionaries","dictionaryNote").getElement().setText("");null!=e.getUserDictionaryName()&&""!=e.getUserDictionaryName()&&
6
- b.getContentElement("dictionaries","dictionaryName").setValue(e.getUserDictionaryName())},0)}},{type:"hbox",id:"notExistDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"createDic",label:f.getLocal("btn_createDic"),title:f.getLocal("btn_createDic"),onClick:function(){var a=this.getDialog(),b=n,e=d.scayt,h=a.getContentElement("dictionaries","dictionaryName").getValue();e.createUserDictionary(h,function(c){c.error||b.toggleDictionaryButtons.call(a,!0);c.dialog=
7
- a;c.command="create";c.name=h;d.fire("scaytUserDictionaryAction",c)},function(c){c.dialog=a;c.command="create";c.name=h;d.fire("scaytUserDictionaryActionError",c)})}},{type:"button",id:"restoreDic",label:f.getLocal("btn_restoreDic"),title:f.getLocal("btn_restoreDic"),onClick:function(){var a=this.getDialog(),b=d.scayt,e=n,h=a.getContentElement("dictionaries","dictionaryName").getValue();b.restoreUserDictionary(h,function(c){c.dialog=a;c.error||e.toggleDictionaryButtons.call(a,!0);c.command="restore";
8
- c.name=h;d.fire("scaytUserDictionaryAction",c)},function(c){c.dialog=a;c.command="restore";c.name=h;d.fire("scaytUserDictionaryActionError",c)})}}]},{type:"hbox",id:"existDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"removeDic",label:f.getLocal("btn_deleteDic"),title:f.getLocal("btn_deleteDic"),onClick:function(){var a=this.getDialog(),b=d.scayt,e=n,h=a.getContentElement("dictionaries","dictionaryName"),c=h.getValue();b.removeUserDictionary(c,function(b){h.setValue("");
9
- b.error||e.toggleDictionaryButtons.call(a,!1);b.dialog=a;b.command="remove";b.name=c;d.fire("scaytUserDictionaryAction",b)},function(b){b.dialog=a;b.command="remove";b.name=c;d.fire("scaytUserDictionaryActionError",b)})}},{type:"button",id:"renameDic",label:f.getLocal("btn_renameDic"),title:f.getLocal("btn_renameDic"),onClick:function(){var a=this.getDialog(),b=d.scayt,e=a.getContentElement("dictionaries","dictionaryName").getValue();b.renameUserDictionary(e,function(b){b.dialog=a;b.command="rename";
10
- b.name=e;d.fire("scaytUserDictionaryAction",b)},function(b){b.dialog=a;b.command="rename";b.name=e;d.fire("scaytUserDictionaryActionError",b)})}}]},{type:"html",id:"dicInfo",html:'\x3cdiv id\x3d"dic_info_editor1" style\x3d"margin:5px auto; width:95%;white-space:normal;"\x3e'+f.getLocal("text_descriptionDic")+"\x3c/div\x3e"}]}]},{id:"about",label:f.getLocal("tab_about"),elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'\x3cdiv\x3e\x3cdiv id\x3d"scayt_about_"\x3e'+p+"\x3c/div\x3e\x3c/div\x3e"}]}];
11
- d.on("scaytUserDictionaryAction",function(a){var b=SCAYT.prototype.UILib,e=a.data.dialog,d=e.getContentElement("dictionaries","dictionaryNote").getElement(),c=a.editor.scayt,g;void 0===a.data.error?(g=c.getLocal("message_success_"+a.data.command+"Dic"),g=g.replace("%s",a.data.name),d.setText(g),b.css(d.$,{color:"blue"})):(""===a.data.name?d.setText(c.getLocal("message_info_emptyDic")):(g=c.getLocal("message_error_"+a.data.command+"Dic"),g=g.replace("%s",a.data.name),d.setText(g)),b.css(d.$,{color:"red"}),
12
- null!=c.getUserDictionaryName()&&""!=c.getUserDictionaryName()?e.getContentElement("dictionaries","dictionaryName").setValue(c.getUserDictionaryName()):e.getContentElement("dictionaries","dictionaryName").setValue(""))});d.on("scaytUserDictionaryActionError",function(a){var b=SCAYT.prototype.UILib,e=a.data.dialog,d=e.getContentElement("dictionaries","dictionaryNote").getElement(),c=a.editor.scayt,g;""===a.data.name?d.setText(c.getLocal("message_info_emptyDic")):(g=c.getLocal("message_error_"+a.data.command+
13
- "Dic"),g=g.replace("%s",a.data.name),d.setText(g));b.css(d.$,{color:"red"});null!=c.getUserDictionaryName()&&""!=c.getUserDictionaryName()?e.getContentElement("dictionaries","dictionaryName").setValue(c.getUserDictionaryName()):e.getContentElement("dictionaries","dictionaryName").setValue("")});var n={title:f.getLocal("text_title"),resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:"moono-lisa"==(CKEDITOR.skinName||d.config.skin)?450:340,minHeight:260,onLoad:function(){if(0!=d.config.scayt_uiTabs[1]){var a=
14
- n,b=a.getLangBoxes.call(this);b.getParent().setStyle("white-space","normal");a.renderLangList(b);this.definition.minWidth=this.getSize().width;this.resize(this.definition.minWidth,this.definition.minHeight)}},onCancel:function(){l.reset()},onHide:function(){d.unlockSelection()},onShow:function(){d.fire("scaytDialogShown",this);if(0!=d.config.scayt_uiTabs[2]){var a=d.scayt,b=this.getContentElement("dictionaries","dictionaryName"),e=this.getContentElement("dictionaries","existDic").getElement().getParent(),
15
- h=this.getContentElement("dictionaries","notExistDic").getElement().getParent();e.hide();h.hide();null!=a.getUserDictionaryName()&&""!=a.getUserDictionaryName()?(this.getContentElement("dictionaries","dictionaryName").setValue(a.getUserDictionaryName()),e.show()):(b.setValue(""),h.show())}},onOk:function(){var a=n,b=d.scayt;this.getContentElement("options","scaytOptions");a=a.getChangedOption.call(this);b.commitOption({changedOptions:a})},toggleDictionaryButtons:function(a){var b=this.getContentElement("dictionaries",
16
- "existDic").getElement().getParent(),d=this.getContentElement("dictionaries","notExistDic").getElement().getParent();a?(b.show(),d.hide()):(b.hide(),d.show())},getChangedOption:function(){var a={};if(1==d.config.scayt_uiTabs[0])for(var b=this.getContentElement("options","scaytOptions").getChild(),e=0;e<b.length;e++)b[e].isChanged()&&(a[b[e].id]=b[e].getValue());l.isChanged()&&(a[l.id]=d.config.scayt_sLang=l.currentLang=l.newLang);return a},buildRadioInputs:function(a,b,e){var h=new CKEDITOR.dom.element("div"),
17
- c="scaytLang_"+d.name+"_"+b,g=CKEDITOR.dom.element.createFromHtml('\x3cinput id\x3d"'+c+'" type\x3d"radio" value\x3d"'+b+'" name\x3d"scayt_lang" /\x3e'),f=new CKEDITOR.dom.element("label"),m=d.scayt;h.setStyles({"white-space":"normal",position:"relative","padding-bottom":"2px"});g.on("click",function(a){l.newLang=a.sender.getValue()});f.appendText(a);f.setAttribute("for",c);e&&d.config.grayt_autoStartup&&f.setStyles({color:"#02b620"});h.append(g);h.append(f);b===m.getLang()&&(g.setAttribute("checked",
18
- !0),g.setAttribute("defaultChecked","defaultChecked"));return h},renderLangList:function(a){var b=a.find("#left-col-"+d.name).getItem(0);a=a.find("#right-col-"+d.name).getItem(0);var e=f.getScaytLangList(),h=f.getGraytLangList(),c={},g=[],l=0,m=!1,k;for(k in e.ltr)c[k]=e.ltr[k];for(k in e.rtl)c[k]=e.rtl[k];for(k in c)g.push([k,c[k]]);g.sort(function(a,b){var c=0;a[1]>b[1]?c=1:a[1]<b[1]&&(c=-1);return c});c={};for(m=0;m<g.length;m++)c[g[m][0]]=g[m][1];g=Math.round(g.length/2);for(k in c)l++,m=k in
19
- h.ltr||k in h.rtl,this.buildRadioInputs(c[k],k,m).appendTo(l<=g?b:a)},getLangBoxes:function(){return this.getContentElement("langs","langBox").getElement()},contents:function(a,b){var d=[],f=b.config.scayt_uiTabs;if(f){for(var c in f)1==f[c]&&d.push(a[c]);d.push(a[a.length-1])}else return a;return d}(p,d)};return n});
1
+ CKEDITOR.dialog.add("scaytDialog",function(c){var d=c.scayt,k='\x3cp\x3e\x3cimg src\x3d"'+d.getLogo()+'" /\x3e\x3c/p\x3e\x3cp\x3e'+d.getLocal("version")+d.getVersion()+"\x3c/p\x3e\x3cp\x3e"+d.getLocal("text_copyrights")+"\x3c/p\x3e",n=CKEDITOR.document,p={isChanged:function(){return null===this.newLang||this.currentLang===this.newLang?!1:!0},currentLang:d.getLang(),newLang:null,reset:function(){this.currentLang=d.getLang();this.newLang=null},id:"lang"},k=[{id:"options",label:d.getLocal("tab_options"),
2
+ onShow:function(){},elements:[{type:"vbox",id:"scaytOptions",children:function(){var b=d.getApplicationConfig(),a=[],c={"ignore-all-caps-words":"label_allCaps","ignore-domain-names":"label_ignoreDomainNames","ignore-words-with-mixed-cases":"label_mixedCase","ignore-words-with-numbers":"label_mixedWithDigits"},f;for(f in b)b={type:"checkbox"},b.id=f,b.label=d.getLocal(c[f]),a.push(b);return a}(),onShow:function(){this.getChild();for(var b=c.scayt,a=0;a<this.getChild().length;a++)this.getChild()[a].setValue(b.getApplicationConfig()[this.getChild()[a].id])}}]},
3
+ {id:"langs",label:d.getLocal("tab_languages"),elements:[{id:"leftLangColumn",type:"vbox",align:"left",widths:["100"],children:[{type:"html",id:"langBox",style:"overflow: hidden; white-space: normal;margin-bottom:15px;",html:'\x3cdiv\x3e\x3cdiv style\x3d"float:left;width:45%;margin-left:5px;" id\x3d"left-col-'+c.name+'" class\x3d"scayt-lang-list"\x3e\x3c/div\x3e\x3cdiv style\x3d"float:left;width:45%;margin-left:15px;" id\x3d"right-col-'+c.name+'" class\x3d"scayt-lang-list"\x3e\x3c/div\x3e\x3c/div\x3e',
4
+ onShow:function(){var b=c.scayt.getLang();n.getById("scaytLang_"+c.name+"_"+b).$.checked=!0}},{type:"html",id:"graytLanguagesHint",html:'\x3cdiv style\x3d"margin:5px auto; width:95%;white-space:normal;" id\x3d"'+c.name+'graytLanguagesHint"\x3e\x3cspan style\x3d"width:10px;height:10px;display: inline-block; background:#02b620;vertical-align:top;margin-top:2px;"\x3e\x3c/span\x3e - This languages are supported by Grammar As You Type(GRAYT).\x3c/div\x3e',onShow:function(){var b=n.getById(c.name+"graytLanguagesHint");
5
+ c.config.grayt_autoStartup||(b.$.style.display="none")}}]}]},{id:"dictionaries",label:d.getLocal("tab_dictionaries"),elements:[{type:"vbox",id:"rightCol_col__left",children:[{type:"html",id:"dictionaryNote",html:""},{type:"text",id:"dictionaryName",label:d.getLocal("label_fieldNameDic")||"Dictionary name",onShow:function(b){var a=b.sender,h=c.scayt;b=SCAYT.prototype.UILib;var f=a.getContentElement("dictionaries","dictionaryName").getInputElement().$;h.isLicensed()||(f.disabled=!0,b.css(f,{cursor:"not-allowed"}));
6
+ setTimeout(function(){a.getContentElement("dictionaries","dictionaryNote").getElement().setText("");null!=h.getUserDictionaryName()&&""!=h.getUserDictionaryName()&&a.getContentElement("dictionaries","dictionaryName").setValue(h.getUserDictionaryName())},0)}},{type:"hbox",id:"udButtonsHolder",align:"left",widths:["auto"],style:"width:auto;",children:[{type:"button",id:"createDic",label:d.getLocal("btn_createDic"),title:d.getLocal("btn_createDic"),onLoad:function(){this.getDialog();var b=c.scayt,a=
7
+ SCAYT.prototype.UILib,h=this.getElement().$,f=this.getElement().getChild(0).$;b.isLicensed()||(a.css(h,{cursor:"not-allowed"}),a.css(f,{cursor:"not-allowed"}))},onClick:function(){var b=this.getDialog(),a=g,h=c.scayt,f=b.getContentElement("dictionaries","dictionaryName").getValue();h.isLicensed()&&h.createUserDictionary(f,function(e){e.error||a.toggleDictionaryState.call(b,"dictionaryState");e.dialog=b;e.command="create";e.name=f;c.fire("scaytUserDictionaryAction",e)},function(a){a.dialog=b;a.command=
8
+ "create";a.name=f;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"restoreDic",label:d.getLocal("btn_connectDic"),title:d.getLocal("btn_connectDic"),onLoad:function(){this.getDialog();var b=c.scayt,a=SCAYT.prototype.UILib,h=this.getElement().$,f=this.getElement().getChild(0).$;b.isLicensed()||(a.css(h,{cursor:"not-allowed"}),a.css(f,{cursor:"not-allowed"}))},onClick:function(){var b=this.getDialog(),a=c.scayt,h=g,f=b.getContentElement("dictionaries","dictionaryName").getValue();a.isLicensed()&&
9
+ a.restoreUserDictionary(f,function(a){a.dialog=b;a.error||h.toggleDictionaryState.call(b,"dictionaryState");a.command="restore";a.name=f;c.fire("scaytUserDictionaryAction",a)},function(a){a.dialog=b;a.command="restore";a.name=f;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"disconnectDic",label:d.getLocal("btn_disconnectDic"),title:d.getLocal("btn_disconnectDic"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=g,f=b.getContentElement("dictionaries","dictionaryName"),e=f.getValue();
10
+ a.isLicensed()&&(a.disconnectFromUserDictionary({}),f.setValue(""),h.toggleDictionaryState.call(b,"initialState"),c.fire("scaytUserDictionaryAction",{dialog:b,command:"disconnect",name:e}))}},{type:"button",id:"removeDic",label:d.getLocal("btn_deleteDic"),title:d.getLocal("btn_deleteDic"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=g,f=b.getContentElement("dictionaries","dictionaryName"),e=f.getValue();a.isLicensed()&&a.removeUserDictionary(e,function(a){f.setValue("");a.error||h.toggleDictionaryState.call(b,
11
+ "initialState");a.dialog=b;a.command="remove";a.name=e;c.fire("scaytUserDictionaryAction",a)},function(a){a.dialog=b;a.command="remove";a.name=e;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"renameDic",label:d.getLocal("btn_renameDic"),title:d.getLocal("btn_renameDic"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=b.getContentElement("dictionaries","dictionaryName").getValue();a.isLicensed()&&a.renameUserDictionary(h,function(a){a.dialog=b;a.command="rename";a.name=h;c.fire("scaytUserDictionaryAction",
12
+ a)},function(a){a.dialog=b;a.command="rename";a.name=h;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"editDic",label:d.getLocal("btn_goToDic"),title:d.getLocal("btn_goToDic"),onLoad:function(){this.getDialog()},onClick:function(){var b=this.getDialog(),a=b.getContentElement("dictionaries","addWordField");g.clearWordList.call(b);a.setValue("");g.getUserDictionary.call(b);g.toggleDictionaryState.call(b,"wordsState")}}]},{type:"hbox",id:"dicInfo",align:"left",children:[{type:"html",
13
+ id:"dicInfoHtml",html:'\x3cdiv id\x3d"dic_info_editor1" style\x3d"margin:5px auto; width:95%;white-space:normal;"\x3e'+(c.scayt.isLicensed&&c.scayt.isLicensed()?d.getLocal("text_descriptionDicForPaid"):d.getLocal("text_descriptionDicForFree"))+"\x3c/div\x3e"}]},{id:"addWordAction",type:"hbox",style:"width: 100%; margin-bottom: 0;",widths:["40%","60%"],children:[{id:"addWord",type:"vbox",style:"min-width: 150px;",children:[{type:"text",id:"addWordField",label:"Add word",maxLength:"64"}]},{id:"addWordButtons",
14
+ type:"vbox",style:"margin-top: 20px;",children:[{type:"hbox",id:"addWordButton",align:"left",children:[{type:"button",id:"addWord",label:d.getLocal("btn_addWord"),title:d.getLocal("btn_addWord"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=b.getContentElement("dictionaries","itemList"),f=b.getContentElement("dictionaries","addWordField"),e=f.getValue(),d=a.getOption("wordBoundaryRegex"),g=this;e&&(-1!==e.search(d)?c.fire("scaytUserDictionaryAction",{dialog:b,command:"wordWithBannedSymbols",
15
+ name:e,error:!0}):h.inChildren(e)?(f.setValue(""),c.fire("scaytUserDictionaryAction",{dialog:b,command:"wordAlreadyAdded",name:e})):(this.disable(),a.addWordToUserDictionary(e,function(a){a.error||(f.setValue(""),h.addChild(e,!0));a.dialog=b;a.command="addWord";a.name=e;g.enable();c.fire("scaytUserDictionaryAction",a)},function(a){a.dialog=b;a.command="addWord";a.name=e;g.enable();c.fire("scaytUserDictionaryActionError",a)})))}},{type:"button",id:"backToDic",label:d.getLocal("btn_dictionaryPreferences"),
16
+ title:d.getLocal("btn_dictionaryPreferences"),align:"right",onClick:function(){var b=this.getDialog(),a=c.scayt;null!=a.getUserDictionaryName()&&""!=a.getUserDictionaryName()?g.toggleDictionaryState.call(b,"dictionaryState"):g.toggleDictionaryState.call(b,"initialState")}}]}]}]},{id:"wordsHolder",type:"hbox",style:"width: 100%; height: 170px; margin-bottom: 0;",children:[{type:"scaytItemList",id:"itemList",align:"left",style:"width: 100%; height: 170px; overflow: auto",onClick:function(b){b=b.data.$;
17
+ var a=c.scayt,h=SCAYT.prototype.UILib,f=h.parent(b.target)[0],e=h.attr(f,"data-cke-scayt-ud-word"),d=this.getDialog(),g=d.getContentElement("dictionaries","itemList"),m=this;h.hasClass(b.target,"cke_scaytItemList_remove")&&!this.isBlocked()&&(this.block(),a.deleteWordFromUserDictionary(e,function(a){a.error||g.removeChild(f,e);m.unblock();a.dialog=d;a.command="deleteWord";a.name=e;c.fire("scaytUserDictionaryAction",a)},function(a){m.unblock();a.dialog=d;a.command="deleteWord";a.name=e;c.fire("scaytUserDictionaryActionError",
18
+ a)}))}}]}]}]},{id:"about",label:d.getLocal("tab_about"),elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'\x3cdiv\x3e\x3cdiv id\x3d"scayt_about_"\x3e'+k+"\x3c/div\x3e\x3c/div\x3e"}]}];c.on("scaytUserDictionaryAction",function(b){var a=SCAYT.prototype.UILib,c=b.data.dialog,f=c.getContentElement("dictionaries","dictionaryNote").getElement(),e=b.editor.scayt,d;void 0===b.data.error?(d=e.getLocal("message_success_"+b.data.command+"Dic"),d=d.replace("%s",b.data.name),f.setText(d),a.css(f.$,
19
+ {color:"blue"})):(""===b.data.name?f.setText(e.getLocal("message_info_emptyDic")):(d=e.getLocal("message_error_"+b.data.command+"Dic"),d=d.replace("%s",b.data.name),f.setText(d)),a.css(f.$,{color:"red"}),null!=e.getUserDictionaryName()&&""!=e.getUserDictionaryName()?c.getContentElement("dictionaries","dictionaryName").setValue(e.getUserDictionaryName()):c.getContentElement("dictionaries","dictionaryName").setValue(""))});c.on("scaytUserDictionaryActionError",function(b){var a=SCAYT.prototype.UILib,
20
+ c=b.data.dialog,d=c.getContentElement("dictionaries","dictionaryNote").getElement(),e=b.editor.scayt,g;""===b.data.name?d.setText(e.getLocal("message_info_emptyDic")):(g=e.getLocal("message_error_"+b.data.command+"Dic"),g=g.replace("%s",b.data.name),d.setText(g));a.css(d.$,{color:"red"});null!=e.getUserDictionaryName()&&""!=e.getUserDictionaryName()?c.getContentElement("dictionaries","dictionaryName").setValue(e.getUserDictionaryName()):c.getContentElement("dictionaries","dictionaryName").setValue("")});
21
+ var g={title:d.getLocal("text_title"),resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:"moono-lisa"==(CKEDITOR.skinName||c.config.skin)?450:340,minHeight:300,onLoad:function(){if(0!=c.config.scayt_uiTabs[1]){var b=g,a=b.getLangBoxes.call(this);this.getContentElement("dictionaries","addWordField");a.getParent().setStyle("white-space","normal");b.renderLangList(a);this.definition.minWidth=this.getSize().width;this.resize(this.definition.minWidth,this.definition.minHeight)}},onCancel:function(){p.reset()},
22
+ onHide:function(){c.unlockSelection()},onShow:function(){c.fire("scaytDialogShown",this);if(0!=c.config.scayt_uiTabs[2]){var b=this.getContentElement("dictionaries","addWordField");g.clearWordList.call(this);b.setValue("");g.getUserDictionary.call(this);g.toggleDictionaryState.call(this,"wordsState")}},onOk:function(){var b=g,a=c.scayt;this.getContentElement("options","scaytOptions");b=b.getChangedOption.call(this);a.commitOption({changedOptions:b})},toggleDictionaryButtons:function(b){var a=this.getContentElement("dictionaries",
23
+ "existDic").getElement().getParent(),c=this.getContentElement("dictionaries","notExistDic").getElement().getParent();b?(a.show(),c.hide()):(a.hide(),c.show())},getChangedOption:function(){var b={};if(1==c.config.scayt_uiTabs[0])for(var a=this.getContentElement("options","scaytOptions").getChild(),d=0;d<a.length;d++)a[d].isChanged()&&(b[a[d].id]=a[d].getValue());p.isChanged()&&(b[p.id]=c.config.scayt_sLang=p.currentLang=p.newLang);return b},buildRadioInputs:function(b,a,d){var f=new CKEDITOR.dom.element("div"),
24
+ e="scaytLang_"+c.name+"_"+a,g=CKEDITOR.dom.element.createFromHtml('\x3cinput id\x3d"'+e+'" type\x3d"radio" value\x3d"'+a+'" name\x3d"scayt_lang" /\x3e'),k=new CKEDITOR.dom.element("label"),m=c.scayt;f.setStyles({"white-space":"normal",position:"relative","padding-bottom":"2px"});g.on("click",function(a){p.newLang=a.sender.getValue()});k.appendText(b);k.setAttribute("for",e);d&&c.config.grayt_autoStartup&&k.setStyles({color:"#02b620"});f.append(g);f.append(k);a===m.getLang()&&(g.setAttribute("checked",
25
+ !0),g.setAttribute("defaultChecked","defaultChecked"));return f},renderLangList:function(b){var a=b.find("#left-col-"+c.name).getItem(0);b=b.find("#right-col-"+c.name).getItem(0);var h=d.getScaytLangList(),f=d.getGraytLangList(),e={},g=[],k=0,m=!1,l;for(l in h.ltr)e[l]=h.ltr[l];for(l in h.rtl)e[l]=h.rtl[l];for(l in e)g.push([l,e[l]]);g.sort(function(a,b){var c=0;a[1]>b[1]?c=1:a[1]<b[1]&&(c=-1);return c});e={};for(m=0;m<g.length;m++)e[g[m][0]]=g[m][1];g=Math.round(g.length/2);for(l in e)k++,m=l in
26
+ f.ltr||l in f.rtl,this.buildRadioInputs(e[l],l,m).appendTo(k<=g?a:b)},getLangBoxes:function(){return this.getContentElement("langs","langBox").getElement()},toggleDictionaryState:function(b){var a=this.getContentElement("dictionaries","dictionaryName").getElement().getParent(),c=this.getContentElement("dictionaries","udButtonsHolder").getElement().getParent(),d=this.getContentElement("dictionaries","createDic").getElement().getParent(),e=this.getContentElement("dictionaries","restoreDic").getElement().getParent(),
27
+ g=this.getContentElement("dictionaries","disconnectDic").getElement().getParent(),k=this.getContentElement("dictionaries","removeDic").getElement().getParent(),m=this.getContentElement("dictionaries","renameDic").getElement().getParent(),l=this.getContentElement("dictionaries","dicInfo").getElement().getParent(),p=this.getContentElement("dictionaries","addWordAction").getElement().getParent(),n=this.getContentElement("dictionaries","wordsHolder").getElement().getParent();switch(b){case "initialState":a.show();
28
+ c.show();d.show();e.show();g.hide();k.hide();m.hide();l.show();p.hide();n.hide();break;case "wordsState":a.hide();c.hide();l.hide();p.show();n.show();break;case "dictionaryState":a.show(),c.show(),d.hide(),e.hide(),g.show(),k.show(),m.show(),l.show(),p.hide(),n.hide()}},clearWordList:function(){this.getContentElement("dictionaries","itemList").removeAllChild()},getUserDictionary:function(){var b=this;c.scayt.getUserDictionary("",function(a){a.error||g.renderItemList.call(b,a.wordlist)})},renderItemList:function(b){for(var a=
29
+ this.getContentElement("dictionaries","itemList"),c=0;c<b.length;c++)a.addChild(b[c])},contents:function(b,a){var c=[],d=a.config.scayt_uiTabs;if(d){for(var e in d)1==d[e]&&c.push(b[e]);c.push(b[b.length-1])}else return b;return c}(k,c)};return g});
30
+ CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{scaytItemList:function(c,d,k){if(arguments.length){var n=this;c.on("load",function(){n.getElement().on("click",function(c){})});CKEDITOR.ui.dialog.uiElement.call(this,c,d,k,"",null,null,function(){var c=['\x3cp class\x3d"cke_dialog_ui_',d.type,'"'];d.style&&c.push('style\x3d"'+d.style+'" ');c.push("\x3e");c.push("\x3c/p\x3e");return c.join("")})}}});
31
+ CKEDITOR.ui.dialog.scaytItemList.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{children:[],blocked:!1,addChild:function(c,d){var k=new CKEDITOR.dom.element("p"),n=new CKEDITOR.dom.element("a"),p=this.getElement().getChildren().getItem(0);this.children.push(c);k.addClass("cke_scaytItemList-child");k.setAttribute("data-cke-scayt-ud-word",c);k.appendText(c);n.addClass("cke_scaytItemList_remove");n.addClass("cke_dialog_close_button");n.setAttribute("href","javascript:void(0)");k.append(n);
32
+ p.append(k,d?!0:!1)},inChildren:function(c){return SCAYT.prototype.Utils.inArray(this.children,c)},removeChild:function(c,d){this.children.splice(SCAYT.prototype.Utils.indexOf(this.children,d),1);this.getElement().getChildren().getItem(0).$.removeChild(c)},removeAllChild:function(){this.children=[];this.getElement().getChildren().getItem(0).setHtml("")},block:function(){this.blocked=!0},unblock:function(){this.blocked=!1},isBlocked:function(){return this.blocked}});
33
+ (function(){commonBuilder={build:function(c,d,k){return new CKEDITOR.ui.dialog[d.type](c,d,k)}};CKEDITOR.dialog.addUIElement("scaytItemList",commonBuilder)})();
@@ -10,10 +10,15 @@
10
10
 
11
11
  #scayt_about_
12
12
  {
13
- width: 190px;
14
13
  margin: 30px auto 0 auto;
15
14
  }
16
15
 
16
+ #scayt_about_ p
17
+ {
18
+ text-align: center;
19
+ margin-bottom: 10px;
20
+ }
21
+
17
22
  .cke_dialog_contents_body div[name=dictionaries] .cke_dialog_ui_hbox_last > a.cke_dialog_ui_button
18
23
  {
19
24
  margin-top: 0;
@@ -88,7 +88,7 @@
88
88
  // Register a plugin named "stylesheetparser".
89
89
  CKEDITOR.plugins.add( 'stylesheetparser', {
90
90
  init: function( editor ) {
91
- // Stylesheet parser is incompatible with filter (#10136).
91
+ // Stylesheet parser is incompatible with filter (http://dev.ckeditor.com/ticket/10136).
92
92
  editor.filter.disable();
93
93
 
94
94
  var cachedDefinitions;
@@ -4,10 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
4
4
  */
5
5
  CKEDITOR.plugins.setLang('wordcount', 'en', {
6
6
  WordCount: 'Words:',
7
+ WordCountRemaining: 'Words remaining',
7
8
  CharCount: 'Characters:',
9
+ CharCountRemaining: 'Characters remaining',
8
10
  CharCountWithHTML: 'Characters (with HTML):',
11
+ CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
9
12
  Paragraphs: 'Paragraphs:',
10
- pasteWarning: 'Content can not be pasted because it is above the allowed limit',
13
+ pasteWarning: 'Content cannot be pasted because it is above the allowed limit',
11
14
  Selected: 'Selected: ',
12
15
  title: 'Statistics'
13
16
  });
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  CKEDITOR.plugins.add("wordcount", {
7
- lang: "ar,ca,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,zh-cn", // %REMOVE_LINE_CORE%
8
- version: 1.16,
7
+ lang: "en,ru", // %REMOVE_LINE_CORE%
8
+ version: 1.17,
9
9
  requires: 'htmlwriter,notification,undo',
10
10
  bbcodePluginLoaded: false,
11
11
  onLoad: function(editor) {
@@ -56,11 +56,14 @@ CKEDITOR.plugins.add("wordcount", {
56
56
 
57
57
  // Default Config
58
58
  var defaultConfig = {
59
+ showRemaining: false,
59
60
  showParagraphs: true,
60
61
  showWordCount: true,
61
62
  showCharCount: false,
63
+ countBytesAsChars: false,
62
64
  countSpacesAsChars: false,
63
65
  countHTML: false,
66
+ countLineBreaks: false,
64
67
  hardLimit: true,
65
68
 
66
69
  //MAXLENGTH Properties
@@ -102,9 +105,16 @@ CKEDITOR.plugins.add("wordcount", {
102
105
  }
103
106
 
104
107
  if (config.showWordCount) {
105
- defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
106
108
  if (config.maxWordCount > -1) {
107
- defaultFormat += "/" + config.maxWordCount;
109
+ if (config.showRemaining) {
110
+ defaultFormat += "%wordCount% " + editor.lang.wordcount.WordCountRemaining;
111
+ } else {
112
+ defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
113
+
114
+ defaultFormat += "/" + config.maxWordCount;
115
+ }
116
+ } else {
117
+ defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
108
118
  }
109
119
  }
110
120
 
@@ -113,11 +123,20 @@ CKEDITOR.plugins.add("wordcount", {
113
123
  }
114
124
 
115
125
  if (config.showCharCount) {
116
- var charLabel = editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"];
117
-
118
- defaultFormat += charLabel + " %charCount%";
119
126
  if (config.maxCharCount > -1) {
120
- defaultFormat += "/" + config.maxCharCount;
127
+ if (config.showRemaining) {
128
+ defaultFormat += "%charCount% " + editor.lang.wordcount[config.countHTML
129
+ ? "CharCountWithHTMLRemaining"
130
+ : "CharCountRemaining"];
131
+ } else {
132
+ defaultFormat += editor.lang.wordcount[config.countHTML
133
+ ? "CharCountWithHTML"
134
+ : "CharCount"] + " %charCount%";
135
+
136
+ defaultFormat += "/" + config.maxCharCount;
137
+ }
138
+ } else {
139
+ defaultFormat += editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"] + " %charCount%";
121
140
  }
122
141
  }
123
142
 
@@ -188,21 +207,31 @@ CKEDITOR.plugins.add("wordcount", {
188
207
  normalizedText = text;
189
208
 
190
209
  if (!config.countSpacesAsChars) {
191
- normalizedText = text.
192
- replace(/\s/g, "").
193
- replace(/&nbsp;/g, "");
210
+ normalizedText = text.replace(/\s/g, "").replace(/&nbsp;/g, "");
194
211
  }
195
212
 
196
- normalizedText = normalizedText.
197
- replace(/(\r\n|\n|\r)/gm, "").
198
- replace(/&nbsp;/gi, " ");
213
+ if (config.countLineBreaks) {
214
+ normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "");
215
+ } else {
216
+ normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "").replace(/&nbsp;/gi, " ");
217
+ }
199
218
 
200
219
  normalizedText = strip(normalizedText).replace(/^([\t\r\n]*)$/, "");
201
220
 
202
- return(normalizedText.length);
221
+ return config.countBytesAsChars ? (countBytes(normalizedText)) : (normalizedText.length);
203
222
  }
204
223
  }
205
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
+
206
235
  function countParagraphs(text) {
207
236
  return (text.replace(/&nbsp;/g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++").split("++").length);
208
237
  }
@@ -238,7 +267,7 @@ CKEDITOR.plugins.add("wordcount", {
238
267
 
239
268
  if (!notify) {
240
269
  counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
241
- editorInstance.fire("limitReached", {}, editor);
270
+ editorInstance.fire("limitReached", {firedBy: "wordCount.limitReached"}, editor);
242
271
  }
243
272
  }
244
273
 
@@ -257,7 +286,17 @@ CKEDITOR.plugins.add("wordcount", {
257
286
  charCount = 0,
258
287
  text;
259
288
 
260
- if (text = editorInstance.getData()) {
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) {
261
300
  if (config.showCharCount) {
262
301
  charCount = countCharacters(text, editorInstance);
263
302
  }
@@ -271,7 +310,24 @@ CKEDITOR.plugins.add("wordcount", {
271
310
  }
272
311
  }
273
312
 
274
- var html = format.replace("%wordCount%", wordCount).replace("%charCount%", charCount).replace("%paragraphs%", paragraphs);
313
+
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);
321
+ }
322
+
323
+ if (config.maxWordCount >= 0) {
324
+ html = html.replace("%wordCount%", config.maxWordCount - wordCount);
325
+ } else {
326
+ html = html.replace("%wordCount%", wordCount);
327
+ }
328
+ } else {
329
+ html = html.replace("%wordCount%", wordCount).replace("%charCount%", charCount);
330
+ }
275
331
 
276
332
  (editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).wordCount = wordCount;
277
333
  (editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).charCount = charCount;
@@ -283,6 +339,9 @@ CKEDITOR.plugins.add("wordcount", {
283
339
  }
284
340
 
285
341
  if (charCount == lastCharCount && wordCount == lastWordCount) {
342
+ if (charCount == config.maxCharCount || wordCount == config.maxWordCount) {
343
+ snapShot = editor.getSnapshot();
344
+ }
286
345
  return true;
287
346
  }
288
347
 
@@ -306,8 +365,8 @@ CKEDITOR.plugins.add("wordcount", {
306
365
  (config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
307
366
 
308
367
  limitReached(editorInstance, limitReachedNotified);
309
- } else if ((config.maxWordCount == -1 || wordCount < config.maxWordCount) &&
310
- (config.maxCharCount == -1 || charCount < config.maxCharCount)) {
368
+ } else if ((config.maxWordCount == -1 || wordCount <= config.maxWordCount) &&
369
+ (config.maxCharCount == -1 || charCount <= config.maxCharCount)) {
311
370
 
312
371
  limitRestored(editorInstance);
313
372
  } else {
@@ -379,9 +438,19 @@ CKEDITOR.plugins.add("wordcount", {
379
438
 
380
439
  // Check if pasted content is above the limits
381
440
  var wordCount = -1,
382
- charCount = -1,
383
- text = event.editor.getData() + event.data.dataValue;
384
-
441
+ charCount = -1;
442
+
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);
452
+
453
+ text += event.data.dataValue;
385
454
 
386
455
  if (config.showCharCount) {
387
456
  charCount = countCharacters(text, event.editor);