glebtv-ckeditor 4.11.1 → 4.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +13 -12
  3. data/README.md +358 -2
  4. data/Rakefile +17 -8
  5. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +313 -317
  6. data/app/controllers/ckeditor/application_controller.rb +3 -0
  7. data/app/controllers/ckeditor/attachment_files_controller.rb +2 -2
  8. data/app/controllers/ckeditor/pictures_controller.rb +2 -2
  9. data/app/helpers/ckeditor/application_helper.rb +2 -0
  10. data/app/views/ckeditor/shared/_asset.html.erb +1 -3
  11. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +0 -2
  12. data/config/locales/da.ckeditor.yml +9 -0
  13. data/config/routes.rb +2 -0
  14. data/lib/ckeditor.rb +13 -19
  15. data/lib/ckeditor/asset_response.rb +17 -10
  16. data/lib/ckeditor/backend/active_storage.rb +68 -0
  17. data/lib/ckeditor/backend/carrierwave.rb +2 -12
  18. data/lib/ckeditor/backend/dragonfly.rb +2 -0
  19. data/lib/ckeditor/backend/paperclip.rb +2 -15
  20. data/lib/ckeditor/backend/shrine.rb +29 -0
  21. data/lib/ckeditor/helpers/controllers.rb +2 -0
  22. data/lib/ckeditor/helpers/form_builder.rb +2 -0
  23. data/lib/ckeditor/helpers/form_helper.rb +2 -0
  24. data/lib/ckeditor/helpers/view_helper.rb +2 -0
  25. data/lib/ckeditor/hooks/cancan.rb +4 -1
  26. data/lib/ckeditor/hooks/formtastic.rb +2 -0
  27. data/lib/ckeditor/hooks/pundit.rb +2 -0
  28. data/lib/ckeditor/hooks/simple_form.rb +2 -0
  29. data/lib/ckeditor/http.rb +14 -9
  30. data/lib/ckeditor/orm/active_record.rb +2 -0
  31. data/lib/ckeditor/orm/base.rb +11 -2
  32. data/lib/ckeditor/orm/mongoid.rb +2 -0
  33. data/lib/ckeditor/paginatable.rb +2 -0
  34. data/lib/ckeditor/rails.rb +2 -0
  35. data/lib/ckeditor/rails_admin/field.rb +16 -3
  36. data/lib/ckeditor/text_area.rb +2 -0
  37. data/lib/ckeditor/utils.rb +3 -16
  38. data/lib/ckeditor/utils/javascript_code.rb +1 -1
  39. data/lib/ckeditor/version.rb +4 -2
  40. data/lib/generators/ckeditor/install_generator.rb +16 -19
  41. data/lib/generators/ckeditor/pundit_policy_generator.rb +2 -0
  42. data/lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/asset.rb +10 -0
  43. data/lib/generators/ckeditor/templates/active_record/{refile → active_storage}/ckeditor/attachment_file.rb +3 -1
  44. data/lib/generators/ckeditor/templates/active_record/active_storage/ckeditor/picture.rb +13 -0
  45. data/lib/generators/ckeditor/templates/active_record/{carrierwave/migration_versioned.rb → active_storage/migration.rb} +8 -5
  46. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -0
  47. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +2 -0
  48. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +2 -0
  49. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +7 -5
  50. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +2 -0
  51. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +2 -0
  52. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +2 -0
  53. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +7 -5
  54. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb +2 -0
  55. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +2 -0
  56. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +2 -0
  57. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +8 -6
  58. data/lib/generators/ckeditor/templates/active_record/{refile → shrine}/ckeditor/asset.rb +3 -1
  59. data/lib/generators/ckeditor/templates/active_record/shrine/ckeditor/attachment_file.rb +21 -0
  60. data/lib/generators/ckeditor/templates/active_record/shrine/ckeditor/picture.rb +49 -0
  61. data/lib/generators/ckeditor/templates/active_record/shrine/migration.rb +22 -0
  62. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +2 -1
  63. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +2 -3
  64. data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +2 -0
  65. data/lib/generators/ckeditor/templates/base/shrine/initializer.rb +25 -0
  66. data/lib/generators/ckeditor/templates/ckeditor.rb +3 -6
  67. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +2 -0
  68. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +2 -0
  69. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +2 -0
  70. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +2 -0
  71. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +2 -0
  72. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +2 -0
  73. data/lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/asset.rb +8 -0
  74. data/lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/attachment_file.rb +21 -0
  75. data/lib/generators/ckeditor/templates/mongoid/shrine/ckeditor/picture.rb +47 -0
  76. data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +2 -0
  77. data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +2 -0
  78. data/lib/tasks/ckeditor.rake +2 -0
  79. data/test/controllers/attachment_files_controller_test.rb +17 -15
  80. data/test/controllers/pictures_controller_test.rb +17 -15
  81. data/test/dummy/Rakefile +2 -0
  82. data/test/dummy/app/assets/javascripts/application.js +0 -2
  83. data/test/dummy/app/controllers/application_controller.rb +2 -0
  84. data/test/dummy/app/controllers/posts_controller.rb +2 -0
  85. data/test/dummy/app/helpers/application_helper.rb +2 -0
  86. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  87. data/test/dummy/app/models/post.rb +2 -0
  88. data/test/dummy/app/views/posts/index.html.erb +0 -3
  89. data/test/dummy/app/views/posts/show.html.erb +3 -0
  90. data/test/dummy/config.ru +2 -0
  91. data/test/dummy/config/application.rb +5 -1
  92. data/test/dummy/config/boot.rb +2 -0
  93. data/test/dummy/config/environment.rb +2 -0
  94. data/test/dummy/config/environments/development.rb +2 -0
  95. data/test/dummy/config/environments/production.rb +2 -0
  96. data/test/dummy/config/environments/test.rb +5 -3
  97. data/test/dummy/config/initializers/assets.rb +2 -0
  98. data/test/dummy/config/initializers/backtrace_silencers.rb +2 -0
  99. data/test/dummy/config/initializers/ckeditor.rb +2 -0
  100. data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
  101. data/test/dummy/config/initializers/inflections.rb +2 -0
  102. data/test/dummy/config/initializers/mime_types.rb +2 -0
  103. data/test/dummy/config/initializers/paperclip.rb +2 -0
  104. data/test/dummy/config/initializers/session_store.rb +2 -0
  105. data/test/dummy/config/initializers/wrap_parameters.rb +2 -0
  106. data/test/dummy/config/routes.rb +2 -0
  107. data/test/dummy/config/storage.yml +3 -0
  108. data/test/dummy/db/migrate/20110623120047_create_posts.rb +5 -3
  109. data/test/dummy/db/migrate/20170806125915_create_active_storage_tables.rb +26 -0
  110. data/test/dummy/script/rails +2 -0
  111. data/test/functional/posts_controller_test.rb +18 -16
  112. data/test/generators/install_generator_test.rb +58 -56
  113. data/test/integration/navigation_test.rb +2 -0
  114. data/test/models/attachment_file_test.rb +4 -4
  115. data/test/models/ckeditor_test.rb +3 -21
  116. data/test/models/picture_test.rb +12 -10
  117. data/test/models/utils_test.rb +2 -0
  118. data/test/orm/active_record.rb +11 -1
  119. data/test/orm/mongoid.rb +2 -0
  120. data/test/support/helpers.rb +2 -0
  121. data/test/support/integration_case.rb +2 -0
  122. data/test/test_helper.rb +15 -9
  123. data/vendor/assets/javascripts/ckeditor/CHANGES.md +178 -2
  124. data/vendor/assets/javascripts/ckeditor/LICENSE.md +3 -2
  125. data/vendor/assets/javascripts/ckeditor/README.md +6 -6
  126. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +6 -6
  127. data/vendor/assets/javascripts/ckeditor/build-config.js +3 -4
  128. data/vendor/assets/javascripts/ckeditor/ckeditor.js +851 -816
  129. data/vendor/assets/javascripts/ckeditor/config.js +1 -1
  130. data/vendor/assets/javascripts/ckeditor/contents.css +1 -1
  131. data/vendor/assets/javascripts/ckeditor/lang/en.js +1 -1
  132. data/vendor/assets/javascripts/ckeditor/lang/ru.js +1 -1
  133. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -1
  134. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +1 -1
  135. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +1 -1
  136. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +1 -1
  137. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +1 -1
  138. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  139. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +4 -2
  140. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  141. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -1
  142. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  143. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -1
  144. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
  145. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  146. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
  147. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
  148. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +7 -3
  149. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +41 -41
  150. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +39 -39
  151. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +32 -32
  152. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +5 -5
  153. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +74 -74
  154. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +38 -38
  155. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +38 -38
  156. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/bespin.css +34 -34
  157. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +32 -32
  158. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +25 -25
  159. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +33 -33
  160. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +51 -46
  161. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +40 -40
  162. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +35 -35
  163. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +36 -36
  164. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +23 -23
  165. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +13 -13
  166. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +34 -34
  167. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +37 -34
  168. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/hopscotch.css +34 -34
  169. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +43 -43
  170. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +41 -41
  171. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/isotope.css +34 -34
  172. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +47 -47
  173. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +95 -95
  174. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -37
  175. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +53 -53
  176. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +37 -37
  177. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +46 -46
  178. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +43 -43
  179. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +41 -41
  180. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +12 -12
  181. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +43 -43
  182. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +27 -27
  183. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/nord.css +42 -0
  184. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -44
  185. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +85 -85
  186. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +38 -38
  187. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +38 -38
  188. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +52 -52
  189. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/railscasts.css +34 -34
  190. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +25 -25
  191. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +44 -44
  192. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -52
  193. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +168 -168
  194. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -16
  195. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +30 -30
  196. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-bright.css +35 -35
  197. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +38 -38
  198. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +64 -64
  199. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +32 -32
  200. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +34 -34
  201. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +53 -53
  202. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -43
  203. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +44 -44
  204. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/yonce.css +59 -0
  205. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/zenburn.css +37 -37
  206. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +1 -1
  207. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +11 -11
  208. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
  209. data/vendor/assets/javascripts/ckeditor/plugins/dialog/styles/dialog.css +18 -0
  210. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -8
  211. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +4 -4
  212. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +16 -16
  213. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +5 -5
  214. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +3 -3
  215. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +2 -2
  216. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +4 -4
  217. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +2 -2
  218. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +16 -16
  219. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +6 -5
  220. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +8 -8
  221. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +8 -7
  222. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +13 -1
  223. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/en.js +1 -1
  224. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/ru.js +1 -1
  225. data/vendor/assets/javascripts/ckeditor/plugins/image/plugin.js +2 -2
  226. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +1 -1
  227. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +2 -2
  228. data/vendor/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +2 -2
  229. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/en.js +1 -1
  230. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +1 -1
  231. data/vendor/assets/javascripts/ckeditor/plugins/image2/plugin.js +95 -32
  232. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +3 -3
  233. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +4 -4
  234. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +25 -25
  235. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -7
  236. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +40 -52
  237. data/vendor/assets/javascripts/ckeditor/plugins/pastetools/filter/common.js +19 -0
  238. data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +63 -7
  239. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +32 -32
  240. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
  241. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +1 -1
  242. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
  243. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
  244. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +19 -18
  245. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +15 -15
  246. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +1 -1
  247. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +1 -1
  248. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +1 -1
  249. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +13 -7
  250. data/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +62 -7
  251. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +4 -4
  252. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +1 -123
  253. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +1 -1
  254. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +1 -1
  255. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +1 -1
  256. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +1 -1
  257. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +1 -1
  258. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  259. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  260. data/vendor/assets/javascripts/ckeditor/skins/minimalist/skin.js +10 -0
  261. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +1 -1
  262. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +1 -1
  263. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +1 -1
  264. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +1 -1
  265. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +2 -2
  266. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +2 -2
  267. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +2 -2
  268. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +2 -2
  269. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +2 -2
  270. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +1 -1
  271. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +1 -1
  272. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +1 -1
  273. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +1 -1
  274. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +1 -1
  275. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +1 -1
  276. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +1 -1
  277. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +2 -2
  278. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +2 -2
  279. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +2 -2
  280. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +2 -2
  281. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +2 -2
  282. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +2 -2
  283. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +2 -2
  284. data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +1 -1
  285. data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
  286. data/vendor/assets/javascripts/ckeditor/vendor/promise.js +13 -0
  287. metadata +65 -121
  288. data/lib/ckeditor/backend/refile.rb +0 -39
  289. data/lib/ckeditor/utils/content_type_detector.rb +0 -38
  290. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration_versioned.rb +0 -23
  291. data/lib/generators/ckeditor/templates/active_record/paperclip/migration_versioned.rb +0 -23
  292. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +0 -11
  293. data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +0 -23
  294. data/lib/generators/ckeditor/templates/active_record/refile/migration_versioned.rb +0 -23
  295. data/test/support/raw_post.rb +0 -9
  296. data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +0 -1637
  297. data/vendor/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
  298. data/vendor/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
  299. data/vendor/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
  300. data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  301. data/vendor/assets/javascripts/ckeditor/samples/img/logo.svg +0 -13
  302. data/vendor/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
  303. data/vendor/assets/javascripts/ckeditor/samples/index.html +0 -128
  304. data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +0 -53
  305. data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +0 -17
  306. data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +0 -85
  307. data/vendor/assets/javascripts/ckeditor/samples/old/api.html +0 -210
  308. data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +0 -59
  309. data/vendor/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
  310. data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +0 -204
  311. data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +0 -59
  312. data/vendor/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
  313. data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +0 -7
  314. data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +0 -508
  315. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +0 -48
  316. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +0 -190
  317. data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +0 -144
  318. data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +0 -106
  319. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
  320. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
  321. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/swfobject.js +0 -19
  322. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +0 -283
  323. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +0 -224
  324. data/vendor/assets/javascripts/ckeditor/samples/old/index.html +0 -134
  325. data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +0 -314
  326. data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +0 -124
  327. data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +0 -113
  328. data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +0 -103
  329. data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +0 -209
  330. data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +0 -76
  331. data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +0 -60
  332. data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +0 -59
  333. data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +0 -357
  334. data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +0 -50
  335. data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +0 -16
  336. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/assets/sample.css +0 -70
  337. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/stylesheetparser.html +0 -85
  338. data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +0 -78
  339. data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +0 -235
  340. data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +0 -72
  341. data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +0 -122
  342. data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +0 -80
  343. data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +0 -234
  344. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +0 -55
  345. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +0 -10
  346. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +0 -28
  347. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
  348. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +0 -14
  349. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
  350. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
  351. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +0 -446
  352. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +0 -13
  353. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +0 -9
  354. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +0 -33
  355. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +0 -14
  356. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/LICENSE +0 -19
  357. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.css +0 -325
  358. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +0 -288
  359. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +0 -25
  360. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +0 -36
  361. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css +0 -38
  362. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +0 -16
  363. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons.png +0 -0
  364. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
@@ -1,55 +0,0 @@
1
- @font-face {
2
- font-family: 'fontello';
3
- src: url('../font/fontello.eot?89024372');
4
- src: url('../font/fontello.eot?89024372#iefix') format('embedded-opentype'),
5
- url('../font/fontello.woff?89024372') format('woff'),
6
- url('../font/fontello.ttf?89024372') format('truetype'),
7
- url('../font/fontello.svg?89024372#fontello') format('svg');
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
- /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
12
- /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
13
- /*
14
- @media screen and (-webkit-min-device-pixel-ratio:0) {
15
- @font-face {
16
- font-family: 'fontello';
17
- src: url('../font/fontello.svg?89024372#fontello') format('svg');
18
- }
19
- }
20
- */
21
-
22
- [class^="icon-"]:before, [class*=" icon-"]:before {
23
- font-family: "fontello";
24
- font-style: normal;
25
- font-weight: normal;
26
- speak: none;
27
-
28
- display: inline-block;
29
- text-decoration: inherit;
30
- width: 1em;
31
- margin-right: .2em;
32
- text-align: center;
33
- /* opacity: .8; */
34
-
35
- /* For safety - reset parent styles, that can break glyph codes*/
36
- font-variant: normal;
37
- text-transform: none;
38
-
39
- /* fix buttons height, for twitter bootstrap */
40
- line-height: 1em;
41
-
42
- /* Animation center compensation - margins should be symmetric */
43
- /* remove if not needed */
44
- margin-left: .2em;
45
-
46
- /* you can be more comfortable with increased icons size */
47
- /* font-size: 120%; */
48
-
49
- /* Uncomment for 3D effect */
50
- /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
51
- }
52
-
53
- .icon-trash:before { content: '\e802'; } /* '' */
54
- .icon-down-big:before { content: '\e800'; } /* '' */
55
- .icon-up-big:before { content: '\e801'; } /* '' */
@@ -1,10 +0,0 @@
1
- Font license info
2
-
3
-
4
- ## Font Awesome
5
-
6
- Copyright (C) 2012 by Dave Gandy
7
-
8
- Author: Dave Gandy
9
- License: SIL ()
10
- Homepage: http://fortawesome.github.com/Font-Awesome/
@@ -1,28 +0,0 @@
1
- {
2
- "name": "",
3
- "css_prefix_text": "icon-",
4
- "css_use_suffix": false,
5
- "hinting": true,
6
- "units_per_em": 1000,
7
- "ascent": 850,
8
- "glyphs": [
9
- {
10
- "uid": "f48ae54adfb27d8ada53d0fd9e34ee10",
11
- "css": "trash-empty",
12
- "code": 59392,
13
- "src": "fontawesome"
14
- },
15
- {
16
- "uid": "1c4068ed75209e21af36017df8871802",
17
- "css": "down-big",
18
- "code": 59393,
19
- "src": "fontawesome"
20
- },
21
- {
22
- "uid": "95376bf082bfec6ce06ea1cda7bd7ead",
23
- "css": "up-big",
24
- "code": 59394,
25
- "src": "fontawesome"
26
- }
27
- ]
28
- }
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
5
- <defs>
6
- <font id="fontello" horiz-adv-x="1000" >
7
- <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
- <missing-glyph horiz-adv-x="1000" />
9
- <glyph glyph-name="trash" unicode="&#xe802;" d="m286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15t6-5h464q2 0 6 5t8 15t4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q22 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
10
- <glyph glyph-name="down-big" unicode="&#xe800;" d="m899 386q0-30-21-50l-363-364q-22-21-51-21q-29 0-50 21l-363 364q-21 20-21 50q0 29 21 51l41 41q22 21 51 21q29 0 50-21l164-164v393q0 29 21 50t51 22h71q29 0 50-22t21-50v-393l164 164q21 21 51 21q29 0 50-21l42-42q21-21 21-50z" horiz-adv-x="928.6" />
11
- <glyph glyph-name="up-big" unicode="&#xe801;" d="m899 308q0-28-21-50l-42-42q-21-21-50-21q-30 0-51 21l-164 164v-393q0-29-20-47t-51-19h-71q-30 0-51 19t-21 47v393l-164-164q-20-21-50-21t-50 21l-42 42q-21 21-21 50q0 30 21 51l363 363q20 21 50 21q30 0 51-21l363-363q21-22 21-51z" horiz-adv-x="928.6" />
12
- </font>
13
- </defs>
14
- </svg>
@@ -1,446 +0,0 @@
1
- <!DOCTYPE html>
2
- <!--
3
- Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
4
- For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5
- -->
6
- <!--[if IE 8]><html class="ie8"><![endif]-->
7
- <!--[if gt IE 8]><html><![endif]-->
8
- <!--[if !IE]><!--><html><!--<![endif]-->
9
- <head>
10
- <meta charset="utf-8">
11
- <title>Toolbar Configurator</title>
12
- <script src="../../ckeditor.js"></script>
13
- <script>
14
- if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
15
- CKEDITOR.tools.enableHtml5Elements( document );
16
- </script>
17
- <link rel="stylesheet" href="lib/codemirror/codemirror.css">
18
- <link rel="stylesheet" href="lib/codemirror/show-hint.css">
19
- <link rel="stylesheet" href="lib/codemirror/neo.css">
20
- <link rel="stylesheet" href="css/fontello.css">
21
- <link rel="stylesheet" href="../css/samples.css">
22
- </head>
23
- <body id="toolbar">
24
-
25
- <nav class="navigation-a">
26
- <div class="grid-container">
27
- <ul class="navigation-a-left grid-width-70">
28
- <li><a href="https://ckeditor.com/ckeditor-4/">Project Homepage</a></li>
29
- <li><a href="https://github.com/ckeditor/ckeditor-dev/issues">I found a bug</a></li>
30
- <li><a href="https://github.com/ckeditor/ckeditor-dev" class="icon-pos-right icon-navigation-a-github">Fork CKEditor on GitHub</a></li>
31
- </ul>
32
- <ul class="navigation-a-right grid-width-30">
33
- <li><a href="https://ckeditor.com/blog/">CKEditor Blog</a></li>
34
- </ul>
35
- </div>
36
- </nav>
37
-
38
- <header class="header-a">
39
- <div class="grid-container">
40
- <h1 class="header-a-logo grid-width-30">
41
- <a href="../index.html"><img src="../img/logo.svg" onerror="this.src='../img/logo.png'; this.onerror=null;" alt="CKEditor Logo"></a>
42
- </h1>
43
- <nav class="navigation-b grid-width-70">
44
- <ul>
45
- <li><a href="../index.html" class="button-a">Start</a></li>
46
- <li><a href="index.html" class="button-a button-a-background">Toolbar configurator</a></li>
47
- </ul>
48
- </nav>
49
- </div>
50
- </header>
51
-
52
- <main>
53
- <div class="adjoined-top">
54
- <div class="grid-container">
55
- <div class="content grid-width-100">
56
- <div class="grid-container-nested">
57
- <h1 class="grid-width-60">
58
- Toolbar Configurator
59
- <a href="#help-content" type="button" title="Configurator help" id="help" class="button-a button-a-background button-a-no-text icon-pos-left icon-question-mark">Help</a>
60
- </h1>
61
-
62
- <div class="grid-width-40 grid-switch-magic">
63
- <div class="switch">
64
- <span class="balloon-a balloon-a-se">Select configurator type</span>
65
- <input type="radio" name="radio" data-num="1" id="radio-basic" />
66
- <input type="radio" name="radio" data-num="2" id="radio-advanced" />
67
- <label data-for="1" for="radio-basic">Basic</label>
68
- <span class="switch-inner">
69
- <span class="handler"></span>
70
- </span>
71
- <label data-for="2" for="radio-advanced">Advanced</label>
72
- </div>
73
- </div>
74
- </div>
75
- </div>
76
- </div>
77
- </div>
78
- <div class="adjoined-bottom">
79
- <div class="grid-container">
80
- <div class="grid-width-100">
81
- <div class="editors-container">
82
- <div id="editor-basic"></div>
83
- <div id="editor-advanced"></div>
84
- </div>
85
- </div>
86
- </div>
87
- </div>
88
-
89
- <div class="grid-container configurator">
90
- <div class="content grid-width-100">
91
- <div class="configurator">
92
- <div>
93
- <div id="toolbarModifierWrapper"></div>
94
- </div>
95
- </div>
96
- </div>
97
- </div>
98
-
99
- <div id="help-content">
100
- <div class="grid-container">
101
- <div class="grid-width-100">
102
- <h2>What Am I Doing Here?</h2>
103
-
104
- <div class="grid-container grid-container-nested">
105
- <div class="basic">
106
- <div class="grid-width-50">
107
- <p>Arrange <a href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-toolbarGroups">toolbar groups</a>, toggle <a href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-removeButtons">button visibility</a> according to your needs and get your toolbar configuration.</p>
108
- <p>You can replace the content of the <a href="../../config.js"><code>config.js</code></a> file with the generated configuration. If you already set some configuration options you will need to merge both configurations.</p>
109
- </div>
110
- <div class="grid-width-50">
111
- <p>Read more about different ways of <a href="https://ckeditor.com/docs/ckeditor4/latest/guide/dev_configuration.html">setting configuration</a> and do not forget about <strong>clearing browser cache</strong>.</p>
112
- <p>Arranging toolbar groups is the recommended way of configuring the toolbar, but if you need more freedom you can use the <a href="#advanced">advanced configurator</a>.</p>
113
- </div>
114
- </div>
115
- <div class="advanced" style="display: none;">
116
- <div class="grid-width-50">
117
- <p>With this code editor you can edit your <a href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-toolbar">toolbar configuration</a> live.</p>
118
- <p>You can replace the content of the <a href="../../config.js"><code>config.js</code></a> file with the generated configuration. If you already set some configuration options you will need to merge both configurations.</p>
119
- </div>
120
- <div class="grid-width-50">
121
- <p>Read more about different ways of <a href="https://ckeditor.com/docs/ckeditor4/latest/guide/dev_configuration.html">setting configuration</a> and do not forget about <strong>clearing browser cache</strong>.</p>
122
- </div>
123
- </div>
124
- </div>
125
-
126
- <p class="grid-container grid-container-nested">
127
- <button type="button" class="help-content-close grid-width-100 button-a button-a-background">Got it. Let's play!</button>
128
- </p>
129
- </div>
130
- </div>
131
- </div>
132
- </main>
133
-
134
- <footer class="footer-a grid-container">
135
- <p class="grid-width-100">
136
- CKEditor &ndash; The text editor for the Internet &ndash; <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
137
- </p>
138
- <p class="grid-width-100" id="copy">
139
- Copyright &copy; 2003-2018, <a class="samples" href="https://cksource.com/">CKSource</a> &ndash; Frederico Knabben. All rights reserved.
140
- </p>
141
- </footer>
142
-
143
- <script src="lib/codemirror/codemirror.js"></script>
144
- <script src="lib/codemirror/javascript.js"></script>
145
- <script src="lib/codemirror/show-hint.js"></script>
146
-
147
- <script src="js/fulltoolbareditor.js"></script>
148
- <script src="js/abstracttoolbarmodifier.js"></script>
149
- <script src="js/toolbarmodifier.js"></script>
150
- <script src="js/toolbartextmodifier.js"></script>
151
- <script src="../js/sf.js"></script>
152
-
153
- <script>
154
- ( function() {
155
- 'use strict';
156
-
157
- var mode = ( window.location.hash.substr( 1 ) === 'advanced' ) ? 'advanced' : 'basic',
158
- configuratorSection = CKEDITOR.document.findOne( 'main > .grid-container.configurator' ),
159
- basicInstruction = CKEDITOR.document.findOne( '#help-content .basic' ),
160
- advancedInstruction = CKEDITOR.document.findOne( '#help-content .advanced' ),
161
-
162
- // Configurator mode switcher.
163
- modeSwitchBasic = CKEDITOR.document.getById( 'radio-basic' ),
164
- modeSwitchAdvanced = CKEDITOR.document.getById( 'radio-advanced' );
165
-
166
- // Initial setup
167
- function updateSwitcher() {
168
- if ( mode === 'advanced' ) {
169
- modeSwitchAdvanced.$.checked = true;
170
- } else {
171
- modeSwitchBasic.$.checked = true;
172
- }
173
- }
174
-
175
- updateSwitcher();
176
-
177
- CKEDITOR.document.getWindow().on( 'hashchange', function( e ) {
178
- var hash = window.location.hash.substr( 1 );
179
- if ( !( hash === 'advanced' || hash === 'basic' ) ) {
180
- return;
181
- }
182
- mode = hash;
183
- onToolbarsDone( mode );
184
- } );
185
-
186
- CKEDITOR.document.getWindow().on( 'resize', function() {
187
- updateToolbar( ( mode === 'basic' ? toolbarModifier : toolbarTextModifier )[ 'editorInstance' ] );
188
- } );
189
-
190
- function onRefresh( modifier ) {
191
- modifier = modifier || this;
192
-
193
- if ( mode === 'basic' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
194
- return;
195
- }
196
-
197
- // CodeMirror container becomes visible, so we need to refresh and to avoid rendering problems.
198
- if ( mode === 'advanced' && modifier instanceof ToolbarConfigurator.ToolbarTextModifier ) {
199
- modifier.codeContainer.refresh();
200
- }
201
-
202
- updateToolbar( modifier.editorInstance );
203
- }
204
-
205
- function updateToolbar( editor ) {
206
- var editorContainer = editor.container;
207
-
208
- // Not always editor is loaded.
209
- if ( !editorContainer ) {
210
- return;
211
- }
212
-
213
- var displayStyle = editorContainer.getStyle( 'display' );
214
-
215
- editorContainer.setStyle( 'display', 'block' );
216
-
217
- var newHeight = editorContainer.getSize( 'height' );
218
-
219
- var newMarginTop = parseInt( editorContainer.getComputedStyle( 'margin-top' ), 10 );
220
- newMarginTop = ( isNaN( newMarginTop ) ? 0 : Number( newMarginTop ) );
221
-
222
- var newMarginBottom = parseInt( editorContainer.getComputedStyle( 'margin-bottom' ), 10 );
223
- newMarginBottom = ( isNaN( newMarginBottom ) ? 0 : Number( newMarginBottom ) );
224
-
225
- var result = newHeight + newMarginTop + newMarginBottom;
226
-
227
- editorContainer.setStyle( 'display', displayStyle );
228
-
229
- editor.container.getAscendant( 'div' ).setStyle( 'height', result + 'px' );
230
- }
231
-
232
- var toolbarModifier = new ToolbarConfigurator.ToolbarModifier( 'editor-basic' );
233
-
234
- var done = 0;
235
- toolbarModifier.init( onToolbarInit );
236
- toolbarModifier.onRefresh = onRefresh;
237
-
238
- CKEDITOR.document.getById( 'toolbarModifierWrapper' ).append( toolbarModifier.mainContainer );
239
-
240
- var toolbarTextModifier = new ToolbarConfigurator.ToolbarTextModifier( 'editor-advanced' );
241
- toolbarTextModifier.init( onToolbarInit );
242
- toolbarTextModifier.onRefresh = onRefresh;
243
-
244
- function onToolbarInit() {
245
- if ( ++done === 2 ) {
246
- onToolbarsDone();
247
-
248
- positionSticky.watch( CKEDITOR.document.findOne( '.toolbar' ), function() {
249
- return mode === 'advanced';
250
- } );
251
- }
252
- }
253
-
254
- function onToolbarsDone() {
255
- if ( mode === 'basic' ) {
256
- toggleModeBasic( false );
257
- } else {
258
- toggleModeAdvanced( false );
259
- }
260
-
261
- updateSwitcher();
262
-
263
- setTimeout( function() {
264
- CKEDITOR.document.findOne( '.editors-container' ).addClass( 'active' );
265
- CKEDITOR.document.findOne( '#toolbarModifierWrapper' ).addClass( 'active' );
266
- }, 200 );
267
- }
268
-
269
- CKEDITOR.document.getById( 'toolbarModifierWrapper' ).append( toolbarTextModifier.mainContainer );
270
-
271
- function toogleModeSwitch( onElement, offElement, onModifier, offModifier ) {
272
- onElement.addClass( 'fancy-button-active' );
273
- offElement.removeClass( 'fancy-button-active' );
274
-
275
- onModifier.showUI();
276
- offModifier.hideUI();
277
- }
278
-
279
- function toggleModeBasic( callOnRefresh ) {
280
- callOnRefresh = ( callOnRefresh !== false );
281
- mode = 'basic';
282
- window.location.hash = '#basic';
283
- toogleModeSwitch( modeSwitchBasic, modeSwitchAdvanced, toolbarModifier, toolbarTextModifier );
284
-
285
- configuratorSection.removeClass( 'freed-width' );
286
- basicInstruction.show();
287
- advancedInstruction.hide();
288
-
289
- callOnRefresh && onRefresh( toolbarModifier );
290
- }
291
-
292
- function toggleModeAdvanced( callOnRefresh ) {
293
- callOnRefresh = ( callOnRefresh !== false );
294
- mode = 'advanced';
295
- window.location.hash = '#advanced';
296
- toogleModeSwitch( modeSwitchAdvanced, modeSwitchBasic, toolbarTextModifier, toolbarModifier );
297
-
298
- configuratorSection.addClass( 'freed-width' );
299
- advancedInstruction.show();
300
- basicInstruction.hide();
301
-
302
- callOnRefresh && onRefresh( toolbarTextModifier );
303
- }
304
-
305
- modeSwitchBasic.on( 'click', toggleModeBasic );
306
- modeSwitchAdvanced.on( 'click', toggleModeAdvanced );
307
-
308
- //
309
- // Position:sticky for the toolbar.
310
- //
311
-
312
- // Will make elements behave like they were styled with position:sticky.
313
- var positionSticky = {
314
- // Store object: {
315
- // element: CKEDITOR.dom.element, // Element which will float.
316
- // placeholder: CKEDITOR.dom.element, // Placeholder which is place to prevent page bounce.
317
- // isFixed: boolean // Whether element float now.
318
- // }
319
- watched: [],
320
-
321
- active: [],
322
-
323
- staticContainer: null,
324
-
325
- init: function() {
326
- var element = CKEDITOR.dom.element.createFromHtml(
327
- '<div class="staticContainer">' +
328
- '<div class="grid-container" >' +
329
- '<div class="grid-width-100">' +
330
- '<div class="inner"></div>' +
331
- '</div>' +
332
- '</div>' +
333
- '</div>' );
334
-
335
- this.staticContainer = element.findOne( '.inner' );
336
-
337
- CKEDITOR.document.getBody().append( element );
338
- },
339
-
340
- watch: function( element, preventFunc ) {
341
- this.watched.push( {
342
- element: element,
343
- placeholder: new CKEDITOR.dom.element( 'div' ),
344
- isFixed: false,
345
- preventFunc: preventFunc
346
- } );
347
- },
348
-
349
- checkAll: function() {
350
- for ( var i = 0; i < this.watched.length; i++ ) {
351
- this.check( this.watched[ i ] );
352
- }
353
- },
354
-
355
- check: function( element ) {
356
- var isFixed = element.isFixed;
357
- var shouldBeFixed = this.shouldBeFixed( element );
358
-
359
- // Nothing to be done.
360
- if ( isFixed === shouldBeFixed ) {
361
- return;
362
- }
363
-
364
- var placeholder = element.placeholder;
365
-
366
- if ( isFixed ) {
367
- // Unfixing.
368
-
369
- element.element.insertBefore( placeholder );
370
- placeholder.remove();
371
-
372
- element.element.removeStyle( 'margin' );
373
-
374
- this.active.splice( CKEDITOR.tools.indexOf( this.active, element ), 1 );
375
-
376
- } else {
377
- // Fixing.
378
- placeholder.setStyle( 'width', element.element.getSize( 'width' ) + 'px' );
379
- placeholder.setStyle( 'height', element.element.getSize( 'height' ) + 'px' );
380
- placeholder.setStyle( 'margin-bottom', element.element.getComputedStyle( 'margin-bottom' ) );
381
- placeholder.setStyle( 'display', element.element.getComputedStyle( 'display' ) );
382
- placeholder.insertAfter( element.element );
383
-
384
- this.staticContainer.append( element.element );
385
-
386
- this.active.push( element );
387
- }
388
-
389
- element.isFixed = !element.isFixed;
390
- },
391
-
392
- shouldBeFixed: function( element ) {
393
- if ( element.preventFunc && element.preventFunc() ) {
394
- return false;
395
- }
396
-
397
- // If element is already fixed we are checking it's placeholder.
398
- var related = ( element.isFixed ? element.placeholder : element.element ),
399
- clientRect = related.$.getBoundingClientRect(),
400
- staticHeight = this.staticContainer.getSize('height' ),
401
- elemHeight = element.element.getSize( 'height' );
402
-
403
- if ( element.isFixed ) {
404
- return ( clientRect.top + elemHeight < staticHeight );
405
- } else {
406
- return ( clientRect.top < staticHeight );
407
- }
408
- }
409
- };
410
-
411
- positionSticky.init();
412
-
413
- CKEDITOR.document.getWindow().on( 'scroll',
414
- new CKEDITOR.tools.eventsBuffer( 100, positionSticky.checkAll, positionSticky ).input
415
- );
416
-
417
- // Make the toolbar sticky.
418
- positionSticky.watch( CKEDITOR.document.findOne( '.editors-container' ) );
419
-
420
- // Help button and help-content.
421
- ( function() {
422
- var helpButton = CKEDITOR.document.getById( 'help' ),
423
- helpContent = CKEDITOR.document.getById( 'help-content' );
424
-
425
- // Don't show help button on IE8 because it's unsupported by Pico Modal.
426
- if ( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) {
427
- helpButton.hide();
428
- } else {
429
- // Display help modal when the button is clicked.
430
- helpButton.on( 'click', function( evt ) {
431
- SF.modal( {
432
- // Clone modal content from DOM.
433
- content: helpContent.getHtml(),
434
-
435
- afterCreate: function( modal ) {
436
- // Enable modal content button to close the modal.
437
- new CKEDITOR.dom.element( modal.modalElem() ).findOne( '.help-content-close' ).once( 'click', modal.close );
438
- }
439
- } ).show();
440
- } );
441
- }
442
- } )();
443
- } )();
444
- </script>
445
- </body>
446
- </html>