glebtv-ckeditor 4.4.7.4 → 4.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (443) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +38 -0
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +124 -84
  5. data/Rakefile +1 -25
  6. data/app/assets/javascripts/ckeditor/application.js +0 -1
  7. data/app/assets/javascripts/ckeditor/config.js.erb +5 -59
  8. data/app/assets/javascripts/ckeditor/config_orig.js +58 -0
  9. data/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg +0 -0
  10. data/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.png +0 -0
  11. data/app/assets/javascripts/ckeditor/filebrowser/images/gal_del.png +0 -0
  12. data/app/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif +0 -0
  13. data/app/assets/javascripts/ckeditor/filebrowser/images/preloader.gif +0 -0
  14. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/avi.gif +0 -0
  15. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif +0 -0
  16. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/doc.gif +0 -0
  17. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/docx.gif +0 -0
  18. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/exe.gif +0 -0
  19. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/gz.gif +0 -0
  20. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/htm.gif +0 -0
  21. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/jpg.gif +0 -0
  22. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif +0 -0
  23. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mpg.gif +0 -0
  24. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif +0 -0
  25. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/psd.gif +0 -0
  26. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif +0 -0
  27. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif +0 -0
  28. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/tar.gif +0 -0
  29. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/txt.gif +0 -0
  30. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/unknown.gif +0 -0
  31. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/wmv.gif +0 -0
  32. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif +0 -0
  33. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xlsx.gif +0 -0
  34. data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/zip.gif +0 -0
  35. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/application.js.erb +58 -56
  36. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
  37. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.endless-scroll.js +0 -0
  38. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
  39. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
  40. data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.erb +12 -6
  41. data/app/assets/javascripts/ckeditor/init.js.erb +6 -1
  42. data/app/assets/stylesheets/ckcontent.css +0 -0
  43. data/app/assets/stylesheets/ckeditor/application.css +0 -0
  44. data/app/controllers/ckeditor/application_controller.rb +6 -17
  45. data/app/controllers/ckeditor/attachment_files_controller.rb +10 -3
  46. data/app/controllers/ckeditor/pictures_controller.rb +9 -2
  47. data/app/helpers/ckeditor/application_helper.rb +0 -0
  48. data/app/views/ckeditor/attachment_files/index.html.erb +3 -3
  49. data/app/views/ckeditor/pictures/index.html.erb +3 -3
  50. data/app/views/ckeditor/shared/_asset.html.erb +0 -0
  51. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +0 -0
  52. data/app/views/layouts/ckeditor/application.html.erb +3 -2
  53. data/app/views/rails_admin/main/_form_ck_editor.html.haml +1 -1
  54. data/app/views/rails_admin/main/_form_ck_editorml.html.haml +1 -1
  55. data/config/locales/bg.ckeditor.yml +9 -0
  56. data/config/locales/cs.ckeditor.yml +0 -0
  57. data/config/locales/de.ckeditor.yml +0 -0
  58. data/config/locales/el-GR.cdkeditor.yml +0 -0
  59. data/config/locales/en.ckeditor.yml +0 -0
  60. data/config/locales/es.ckeditor.yml +0 -0
  61. data/config/locales/fr.ckeditor.yml +0 -0
  62. data/config/locales/hu.ckeditor.yml +0 -0
  63. data/config/locales/it.ckeditor.yml +0 -0
  64. data/config/locales/ja.ckeditor.yml +9 -0
  65. data/config/locales/nb.ckeditor.yml +9 -0
  66. data/config/locales/nl.ckeditor.yml +0 -0
  67. data/config/locales/pl.ckeditor.yml +0 -0
  68. data/config/locales/pt-BR.ckeditor.yml +0 -0
  69. data/config/locales/pt-PT.ckeditor.yml +0 -0
  70. data/config/locales/ru.ckeditor.yml +0 -0
  71. data/config/locales/sv-SE.ckeditor.yml +0 -0
  72. data/config/locales/tr.ckeditor.yml +9 -0
  73. data/config/locales/uk.ckeditor.yml +0 -0
  74. data/config/locales/zh-CN.ckeditor.yml +1 -1
  75. data/config/locales/zh-TW.ckeditor.yml +9 -0
  76. data/config/routes.rb +0 -0
  77. data/lib/ckeditor.rb +39 -5
  78. data/lib/ckeditor/asset_response.rb +59 -0
  79. data/lib/ckeditor/backend/carrierwave.rb +1 -8
  80. data/lib/ckeditor/backend/dragonfly.rb +8 -6
  81. data/lib/ckeditor/backend/paperclip.rb +7 -11
  82. data/lib/ckeditor/backend/refile.rb +37 -0
  83. data/lib/ckeditor/engine.rb +4 -0
  84. data/lib/ckeditor/helpers/controllers.rb +0 -0
  85. data/lib/ckeditor/helpers/form_builder.rb +0 -0
  86. data/lib/ckeditor/helpers/form_helper.rb +0 -0
  87. data/lib/ckeditor/helpers/view_helper.rb +0 -0
  88. data/lib/ckeditor/hooks/cancan.rb +4 -1
  89. data/lib/ckeditor/hooks/formtastic.rb +0 -0
  90. data/lib/ckeditor/hooks/pundit.rb +0 -0
  91. data/lib/ckeditor/hooks/simple_form.rb +1 -1
  92. data/lib/ckeditor/http.rb +1 -3
  93. data/lib/ckeditor/orm/active_record.rb +0 -0
  94. data/lib/ckeditor/orm/base.rb +0 -0
  95. data/lib/ckeditor/orm/mongoid.rb +0 -0
  96. data/lib/ckeditor/paginatable.rb +0 -0
  97. data/lib/ckeditor/text_area.rb +2 -1
  98. data/lib/ckeditor/utils.rb +26 -23
  99. data/lib/ckeditor/utils/content_type_detector.rb +41 -0
  100. data/lib/ckeditor/utils/javascript_code.rb +10 -0
  101. data/lib/ckeditor/version.rb +4 -2
  102. data/lib/generators/ckeditor/install_generator.rb +1 -1
  103. data/lib/generators/ckeditor/pundit_policy_generator.rb +0 -0
  104. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +0 -0
  105. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +0 -0
  106. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +0 -0
  107. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +0 -0
  108. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +1 -1
  109. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +1 -1
  110. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +0 -0
  111. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +0 -0
  112. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb +0 -0
  113. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +3 -5
  114. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +3 -5
  115. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +7 -7
  116. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/asset.rb +4 -0
  117. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/attachment_file.rb +7 -0
  118. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +11 -0
  119. data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +28 -0
  120. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +2 -0
  121. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +0 -0
  122. data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +13 -19
  123. data/lib/generators/ckeditor/templates/ckeditor.rb +23 -0
  124. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +0 -0
  125. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +0 -0
  126. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +0 -0
  127. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +0 -0
  128. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +3 -6
  129. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +3 -5
  130. data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +3 -3
  131. data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +3 -3
  132. data/lib/glebtv-ckeditor.rb +0 -0
  133. data/lib/tasks/ckeditor.rake +26 -0
  134. data/test/controllers/attachment_files_controller_test.rb +2 -2
  135. data/test/controllers/pictures_controller_test.rb +3 -4
  136. data/test/dummy/Rakefile +0 -0
  137. data/test/dummy/app/assets/javascripts/application.js +0 -1
  138. data/test/dummy/app/assets/stylesheets/application.css +0 -0
  139. data/test/dummy/app/assets/stylesheets/scaffold.css +0 -0
  140. data/test/dummy/app/controllers/application_controller.rb +0 -1
  141. data/test/dummy/app/controllers/posts_controller.rb +0 -0
  142. data/test/dummy/app/helpers/application_helper.rb +0 -0
  143. data/test/dummy/app/helpers/posts_helper.rb +0 -0
  144. data/test/dummy/app/models/post.rb +0 -0
  145. data/test/dummy/app/views/layouts/application.html.erb +2 -2
  146. data/test/dummy/app/views/posts/_form.html.erb +0 -0
  147. data/test/dummy/app/views/posts/edit.html.erb +0 -0
  148. data/test/dummy/app/views/posts/index.html.erb +0 -0
  149. data/test/dummy/app/views/posts/new.html.erb +0 -0
  150. data/test/dummy/app/views/posts/show.html.erb +0 -0
  151. data/test/dummy/config.ru +0 -0
  152. data/test/dummy/config/application.rb +15 -15
  153. data/test/dummy/config/boot.rb +0 -0
  154. data/test/dummy/config/database.yml +0 -0
  155. data/test/dummy/config/environment.rb +0 -0
  156. data/test/dummy/config/environments/development.rb +0 -0
  157. data/test/dummy/config/environments/production.rb +0 -0
  158. data/test/dummy/config/environments/test.rb +7 -5
  159. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -0
  160. data/test/dummy/config/initializers/ckeditor.rb +0 -0
  161. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  162. data/test/dummy/config/initializers/inflections.rb +0 -0
  163. data/test/dummy/config/initializers/mime_types.rb +0 -0
  164. data/test/dummy/config/initializers/session_store.rb +0 -0
  165. data/test/dummy/config/initializers/wrap_parameters.rb +0 -0
  166. data/test/dummy/config/locales/en.yml +0 -0
  167. data/test/dummy/config/mongoid.yml +135 -1
  168. data/test/dummy/config/routes.rb +3 -3
  169. data/test/dummy/config/secrets.yml +8 -0
  170. data/test/dummy/db/migrate/20110623120047_create_posts.rb +1 -1
  171. data/test/dummy/public/404.html +0 -0
  172. data/test/dummy/public/422.html +0 -0
  173. data/test/dummy/public/500.html +0 -0
  174. data/test/dummy/public/favicon.ico +0 -0
  175. data/test/dummy/script/rails +0 -0
  176. data/test/dummy/test/fixtures/files/rails.png +0 -0
  177. data/test/dummy/test/fixtures/files/rails.tar.gz +0 -0
  178. data/test/functional/posts_controller_test.rb +6 -6
  179. data/test/generators/install_generator_test.rb +14 -0
  180. data/test/integration/navigation_test.rb +0 -0
  181. data/test/models/attachment_file_test.rb +2 -2
  182. data/test/{ckeditor_test.rb → models/ckeditor_test.rb} +35 -0
  183. data/test/models/picture_test.rb +6 -1
  184. data/test/models/utils_test.rb +6 -6
  185. data/test/orm/active_record.rb +0 -0
  186. data/test/orm/mongoid.rb +0 -0
  187. data/test/support/helpers.rb +0 -0
  188. data/test/support/integration_case.rb +0 -0
  189. data/test/support/raw_post.rb +0 -0
  190. data/test/support/routes.txt +0 -0
  191. data/test/test_helper.rb +3 -5
  192. data/vendor/assets/javascripts/ckeditor/LICENSE.md +159 -3
  193. data/vendor/assets/javascripts/ckeditor/README.md +39 -0
  194. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +7 -7
  195. data/vendor/assets/javascripts/ckeditor/build-config.js +4 -3
  196. data/vendor/assets/javascripts/ckeditor/ckeditor.js +1028 -964
  197. data/vendor/assets/javascripts/ckeditor/config.js +1 -1
  198. data/vendor/assets/javascripts/ckeditor/lang/en.js +3 -3
  199. data/vendor/assets/javascripts/ckeditor/lang/ru.js +3 -3
  200. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +5 -5
  201. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +4 -4
  202. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  203. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +4 -4
  204. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
  205. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  206. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +9 -8
  207. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  208. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autocomplete.png +0 -0
  209. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  210. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/commentselectedrange.png +0 -0
  211. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  212. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  213. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +1 -1
  214. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -1
  215. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  216. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -1
  217. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcode.min.js +0 -0
  218. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +0 -0
  219. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -1
  220. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  221. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +1 -1
  222. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +0 -0
  223. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +0 -0
  224. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +49 -29
  225. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +2 -0
  226. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +2 -0
  227. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +0 -0
  228. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +7 -8
  229. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +2 -0
  230. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +2 -0
  231. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +2 -0
  232. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +2 -0
  233. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +33 -0
  234. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +0 -0
  235. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +0 -0
  236. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +3 -1
  237. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +4 -2
  238. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +95 -0
  239. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +2 -0
  240. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +3 -1
  241. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +2 -0
  242. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -1
  243. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +0 -0
  244. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +0 -0
  245. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +2 -0
  246. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +2 -0
  247. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +2 -0
  248. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +3 -0
  249. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +2 -0
  250. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +9 -9
  251. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +2 -0
  252. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-bright.css +35 -0
  253. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +2 -0
  254. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +65 -0
  255. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +2 -0
  256. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +2 -0
  257. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +2 -0
  258. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +0 -0
  259. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/zenburn.css +37 -0
  260. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +10 -10
  261. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
  262. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +8 -8
  263. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +16 -16
  264. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +14 -14
  265. data/vendor/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
  266. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +2 -2
  267. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +4 -3
  268. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +4 -4
  269. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +4 -4
  270. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +6 -5
  271. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +15 -15
  272. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +3 -3
  273. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +6 -5
  274. data/vendor/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
  275. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  276. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  277. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +3 -3
  278. data/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  279. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +29 -34
  280. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +41 -40
  281. data/vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
  282. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/LICENSE +22 -0
  283. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/README.md +2 -0
  284. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/en.js +3 -0
  285. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +3 -0
  286. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/plugin.js +81 -0
  287. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/readme.txt +30 -0
  288. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +2 -2
  289. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +20 -20
  290. data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  291. data/vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
  292. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -7
  293. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/hidpi/loremipsum.png +0 -0
  294. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/loremipsum.png +0 -0
  295. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/en.js +8 -0
  296. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/ru.js +8 -0
  297. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +131 -0
  298. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
  299. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
  300. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon-rtl.png +0 -0
  301. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
  302. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +7 -0
  303. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +7 -0
  304. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +923 -0
  305. data/vendor/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
  306. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +29 -28
  307. data/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +0 -0
  308. data/vendor/assets/javascripts/ckeditor/plugins/scayt/CHANGELOG.md +20 -0
  309. data/vendor/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +28 -28
  310. data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +25 -0
  311. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +19 -17
  312. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
  313. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  314. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  315. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  316. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  317. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  318. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  319. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  320. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  321. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  322. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  323. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  324. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +8 -7
  325. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  326. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.png +0 -0
  327. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  328. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.png +0 -0
  329. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  330. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.png +0 -0
  331. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  332. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.png +0 -0
  333. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  334. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.png +0 -0
  335. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  336. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.png +0 -0
  337. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  338. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
  339. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.png +0 -0
  340. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  341. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.png +0 -0
  342. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
  343. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.png +0 -0
  344. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  345. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.png +0 -0
  346. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  347. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.png +0 -0
  348. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  349. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.png +0 -0
  350. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  351. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.png +0 -0
  352. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  353. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.png +0 -0
  354. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  355. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.png +0 -0
  356. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  357. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.png +0 -0
  358. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  359. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.png +0 -0
  360. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  361. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.png +0 -0
  362. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
  363. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.png +0 -0
  364. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  365. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  366. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.png +0 -0
  367. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  368. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.png +0 -0
  369. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +1 -1
  370. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
  371. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +10 -10
  372. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +9 -3
  373. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +17 -17
  374. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +12 -12
  375. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +1 -1
  376. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +7 -7
  377. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +4 -3
  378. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  379. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  380. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  381. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +1 -1
  382. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +4 -2
  383. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +4 -2
  384. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +286 -145
  385. data/vendor/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +0 -0
  386. data/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -0
  387. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
  388. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
  389. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
  390. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +88 -70
  391. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc_ie.js +7 -7
  392. data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
  393. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +1 -1
  394. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +388 -388
  395. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +5 -0
  396. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +5 -0
  397. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +5 -0
  398. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +5 -0
  399. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +5 -0
  400. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +5 -0
  401. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +5 -0
  402. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +5 -0
  403. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +5 -0
  404. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
  405. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +5 -0
  406. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  407. data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
  408. data/vendor/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
  409. data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
  410. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
  411. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
  412. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
  413. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
  414. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
  415. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
  416. data/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
  417. data/vendor/assets/javascripts/ckeditor/skins/moono/images/spinner.gif +0 -0
  418. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +49 -0
  419. data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
  420. metadata +105 -130
  421. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.min.js +0 -4
  422. data/app/assets/javascripts/ckeditor/override.js.erb +0 -21
  423. data/test/dummy/config/initializers/secret_token.rb +0 -7
  424. data/test/support/controller_hooks.rb +0 -27
  425. data/vendor/assets/javascripts/ckeditor/plugins/ipsum/icon.png +0 -0
  426. data/vendor/assets/javascripts/ckeditor/plugins/ipsum/plugin.js +0 -63
  427. data/vendor/assets/javascripts/ckeditor/plugins/map/example_usage.js +0 -30
  428. data/vendor/assets/javascripts/ckeditor/plugins/map/map.gif +0 -0
  429. data/vendor/assets/javascripts/ckeditor/plugins/map/plugin.js +0 -187
  430. data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/icons/hidpi/mediaembed.png +0 -0
  431. data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/icons/mediaembed.png +0 -0
  432. data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/plugin.js +0 -64
  433. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css.scss +0 -771
  434. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css.scss +0 -812
  435. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css.scss +0 -844
  436. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css.scss +0 -825
  437. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css.scss +0 -816
  438. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css.scss +0 -2136
  439. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css.scss +0 -2145
  440. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css.scss +0 -2194
  441. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css.scss +0 -2362
  442. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css.scss +0 -2206
  443. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css.scss +0 -2254
@@ -1,17 +1,17 @@
1
1
  /*
2
- Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
2
+ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.md or http://ckeditor.com/license
4
4
  */
5
- CKEDITOR.dialog.add("cellProperties",function(g){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&("select"==this.type&&!c)&&(this.getInputElement().$.selectedIndex=-1))}}function j(a){if(a=l.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=g.lang.table,c=h.cell,e=g.lang.common,i=CKEDITOR.dialog.validate,l=/^(\d+(?:\.\d+)?)(px|%)$/,f={type:"html",html:"&nbsp;"},m="rtl"==
6
- g.lang.dir,k=g.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:e.width,validate:i.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info",
7
- "widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10),a=parseInt(a.getStyle("width"),10);return!isNaN(a)?a:!isNaN(b)?b:""}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||j(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",
8
- label:g.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(j)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",label:e.height,width:"100px","default":"",validate:i.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=
9
- parseInt(a.getAttribute("height"),10),a=parseInt(a.getStyle("height"),10);return!isNaN(a)?a:!isNaN(b)?b:""}),commit:function(a){var b=parseInt(this.getValue(),10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"<br />"+h.widthPx}]},f,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==a.getStyle("white-space")||
10
- b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");
11
- a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign"),a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},
12
- f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:i.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):
13
- a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:i.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},f,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");
14
- return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},k?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,
15
- {type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},k?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(m?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align",
5
+ CKEDITOR.dialog.add("cellProperties",function(g){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&"select"==this.type&&!c&&(this.getInputElement().$.selectedIndex=-1))}}function l(a){if(a=n.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=g.lang.table,c=h.cell,e=g.lang.common,k=CKEDITOR.dialog.validate,n=/^(\d+(?:\.\d+)?)(px|%)$/,f={type:"html",html:"\x26nbsp;"},p="rtl"==
6
+ g.lang.dir,m=g.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:e.width,validate:k.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info",
7
+ "widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10);a=parseInt(a.getStyle("width"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||l(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",
8
+ label:g.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(l)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",label:e.height,width:"100px","default":"",validate:k.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=
9
+ parseInt(a.getAttribute("height"),10);a=parseInt(a.getStyle("height"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"\x3cbr /\x3e"+h.widthPx}]},f,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==
10
+ a.getStyle("white-space")||b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",
11
+ b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign");a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");
12
+ a.removeAttribute("vAlign")}}]},f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:k.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",
13
+ this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:k.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},f,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");
14
+ return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},m?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,
15
+ {type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},m?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(p?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align",
16
16
  "bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:f]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells)},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()},
17
17
  onLoad:function(){var a={};this.foreach(function(b){b.setup&&b.commit&&(b.setup=CKEDITOR.tools.override(b.setup,function(c){return function(){c.apply(this,arguments);a[b.id]=b.getValue()}}),b.commit=CKEDITOR.tools.override(b.commit,function(c){return function(){a[b.id]!==b.getValue()&&c.apply(this,arguments)}}))})}}});
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
2
+ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.md or http://ckeditor.com/license
4
4
  */
5
5
 
@@ -1,10 +1,10 @@
1
1
  /*
2
- Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
2
+ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.md or http://ckeditor.com/license
4
4
  */
5
- (function(){CKEDITOR.dialog.add("templates",function(c){function o(a,b){var k=CKEDITOR.dom.element.createFromHtml('<a href="javascript:void(0)" tabIndex="-1" role="option" ><div class="cke_tpl_item"></div></a>'),d='<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';a.image&&b&&(d+='<td class="cke_tpl_preview_img"><img src="'+CKEDITOR.getUrl(b+a.image)+'"'+(CKEDITOR.env.ie6Compat?' onload="this.width=this.width"':"")+' alt="" title=""></td>');d+='<td style="white-space:normal;"><span class="cke_tpl_title">'+
6
- a.title+"</span><br/>";a.description&&(d+="<span>"+a.description+"</span>");k.getFirst().setHtml(d+"</td></tr></table>");k.on("click",function(){p(a.html)});return k}function p(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function i(a){var b=a.data.getTarget(),
7
- c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+"dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,l=c.config;return{title:c.lang.templates.title,
8
- minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:"<span>"+f.selectPromptMsg+"</span>"},{id:"templatesList",type:"html",focus:!0,html:'<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="'+h+'"><div class="cke_tpl_loading"><span></span></div></div><span class="cke_voice_label" id="'+h+'">'+f.options+"</span>"},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption,
9
- "default":l.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(l.templates_files,function(){var b=(l.templates||"default").split(",");if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;d<h;d++)for(var e=CKEDITOR.getTemplates(b[d]),i=e.imagesPath,e=e.templates,n=e.length,j=0;j<n;j++){var m=o(e[j],i);m.setAttribute("aria-posinset",j+1);m.setAttribute("aria-setsize",
10
- n);c.append(m)}a.focus()}else g.setHtml('<div class="cke_tpl_empty"><span>'+f.emptyListMsg+"</span></div>")});this._.element.on("keydown",i)},onHide:function(){this._.element.removeListener("keydown",i)}}})})();
5
+ (function(){CKEDITOR.dialog.add("templates",function(c){function r(a,b){var m=CKEDITOR.dom.element.createFromHtml('\x3ca href\x3d"javascript:void(0)" tabIndex\x3d"-1" role\x3d"option" \x3e\x3cdiv class\x3d"cke_tpl_item"\x3e\x3c/div\x3e\x3c/a\x3e'),d='\x3ctable style\x3d"width:350px;" class\x3d"cke_tpl_preview" role\x3d"presentation"\x3e\x3ctr\x3e';a.image&&b&&(d+='\x3ctd class\x3d"cke_tpl_preview_img"\x3e\x3cimg src\x3d"'+CKEDITOR.getUrl(b+a.image)+'"'+(CKEDITOR.env.ie6Compat?' onload\x3d"this.width\x3dthis.width"':
6
+ "")+' alt\x3d"" title\x3d""\x3e\x3c/td\x3e');d+='\x3ctd style\x3d"white-space:normal;"\x3e\x3cspan class\x3d"cke_tpl_title"\x3e'+a.title+"\x3c/span\x3e\x3cbr/\x3e";a.description&&(d+="\x3cspan\x3e"+a.description+"\x3c/span\x3e");d+="\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e";m.getFirst().setHtml(d);m.on("click",function(){t(a.html)});return m}function t(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();
7
+ a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function k(a){var b=a.data.getTarget(),c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+
8
+ "dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,n=c.config;return{title:c.lang.templates.title,minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:"\x3cspan\x3e"+f.selectPromptMsg+"\x3c/span\x3e"},{id:"templatesList",type:"html",focus:!0,html:'\x3cdiv class\x3d"cke_tpl_list" tabIndex\x3d"-1" role\x3d"listbox" aria-labelledby\x3d"'+
9
+ h+'"\x3e\x3cdiv class\x3d"cke_tpl_loading"\x3e\x3cspan\x3e\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e\x3cspan class\x3d"cke_voice_label" id\x3d"'+h+'"\x3e'+f.options+"\x3c/span\x3e"},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption,"default":n.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(n.templates_files,function(){var b=(n.templates||"default").split(",");
10
+ if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;d<h;d++)for(var e=CKEDITOR.getTemplates(b[d]),k=e.imagesPath,e=e.templates,q=e.length,l=0;l<q;l++){var p=r(e[l],k);p.setAttribute("aria-posinset",l+1);p.setAttribute("aria-setsize",q);c.append(p)}a.focus()}else g.setHtml('\x3cdiv class\x3d"cke_tpl_empty"\x3e\x3cspan\x3e'+f.emptyListMsg+"\x3c/span\x3e\x3c/div\x3e")});this._.element.on("keydown",k)},onHide:function(){this._.element.removeListener("keydown",k)}}})})();
@@ -1,6 +1,7 @@
1
1
  /*
2
- Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
2
+ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.md or http://ckeditor.com/license
4
4
  */
5
- CKEDITOR.addTemplates("default",{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath("templates")+"templates/images/"),templates:[{title:"Image and Title",image:"template1.gif",description:"One main image with a title and text that surround the image.",html:'<h3><img src=" " alt="" style="margin-right: 10px" height="100" width="100" align="left" />Type the title here</h3><p>Type the text here</p>'},{title:"Strange Template",image:"template2.gif",description:"A template that defines two colums, each one with a title, and some text.",
6
- html:'<table cellspacing="0" cellpadding="0" style="width:100%" border="0"><tr><td style="width:50%"><h3>Title 1</h3></td><td></td><td style="width:50%"><h3>Title 2</h3></td></tr><tr><td>Text 1</td><td></td><td>Text 2</td></tr></table><p>More text goes here.</p>'},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.",html:'<div style="width: 80%"><h3>Title goes here</h3><table style="width:150px;float: right" cellspacing="0" cellpadding="0" border="1"><caption style="border:solid 1px black"><strong>Table title</strong></caption><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table><p>Type the text here</p></div>'}]});
5
+ CKEDITOR.addTemplates("default",{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath("templates")+"templates/images/"),templates:[{title:"Image and Title",image:"template1.gif",description:"One main image with a title and text that surround the image.",html:'\x3ch3\x3e\x3cimg src\x3d" " alt\x3d"" style\x3d"margin-right: 10px" height\x3d"100" width\x3d"100" align\x3d"left" /\x3eType the title here\x3c/h3\x3e\x3cp\x3eType the text here\x3c/p\x3e'},{title:"Strange Template",image:"template2.gif",description:"A template that defines two colums, each one with a title, and some text.",
6
+ html:'\x3ctable cellspacing\x3d"0" cellpadding\x3d"0" style\x3d"width:100%" border\x3d"0"\x3e\x3ctr\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 1\x3c/h3\x3e\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 2\x3c/h3\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3eText 1\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3eText 2\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cp\x3eMore text goes here.\x3c/p\x3e'},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.",
7
+ html:'\x3cdiv style\x3d"width: 80%"\x3e\x3ch3\x3eTitle goes here\x3c/h3\x3e\x3ctable style\x3d"width:150px;float: right" cellspacing\x3d"0" cellpadding\x3d"0" border\x3d"1"\x3e\x3ccaption style\x3d"border:solid 1px black"\x3e\x3cstrong\x3eTable title\x3c/strong\x3e\x3c/caption\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cp\x3eType the text here\x3c/p\x3e\x3c/div\x3e'}]});
@@ -1,3 +1,3 @@
1
1
  .cke_wordcount {display:block;float:right;margin-top:-2px;margin-right:3px;color:black;}
2
2
 
3
- .cke_wordcountLimitReached span {color:red! important}
3
+ .cke_wordcountLimitReached {color:red! important}
@@ -5,7 +5,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
5
5
  CKEDITOR.plugins.setLang('wordcount', 'en', {
6
6
  WordCount: 'Words:',
7
7
  CharCount: 'Characters:',
8
- CharCountWithHTML: 'Characters (including HTML):',
9
- limit: 'Limit:',
8
+ CharCountWithHTML: ' (with HTML: %charCountHTML%)',
9
+ Paragraphs: 'Paragraphs:',
10
+ pasteWarning: 'Content can not be pasted because it is above the allowed limit',
11
+ Selected: 'Selected: ',
10
12
  title: 'Statistics'
11
13
  });
@@ -5,7 +5,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
5
5
  CKEDITOR.plugins.setLang('wordcount', 'ru', {
6
6
  WordCount: 'Слов:',
7
7
  CharCount: 'Символов:',
8
- CharCountWithHTML: 'Символов (включая HTML):',
9
- limit: 'Лимит:',
8
+ CharCountWithHTML: ' (включая HTML разметку: %charCountHTML%)',
9
+ Paragraphs: 'Параграфов:',
10
+ pasteWarning: 'Контент не может быть вставлен, т.к. привышает допустимый лимит',
11
+ Selected: 'Выделено: ',
10
12
  title: 'Статистика'
11
13
  });
@@ -3,64 +3,120 @@
3
3
  * For licensing, see LICENSE.html or http://ckeditor.com/license
4
4
  */
5
5
 
6
- CKEDITOR.plugins.add('wordcount', {
7
- lang: 'ca,de,en,es,fr,it,jp,nl,no,pl,pt-br,ru,sv', // %REMOVE_LINE_CORE%
8
- version: 1.10,
9
- init: function(editor) {
10
- if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
11
- return;
12
- }
13
-
14
- var defaultFormat = '<span class="cke_path_item">',
6
+ CKEDITOR.plugins.add("wordcount", {
7
+ lang: "ca,de,el,en,es,fr,he,hr,it,jp,nl,no,pl,pt-br,ru,sv,tr,zh-cn", // %REMOVE_LINE_CORE%
8
+ version: 1.14,
9
+ requires: 'htmlwriter,notification,undo',
10
+ init: function (editor) {
11
+ var defaultFormat = "",
15
12
  intervalId,
16
- lastWordCount,
17
- lastCharCount = 0; /*,
13
+ lastWordCount = -1,
14
+ lastCharCount = -1,
18
15
  limitReachedNotified = false,
19
- limitRestoredNotified = false;*/
16
+ limitRestoredNotified = false,
17
+ snapShot = editor.getSnapshot();
18
+
19
+ var dispatchEvent = function (type, currentLength, maxLength) {
20
+ if (typeof document.dispatchEvent == 'undefined') {
21
+ return;
22
+ }
23
+
24
+ type = 'ckeditor.wordcount.' + type;
25
+
26
+ var cEvent;
27
+ var eventInitDict = {
28
+ bubbles: false,
29
+ cancelable: true,
30
+ detail: {
31
+ currentLength: currentLength,
32
+ maxLength: maxLength
33
+ }
34
+ };
35
+
36
+ try {
37
+ cEvent = new CustomEvent(type, eventInitDict);
38
+ } catch (o_O) {
39
+ cEvent = document.createEvent('CustomEvent');
40
+ cEvent.initCustomEvent(
41
+ type,
42
+ eventInitDict.bubbles,
43
+ eventInitDict.cancelable,
44
+ eventInitDict.detail
45
+ );
46
+ }
47
+
48
+ document.dispatchEvent(cEvent);
49
+ };
20
50
 
21
51
  // Default Config
22
52
  var defaultConfig = {
53
+ showParagraphs: true,
23
54
  showWordCount: true,
24
55
  showCharCount: false,
25
56
  countSpacesAsChars: false,
26
- //charLimit: 'unlimited',
27
- //wordLimit: 'unlimited',
28
- countHTML: false
57
+ countHTML: false,
58
+ hardLimit: true,
59
+
60
+ //MAXLENGTH Properties
61
+ maxWordCount: -1,
62
+ maxCharCount: -1,
63
+
64
+ //DisAllowed functions
65
+ wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
66
+ dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
67
+ },
68
+ charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
69
+ dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
70
+ },
71
+
72
+ //Allowed Functions
73
+ wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
74
+ dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
75
+ },
76
+ charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
77
+ dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
78
+ }
29
79
  };
30
80
 
31
81
  // Get Config & Lang
32
82
  var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true);
33
83
 
34
- if (config.showCharCount) {
35
- var charLabel = editor.lang.wordcount[config.countHTML ? 'CharCountWithHTML' : 'CharCount'];
84
+ if (config.showParagraphs) {
85
+ defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphs%";
86
+ }
36
87
 
37
- defaultFormat += charLabel + '&nbsp;%charCount%';
88
+ if (config.showParagraphs && (config.showWordCount || config.showCharCount)) {
89
+ defaultFormat += ", ";
90
+ }
38
91
 
39
- /*if (config.charLimit != 'unlimited') {
40
- defaultFormat += '&nbsp;(' + editor.lang.wordcount.limit + '&nbsp;' + config.charLimit + ')';
41
- }*/
92
+ if (config.showWordCount) {
93
+ defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
94
+ if (config.maxWordCount > -1) {
95
+ defaultFormat += "/" + config.maxWordCount;
96
+ }
42
97
  }
43
98
 
44
99
  if (config.showCharCount && config.showWordCount) {
45
- defaultFormat += ',&nbsp;';
100
+ defaultFormat += ", ";
46
101
  }
47
102
 
48
- if (config.showWordCount) {
49
- defaultFormat += editor.lang.wordcount.WordCount + ' %wordCount%';
103
+ if (config.showCharCount) {
104
+ var charLabel = editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"];
50
105
 
51
- /*if (config.wordLimit != 'unlimited') {
52
- defaultFormat += '&nbsp;(' + editor.lang.wordcount.limit + '&nbsp;' + config.wordLimit + ')';
53
- }*/
106
+ defaultFormat += charLabel + " %charCount%";
107
+ if (config.maxCharCount > -1) {
108
+ defaultFormat += "/" + config.maxCharCount;
109
+ }
54
110
  }
55
111
 
56
- defaultFormat += '</span>';
57
-
58
112
  var format = defaultFormat;
59
113
 
60
- CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl('plugins/wordcount/css/wordcount.css'));
114
+ if (config.loadCss === undefined || config.loadCss) {
115
+ CKEDITOR.document.appendStyleSheet(this.path + "css/wordcount.css");
116
+ }
61
117
 
62
118
  function counterId(editorInstance) {
63
- return 'cke_wordcount_' + editorInstance.name;
119
+ return "cke_wordcount_" + editorInstance.name;
64
120
  }
65
121
 
66
122
  function counterElement(editorInstance) {
@@ -71,172 +127,257 @@ CKEDITOR.plugins.add('wordcount', {
71
127
  var tmp = document.createElement("div");
72
128
  tmp.innerHTML = html;
73
129
 
74
- if (tmp.textContent == '' && typeof tmp.innerText == 'undefined') {
75
- return '';
130
+ if (tmp.textContent == "" && typeof tmp.innerText == "undefined") {
131
+ return "";
76
132
  }
77
133
 
78
134
  return tmp.textContent || tmp.innerText;
79
135
  }
80
136
 
81
- function updateCounter(editorInstance) {
82
- var wordCount = 0,
83
- charCount = 0,
84
- normalizedText,
85
- text;
86
-
87
- if (text = editorInstance.getData()) {
88
- if (config.showCharCount) {
89
- if (config.countHTML) {
90
- charCount = text.length;
91
- } else {
92
- // strip body tags
93
- if (editor.config.fullPage) {
94
- var i = text.search(new RegExp("<body>", "i"));
95
- if (i != -1) {
96
- var j = text.search(new RegExp("</body>", "i"));
97
- text = text.substring(i + 6, j);
98
- }
99
-
100
- }
101
-
102
- normalizedText = text.
103
- replace(/(\r\n|\n|\r)/gm, "").
104
- replace(/^\s+|\s+$/g, "").
105
- replace("&nbsp;", "");
106
-
107
- if (!config.countSpacesAsChars) {
108
- normalizedText = text.
109
- replace(/\s/g, "");
110
- }
111
-
112
- normalizedText = strip(normalizedText).replace(/^([\s\t\r\n]*)$/, "");
113
-
114
- charCount = normalizedText.length;
137
+ function countCharacters(text, editorInstance) {
138
+ if (config.countHTML) {
139
+ return (text.length);
140
+ } else {
141
+ var normalizedText;
142
+
143
+ // strip body tags
144
+ if (editor.config.fullPage) {
145
+ var i = text.search(new RegExp("<body>", "i"));
146
+ if (i != -1) {
147
+ var j = text.search(new RegExp("</body>", "i"));
148
+ text = text.substring(i + 6, j);
115
149
  }
150
+
116
151
  }
117
152
 
118
- if (config.showWordCount) {
119
- normalizedText = text.
120
- replace(/(\r\n|\n|\r)/gm, " ").
121
- replace(/^\s+|\s+$/g, "").
122
- replace("&nbsp;", " ");
153
+ normalizedText = text;
123
154
 
124
- normalizedText = strip(normalizedText);
155
+ if (!config.countSpacesAsChars) {
156
+ normalizedText = text.
157
+ replace(/\s/g, "").
158
+ replace(/&nbsp;/g, "");
159
+ }
125
160
 
126
- var words = normalizedText.split(/\s+/);
161
+ normalizedText = normalizedText.
162
+ replace(/(\r\n|\n|\r)/gm, "").
163
+ replace(/&nbsp;/gi, " ");
127
164
 
128
- for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
129
- if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
130
- words.splice(wordIndex, 1);
131
- }
132
- }
165
+ normalizedText = strip(normalizedText).replace(/^([\t\r\n]*)$/, "");
133
166
 
134
- wordCount = words.length;
135
- }
167
+ return(normalizedText.length);
136
168
  }
169
+ }
137
170
 
138
- var html = format.replace('%wordCount%', wordCount).replace('%charCount%', charCount);
139
-
140
- editor.plugins.wordcount.wordCount = wordCount;
141
- editor.plugins.wordcount.charCount = charCount;
171
+ function countParagraphs(text) {
172
+ return (text.replace(/&nbsp;/g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++").split("++").length);
173
+ }
142
174
 
143
- counterElement(editorInstance).innerHTML = html;
175
+ function countWords(text) {
176
+ var normalizedText = text.
177
+ replace(/(\r\n|\n|\r)/gm, " ").
178
+ replace(/^\s+|\s+$/g, "").
179
+ replace("&nbsp;", " ");
144
180
 
145
- if (charCount == lastCharCount) {
146
- return true;
147
- }
181
+ normalizedText = strip(normalizedText);
148
182
 
149
- lastWordCount = wordCount;
150
- lastCharCount = charCount;
183
+ var words = normalizedText.split(/\s+/);
151
184
 
152
- // Check for word limit
153
- /*if (config.showWordCount && wordCount > config.wordLimit) {
154
- limitReached(editor, limitReachedNotified);
155
- } else if (config.showWordCount && wordCount == config.wordLimit) {
156
- // create snapshot to make sure only the content after the limit gets deleted
157
- editorInstance.fire('saveSnapshot');
158
- } else if (!limitRestoredNotified && wordCount < config.wordLimit) {
159
- limitRestored(editor);
160
- }*/
161
-
162
- // Check for char limit
163
- /*if (config.showCharCount && charCount > config.charLimit) {
164
- limitReached(editor, limitReachedNotified);
165
- } else if (config.showCharCount && charCount == config.charLimit) {
166
- // create snapshot to make sure only the content after the limit gets deleted
167
- editorInstance.fire('saveSnapshot');
168
- } else if (!limitRestoredNotified && charCount < config.charLimit) {
169
- limitRestored(editor);
170
- }*/
185
+ for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
186
+ if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
187
+ words.splice(wordIndex, 1);
188
+ }
189
+ }
171
190
 
172
- return true;
191
+ return (words.length);
173
192
  }
174
193
 
175
- /*function limitReached(editorInstance, notify) {
194
+ function limitReached(editorInstance, notify) {
176
195
  limitReachedNotified = true;
177
196
  limitRestoredNotified = false;
178
197
 
179
- editorInstance.execCommand('undo');
198
+ if (config.hardLimit) {
199
+ editorInstance.loadSnapshot(snapShot);
200
+ // lock editor
201
+ editorInstance.config.Locked = 1;
202
+ }
180
203
 
181
204
  if (!notify) {
182
- //counterElement(editorInstance).className = "cke_wordcount cke_wordcountLimitReached";
183
-
184
- editorInstance.fire('limitReached', {}, editor);
205
+ counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
206
+ editorInstance.fire("limitReached", {}, editor);
185
207
  }
186
-
187
- // lock editor
188
- editorInstance.config.Locked = 1;
189
208
  }
190
209
 
191
210
  function limitRestored(editorInstance) {
192
-
193
211
  limitRestoredNotified = true;
194
212
  limitReachedNotified = false;
195
213
  editorInstance.config.Locked = 0;
196
-
197
- counterElement(editorInstance).className = "cke_wordcount";
198
- }*/
214
+ snapShot = editor.getSnapshot();
215
+
216
+ counterElement(editorInstance).className = "cke_path_item";
217
+ }
218
+
219
+ function updateCounter(editorInstance) {
220
+ var paragraphs = 0,
221
+ wordCount = 0,
222
+ charCount = 0,
223
+ text;
199
224
 
200
- editor.on('key', function(event) {
201
- if (editor.mode === 'source') {
225
+ if (text = editorInstance.getData()) {
226
+ if (config.showCharCount) {
227
+ charCount = countCharacters(text, editorInstance);
228
+ }
229
+
230
+ if (config.showParagraphs) {
231
+ paragraphs = countParagraphs(text);
232
+ }
233
+
234
+ if (config.showWordCount) {
235
+ wordCount = countWords(text);
236
+ }
237
+ }
238
+
239
+ var html = format.replace("%wordCount%", wordCount).replace("%charCount%", charCount).replace("%paragraphs%", paragraphs);
240
+
241
+ editorInstance.plugins.wordcount.wordCount = wordCount;
242
+ editorInstance.plugins.wordcount.charCount = charCount;
243
+
244
+ if (CKEDITOR.env.gecko) {
245
+ counterElement(editorInstance).innerHTML = html;
246
+ } else {
247
+ counterElement(editorInstance).innerText = html;
248
+ }
249
+
250
+ if (charCount == lastCharCount && wordCount == lastWordCount) {
251
+ return true;
252
+ }
253
+
254
+ //If the limit is already over, allow the deletion of characters/words. Otherwise,
255
+ //the user would have to delete at one go the number of offending characters
256
+ var deltaWord = wordCount - lastWordCount;
257
+ var deltaChar = charCount - lastCharCount;
258
+
259
+ lastWordCount = wordCount;
260
+ lastCharCount = charCount;
261
+
262
+ if (lastWordCount == -1) {
263
+ lastWordCount = wordCount;
264
+ }
265
+ if (lastCharCount == -1) {
266
+ lastCharCount = charCount;
267
+ }
268
+
269
+ // Check for word limit and/or char limit
270
+ if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
271
+ (config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
272
+
273
+ limitReached(editorInstance, limitReachedNotified);
274
+ } else if ((config.maxWordCount == -1 || wordCount < config.maxWordCount) &&
275
+ (config.maxCharCount == -1 || charCount < config.maxCharCount)) {
276
+
277
+ limitRestored(editorInstance);
278
+ } else {
279
+ snapShot = editorInstance.getSnapshot();
280
+ }
281
+
282
+ // Fire Custom Events
283
+ if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
284
+ if (charCount > config.maxCharCount && config.maxCharCount > -1) {
285
+ config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
286
+ } else {
287
+ config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
288
+ }
289
+ }
290
+
291
+ if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
292
+ if (wordCount > config.maxWordCount && config.maxWordCount > -1) {
293
+ config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
294
+
295
+ } else {
296
+ config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
297
+ }
298
+ }
299
+
300
+ return true;
301
+ }
302
+
303
+ editor.on("key", function (event) {
304
+ if (editor.mode === "source") {
202
305
  updateCounter(event.editor);
203
306
  }
204
307
  }, editor, null, 100);
205
308
 
206
- editor.on('change', function(event) {
207
-
309
+ editor.on("change", function (event) {
208
310
  updateCounter(event.editor);
209
311
  }, editor, null, 100);
210
312
 
211
- editor.on('uiSpace', function(event) {
212
- if (event.data.space == 'bottom') {
213
- event.data.html += '<div id="' + counterId(event.editor) + '" class="cke_wordcount" style=""' + ' title="' + editor.lang.wordcount.title + '"' + '>&nbsp;</div>';
313
+ editor.on("uiSpace", function (event) {
314
+ if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
315
+ if (event.data.space == "top") {
316
+ event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
317
+ " title=\"" +
318
+ editor.lang.wordcount.title +
319
+ "\"" +
320
+ "><span id=\"" +
321
+ counterId(event.editor) +
322
+ "\" class=\"cke_path_item\">&nbsp;</span></div>";
323
+ }
324
+ } else {
325
+ if (event.data.space == "bottom") {
326
+ event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
327
+ " title=\"" +
328
+ editor.lang.wordcount.title +
329
+ "\"" +
330
+ "><span id=\"" +
331
+ counterId(event.editor) +
332
+ "\" class=\"cke_path_item\">&nbsp;</span></div>";
333
+ }
214
334
  }
335
+
215
336
  }, editor, null, 100);
216
337
 
217
- editor.on('dataReady', function(event) {
338
+ editor.on("dataReady", function (event) {
218
339
  updateCounter(event.editor);
219
340
  }, editor, null, 100);
220
341
 
221
- editor.on('afterPaste', function(event) {
342
+ editor.on("paste", function(event) {
343
+ if (config.maxWordCount > 0 || config.maxCharCount > 0) {
344
+
345
+ // Check if pasted content is above the limits
346
+ var wordCount = -1,
347
+ charCount = -1,
348
+ text = event.editor.getData() + event.data.dataValue;
349
+
350
+
351
+ if (config.showCharCount) {
352
+ charCount = countCharacters(text, event.editor);
353
+ }
354
+
355
+ if (config.showWordCount) {
356
+ wordCount = countWords(text);
357
+ }
358
+
359
+ var notification = new CKEDITOR.plugins.notification(event.editor, { message: event.editor.lang.wordcount.pasteWarning, type: 'warning' });
360
+
361
+ if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
362
+ notification.show();
363
+ event.cancel();
364
+ }
365
+
366
+ if (config.maxWordCount > 0 && wordCount > config.maxWordCount && config.hardLimit) {
367
+ notification.show();
368
+ event.cancel();
369
+ }
370
+ }
371
+ }, editor, null, 100);
372
+
373
+ editor.on("afterPaste", function (event) {
222
374
  updateCounter(event.editor);
223
375
  }, editor, null, 100);
224
- /*editor.on('focus', function (event) {
225
- editorHasFocus = true;
226
- intervalId = window.setInterval(function () {
227
- updateCounter(editor);
228
- }, 300, event.editor);
229
- }, editor, null, 300);*/
230
- editor.on('blur', function() {
376
+
377
+ editor.on("blur", function () {
231
378
  if (intervalId) {
232
379
  window.clearInterval(intervalId);
233
380
  }
234
381
  }, editor, null, 300);
235
-
236
- if (!String.prototype.trim) {
237
- String.prototype.trim = function() {
238
- return this.replace(/^\s+|\s+$/g, '');
239
- };
240
- }
241
382
  }
242
383
  });