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
@@ -0,0 +1,7 @@
1
+ /*
2
+ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+ CKEDITOR.plugins.setLang( 'notification', 'en', {
6
+ closed: 'Notification closed.'
7
+ } );
@@ -0,0 +1,7 @@
1
+ /*
2
+ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+ CKEDITOR.plugins.setLang( 'notification', 'ru', {
6
+ closed: 'Уведомление закрыто'
7
+ } );
@@ -0,0 +1,923 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+
6
+ /**
7
+ * @fileOverview The "Notification" plugin.
8
+ *
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ CKEDITOR.plugins.add( 'notification', {
14
+ lang: 'cs,da,de,de-ch,en,eo,eu,fr,gl,id,it,ko,ku,nb,nl,pl,pt-br,ru,sv,tr,ug,uk,zh,zh-cn', // %REMOVE_LINE_CORE%
15
+ requires: 'toolbar',
16
+
17
+ init: function( editor ) {
18
+ editor._.notificationArea = new Area( editor );
19
+
20
+ // Overwrites default `editor.showNotification`.
21
+ editor.showNotification = function( message, type, progressOrDuration ) {
22
+ var progress, duration;
23
+
24
+ if ( type == 'progress' ) {
25
+ progress = progressOrDuration;
26
+ } else {
27
+ duration = progressOrDuration;
28
+ }
29
+
30
+ var notification = new CKEDITOR.plugins.notification( editor, {
31
+ message: message,
32
+ type: type,
33
+ progress: progress,
34
+ duration: duration
35
+ } );
36
+
37
+ notification.show();
38
+
39
+ return notification;
40
+ };
41
+
42
+ // Close the last notification on ESC.
43
+ editor.on( 'key', function( evt ) {
44
+ if ( evt.data.keyCode == 27 ) { /* ESC */
45
+ var notifications = editor._.notificationArea.notifications;
46
+
47
+ if ( !notifications.length ) {
48
+ return;
49
+ }
50
+
51
+ // As long as this is not a common practice to inform screen-reader users about actions, in this case
52
+ // this is the best solution (unfortunately there is no standard for accessibility for notifications).
53
+ // Notification has an `alert` aria role what means that it does not get a focus nor is needed to be
54
+ // closed (unlike `alertdialog`). However notification will capture ESC key so we need to inform user
55
+ // why it does not do other actions.
56
+ say( editor.lang.notification.closed );
57
+
58
+ // Hide last.
59
+ notifications[ notifications.length - 1 ].hide();
60
+
61
+ evt.cancel();
62
+ }
63
+ } );
64
+
65
+ // Send the message to the screen readers.
66
+ function say( text ) {
67
+ var message = new CKEDITOR.dom.element( 'div' );
68
+ message.setStyles( {
69
+ position: 'fixed',
70
+ 'margin-left': '-9999px'
71
+ } );
72
+ message.setAttributes( {
73
+ 'aria-live': 'assertive',
74
+ 'aria-atomic': 'true'
75
+ } );
76
+ message.setText( text );
77
+
78
+ CKEDITOR.document.getBody().append( message );
79
+
80
+ setTimeout( function() {
81
+ message.remove();
82
+ }, 100 );
83
+ }
84
+ }
85
+ } );
86
+
87
+ /**
88
+ * Notification class. Notifications are used to display short messages to the user. They might be used to show the result of
89
+ * asynchronous actions or information about changes in the editor content. It is recommended to use them instead of
90
+ * alert dialogs. They should **not** be used if a user response is required nor with dialog windows (e.g. in dialog validation).
91
+ *
92
+ * There are four types of notifications available, see the {@link #type} property.
93
+ *
94
+ * Note that the notification constructor only creates a notification instance. To show it, use the {@link #show} method:
95
+ *
96
+ * var notification = new CKEDITOR.plugins.notification( editor, { message: 'Foo' } );
97
+ * notification.show();
98
+ *
99
+ * You can also use the {@link CKEDITOR.editor#showNotification} method:
100
+ *
101
+ * editor.showNotification( 'Foo' );
102
+ *
103
+ * All of the notification actions: ({@link #show}, {@link #update} and {@link #hide}) fire cancelable events
104
+ * on the related {@link CKEDITOR.editor} instance so you can integrate editor notifications with your website notifications.
105
+ *
106
+ * Refer to the [Notifications](http://docs.ckeditor.com/#!/guide/dev_notifications) article for more information about this feature.
107
+ *
108
+ * @since 4.5
109
+ * @class CKEDITOR.plugins.notification
110
+ * @constructor Create a notification object. Call {@link #show} to show the created notification.
111
+ * @param {CKEDITOR.editor} editor The editor instance.
112
+ * @param {Object} options
113
+ * @param {String} options.message The message displayed in the notification.
114
+ * @param {String} [options.type='info'] Notification type, see {@link #type}.
115
+ * @param {Number} [options.progress=0] If the type is `progress` this may be a progress from 0 to 1.
116
+ * @param {Number} [options.duration] How long the notification will be visible, see {@link #duration}.
117
+ */
118
+ function Notification( editor, options ) {
119
+ CKEDITOR.tools.extend( this, options, {
120
+ editor: editor,
121
+ id: 'cke-' + CKEDITOR.tools.getUniqueId(),
122
+ area: editor._.notificationArea
123
+ } );
124
+
125
+ if ( !options.type ) {
126
+ this.type = 'info';
127
+ }
128
+
129
+ this.element = this._createElement();
130
+
131
+ // Don't allow dragging on notification (#13184).
132
+ editor.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement( this.element );
133
+ }
134
+
135
+ /**
136
+ * The editor instance.
137
+ *
138
+ * @readonly
139
+ * @property {CKEDITOR.editor} editor
140
+ */
141
+
142
+ /**
143
+ * Message displayed in the notification.
144
+ *
145
+ * @readonly
146
+ * @property {String} message
147
+ */
148
+
149
+ /**
150
+ * Notification type. There are four types available:
151
+ *
152
+ * * `info` (default) – Information for the user (e.g. "File is uploading.", "ACF modified content."),
153
+ * * `warning` – Warning or error message (e.g. "This type of file is not supported.",
154
+ * "You cannot paste the script."),
155
+ * * `success` – Information that an operation finished successfully (e.g. "File uploaded.", "Data imported.").
156
+ * * `progress` – Information about the progress of an operation. When the operation is done, the notification
157
+ * type should be changed to `success`.
158
+ *
159
+ * @readonly
160
+ * @property {String} type
161
+ */
162
+
163
+ /**
164
+ * If the notification {@link #type} is `'progress'`, this is the progress from `0` to `1`.
165
+ *
166
+ * @readonly
167
+ * @property {Number} progress
168
+ */
169
+
170
+ /**
171
+ * Notification duration. Determines after how many milliseconds the notification should close automatically.
172
+ * `0` means that the notification will not close automatically and that the user needs to close it manually.
173
+ * The default value for `warning` and `progress` notifications is `0`. For `info` and `success` the value can
174
+ * either be set through the {@link CKEDITOR.config#notification_duration} configuration option or equals `5000`
175
+ * if the configuration option is not set.
176
+ *
177
+ * @readonly
178
+ * @property {Number} duration
179
+ */
180
+
181
+ /**
182
+ * Unique notification ID.
183
+ *
184
+ * @readonly
185
+ * @property {Number} id
186
+ */
187
+
188
+ /**
189
+ * Notification DOM element. There is one element per notification. It is created when the notification is created,
190
+ * even if it is not shown. If the notification is hidden, the element is detached from the document but not deleted.
191
+ * It will be reused if the notification is shown again.
192
+ *
193
+ * @readonly
194
+ * @property {CKEDITOR.dom.element} element
195
+ */
196
+
197
+ /**
198
+ * {@link CKEDITOR.plugins.notification.area Notification area} reference.
199
+ *
200
+ * @readonly
201
+ * @property {CKEDITOR.plugins.notification.area} area
202
+ */
203
+
204
+ Notification.prototype = {
205
+ /**
206
+ * Adds the notification element to the notification area. The notification will be hidden automatically if
207
+ * {@link #duration} is set.
208
+ *
209
+ * Fires the {@link CKEDITOR.editor#notificationShow} event.
210
+ */
211
+ show: function() {
212
+ if ( this.editor.fire( 'notificationShow', { notification: this } ) === false ) {
213
+ return;
214
+ }
215
+
216
+ this.area.add( this );
217
+
218
+ this._hideAfterTimeout();
219
+ },
220
+
221
+ /**
222
+ * Updates the notification object and element.
223
+ *
224
+ * Fires the {@link CKEDITOR.editor#notificationUpdate} event.
225
+ *
226
+ * @param {Object} options
227
+ * @param {String} [options.message] {@link #message}
228
+ * @param {String} [options.type] {@link #type}
229
+ * @param {Number} [options.progress] {@link #progress}
230
+ * @param {Number} [options.duration] {@link #duration}
231
+ * @param {Boolean} [options.important=false] If the update is important, the notification will be shown
232
+ * if it was hidden and read by screen readers.
233
+ */
234
+ update: function( options ) {
235
+ var show = true;
236
+
237
+ if ( this.editor.fire( 'notificationUpdate', { notification: this, options: options } ) === false ) {
238
+ // The idea of cancelable event is to let user create his own way of displaying notification, so if
239
+ // `notificationUpdate` event will be canceled there will be no interaction with notification area, but on
240
+ // the other hand the logic should work anyway so object will be updated (including `element` property).
241
+ // Note: we can safely update the element's attributes below, because this element is created inside
242
+ // the constructor. If the notificatinShow event was canceled as well, the element is detached from DOM.
243
+ show = false;
244
+ }
245
+
246
+ var element = this.element,
247
+ messageElement = element.findOne( '.cke_notification_message' ),
248
+ progressElement = element.findOne( '.cke_notification_progress' ),
249
+ type = options.type;
250
+
251
+ element.removeAttribute( 'role' );
252
+
253
+ // Change type to progress if `options.progress` is set.
254
+ if ( options.progress && this.type != 'progress' ) {
255
+ type = 'progress';
256
+ }
257
+
258
+ if ( type ) {
259
+ element.removeClass( this._getClass() );
260
+ element.removeAttribute( 'aria-label' );
261
+
262
+ this.type = type;
263
+
264
+ element.addClass( this._getClass() );
265
+ element.setAttribute( 'aria-label', this.type );
266
+
267
+ if ( this.type == 'progress' && !progressElement ) {
268
+ progressElement = this._createProgressElement();
269
+ progressElement.insertBefore( messageElement );
270
+ } else if ( this.type != 'progress' && progressElement ) {
271
+ progressElement.remove();
272
+ }
273
+ }
274
+
275
+ if ( options.message !== undefined ) {
276
+ this.message = options.message;
277
+ messageElement.setHtml( this.message );
278
+ }
279
+
280
+ if ( options.progress !== undefined ) {
281
+ this.progress = options.progress;
282
+
283
+ if ( progressElement ) {
284
+ progressElement.setStyle( 'width', this._getPercentageProgress() );
285
+ }
286
+ }
287
+
288
+ if ( show && options.important ) {
289
+ element.setAttribute( 'role', 'alert' );
290
+
291
+ if ( !this.isVisible() ) {
292
+ this.area.add( this );
293
+ }
294
+ }
295
+
296
+ // Overwrite even if it is undefined.
297
+ this.duration = options.duration;
298
+
299
+ this._hideAfterTimeout();
300
+ },
301
+
302
+ /**
303
+ * Removes the notification element from the notification area.
304
+ *
305
+ * Fires the {@link CKEDITOR.editor#notificationHide} event.
306
+ */
307
+ hide: function() {
308
+ if ( this.editor.fire( 'notificationHide', { notification: this } ) === false ) {
309
+ return;
310
+ }
311
+
312
+ this.area.remove( this );
313
+ },
314
+
315
+ /**
316
+ * Returns `true` if the notification is in the notification area.
317
+ *
318
+ * @returns {Boolean} `true` if the notification is in the notification area.
319
+ */
320
+ isVisible: function() {
321
+ return CKEDITOR.tools.indexOf( this.area.notifications, this ) >= 0;
322
+ },
323
+
324
+ /**
325
+ * Creates the notification DOM element.
326
+ *
327
+ * @private
328
+ * @returns {CKEDITOR.dom.element} Notification DOM element.
329
+ */
330
+ _createElement: function() {
331
+ var notification = this,
332
+ notificationElement, notificationMessageElement, notificationCloseElement,
333
+ close = this.editor.lang.common.close;
334
+
335
+ notificationElement = new CKEDITOR.dom.element( 'div' );
336
+ notificationElement.addClass( 'cke_notification' );
337
+ notificationElement.addClass( this._getClass() );
338
+ notificationElement.setAttributes( {
339
+ id: this.id,
340
+ role: 'alert',
341
+ 'aria-label': this.type
342
+ } );
343
+
344
+ if ( this.type == 'progress' )
345
+ notificationElement.append( this._createProgressElement() );
346
+
347
+ notificationMessageElement = new CKEDITOR.dom.element( 'p' );
348
+ notificationMessageElement.addClass( 'cke_notification_message' );
349
+ notificationMessageElement.setHtml( this.message );
350
+ notificationElement.append( notificationMessageElement );
351
+
352
+ notificationCloseElement = CKEDITOR.dom.element.createFromHtml(
353
+ '<a class="cke_notification_close" href="javascript:void(0)" title="' + close + '" role="button" tabindex="-1">' +
354
+ '<span class="cke_label">X</span>' +
355
+ '</a>' );
356
+ notificationElement.append( notificationCloseElement );
357
+
358
+ notificationCloseElement.on( 'click', function() {
359
+ // Focus editor on close (#12865)
360
+ notification.editor.focus();
361
+
362
+ notification.hide();
363
+ } );
364
+
365
+ return notificationElement;
366
+ },
367
+
368
+ /**
369
+ * Gets the notification CSS class.
370
+ *
371
+ * @private
372
+ * @returns {String} Notification CSS class.
373
+ */
374
+ _getClass: function() {
375
+ return ( this.type == 'progress' ) ?
376
+ 'cke_notification_info' :
377
+ ( 'cke_notification_' + this.type );
378
+ },
379
+
380
+ /**
381
+ * Creates a progress element for the notification element.
382
+ *
383
+ * @private
384
+ * @returns {CKEDITOR.dom.element} Progress element for the notification element.
385
+ */
386
+ _createProgressElement: function() {
387
+ var element = new CKEDITOR.dom.element( 'span' );
388
+ element.addClass( 'cke_notification_progress' );
389
+ element.setStyle( 'width', this._getPercentageProgress() );
390
+ return element;
391
+ },
392
+
393
+ /**
394
+ * Gets the progress as a percentage (ex. `0.3` -> `30%`).
395
+ *
396
+ * @private
397
+ * @returns {String} Progress as a percentage.
398
+ */
399
+ _getPercentageProgress: function() {
400
+ return Math.round( ( this.progress || 0 ) * 100 ) + '%';
401
+ },
402
+
403
+ /**
404
+ * Hides the notification after a timeout.
405
+ *
406
+ * @private
407
+ */
408
+ _hideAfterTimeout: function() {
409
+ var notification = this,
410
+ duration;
411
+
412
+ if ( this._hideTimeoutId ) {
413
+ clearTimeout( this._hideTimeoutId );
414
+ }
415
+
416
+ if ( typeof this.duration == 'number' ) {
417
+ duration = this.duration;
418
+ } else if ( this.type == 'info' || this.type == 'success' ) {
419
+ duration = ( typeof this.editor.config.notification_duration == 'number' ) ?
420
+ this.editor.config.notification_duration :
421
+ 5000;
422
+ }
423
+
424
+ if ( duration ) {
425
+ notification._hideTimeoutId = setTimeout( function() {
426
+ notification.hide();
427
+ }, duration );
428
+ }
429
+ }
430
+ };
431
+
432
+ /**
433
+ * Notification area is an area where all notifications are put. The area is laid out dynamically.
434
+ * When the first notification is added, the area is shown and all listeners are added.
435
+ * When the last notification is removed, the area is hidden and all listeners are removed.
436
+ *
437
+ * @since 4.5
438
+ * @private
439
+ * @class CKEDITOR.plugins.notification.area
440
+ * @constructor
441
+ * @param {CKEDITOR.editor} editor The editor instance.
442
+ */
443
+ function Area( editor ) {
444
+ var that = this;
445
+
446
+ this.editor = editor;
447
+ this.notifications = [];
448
+ this.element = this._createElement();
449
+ this._uiBuffer = CKEDITOR.tools.eventsBuffer( 10, this._layout, this );
450
+ this._changeBuffer = CKEDITOR.tools.eventsBuffer( 500, this._layout, this );
451
+
452
+ editor.on( 'destroy', function() {
453
+ that._removeListeners();
454
+ that.element.remove();
455
+ } );
456
+ }
457
+
458
+ /**
459
+ * The editor instance.
460
+ *
461
+ * @readonly
462
+ * @property {CKEDITOR.editor} editor
463
+ */
464
+
465
+ /**
466
+ * The array of added notifications.
467
+ *
468
+ * @readonly
469
+ * @property {Array} notifications
470
+ */
471
+
472
+ /**
473
+ * Notification area DOM element. This element is created when the area object is created. It will be attached to the document
474
+ * when the first notification is added and removed when the last notification is removed.
475
+ *
476
+ * @readonly
477
+ * @property {CKEDITOR.dom.element} element
478
+ */
479
+
480
+ /**
481
+ * Notification width. Cached for performance reasons.
482
+ *
483
+ * @private
484
+ * @property {CKEDITOR.dom.element} _notificationWidth
485
+ */
486
+
487
+ /**
488
+ * Notification margin. Cached for performance reasons.
489
+ *
490
+ * @private
491
+ * @property {CKEDITOR.dom.element} _notificationMargin
492
+ */
493
+
494
+ /**
495
+ * Event buffer object for UI events to optimize performance.
496
+ *
497
+ * @private
498
+ * @property {Object} _uiBuffer
499
+ */
500
+
501
+ /**
502
+ * Event buffer object for editor change events to optimize performance.
503
+ *
504
+ * @private
505
+ * @property {Object} _changeBuffer
506
+ */
507
+
508
+ Area.prototype = {
509
+ /**
510
+ * Adds the notification to the notification area. If it is the first notification, the area will also be attached to
511
+ * the document and listeners will be attached.
512
+ *
513
+ * Note that the proper way to show a notification is to call the {@link CKEDITOR.plugins.notification#show} method.
514
+ *
515
+ * @param {CKEDITOR.plugins.notification} notification Notification to add.
516
+ */
517
+ add: function( notification ) {
518
+ this.notifications.push( notification );
519
+
520
+ this.element.append( notification.element );
521
+
522
+ if ( this.element.getChildCount() == 1 ) {
523
+ CKEDITOR.document.getBody().append( this.element );
524
+ this._attachListeners();
525
+ }
526
+
527
+ this._layout();
528
+ },
529
+
530
+ /**
531
+ * Removes the notification from the notification area. If it is the last notification, the area will also be
532
+ * detached from the document and listeners will be detached.
533
+ *
534
+ * Note that the proper way to hide a notification is to call the {@link CKEDITOR.plugins.notification#hide} method.
535
+ *
536
+ * @param {CKEDITOR.plugins.notification} notification Notification to remove.
537
+ */
538
+ remove: function( notification ) {
539
+ var i = CKEDITOR.tools.indexOf( this.notifications, notification );
540
+
541
+ if ( i < 0 ) {
542
+ return;
543
+ }
544
+
545
+ this.notifications.splice( i, 1 );
546
+
547
+ notification.element.remove();
548
+
549
+ if ( !this.element.getChildCount() ) {
550
+ this._removeListeners();
551
+ this.element.remove();
552
+ }
553
+ },
554
+
555
+ /**
556
+ * Creates the notification area element.
557
+ *
558
+ * @private
559
+ * @returns {CKEDITOR.dom.element} Notification area element.
560
+ */
561
+ _createElement: function() {
562
+ var editor = this.editor,
563
+ config = editor.config,
564
+ notificationArea = new CKEDITOR.dom.element( 'div' );
565
+
566
+ notificationArea.addClass( 'cke_notifications_area' );
567
+ notificationArea.setAttribute( 'id', 'cke_notifications_area_' + editor.name );
568
+ notificationArea.setStyle( 'z-index', config.baseFloatZIndex - 2 );
569
+
570
+ return notificationArea;
571
+ },
572
+
573
+ /**
574
+ * Attaches listeners to the notification area.
575
+ *
576
+ * @private
577
+ */
578
+ _attachListeners: function() {
579
+ var win = CKEDITOR.document.getWindow(),
580
+ editor = this.editor;
581
+
582
+ win.on( 'scroll', this._uiBuffer.input );
583
+ win.on( 'resize', this._uiBuffer.input );
584
+ editor.on( 'change', this._changeBuffer.input );
585
+ editor.on( 'floatingSpaceLayout', this._layout, this, null, 20 );
586
+ editor.on( 'blur', this._layout, this, null, 20 );
587
+ },
588
+
589
+ /**
590
+ * Detaches listeners from the notification area.
591
+ *
592
+ * @private
593
+ */
594
+ _removeListeners: function() {
595
+ var win = CKEDITOR.document.getWindow(),
596
+ editor = this.editor;
597
+
598
+ win.removeListener( 'scroll', this._uiBuffer.input );
599
+ win.removeListener( 'resize', this._uiBuffer.input );
600
+ editor.removeListener( 'change', this._changeBuffer.input );
601
+ editor.removeListener( 'floatingSpaceLayout', this._layout );
602
+ editor.removeListener( 'blur', this._layout );
603
+ },
604
+
605
+ /**
606
+ * Sets the position of the notification area based on the editor content, toolbar as well as
607
+ * viewport position and dimensions.
608
+ *
609
+ * @private
610
+ */
611
+ _layout: function() {
612
+ var area = this.element,
613
+ editor = this.editor,
614
+ contentsRect = editor.ui.contentsElement.getClientRect(),
615
+ contentsPos = editor.ui.contentsElement.getDocumentPosition(),
616
+ top = editor.ui.space( 'top' ),
617
+ topRect = top.getClientRect(),
618
+ areaRect = area.getClientRect(),
619
+ notification,
620
+ notificationWidth = this._notificationWidth,
621
+ notificationMargin = this._notificationMargin,
622
+ win = CKEDITOR.document.getWindow(),
623
+ scrollPos = win.getScrollPosition(),
624
+ viewRect = win.getViewPaneSize(),
625
+ body = CKEDITOR.document.getBody(),
626
+ bodyPos = body.getDocumentPosition(),
627
+ cssLength = CKEDITOR.tools.cssLength;
628
+
629
+ // Cache for optimization
630
+ if ( !notificationWidth || !notificationMargin ) {
631
+ notification = this.element.getChild( 0 );
632
+ notificationWidth = this._notificationWidth = notification.getClientRect().width;
633
+ notificationMargin = this._notificationMargin =
634
+ parseInt( notification.getComputedStyle( 'margin-left' ), 10 ) +
635
+ parseInt( notification.getComputedStyle( 'margin-right' ), 10 );
636
+ }
637
+
638
+ // --------------------------------------- Horizontal layout ----------------------------------------
639
+
640
+ // +---Viewport-------------------------------+ +---Viewport-------------------------------+
641
+ // | | | |
642
+ // | +---Toolbar----------------------------+ | | +---Content----------------------------+ |
643
+ // | | | | | | | |
644
+ // | +---Content----------------------------+ | | | | |
645
+ // | | | | | +---Toolbar----------------------+ | |
646
+ // | | +------Notification------+ | | | | | | |
647
+ // | | | | OR | +--------------------------------+ | |
648
+ // | | | | | | | |
649
+ // | | | | | | +------Notification------+ | |
650
+ // | | | | | | | |
651
+ // | | | | | | | |
652
+ // | +--------------------------------------+ | | +--------------------------------------+ |
653
+ // +------------------------------------------+ +------------------------------------------+
654
+ if ( top.isVisible() &&
655
+ topRect.bottom > contentsRect.top &&
656
+ topRect.bottom < contentsRect.bottom - areaRect.height ) {
657
+ setBelowToolbar();
658
+
659
+ // +---Viewport-------------------------------+
660
+ // | |
661
+ // | +---Content----------------------------+ |
662
+ // | | | |
663
+ // | | +------Notification------+ | |
664
+ // | | | |
665
+ // | | | |
666
+ // | | | |
667
+ // | +--------------------------------------+ |
668
+ // | |
669
+ // +------------------------------------------+
670
+ } else if ( contentsRect.top > 0 ) {
671
+ setTopStandard();
672
+
673
+ // +---Content----------------------------+
674
+ // | |
675
+ // +---Viewport-------------------------------+
676
+ // | | | |
677
+ // | | +------Notification------+ | |
678
+ // | | | |
679
+ // | | | |
680
+ // | | | |
681
+ // | +--------------------------------------+ |
682
+ // | |
683
+ // +------------------------------------------+
684
+ } else if ( contentsPos.y + contentsRect.height - areaRect.height > scrollPos.y ) {
685
+ setTopFixed();
686
+
687
+ // +---Content----------------------------+ +---Content----------------------------+
688
+ // | | | |
689
+ // | | | |
690
+ // | | | +------Notification------+ |
691
+ // | | | |
692
+ // | | OR +--------------------------------------+
693
+ // +---Viewport-------------------------------+
694
+ // | | +------Notification------+ | | +---Viewport-------------------------------+
695
+ // | | | | | |
696
+ // | +--------------------------------------+ | | |
697
+ // | | | |
698
+ // +------------------------------------------+ +------------------------------------------+
699
+ } else {
700
+ setBottom();
701
+ }
702
+
703
+ function setTopStandard() {
704
+ area.setStyles( {
705
+ position: 'absolute',
706
+ top: cssLength( contentsPos.y )
707
+ } );
708
+ }
709
+
710
+ function setBelowToolbar() {
711
+ area.setStyles( {
712
+ position: 'fixed',
713
+ top: cssLength( topRect.bottom )
714
+ } );
715
+ }
716
+
717
+ function setTopFixed() {
718
+ area.setStyles( {
719
+ position: 'fixed',
720
+ top: 0
721
+ } );
722
+ }
723
+
724
+ function setBottom() {
725
+ area.setStyles( {
726
+ position: 'absolute',
727
+ top: cssLength( contentsPos.y + contentsRect.height - areaRect.height )
728
+ } );
729
+ }
730
+
731
+ // ---------------------------------------- Vertical layout -----------------------------------------
732
+
733
+ var leftBase = area.getStyle( 'position' ) == 'fixed' ?
734
+ contentsRect.left :
735
+ body.getComputedStyle( 'position' ) != 'static' ? contentsPos.x - bodyPos.x : contentsPos.x;
736
+
737
+ // Content is narrower than notification
738
+ if ( contentsRect.width < notificationWidth + notificationMargin ) {
739
+
740
+ // +---Viewport-------------------------------+
741
+ // | |
742
+ // | +---Content------------+ |
743
+ // | | | |
744
+ // | +------Notification------+ | |
745
+ // | | | |
746
+ // | +----------------------+ |
747
+ // | |
748
+ // +------------------------------------------+
749
+ if ( contentsPos.x + notificationWidth + notificationMargin > scrollPos.x + viewRect.width ) {
750
+ setRight();
751
+
752
+ // +---Viewport-------------------------------+ +---Viewport--------------------------+
753
+ // | | | |
754
+ // | +---Content------------+ | +---Content------------+ |
755
+ // | | | | | | | |
756
+ // | | +------Notification------+ | OR | +------Notification------+ |
757
+ // | | | | | | | |
758
+ // | +----------------------+ | +----------------------+ |
759
+ // | | | |
760
+ // +------------------------------------------+ +-------------------------------------+
761
+ } else {
762
+ setLeft();
763
+ }
764
+
765
+ // Content is wider than notification.
766
+ } else {
767
+
768
+ // +--+Viewport+------------------------+
769
+ // | |
770
+ // | +---Content-----------------------------------------+
771
+ // | | | |
772
+ // | | +-----+Notification+-----+ |
773
+ // | | | |
774
+ // | | | |
775
+ // | | | |
776
+ // | +---------------------------------------------------+
777
+ // | |
778
+ // +------------------------------------+
779
+ if ( contentsPos.x + notificationWidth + notificationMargin > scrollPos.x + viewRect.width ) {
780
+ setLeft();
781
+
782
+ // +---Viewport-------------------------+
783
+ // | |
784
+ // | +---Content----------------------------------------------+
785
+ // | | | |
786
+ // | | +------Notification------+ | |
787
+ // | | | |
788
+ // | | | |
789
+ // | +--------------------------------------------------------+
790
+ // | |
791
+ // +------------------------------------+
792
+ } else if ( contentsPos.x + contentsRect.width / 2 +
793
+ notificationWidth / 2 + notificationMargin > scrollPos.x + viewRect.width ) {
794
+ setRightFixed();
795
+
796
+ // +---Viewport-------------------------+
797
+ // | |
798
+ // +---Content----------------------------+ |
799
+ // | | | |
800
+ // | +------Notification------+ | |
801
+ // | | | |
802
+ // | | | |
803
+ // +--------------------------------------+ |
804
+ // | |
805
+ // +------------------------------------+
806
+ } else if ( contentsRect.left + contentsRect.width - notificationWidth - notificationMargin < 0 ) {
807
+ setRight();
808
+
809
+ // +---Viewport-------------------------+
810
+ // | |
811
+ // +---Content---------------------------------------------+ |
812
+ // | | | |
813
+ // | | +------Notification------+ | |
814
+ // | | | |
815
+ // | | | |
816
+ // +-------------------------------------------------------+ |
817
+ // | |
818
+ // +------------------------------------+
819
+ } else if ( contentsRect.left + contentsRect.width / 2 - notificationWidth / 2 < 0 ) {
820
+ setLeftFixed();
821
+
822
+ // +---Viewport-------------------------+
823
+ // | |
824
+ // | +---Content----------------------+ |
825
+ // | | | |
826
+ // | | +-----Notification-----+ | |
827
+ // | | | |
828
+ // | | | |
829
+ // | +--------------------------------+ |
830
+ // | |
831
+ // +------------------------------------+
832
+ } else {
833
+ setCenter();
834
+ }
835
+ }
836
+
837
+ function setLeft() {
838
+ area.setStyle( 'left', cssLength( leftBase ) );
839
+ }
840
+
841
+ function setLeftFixed() {
842
+ area.setStyle( 'left', cssLength( leftBase - contentsPos.x + scrollPos.x ) );
843
+ }
844
+
845
+ function setCenter() {
846
+ area.setStyle( 'left', cssLength( leftBase + contentsRect.width / 2 - notificationWidth / 2 - notificationMargin / 2 ) );
847
+ }
848
+
849
+ function setRight() {
850
+ area.setStyle( 'left', cssLength( leftBase + contentsRect.width - notificationWidth - notificationMargin ) );
851
+ }
852
+
853
+ function setRightFixed() {
854
+ area.setStyle( 'left', cssLength( leftBase - contentsPos.x + scrollPos.x + viewRect.width -
855
+ notificationWidth - notificationMargin ) );
856
+ }
857
+ }
858
+ };
859
+
860
+ CKEDITOR.plugins.notification = Notification;
861
+
862
+ /**
863
+ * After how many milliseconds the notification of the `info` and `success`
864
+ * {@link CKEDITOR.plugins.notification#type type} should close automatically.
865
+ * `0` means that notifications will not close automatically.
866
+ * Note that `warning` and `progress` notifications will never close automatically.
867
+ *
868
+ * Refer to the [Notifications](http://docs.ckeditor.com/#!/guide/dev_notifications) article
869
+ * for more information about this feature.
870
+ *
871
+ * @since 4.5
872
+ * @cfg {Number} [notification_duration=5000]
873
+ * @member CKEDITOR.config
874
+ */
875
+
876
+ /**
877
+ * Event fired when the {@link CKEDITOR.plugins.notification#show} method is called, before the
878
+ * notification is shown. If this event is canceled, the notification will not be shown.
879
+ *
880
+ * Using this event allows you to fully customize how a notification will be shown. It may be used to integrate
881
+ * the CKEditor notification system with your web page notifications.
882
+ *
883
+ * @since 4.5
884
+ * @event notificationShow
885
+ * @member CKEDITOR.editor
886
+ * @param data
887
+ * @param {CKEDITOR.plugins.notification} data.notification Notification which will be shown.
888
+ * @param {CKEDITOR.editor} editor The editor instance.
889
+ */
890
+
891
+ /**
892
+ * Event fired when the {@link CKEDITOR.plugins.notification#update} method is called, before the
893
+ * notification is updated. If this event is canceled, the notification will not be shown even if the update was important,
894
+ * but the object will be updated anyway. Note that canceling this event does not prevent updating {@link #element}
895
+ * attributes, but if {@link #notificationShow} was canceled as well, this element is detached from the DOM.
896
+ *
897
+ * Using this event allows you to fully customize how a notification will be updated. It may be used to integrate
898
+ * the CKEditor notification system with your web page notifications.
899
+ *
900
+ * @since 4.5
901
+ * @event notificationUpdate
902
+ * @member CKEDITOR.editor
903
+ * @param data
904
+ * @param {CKEDITOR.plugins.notification} data.notification Notification which will be updated.
905
+ * Note that it contains the data that has not been updated yet.
906
+ * @param {Object} data.options Update options, see {@link CKEDITOR.plugins.notification#update}.
907
+ * @param {CKEDITOR.editor} editor The editor instance.
908
+ */
909
+
910
+ /**
911
+ * Event fired when the {@link CKEDITOR.plugins.notification#hide} method is called, before the
912
+ * notification is hidden. If this event is canceled, the notification will not be hidden.
913
+ *
914
+ * Using this event allows you to fully customize how a notification will be hidden. It may be used to integrate
915
+ * the CKEditor notification system with your web page notifications.
916
+ *
917
+ * @since 4.5
918
+ * @event notificationHide
919
+ * @member CKEDITOR.editor
920
+ * @param data
921
+ * @param {CKEDITOR.plugins.notification} data.notification Notification which will be hidden.
922
+ * @param {CKEDITOR.editor} editor The editor instance.
923
+ */