glebtv-ckeditor 4.7.3 → 4.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (380) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +13 -12
  3. data/README.md +358 -2
  4. data/Rakefile +17 -17
  5. data/app/assets/javascripts/ckeditor/config.js.erb +3 -3
  6. data/app/controllers/ckeditor/application_controller.rb +3 -0
  7. data/app/controllers/ckeditor/attachment_files_controller.rb +2 -0
  8. data/app/controllers/ckeditor/pictures_controller.rb +2 -0
  9. data/app/helpers/ckeditor/application_helper.rb +2 -0
  10. data/config/locales/bg.ckeditor.yml +9 -0
  11. data/config/locales/cs.ckeditor.yml +9 -0
  12. data/config/locales/da.ckeditor.yml +9 -0
  13. data/config/locales/de.ckeditor.yml +9 -0
  14. data/config/locales/el-GR.cdkeditor.yml +9 -0
  15. data/config/locales/es.ckeditor.yml +9 -0
  16. data/config/locales/fr.ckeditor.yml +9 -0
  17. data/config/locales/hu.ckeditor.yml +9 -0
  18. data/config/locales/it.ckeditor.yml +9 -0
  19. data/config/locales/ja.ckeditor.yml +9 -0
  20. data/config/locales/nb.ckeditor.yml +9 -0
  21. data/config/locales/nl.ckeditor.yml +9 -0
  22. data/config/locales/pl.ckeditor.yml +9 -0
  23. data/config/locales/pt-BR.ckeditor.yml +9 -0
  24. data/config/locales/pt-PT.ckeditor.yml +9 -0
  25. data/config/locales/pt.ckeditor.yml +9 -0
  26. data/config/locales/sq.ckeditor.yml +9 -0
  27. data/config/locales/sv-SE.ckeditor.yml +9 -0
  28. data/config/locales/tr.ckeditor.yml +9 -0
  29. data/config/locales/uk.ckeditor.yml +9 -0
  30. data/config/locales/zh-CN.ckeditor.yml +9 -0
  31. data/config/locales/zh-TW.ckeditor.yml +9 -0
  32. data/config/routes.rb +2 -0
  33. data/lib/ckeditor.rb +13 -16
  34. data/lib/ckeditor/asset_response.rb +15 -4
  35. data/lib/ckeditor/backend/active_storage.rb +68 -0
  36. data/lib/ckeditor/backend/carrierwave.rb +2 -12
  37. data/lib/ckeditor/backend/dragonfly.rb +2 -0
  38. data/lib/ckeditor/backend/paperclip.rb +2 -15
  39. data/lib/ckeditor/backend/shrine.rb +29 -0
  40. data/lib/ckeditor/helpers/controllers.rb +2 -0
  41. data/lib/ckeditor/helpers/form_builder.rb +2 -0
  42. data/lib/ckeditor/helpers/form_helper.rb +2 -0
  43. data/lib/ckeditor/helpers/view_helper.rb +2 -0
  44. data/lib/ckeditor/hooks/cancan.rb +4 -1
  45. data/lib/ckeditor/hooks/formtastic.rb +2 -0
  46. data/lib/ckeditor/hooks/pundit.rb +2 -0
  47. data/lib/ckeditor/hooks/simple_form.rb +2 -0
  48. data/lib/ckeditor/http.rb +8 -5
  49. data/lib/ckeditor/orm/active_record.rb +2 -0
  50. data/lib/ckeditor/orm/base.rb +11 -2
  51. data/lib/ckeditor/orm/mongoid.rb +2 -0
  52. data/lib/ckeditor/paginatable.rb +2 -0
  53. data/lib/ckeditor/rails.rb +2 -0
  54. data/lib/ckeditor/rails_admin/field.rb +16 -3
  55. data/lib/ckeditor/text_area.rb +2 -0
  56. data/lib/ckeditor/utils.rb +3 -16
  57. data/lib/ckeditor/utils/javascript_code.rb +1 -1
  58. data/lib/ckeditor/version.rb +4 -2
  59. data/lib/generators/ckeditor/install_generator.rb +16 -19
  60. data/lib/generators/ckeditor/pundit_policy_generator.rb +2 -0
  61. data/lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/asset.rb +10 -0
  62. data/lib/generators/ckeditor/templates/active_record/{refile → active_storage}/ckeditor/attachment_file.rb +3 -1
  63. data/lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/picture.rb +13 -0
  64. data/lib/generators/ckeditor/templates/active_record/{carrierwave/migration_versioned.rb → active_storage/migration.rb} +8 -5
  65. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -0
  66. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +2 -0
  67. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +2 -0
  68. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +7 -5
  69. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +2 -0
  70. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +2 -0
  71. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +2 -0
  72. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +7 -5
  73. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb +2 -0
  74. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +2 -0
  75. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +2 -0
  76. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +8 -6
  77. data/lib/generators/ckeditor/templates/active_record/{refile → shrine}/ckeditor/asset.rb +3 -1
  78. data/lib/generators/ckeditor/templates/active_record/shrine/ckeditor/attachment_file.rb +21 -0
  79. data/lib/generators/ckeditor/templates/active_record/shrine/ckeditor/picture.rb +49 -0
  80. data/lib/generators/ckeditor/templates/active_record/shrine/migration.rb +22 -0
  81. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +2 -1
  82. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +2 -3
  83. data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +2 -0
  84. data/lib/generators/ckeditor/templates/base/shrine/initializer.rb +25 -0
  85. data/lib/generators/ckeditor/templates/ckeditor.rb +3 -6
  86. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +2 -0
  87. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +2 -0
  88. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +2 -0
  89. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +2 -0
  90. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +2 -0
  91. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +2 -0
  92. data/lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/asset.rb +8 -0
  93. data/lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/attachment_file.rb +21 -0
  94. data/lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb +47 -0
  95. data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +2 -0
  96. data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +2 -0
  97. data/lib/tasks/ckeditor.rake +2 -0
  98. data/test/controllers/attachment_files_controller_test.rb +17 -15
  99. data/test/controllers/pictures_controller_test.rb +17 -15
  100. data/test/dummy/Rakefile +2 -0
  101. data/test/dummy/app/assets/javascripts/application.js +0 -2
  102. data/test/dummy/app/controllers/application_controller.rb +2 -0
  103. data/test/dummy/app/controllers/posts_controller.rb +2 -0
  104. data/test/dummy/app/helpers/application_helper.rb +2 -0
  105. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  106. data/test/dummy/app/models/post.rb +2 -0
  107. data/test/dummy/app/views/posts/index.html.erb +0 -3
  108. data/test/dummy/app/views/posts/show.html.erb +3 -0
  109. data/test/dummy/config.ru +2 -0
  110. data/test/dummy/config/application.rb +5 -1
  111. data/test/dummy/config/boot.rb +2 -0
  112. data/test/dummy/config/environment.rb +2 -0
  113. data/test/dummy/config/environments/development.rb +2 -0
  114. data/test/dummy/config/environments/production.rb +2 -0
  115. data/test/dummy/config/environments/test.rb +5 -3
  116. data/test/dummy/config/initializers/assets.rb +2 -0
  117. data/test/dummy/config/initializers/backtrace_silencers.rb +2 -0
  118. data/test/dummy/config/initializers/ckeditor.rb +2 -0
  119. data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
  120. data/test/dummy/config/initializers/inflections.rb +2 -0
  121. data/test/dummy/config/initializers/mime_types.rb +2 -0
  122. data/test/dummy/config/initializers/paperclip.rb +2 -0
  123. data/test/dummy/config/initializers/session_store.rb +2 -0
  124. data/test/dummy/config/initializers/wrap_parameters.rb +2 -0
  125. data/test/dummy/config/routes.rb +2 -0
  126. data/test/dummy/config/storage.yml +3 -0
  127. data/test/dummy/db/migrate/20110623120047_create_posts.rb +5 -3
  128. data/test/dummy/db/migrate/20170806125915_create_active_storage_tables.rb +26 -0
  129. data/test/dummy/script/rails +2 -0
  130. data/test/functional/posts_controller_test.rb +18 -16
  131. data/test/generators/install_generator_test.rb +58 -56
  132. data/test/integration/navigation_test.rb +2 -0
  133. data/test/models/attachment_file_test.rb +4 -4
  134. data/test/models/ckeditor_test.rb +3 -21
  135. data/test/models/picture_test.rb +12 -10
  136. data/test/models/utils_test.rb +2 -0
  137. data/test/orm/active_record.rb +11 -1
  138. data/test/orm/mongoid.rb +2 -0
  139. data/test/support/helpers.rb +2 -0
  140. data/test/support/integration_case.rb +2 -0
  141. data/test/test_helper.rb +15 -9
  142. data/vendor/assets/javascripts/ckeditor/CHANGES.md +1404 -859
  143. data/vendor/assets/javascripts/ckeditor/LICENSE.md +8 -7
  144. data/vendor/assets/javascripts/ckeditor/README.md +5 -5
  145. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +7 -7
  146. data/vendor/assets/javascripts/ckeditor/build-config.js +12 -6
  147. data/vendor/assets/javascripts/ckeditor/ckeditor.js +1090 -907
  148. data/vendor/assets/javascripts/ckeditor/config.js +2 -2
  149. data/vendor/assets/javascripts/ckeditor/contents.css +7 -7
  150. data/vendor/assets/javascripts/ckeditor/lang/en.js +3 -3
  151. data/vendor/assets/javascripts/ckeditor/lang/ru.js +3 -3
  152. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -7
  153. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +2 -2
  154. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  155. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +5 -5
  156. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
  157. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  158. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  160. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  161. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  162. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autocomplete.png +0 -0
  164. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autoformat.png +0 -0
  165. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/commentselectedrange.png +0 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/searchcode.png +0 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/uncommentselectedrange.png +0 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -2
  169. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -2
  170. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  171. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -6
  172. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  173. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
  175. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  176. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
  177. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
  178. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +236 -218
  179. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +1 -1
  180. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +51 -0
  181. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +37 -0
  182. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +42 -0
  183. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +2 -2
  184. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -0
  185. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -0
  186. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/nord.css +42 -0
  187. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -0
  188. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +1 -1
  189. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -0
  190. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -1
  191. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -0
  192. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +1 -1
  193. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/yonce.css +59 -0
  194. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +2 -2
  195. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +12 -12
  196. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +2 -2
  197. data/vendor/assets/javascripts/ckeditor/plugins/dialog/styles/dialog.css +18 -0
  198. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -8
  199. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +23 -23
  200. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +17 -17
  201. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +6 -6
  202. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +5 -5
  203. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +3 -3
  204. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +5 -5
  205. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +7 -7
  206. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +17 -16
  207. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +7 -6
  208. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +9 -9
  209. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  210. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  211. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +9 -8
  212. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +1271 -44
  213. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/hidpi/image.png +0 -0
  214. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/image.png +0 -0
  215. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/en.js +25 -0
  216. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/ru.js +25 -0
  217. data/vendor/assets/javascripts/ckeditor/plugins/image/plugin.js +184 -0
  218. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
  219. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
  220. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +35 -0
  221. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +339 -0
  222. data/vendor/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +553 -0
  223. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
  224. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/image.png +0 -0
  225. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/en.js +21 -0
  226. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +21 -0
  227. data/vendor/assets/javascripts/ckeditor/plugins/image2/plugin.js +1783 -0
  228. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
  229. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
  230. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +69 -0
  231. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/plugin.js +1 -1
  232. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +5 -5
  233. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +27 -25
  234. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +8 -8
  235. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/fr.js +8 -0
  236. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
  237. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +41 -51
  238. data/vendor/assets/javascripts/ckeditor/plugins/pastetools/filter/common.js +22 -0
  239. data/vendor/assets/javascripts/ckeditor/plugins/pastetools/filter/image.js +6 -0
  240. data/vendor/assets/javascripts/ckeditor/plugins/preview/images/pagebreak.gif +0 -0
  241. data/vendor/assets/javascripts/ckeditor/plugins/preview/styles/screen.css +10 -0
  242. data/vendor/assets/javascripts/ckeditor/plugins/scayt/CHANGELOG.md +1 -17
  243. data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +63 -7
  244. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +32 -33
  245. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +2 -2
  246. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
  247. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +2 -2
  248. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +12 -12
  249. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +10 -10
  250. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +8 -7
  251. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +20 -19
  252. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -15
  253. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +2 -2
  254. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +2 -2
  255. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
  256. data/vendor/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
  257. data/vendor/assets/javascripts/ckeditor/{samples/toolbarconfigurator/lib/codemirror/LICENSE → plugins/wordcount/LICENSE.md} +21 -19
  258. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/README.md +106 -0
  259. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -0
  260. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +2 -1
  261. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +475 -378
  262. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/maxParagraphs.html +26 -0
  263. data/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +62 -7
  264. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
  265. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +82 -82
  266. data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +15 -0
  267. data/vendor/assets/javascripts/ckeditor/plugins/youtube/README.md +156 -0
  268. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +8 -7
  269. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +1 -1
  270. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +1 -1
  271. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +1 -1
  272. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +1 -1
  273. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +1 -1
  274. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +1 -1
  275. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  276. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  277. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +3 -3
  278. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +3 -3
  279. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +3 -3
  280. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +3 -3
  281. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +3 -3
  282. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +3 -3
  283. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +3 -3
  284. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +3 -3
  285. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +3 -3
  286. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +3 -3
  287. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +2 -2
  288. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +3 -3
  289. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +3 -3
  290. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +3 -3
  291. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +3 -3
  292. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +3 -3
  293. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +3 -3
  294. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +3 -3
  295. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +3 -3
  296. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +3 -3
  297. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +3 -3
  298. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +3 -3
  299. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +5 -5
  300. data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +2 -2
  301. data/vendor/assets/javascripts/ckeditor/styles.js +4 -4
  302. data/vendor/assets/javascripts/ckeditor/vendor/promise.js +13 -0
  303. metadata +143 -138
  304. data/lib/ckeditor/backend/refile.rb +0 -39
  305. data/lib/ckeditor/utils/content_type_detector.rb +0 -38
  306. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration_versioned.rb +0 -23
  307. data/lib/generators/ckeditor/templates/active_record/paperclip/migration_versioned.rb +0 -23
  308. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +0 -11
  309. data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +0 -23
  310. data/lib/generators/ckeditor/templates/active_record/refile/migration_versioned.rb +0 -23
  311. data/test/support/raw_post.rb +0 -9
  312. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -169
  313. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +0 -3
  314. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/ru.js +0 -8
  315. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +0 -7
  316. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +0 -7
  317. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +0 -929
  318. data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +0 -1632
  319. data/vendor/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
  320. data/vendor/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
  321. data/vendor/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
  322. data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  323. data/vendor/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
  324. data/vendor/assets/javascripts/ckeditor/samples/index.html +0 -128
  325. data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +0 -53
  326. data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +0 -17
  327. data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +0 -85
  328. data/vendor/assets/javascripts/ckeditor/samples/old/api.html +0 -210
  329. data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +0 -59
  330. data/vendor/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
  331. data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +0 -204
  332. data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +0 -59
  333. data/vendor/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
  334. data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +0 -7
  335. data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +0 -508
  336. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +0 -48
  337. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +0 -190
  338. data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +0 -144
  339. data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +0 -106
  340. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
  341. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
  342. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/swfobject.js +0 -19
  343. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +0 -283
  344. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +0 -224
  345. data/vendor/assets/javascripts/ckeditor/samples/old/index.html +0 -131
  346. data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +0 -314
  347. data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +0 -124
  348. data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +0 -113
  349. data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +0 -103
  350. data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +0 -209
  351. data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +0 -76
  352. data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +0 -60
  353. data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +0 -59
  354. data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +0 -357
  355. data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +0 -50
  356. data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +0 -16
  357. data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +0 -78
  358. data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +0 -235
  359. data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +0 -72
  360. data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +0 -122
  361. data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +0 -80
  362. data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +0 -234
  363. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +0 -55
  364. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +0 -10
  365. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +0 -28
  366. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
  367. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +0 -14
  368. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
  369. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
  370. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +0 -446
  371. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +0 -13
  372. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +0 -9
  373. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +0 -33
  374. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +0 -14
  375. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.css +0 -325
  376. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +0 -288
  377. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +0 -25
  378. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +0 -36
  379. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css +0 -38
  380. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +0 -16
@@ -1,39 +0,0 @@
1
- module Ckeditor
2
- module Backend
3
- module Refile
4
- extend ActiveSupport::Concern
5
-
6
- included do
7
- validates :data, presence: true
8
- delegate :rewind, :download, :to_io, :exists?, :delete, :close, :eof?, :read, to: :data
9
- alias_attribute :data_file_name, :data_filename
10
- alias_attribute :data_file_size, :data_size
11
- end
12
-
13
- class_methods do
14
- def attachment_file_types
15
- @attachment_file_types ||= Ckeditor.attachment_file_types.map(&:to_s)
16
- end
17
-
18
- def image_file_types
19
- @image_file_types ||= Ckeditor.image_file_types.map(&:to_s)
20
- end
21
- end
22
-
23
- def url(*attrs)
24
- ::Refile.attachment_url(self, :data, *attrs)
25
- end
26
-
27
- def magick
28
- @magick ||= MiniMagick::Image.open(model.to_io)
29
- end
30
-
31
- def extract_dimensions
32
- if model.image? && model.has_dimensions?
33
- model.width = magick.width
34
- model.height = magick.height
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,38 +0,0 @@
1
- # encoding: utf-8
2
- require 'cocaine'
3
-
4
- module Ckeditor
5
- module Utils
6
- class ContentTypeDetector
7
- EMPTY_CONTENT_TYPE = 'inode/x-empty'.freeze
8
- DEFAULT_CONTENT_TYPE = 'application/octet-stream'.freeze
9
-
10
- def initialize(file_path)
11
- @file_path = file_path
12
- end
13
-
14
- # content type detection strategy:
15
- #
16
- # 1. empty file: returns 'inode/x-empty'
17
- # 2. nonempty file: if the file is not empty then returns the content type using file command
18
- # 3. invalid file: file command raises error and returns 'application/octet-stream'
19
-
20
- def detect
21
- empty_file? ? EMPTY_CONTENT_TYPE : content_type_from_file_command
22
- end
23
-
24
- private
25
-
26
- def empty_file?
27
- return true if @file_path.blank?
28
- File.exist?(@file_path) && File.size(@file_path).zero?
29
- end
30
-
31
- def content_type_from_file_command
32
- Cocaine::CommandLine.new('file', '-b --mime-type :file').run(file: @file_path).strip
33
- rescue Cocaine::CommandLineError
34
- DEFAULT_CONTENT_TYPE
35
- end
36
- end
37
- end
38
- end
@@ -1,23 +0,0 @@
1
- class CreateCkeditorAssets < ActiveRecord::Migration<%= migration_version %>
2
- def self.up
3
- create_table :ckeditor_assets do |t|
4
- t.string :data_uid, null: false
5
- t.string :data_name, null: false
6
- t.string :data_mime_type
7
- t.integer :data_size
8
- t.string :type, limit: 30
9
-
10
- # Uncomment these to save image dimensions, if your need them.
11
- t.integer :data_width
12
- t.integer :data_height
13
-
14
- t.timestamps null: false
15
- end
16
-
17
- add_index :ckeditor_assets, :type
18
- end
19
-
20
- def self.down
21
- drop_table :ckeditor_assets
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- class CreateCkeditorAssets < ActiveRecord::Migration<%= migration_version %>
2
- def self.up
3
- create_table :ckeditor_assets do |t|
4
- t.string :data_file_name, null: false
5
- t.string :data_content_type
6
- t.integer :data_file_size
7
- t.string :data_fingerprint
8
- t.string :type, limit: 30
9
-
10
- # Uncomment it to save images dimensions, if your need it
11
- t.integer :width
12
- t.integer :height
13
-
14
- t.timestamps null: false
15
- end
16
-
17
- add_index :ckeditor_assets, :type
18
- end
19
-
20
- def self.down
21
- drop_table :ckeditor_assets
22
- end
23
- end
@@ -1,11 +0,0 @@
1
- class Ckeditor::Picture < Ckeditor::Asset
2
- attachment :data, extension: image_file_types
3
-
4
- def url_content
5
- url
6
- end
7
-
8
- def url_thumb
9
- url(:fill, 118, 100)
10
- end
11
- end
@@ -1,23 +0,0 @@
1
- class CreateCkeditorAssets < ActiveRecord::Migration
2
- def self.up
3
- create_table :ckeditor_assets do |t|
4
- t.string :data_id, null: false
5
- t.string :data_filename, null: false
6
- t.integer :data_size
7
- t.string :data_content_type
8
- t.string :type, limit: 30
9
-
10
- # Uncomment it to save images dimensions, if your need it
11
- t.integer :width
12
- t.integer :height
13
-
14
- t.timestamps null: false
15
- end
16
-
17
- add_index :ckeditor_assets, :type
18
- end
19
-
20
- def self.down
21
- drop_table :ckeditor_assets
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- class CreateCkeditorAssets < ActiveRecord::Migration<%= migration_version %>
2
- def self.up
3
- create_table :ckeditor_assets do |t|
4
- t.string :data_id, null: false
5
- t.string :data_filename, null: false
6
- t.integer :data_size
7
- t.string :data_content_type
8
- t.string :type, limit: 30
9
-
10
- # Uncomment it to save images dimensions, if your need it
11
- t.integer :width
12
- t.integer :height
13
-
14
- t.timestamps null: false
15
- end
16
-
17
- add_index :ckeditor_assets, :type
18
- end
19
-
20
- def self.down
21
- drop_table :ckeditor_assets
22
- end
23
- end
@@ -1,9 +0,0 @@
1
- module RawPost
2
- def raw_post(action, params, body, content_type = nil)
3
- @request.env['RAW_POST_DATA'] = body
4
- @request.env['CONTENT_TYPE'] = content_type
5
- response = post(action, params)
6
- @request.env.delete('RAW_POST_DATA')
7
- response
8
- end
9
- end
@@ -1,169 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.md or http://ckeditor.com/license
4
- */
5
-
6
- /**
7
- * @fileOverview Plugin for making iframe based dialogs.
8
- */
9
-
10
- CKEDITOR.plugins.add( 'iframedialog', {
11
- requires: 'dialog',
12
- onLoad: function() {
13
- /**
14
- * An iframe base dialog.
15
- *
16
- * @static
17
- * @member CKEDITOR.dialog
18
- * @param {String} name Name of the dialog.
19
- * @param {String} title Title of the dialog.
20
- * @param {Number} minWidth Minimum width of the dialog.
21
- * @param {Number} minHeight Minimum height of the dialog.
22
- * @param {Function} [onContentLoad] Function called when the iframe has been loaded.
23
- * If it isn't specified, the inner frame is notified of the dialog events (`'load'`,
24
- * `'resize'`, `'ok'` and `'cancel'`) on a function called `'onDialogEvent'`.
25
- * @param {Object} [userDefinition] Additional properties for the dialog definition.
26
- */
27
- CKEDITOR.dialog.addIframe = function( name, title, src, minWidth, minHeight, onContentLoad, userDefinition ) {
28
- var element = {
29
- type: 'iframe',
30
- src: src,
31
- width: '100%',
32
- height: '100%'
33
- };
34
-
35
- if ( typeof onContentLoad == 'function' )
36
- element.onContentLoad = onContentLoad;
37
- else {
38
- element.onContentLoad = function() {
39
- var element = this.getElement(), childWindow = element.$.contentWindow;
40
-
41
- // If the inner frame has defined a "onDialogEvent" function, setup listeners
42
- if ( childWindow.onDialogEvent ) {
43
- var dialog = this.getDialog(), notifyEvent = function( e ) {
44
- return childWindow.onDialogEvent( e );
45
- };
46
-
47
- dialog.on( 'ok', notifyEvent );
48
- dialog.on( 'cancel', notifyEvent );
49
- dialog.on( 'resize', notifyEvent );
50
-
51
- // Clear listeners
52
- dialog.on( 'hide', function( e ) {
53
- dialog.removeListener( 'ok', notifyEvent );
54
- dialog.removeListener( 'cancel', notifyEvent );
55
- dialog.removeListener( 'resize', notifyEvent );
56
-
57
- e.removeListener();
58
- } );
59
-
60
- // Notify child iframe of load:
61
- childWindow.onDialogEvent( {
62
- name: 'load', sender: this, editor: dialog._.editor
63
- } );
64
- }
65
- };
66
- }
67
-
68
- var definition = {
69
- title: title,
70
- minWidth: minWidth,
71
- minHeight: minHeight,
72
- contents: [ {
73
- id: 'iframe',
74
- label: title,
75
- expand: true,
76
- elements: [ element ],
77
- style: 'width:' + element.width + ';height:' + element.height
78
- } ]
79
- };
80
-
81
- for ( var i in userDefinition )
82
- definition[ i ] = userDefinition[ i ];
83
-
84
- this.add( name, function() {
85
- return definition;
86
- } );
87
- };
88
-
89
- ( function() {
90
- /**
91
- * An iframe element.
92
- *
93
- * @class CKEDITOR.ui.dialog.iframeElement
94
- * @extends CKEDITOR.ui.dialog.uiElement
95
- * @constructor
96
- * @private
97
- * @param {CKEDITOR.dialog} dialog Parent dialog object.
98
- * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
99
- * The element definition. Accepted fields:
100
- *
101
- * * `src` (Required) The src field of the iframe.
102
- * * `width` (Required) The iframe's width.
103
- * * `height` (Required) The iframe's height.
104
- * * `onContentLoad` (Optional) A function to be executed
105
- * after the iframe's contents has finished loading.
106
- *
107
- * @param {Array} htmlList List of HTML code to output to.
108
- */
109
- var iframeElement = function( dialog, elementDefinition, htmlList ) {
110
- if ( arguments.length < 3 )
111
- return;
112
-
113
- var _ = ( this._ || ( this._ = {} ) ),
114
- contentLoad = elementDefinition.onContentLoad && CKEDITOR.tools.bind( elementDefinition.onContentLoad, this ),
115
- cssWidth = CKEDITOR.tools.cssLength( elementDefinition.width ),
116
- cssHeight = CKEDITOR.tools.cssLength( elementDefinition.height );
117
- _.frameId = CKEDITOR.tools.getNextId() + '_iframe';
118
-
119
- // IE BUG: Parent container does not resize to contain the iframe automatically.
120
- dialog.on( 'load', function() {
121
- var iframe = CKEDITOR.document.getById( _.frameId ),
122
- parentContainer = iframe.getParent();
123
-
124
- parentContainer.setStyles( {
125
- width: cssWidth,
126
- height: cssHeight
127
- } );
128
- } );
129
-
130
- var attributes = {
131
- src: '%2',
132
- id: _.frameId,
133
- frameborder: 0,
134
- allowtransparency: true
135
- };
136
- var myHtml = [];
137
-
138
- if ( typeof elementDefinition.onContentLoad == 'function' )
139
- attributes.onload = 'CKEDITOR.tools.callFunction(%1);';
140
-
141
- CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtml, 'iframe', {
142
- width: cssWidth,
143
- height: cssHeight
144
- }, attributes, '' );
145
-
146
- // Put a placeholder for the first time.
147
- htmlList.push( '<div style="width:' + cssWidth + ';height:' + cssHeight + ';" id="' + this.domId + '"></div>' );
148
-
149
- // Iframe elements should be refreshed whenever it is shown.
150
- myHtml = myHtml.join( '' );
151
- dialog.on( 'show', function() {
152
- var iframe = CKEDITOR.document.getById( _.frameId ),
153
- parentContainer = iframe.getParent(),
154
- callIndex = CKEDITOR.tools.addFunction( contentLoad ),
155
- html = myHtml.replace( '%1', callIndex ).replace( '%2', CKEDITOR.tools.htmlEncode( elementDefinition.src ) );
156
- parentContainer.setHtml( html );
157
- } );
158
- };
159
-
160
- iframeElement.prototype = new CKEDITOR.ui.dialog.uiElement();
161
-
162
- CKEDITOR.dialog.addUIElement( 'iframe', {
163
- build: function( dialog, elementDefinition, output ) {
164
- return new iframeElement( dialog, elementDefinition, output );
165
- }
166
- } );
167
- } )();
168
- }
169
- } );
@@ -1,3 +0,0 @@
1
- CKEDITOR.plugins.setLang('lineheight','ru', {
2
- title: 'Высота строки'
3
- } );
@@ -1,8 +0,0 @@
1
- CKEDITOR.plugins.setLang( 'loremipsum', 'ru', {
2
- title: 'Генератор Lorem Ipsum',
3
- toolbar: 'Генератор Lorem Ipsum',
4
- paragraph: 'Параграф',
5
- sentence: 'Предложение',
6
- paragraphs: 'Параграфы',
7
- sentences: 'Предложения'
8
- } );
@@ -1,7 +0,0 @@
1
- /*
2
- Copyright (c) 2003-2017, 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
- } );
@@ -1,7 +0,0 @@
1
- /*
2
- Copyright (c) 2003-2017, 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
- } );
@@ -1,929 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2017, 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: 'en,ru', // %REMOVE_LINE_CORE%
15
-
16
- init: function( editor ) {
17
- editor._.notificationArea = new Area( editor );
18
-
19
- // Overwrites default `editor.showNotification`.
20
- editor.showNotification = function( message, type, progressOrDuration ) {
21
- var progress, duration;
22
-
23
- if ( type == 'progress' ) {
24
- progress = progressOrDuration;
25
- } else {
26
- duration = progressOrDuration;
27
- }
28
-
29
- var notification = new CKEDITOR.plugins.notification( editor, {
30
- message: message,
31
- type: type,
32
- progress: progress,
33
- duration: duration
34
- } );
35
-
36
- notification.show();
37
-
38
- return notification;
39
- };
40
-
41
- // Close the last notification on ESC.
42
- editor.on( 'key', function( evt ) {
43
- if ( evt.data.keyCode == 27 ) { /* ESC */
44
- var notifications = editor._.notificationArea.notifications;
45
-
46
- if ( !notifications.length ) {
47
- return;
48
- }
49
-
50
- // As long as this is not a common practice to inform screen-reader users about actions, in this case
51
- // this is the best solution (unfortunately there is no standard for accessibility for notifications).
52
- // Notification has an `alert` aria role what means that it does not get a focus nor is needed to be
53
- // closed (unlike `alertdialog`). However notification will capture ESC key so we need to inform user
54
- // why it does not do other actions.
55
- say( editor.lang.notification.closed );
56
-
57
- // Hide last.
58
- notifications[ notifications.length - 1 ].hide();
59
-
60
- evt.cancel();
61
- }
62
- } );
63
-
64
- // Send the message to the screen readers.
65
- function say( text ) {
66
- var message = new CKEDITOR.dom.element( 'div' );
67
- message.setStyles( {
68
- position: 'fixed',
69
- 'margin-left': '-9999px'
70
- } );
71
- message.setAttributes( {
72
- 'aria-live': 'assertive',
73
- 'aria-atomic': 'true'
74
- } );
75
- message.setText( text );
76
-
77
- CKEDITOR.document.getBody().append( message );
78
-
79
- setTimeout( function() {
80
- message.remove();
81
- }, 100 );
82
- }
83
- }
84
- } );
85
-
86
- /**
87
- * Notification class. Notifications are used to display short messages to the user. They might be used to show the result of
88
- * asynchronous actions or information about changes in the editor content. It is recommended to use them instead of
89
- * alert dialogs. They should **not** be used if a user response is required nor with dialog windows (e.g. in dialog validation).
90
- *
91
- * There are four types of notifications available, see the {@link #type} property.
92
- *
93
- * Note that the notification constructor only creates a notification instance. To show it, use the {@link #show} method:
94
- *
95
- * var notification = new CKEDITOR.plugins.notification( editor, { message: 'Foo' } );
96
- * notification.show();
97
- *
98
- * You can also use the {@link CKEDITOR.editor#showNotification} method:
99
- *
100
- * editor.showNotification( 'Foo' );
101
- *
102
- * All of the notification actions: ({@link #show}, {@link #update} and {@link #hide}) fire cancelable events
103
- * on the related {@link CKEDITOR.editor} instance so you can integrate editor notifications with your website notifications.
104
- *
105
- * Refer to the [Notifications](http://docs.ckeditor.com/#!/guide/dev_notifications) article for more information about this feature.
106
- *
107
- * @since 4.5
108
- * @class CKEDITOR.plugins.notification
109
- * @constructor Create a notification object. Call {@link #show} to show the created notification.
110
- * @param {CKEDITOR.editor} editor The editor instance.
111
- * @param {Object} options
112
- * @param {String} options.message The message displayed in the notification.
113
- * @param {String} [options.type='info'] Notification type, see {@link #type}.
114
- * @param {Number} [options.progress=0] If the type is `progress` this may be a progress from 0 to 1.
115
- * @param {Number} [options.duration] How long the notification will be visible, see {@link #duration}.
116
- */
117
- function Notification( editor, options ) {
118
- CKEDITOR.tools.extend( this, options, {
119
- editor: editor,
120
- id: 'cke-' + CKEDITOR.tools.getUniqueId(),
121
- area: editor._.notificationArea
122
- } );
123
-
124
- if ( !options.type ) {
125
- this.type = 'info';
126
- }
127
-
128
- this.element = this._createElement();
129
-
130
- // Don't allow dragging on notification (http://dev.ckeditor.com/ticket/13184).
131
- editor.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement( this.element );
132
- }
133
-
134
- /**
135
- * The editor instance.
136
- *
137
- * @readonly
138
- * @property {CKEDITOR.editor} editor
139
- */
140
-
141
- /**
142
- * Message displayed in the notification.
143
- *
144
- * @readonly
145
- * @property {String} message
146
- */
147
-
148
- /**
149
- * Notification type. There are four types available:
150
- *
151
- * * `info` (default) &ndash; Information for the user (e.g. "File is uploading.", "ACF modified content."),
152
- * * `warning` &ndash; Warning or error message (e.g. "This type of file is not supported.",
153
- * "You cannot paste the script."),
154
- * * `success` &ndash; Information that an operation finished successfully (e.g. "File uploaded.", "Data imported.").
155
- * * `progress` &ndash; Information about the progress of an operation. When the operation is done, the notification
156
- * type should be changed to `success`.
157
- *
158
- * @readonly
159
- * @property {String} type
160
- */
161
-
162
- /**
163
- * If the notification {@link #type} is `'progress'`, this is the progress from `0` to `1`.
164
- *
165
- * @readonly
166
- * @property {Number} progress
167
- */
168
-
169
- /**
170
- * Notification duration. Determines after how many milliseconds the notification should close automatically.
171
- * `0` means that the notification will not close automatically and that the user needs to close it manually.
172
- * The default value for `warning` and `progress` notifications is `0`. For `info` and `success` the value can
173
- * either be set through the {@link CKEDITOR.config#notification_duration} configuration option or equals `5000`
174
- * if the configuration option is not set.
175
- *
176
- * @readonly
177
- * @property {Number} duration
178
- */
179
-
180
- /**
181
- * Unique notification ID.
182
- *
183
- * @readonly
184
- * @property {Number} id
185
- */
186
-
187
- /**
188
- * Notification DOM element. There is one element per notification. It is created when the notification is created,
189
- * even if it is not shown. If the notification is hidden, the element is detached from the document but not deleted.
190
- * It will be reused if the notification is shown again.
191
- *
192
- * @readonly
193
- * @property {CKEDITOR.dom.element} element
194
- */
195
-
196
- /**
197
- * {@link CKEDITOR.plugins.notification.area Notification area} reference.
198
- *
199
- * @readonly
200
- * @property {CKEDITOR.plugins.notification.area} area
201
- */
202
-
203
- Notification.prototype = {
204
- /**
205
- * Adds the notification element to the notification area. The notification will be hidden automatically if
206
- * {@link #duration} is set.
207
- *
208
- * Fires the {@link CKEDITOR.editor#notificationShow} event.
209
- */
210
- show: function() {
211
- if ( this.editor.fire( 'notificationShow', { notification: this } ) === false ) {
212
- return;
213
- }
214
-
215
- this.area.add( this );
216
-
217
- this._hideAfterTimeout();
218
- },
219
-
220
- /**
221
- * Updates the notification object and element.
222
- *
223
- * Fires the {@link CKEDITOR.editor#notificationUpdate} event.
224
- *
225
- * @param {Object} options
226
- * @param {String} [options.message] {@link #message}
227
- * @param {String} [options.type] {@link #type}
228
- * @param {Number} [options.progress] {@link #progress}
229
- * @param {Number} [options.duration] {@link #duration}
230
- * @param {Boolean} [options.important=false] If the update is important, the notification will be shown
231
- * if it was hidden and read by screen readers.
232
- */
233
- update: function( options ) {
234
- var show = true;
235
-
236
- if ( this.editor.fire( 'notificationUpdate', { notification: this, options: options } ) === false ) {
237
- // The idea of cancelable event is to let user create his own way of displaying notification, so if
238
- // `notificationUpdate` event will be canceled there will be no interaction with notification area, but on
239
- // the other hand the logic should work anyway so object will be updated (including `element` property).
240
- // Note: we can safely update the element's attributes below, because this element is created inside
241
- // the constructor. If the notificatinShow event was canceled as well, the element is detached from DOM.
242
- show = false;
243
- }
244
-
245
- var element = this.element,
246
- messageElement = element.findOne( '.cke_notification_message' ),
247
- progressElement = element.findOne( '.cke_notification_progress' ),
248
- type = options.type;
249
-
250
- element.removeAttribute( 'role' );
251
-
252
- // Change type to progress if `options.progress` is set.
253
- if ( options.progress && this.type != 'progress' ) {
254
- type = 'progress';
255
- }
256
-
257
- if ( type ) {
258
- element.removeClass( this._getClass() );
259
- element.removeAttribute( 'aria-label' );
260
-
261
- this.type = type;
262
-
263
- element.addClass( this._getClass() );
264
- element.setAttribute( 'aria-label', this.type );
265
-
266
- if ( this.type == 'progress' && !progressElement ) {
267
- progressElement = this._createProgressElement();
268
- progressElement.insertBefore( messageElement );
269
- } else if ( this.type != 'progress' && progressElement ) {
270
- progressElement.remove();
271
- }
272
- }
273
-
274
- if ( options.message !== undefined ) {
275
- this.message = options.message;
276
- messageElement.setHtml( this.message );
277
- }
278
-
279
- if ( options.progress !== undefined ) {
280
- this.progress = options.progress;
281
-
282
- if ( progressElement ) {
283
- progressElement.setStyle( 'width', this._getPercentageProgress() );
284
- }
285
- }
286
-
287
- if ( show && options.important ) {
288
- element.setAttribute( 'role', 'alert' );
289
-
290
- if ( !this.isVisible() ) {
291
- this.area.add( this );
292
- }
293
- }
294
-
295
- // Overwrite even if it is undefined.
296
- this.duration = options.duration;
297
-
298
- this._hideAfterTimeout();
299
- },
300
-
301
- /**
302
- * Removes the notification element from the notification area.
303
- *
304
- * Fires the {@link CKEDITOR.editor#notificationHide} event.
305
- */
306
- hide: function() {
307
- if ( this.editor.fire( 'notificationHide', { notification: this } ) === false ) {
308
- return;
309
- }
310
-
311
- this.area.remove( this );
312
- },
313
-
314
- /**
315
- * Returns `true` if the notification is in the notification area.
316
- *
317
- * @returns {Boolean} `true` if the notification is in the notification area.
318
- */
319
- isVisible: function() {
320
- return CKEDITOR.tools.indexOf( this.area.notifications, this ) >= 0;
321
- },
322
-
323
- /**
324
- * Creates the notification DOM element.
325
- *
326
- * @private
327
- * @returns {CKEDITOR.dom.element} Notification DOM element.
328
- */
329
- _createElement: function() {
330
- var notification = this,
331
- notificationElement, notificationMessageElement, notificationCloseElement,
332
- close = this.editor.lang.common.close;
333
-
334
- notificationElement = new CKEDITOR.dom.element( 'div' );
335
- notificationElement.addClass( 'cke_notification' );
336
- notificationElement.addClass( this._getClass() );
337
- notificationElement.setAttributes( {
338
- id: this.id,
339
- role: 'alert',
340
- 'aria-label': this.type
341
- } );
342
-
343
- if ( this.type == 'progress' )
344
- notificationElement.append( this._createProgressElement() );
345
-
346
- notificationMessageElement = new CKEDITOR.dom.element( 'p' );
347
- notificationMessageElement.addClass( 'cke_notification_message' );
348
- notificationMessageElement.setHtml( this.message );
349
- notificationElement.append( notificationMessageElement );
350
-
351
- notificationCloseElement = CKEDITOR.dom.element.createFromHtml(
352
- '<a class="cke_notification_close" href="javascript:void(0)" title="' + close + '" role="button" tabindex="-1">' +
353
- '<span class="cke_label">X</span>' +
354
- '</a>' );
355
- notificationElement.append( notificationCloseElement );
356
-
357
- notificationCloseElement.on( 'click', function() {
358
- // Focus editor on close (http://dev.ckeditor.com/ticket/12865)
359
- notification.editor.focus();
360
-
361
- notification.hide();
362
- } );
363
-
364
- return notificationElement;
365
- },
366
-
367
- /**
368
- * Gets the notification CSS class.
369
- *
370
- * @private
371
- * @returns {String} Notification CSS class.
372
- */
373
- _getClass: function() {
374
- return ( this.type == 'progress' ) ?
375
- 'cke_notification_info' :
376
- ( 'cke_notification_' + this.type );
377
- },
378
-
379
- /**
380
- * Creates a progress element for the notification element.
381
- *
382
- * @private
383
- * @returns {CKEDITOR.dom.element} Progress element for the notification element.
384
- */
385
- _createProgressElement: function() {
386
- var element = new CKEDITOR.dom.element( 'span' );
387
- element.addClass( 'cke_notification_progress' );
388
- element.setStyle( 'width', this._getPercentageProgress() );
389
- return element;
390
- },
391
-
392
- /**
393
- * Gets the progress as a percentage (ex. `0.3` -> `30%`).
394
- *
395
- * @private
396
- * @returns {String} Progress as a percentage.
397
- */
398
- _getPercentageProgress: function() {
399
- return Math.round( ( this.progress || 0 ) * 100 ) + '%';
400
- },
401
-
402
- /**
403
- * Hides the notification after a timeout.
404
- *
405
- * @private
406
- */
407
- _hideAfterTimeout: function() {
408
- var notification = this,
409
- duration;
410
-
411
- if ( this._hideTimeoutId ) {
412
- clearTimeout( this._hideTimeoutId );
413
- }
414
-
415
- if ( typeof this.duration == 'number' ) {
416
- duration = this.duration;
417
- } else if ( this.type == 'info' || this.type == 'success' ) {
418
- duration = ( typeof this.editor.config.notification_duration == 'number' ) ?
419
- this.editor.config.notification_duration :
420
- 5000;
421
- }
422
-
423
- if ( duration ) {
424
- notification._hideTimeoutId = setTimeout( function() {
425
- notification.hide();
426
- }, duration );
427
- }
428
- }
429
- };
430
-
431
- /**
432
- * Notification area is an area where all notifications are put. The area is laid out dynamically.
433
- * When the first notification is added, the area is shown and all listeners are added.
434
- * When the last notification is removed, the area is hidden and all listeners are removed.
435
- *
436
- * @since 4.5
437
- * @private
438
- * @class CKEDITOR.plugins.notification.area
439
- * @constructor
440
- * @param {CKEDITOR.editor} editor The editor instance.
441
- */
442
- function Area( editor ) {
443
- var that = this;
444
-
445
- this.editor = editor;
446
- this.notifications = [];
447
- this.element = this._createElement();
448
- this._uiBuffer = CKEDITOR.tools.eventsBuffer( 10, this._layout, this );
449
- this._changeBuffer = CKEDITOR.tools.eventsBuffer( 500, this._layout, this );
450
-
451
- editor.on( 'destroy', function() {
452
- that._removeListeners();
453
- that.element.remove();
454
- } );
455
- }
456
-
457
- /**
458
- * The editor instance.
459
- *
460
- * @readonly
461
- * @property {CKEDITOR.editor} editor
462
- */
463
-
464
- /**
465
- * The array of added notifications.
466
- *
467
- * @readonly
468
- * @property {Array} notifications
469
- */
470
-
471
- /**
472
- * Notification area DOM element. This element is created when the area object is created. It will be attached to the document
473
- * when the first notification is added and removed when the last notification is removed.
474
- *
475
- * @readonly
476
- * @property {CKEDITOR.dom.element} element
477
- */
478
-
479
- /**
480
- * Notification width. Cached for performance reasons.
481
- *
482
- * @private
483
- * @property {CKEDITOR.dom.element} _notificationWidth
484
- */
485
-
486
- /**
487
- * Notification margin. Cached for performance reasons.
488
- *
489
- * @private
490
- * @property {CKEDITOR.dom.element} _notificationMargin
491
- */
492
-
493
- /**
494
- * Event buffer object for UI events to optimize performance.
495
- *
496
- * @private
497
- * @property {Object} _uiBuffer
498
- */
499
-
500
- /**
501
- * Event buffer object for editor change events to optimize performance.
502
- *
503
- * @private
504
- * @property {Object} _changeBuffer
505
- */
506
-
507
- Area.prototype = {
508
- /**
509
- * Adds the notification to the notification area. If it is the first notification, the area will also be attached to
510
- * the document and listeners will be attached.
511
- *
512
- * Note that the proper way to show a notification is to call the {@link CKEDITOR.plugins.notification#show} method.
513
- *
514
- * @param {CKEDITOR.plugins.notification} notification Notification to add.
515
- */
516
- add: function( notification ) {
517
- this.notifications.push( notification );
518
-
519
- this.element.append( notification.element );
520
-
521
- if ( this.element.getChildCount() == 1 ) {
522
- CKEDITOR.document.getBody().append( this.element );
523
- this._attachListeners();
524
- }
525
-
526
- this._layout();
527
- },
528
-
529
- /**
530
- * Removes the notification from the notification area. If it is the last notification, the area will also be
531
- * detached from the document and listeners will be detached.
532
- *
533
- * Note that the proper way to hide a notification is to call the {@link CKEDITOR.plugins.notification#hide} method.
534
- *
535
- * @param {CKEDITOR.plugins.notification} notification Notification to remove.
536
- */
537
- remove: function( notification ) {
538
- var i = CKEDITOR.tools.indexOf( this.notifications, notification );
539
-
540
- if ( i < 0 ) {
541
- return;
542
- }
543
-
544
- this.notifications.splice( i, 1 );
545
-
546
- notification.element.remove();
547
-
548
- if ( !this.element.getChildCount() ) {
549
- this._removeListeners();
550
- this.element.remove();
551
- }
552
- },
553
-
554
- /**
555
- * Creates the notification area element.
556
- *
557
- * @private
558
- * @returns {CKEDITOR.dom.element} Notification area element.
559
- */
560
- _createElement: function() {
561
- var editor = this.editor,
562
- config = editor.config,
563
- notificationArea = new CKEDITOR.dom.element( 'div' );
564
-
565
- notificationArea.addClass( 'cke_notifications_area' );
566
- notificationArea.setAttribute( 'id', 'cke_notifications_area_' + editor.name );
567
- notificationArea.setStyle( 'z-index', config.baseFloatZIndex - 2 );
568
-
569
- return notificationArea;
570
- },
571
-
572
- /**
573
- * Attaches listeners to the notification area.
574
- *
575
- * @private
576
- */
577
- _attachListeners: function() {
578
- var win = CKEDITOR.document.getWindow(),
579
- editor = this.editor;
580
-
581
- win.on( 'scroll', this._uiBuffer.input );
582
- win.on( 'resize', this._uiBuffer.input );
583
- editor.on( 'change', this._changeBuffer.input );
584
- editor.on( 'floatingSpaceLayout', this._layout, this, null, 20 );
585
- editor.on( 'blur', this._layout, this, null, 20 );
586
- },
587
-
588
- /**
589
- * Detaches listeners from the notification area.
590
- *
591
- * @private
592
- */
593
- _removeListeners: function() {
594
- var win = CKEDITOR.document.getWindow(),
595
- editor = this.editor;
596
-
597
- win.removeListener( 'scroll', this._uiBuffer.input );
598
- win.removeListener( 'resize', this._uiBuffer.input );
599
- editor.removeListener( 'change', this._changeBuffer.input );
600
- editor.removeListener( 'floatingSpaceLayout', this._layout );
601
- editor.removeListener( 'blur', this._layout );
602
- },
603
-
604
- /**
605
- * Sets the position of the notification area based on the editor content, toolbar as well as
606
- * viewport position and dimensions.
607
- *
608
- * @private
609
- */
610
- _layout: function() {
611
- var area = this.element,
612
- editor = this.editor,
613
- contentsRect = editor.ui.contentsElement.getClientRect(),
614
- contentsPos = editor.ui.contentsElement.getDocumentPosition(),
615
- top,
616
- topRect,
617
- areaRect = area.getClientRect(),
618
- notification,
619
- notificationWidth = this._notificationWidth,
620
- notificationMargin = this._notificationMargin,
621
- win = CKEDITOR.document.getWindow(),
622
- scrollPos = win.getScrollPosition(),
623
- viewRect = win.getViewPaneSize(),
624
- body = CKEDITOR.document.getBody(),
625
- bodyPos = body.getDocumentPosition(),
626
- cssLength = CKEDITOR.tools.cssLength;
627
-
628
- // Cache for optimization
629
- if ( !notificationWidth || !notificationMargin ) {
630
- notification = this.element.getChild( 0 );
631
- notificationWidth = this._notificationWidth = notification.getClientRect().width;
632
- notificationMargin = this._notificationMargin =
633
- parseInt( notification.getComputedStyle( 'margin-left' ), 10 ) +
634
- parseInt( notification.getComputedStyle( 'margin-right' ), 10 );
635
- }
636
-
637
- // Check if toolbar exist and if so, then assign values to it (#491).
638
- if ( editor.toolbar ) {
639
- top = editor.ui.space( 'top' );
640
- topRect = top.getClientRect();
641
- }
642
-
643
-
644
- // --------------------------------------- Horizontal layout ----------------------------------------
645
-
646
- // +---Viewport-------------------------------+ +---Viewport-------------------------------+
647
- // | | | |
648
- // | +---Toolbar----------------------------+ | | +---Content----------------------------+ |
649
- // | | | | | | | |
650
- // | +---Content----------------------------+ | | | | |
651
- // | | | | | +---Toolbar----------------------+ | |
652
- // | | +------Notification------+ | | | | | | |
653
- // | | | | OR | +--------------------------------+ | |
654
- // | | | | | | | |
655
- // | | | | | | +------Notification------+ | |
656
- // | | | | | | | |
657
- // | | | | | | | |
658
- // | +--------------------------------------+ | | +--------------------------------------+ |
659
- // +------------------------------------------+ +------------------------------------------+
660
- if ( top && top.isVisible() &&
661
- topRect.bottom > contentsRect.top &&
662
- topRect.bottom < contentsRect.bottom - areaRect.height ) {
663
- setBelowToolbar();
664
-
665
- // +---Viewport-------------------------------+
666
- // | |
667
- // | +---Content----------------------------+ |
668
- // | | | |
669
- // | | +------Notification------+ | |
670
- // | | | |
671
- // | | | |
672
- // | | | |
673
- // | +--------------------------------------+ |
674
- // | |
675
- // +------------------------------------------+
676
- } else if ( contentsRect.top > 0 ) {
677
- setTopStandard();
678
-
679
- // +---Content----------------------------+
680
- // | |
681
- // +---Viewport-------------------------------+
682
- // | | | |
683
- // | | +------Notification------+ | |
684
- // | | | |
685
- // | | | |
686
- // | | | |
687
- // | +--------------------------------------+ |
688
- // | |
689
- // +------------------------------------------+
690
- } else if ( contentsPos.y + contentsRect.height - areaRect.height > scrollPos.y ) {
691
- setTopFixed();
692
-
693
- // +---Content----------------------------+ +---Content----------------------------+
694
- // | | | |
695
- // | | | |
696
- // | | | +------Notification------+ |
697
- // | | | |
698
- // | | OR +--------------------------------------+
699
- // +---Viewport-------------------------------+
700
- // | | +------Notification------+ | | +---Viewport-------------------------------+
701
- // | | | | | |
702
- // | +--------------------------------------+ | | |
703
- // | | | |
704
- // +------------------------------------------+ +------------------------------------------+
705
- } else {
706
- setBottom();
707
- }
708
-
709
- function setTopStandard() {
710
- area.setStyles( {
711
- position: 'absolute',
712
- top: cssLength( contentsPos.y )
713
- } );
714
- }
715
-
716
- function setBelowToolbar() {
717
- area.setStyles( {
718
- position: 'fixed',
719
- top: cssLength( topRect.bottom )
720
- } );
721
- }
722
-
723
- function setTopFixed() {
724
- area.setStyles( {
725
- position: 'fixed',
726
- top: 0
727
- } );
728
- }
729
-
730
- function setBottom() {
731
- area.setStyles( {
732
- position: 'absolute',
733
- top: cssLength( contentsPos.y + contentsRect.height - areaRect.height )
734
- } );
735
- }
736
-
737
- // ---------------------------------------- Vertical layout -----------------------------------------
738
-
739
- var leftBase = area.getStyle( 'position' ) == 'fixed' ?
740
- contentsRect.left :
741
- body.getComputedStyle( 'position' ) != 'static' ? contentsPos.x - bodyPos.x : contentsPos.x;
742
-
743
- // Content is narrower than notification
744
- if ( contentsRect.width < notificationWidth + notificationMargin ) {
745
-
746
- // +---Viewport-------------------------------+
747
- // | |
748
- // | +---Content------------+ |
749
- // | | | |
750
- // | +------Notification------+ | |
751
- // | | | |
752
- // | +----------------------+ |
753
- // | |
754
- // +------------------------------------------+
755
- if ( contentsPos.x + notificationWidth + notificationMargin > scrollPos.x + viewRect.width ) {
756
- setRight();
757
-
758
- // +---Viewport-------------------------------+ +---Viewport--------------------------+
759
- // | | | |
760
- // | +---Content------------+ | +---Content------------+ |
761
- // | | | | | | | |
762
- // | | +------Notification------+ | OR | +------Notification------+ |
763
- // | | | | | | | |
764
- // | +----------------------+ | +----------------------+ |
765
- // | | | |
766
- // +------------------------------------------+ +-------------------------------------+
767
- } else {
768
- setLeft();
769
- }
770
-
771
- // Content is wider than notification.
772
- } else {
773
-
774
- // +--+Viewport+------------------------+
775
- // | |
776
- // | +---Content-----------------------------------------+
777
- // | | | |
778
- // | | +-----+Notification+-----+ |
779
- // | | | |
780
- // | | | |
781
- // | | | |
782
- // | +---------------------------------------------------+
783
- // | |
784
- // +------------------------------------+
785
- if ( contentsPos.x + notificationWidth + notificationMargin > scrollPos.x + viewRect.width ) {
786
- setLeft();
787
-
788
- // +---Viewport-------------------------+
789
- // | |
790
- // | +---Content----------------------------------------------+
791
- // | | | |
792
- // | | +------Notification------+ | |
793
- // | | | |
794
- // | | | |
795
- // | +--------------------------------------------------------+
796
- // | |
797
- // +------------------------------------+
798
- } else if ( contentsPos.x + contentsRect.width / 2 +
799
- notificationWidth / 2 + notificationMargin > scrollPos.x + viewRect.width ) {
800
- setRightFixed();
801
-
802
- // +---Viewport-------------------------+
803
- // | |
804
- // +---Content----------------------------+ |
805
- // | | | |
806
- // | +------Notification------+ | |
807
- // | | | |
808
- // | | | |
809
- // +--------------------------------------+ |
810
- // | |
811
- // +------------------------------------+
812
- } else if ( contentsRect.left + contentsRect.width - notificationWidth - notificationMargin < 0 ) {
813
- setRight();
814
-
815
- // +---Viewport-------------------------+
816
- // | |
817
- // +---Content---------------------------------------------+ |
818
- // | | | |
819
- // | | +------Notification------+ | |
820
- // | | | |
821
- // | | | |
822
- // +-------------------------------------------------------+ |
823
- // | |
824
- // +------------------------------------+
825
- } else if ( contentsRect.left + contentsRect.width / 2 - notificationWidth / 2 < 0 ) {
826
- setLeftFixed();
827
-
828
- // +---Viewport-------------------------+
829
- // | |
830
- // | +---Content----------------------+ |
831
- // | | | |
832
- // | | +-----Notification-----+ | |
833
- // | | | |
834
- // | | | |
835
- // | +--------------------------------+ |
836
- // | |
837
- // +------------------------------------+
838
- } else {
839
- setCenter();
840
- }
841
- }
842
-
843
- function setLeft() {
844
- area.setStyle( 'left', cssLength( leftBase ) );
845
- }
846
-
847
- function setLeftFixed() {
848
- area.setStyle( 'left', cssLength( leftBase - contentsPos.x + scrollPos.x ) );
849
- }
850
-
851
- function setCenter() {
852
- area.setStyle( 'left', cssLength( leftBase + contentsRect.width / 2 - notificationWidth / 2 - notificationMargin / 2 ) );
853
- }
854
-
855
- function setRight() {
856
- area.setStyle( 'left', cssLength( leftBase + contentsRect.width - notificationWidth - notificationMargin ) );
857
- }
858
-
859
- function setRightFixed() {
860
- area.setStyle( 'left', cssLength( leftBase - contentsPos.x + scrollPos.x + viewRect.width -
861
- notificationWidth - notificationMargin ) );
862
- }
863
- }
864
- };
865
-
866
- CKEDITOR.plugins.notification = Notification;
867
-
868
- /**
869
- * After how many milliseconds the notification of the `info` and `success`
870
- * {@link CKEDITOR.plugins.notification#type type} should close automatically.
871
- * `0` means that notifications will not close automatically.
872
- * Note that `warning` and `progress` notifications will never close automatically.
873
- *
874
- * Refer to the [Notifications](http://docs.ckeditor.com/#!/guide/dev_notifications) article
875
- * for more information about this feature.
876
- *
877
- * @since 4.5
878
- * @cfg {Number} [notification_duration=5000]
879
- * @member CKEDITOR.config
880
- */
881
-
882
- /**
883
- * Event fired when the {@link CKEDITOR.plugins.notification#show} method is called, before the
884
- * notification is shown. If this event is canceled, the notification will not be shown.
885
- *
886
- * Using this event allows you to fully customize how a notification will be shown. It may be used to integrate
887
- * the CKEditor notification system with your web page notifications.
888
- *
889
- * @since 4.5
890
- * @event notificationShow
891
- * @member CKEDITOR.editor
892
- * @param data
893
- * @param {CKEDITOR.plugins.notification} data.notification Notification which will be shown.
894
- * @param {CKEDITOR.editor} editor The editor instance.
895
- */
896
-
897
- /**
898
- * Event fired when the {@link CKEDITOR.plugins.notification#update} method is called, before the
899
- * notification is updated. If this event is canceled, the notification will not be shown even if the update was important,
900
- * but the object will be updated anyway. Note that canceling this event does not prevent updating {@link #element}
901
- * attributes, but if {@link #notificationShow} was canceled as well, this element is detached from the DOM.
902
- *
903
- * Using this event allows you to fully customize how a notification will be updated. It may be used to integrate
904
- * the CKEditor notification system with your web page notifications.
905
- *
906
- * @since 4.5
907
- * @event notificationUpdate
908
- * @member CKEDITOR.editor
909
- * @param data
910
- * @param {CKEDITOR.plugins.notification} data.notification Notification which will be updated.
911
- * Note that it contains the data that has not been updated yet.
912
- * @param {Object} data.options Update options, see {@link CKEDITOR.plugins.notification#update}.
913
- * @param {CKEDITOR.editor} editor The editor instance.
914
- */
915
-
916
- /**
917
- * Event fired when the {@link CKEDITOR.plugins.notification#hide} method is called, before the
918
- * notification is hidden. If this event is canceled, the notification will not be hidden.
919
- *
920
- * Using this event allows you to fully customize how a notification will be hidden. It may be used to integrate
921
- * the CKEditor notification system with your web page notifications.
922
- *
923
- * @since 4.5
924
- * @event notificationHide
925
- * @member CKEDITOR.editor
926
- * @param data
927
- * @param {CKEDITOR.plugins.notification} data.notification Notification which will be hidden.
928
- * @param {CKEDITOR.editor} editor The editor instance.
929
- */