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,6 +1,6 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
6
6
  .cke_colordialog_colorcell {
@@ -1,14 +1,14 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("colordialog",function(x){function m(){h.getById(n).removeStyle("background-color");p.getContentElement("picker","selectedColor").setValue("");y()}function z(a){a=a.data.getTarget();var c;"td"==a.getName()&&(c=a.getChild(0).getHtml())&&(y(),f=a,f.setAttribute("aria-selected",!0),f.addClass("cke_colordialog_selected"),p.getContentElement("picker","selectedColor").setValue(c))}function y(){f&&(f.removeClass("cke_colordialog_selected"),f.removeAttribute("aria-selected"),f=null)}function D(a){a=
6
- a.replace(/^#/,"");for(var c=0,b=[];2>=c;c++)b[c]=parseInt(a.substr(2*c,2),16);return 165<=.2126*b[0]+.7152*b[1]+.0722*b[2]}function A(a){!a.name&&(a=new CKEDITOR.event(a));var c=!/mouse/.test(a.name),b=a.data.getTarget(),g;"td"==b.getName()&&(g=b.getChild(0).getHtml())&&(q(a),c?d=b:B=b,c&&b.addClass(D(g)?"cke_colordialog_focused_light":"cke_colordialog_focused_dark"),r(g))}function q(a){if(a=!/mouse/.test(a.name)&&d)a.removeClass("cke_colordialog_focused_light"),a.removeClass("cke_colordialog_focused_dark");
7
- d||B||r(!1)}function r(a){a?(h.getById(t).setStyle("background-color",a),h.getById(u).setHtml(a)):(h.getById(t).removeStyle("background-color"),h.getById(u).setHtml("\x26nbsp;"))}function E(a){var c=a.data,b=c.getTarget(),g=c.getKeystroke(),e="rtl"==x.lang.dir;switch(g){case 38:if(a=b.getParent().getPrevious())a=a.getChild([b.getIndex()]),a.focus();c.preventDefault();break;case 40:(a=b.getParent().getNext())&&(a=a.getChild([b.getIndex()]))&&1==a.type&&a.focus();c.preventDefault();break;case 32:case 13:z(a);
8
- c.preventDefault();break;case e?37:39:(a=b.getNext())?1==a.type&&(a.focus(),c.preventDefault(!0)):(a=b.getParent().getNext())&&(a=a.getChild([0]))&&1==a.type&&(a.focus(),c.preventDefault(!0));break;case e?39:37:if(a=b.getPrevious())a.focus(),c.preventDefault(!0);else if(a=b.getParent().getPrevious())a=a.getLast(),a.focus(),c.preventDefault(!0)}}var v=CKEDITOR.dom.element,h=CKEDITOR.document,e=x.lang.colordialog,p,f,C={type:"html",html:"\x26nbsp;"},d,B,l=function(a){return CKEDITOR.tools.getNextId()+
9
- "_"+a},t=l("hicolor"),u=l("hicolortext"),n=l("selhicolor"),k;(function(){function a(a,d){for(var w=a;w<a+3;w++){var f=new v(k.$.insertRow(-1));f.setAttribute("role","row");for(var e=d;e<d+3;e++)for(var g=0;6>g;g++)c(f.$,"#"+b[e]+b[g]+b[w])}}function c(a,c){var b=new v(a.insertCell(-1));b.setAttribute("class","ColorCell cke_colordialog_colorcell");b.setAttribute("tabIndex",-1);b.setAttribute("role","gridcell");b.on("keydown",E);b.on("click",z);b.on("focus",A);b.on("blur",q);b.setStyle("background-color",
10
- c);var d=l("color_table_cell");b.setAttribute("aria-labelledby",d);b.append(CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+d+'" class\x3d"cke_voice_label"\x3e'+c+"\x3c/span\x3e",CKEDITOR.document))}k=CKEDITOR.dom.element.createFromHtml('\x3ctable tabIndex\x3d"-1" class\x3d"cke_colordialog_table" aria-label\x3d"'+e.options+'" role\x3d"grid" style\x3d"border-collapse:separate;" cellspacing\x3d"0"\x3e\x3ccaption class\x3d"cke_voice_label"\x3e'+e.options+'\x3c/caption\x3e\x3ctbody role\x3d"presentation"\x3e\x3c/tbody\x3e\x3c/table\x3e');
11
- k.on("mouseover",A);k.on("mouseout",q);var b="00 33 66 99 cc ff".split(" ");a(0,0);a(3,0);a(0,3);a(3,3);var g=new v(k.$.insertRow(-1));g.setAttribute("role","row");c(g.$,"#000000");for(var f=0;16>f;f++){var d=f.toString(16);c(g.$,"#"+d+d+d+d+d+d)}c(g.$,"#ffffff")})();CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(CKEDITOR.plugins.get("colordialog").path+"dialogs/colordialog.css"));return{title:e.title,minWidth:360,minHeight:220,onLoad:function(){p=this},onHide:function(){m();d.removeClass("cke_colordialog_focused_light");
12
- d.removeClass("cke_colordialog_focused_dark");r(!1);d=null},contents:[{id:"picker",label:e.title,accessKey:"I",elements:[{type:"hbox",padding:0,widths:["70%","10%","30%"],children:[{type:"html",html:"\x3cdiv\x3e\x3c/div\x3e",onLoad:function(){CKEDITOR.document.getById(this.domId).append(k)},focus:function(){(d||this.getElement().getElementsByTag("td").getItem(0)).focus()}},C,{type:"vbox",padding:0,widths:["70%","5%","25%"],children:[{type:"html",html:"\x3cspan\x3e"+e.highlight+'\x3c/span\x3e\x3cdiv id\x3d"'+
13
- t+'" style\x3d"border: 1px solid; height: 74px; width: 74px;"\x3e\x3c/div\x3e\x3cdiv id\x3d"'+u+'"\x3e\x26nbsp;\x3c/div\x3e\x3cspan\x3e'+e.selected+'\x3c/span\x3e\x3cdiv id\x3d"'+n+'" style\x3d"border: 1px solid; height: 20px; width: 74px;"\x3e\x3c/div\x3e'},{type:"text",label:e.selected,labelStyle:"display:none",id:"selectedColor",style:"width: 76px;margin-top:4px",onChange:function(){try{h.getById(n).setStyle("background-color",this.getValue())}catch(a){m()}}},C,{type:"button",id:"clear",label:e.clear,
14
- onClick:m}]}]}]}]}});
5
+ CKEDITOR.dialog.add("colordialog",function(w){function l(){h.getById(p).removeStyle("background-color");m.getContentElement("picker","selectedColor").setValue("");x()}function y(a){a=a.data.getTarget();var c;"td"==a.getName()&&(c=a.getChild(0).getHtml())&&(x(),e=a,e.setAttribute("aria-selected",!0),e.addClass("cke_colordialog_selected"),m.getContentElement("picker","selectedColor").setValue(c))}function x(){e&&(e.removeClass("cke_colordialog_selected"),e.removeAttribute("aria-selected"),e=null)}function D(a){a=
6
+ a.replace(/^#/,"");for(var c=0,b=[];2>=c;c++)b[c]=parseInt(a.substr(2*c,2),16);return 165<=.2126*b[0]+.7152*b[1]+.0722*b[2]}function z(a){!a.name&&(a=new CKEDITOR.event(a));var c=!/mouse/.test(a.name),b=a.data.getTarget(),f;"td"==b.getName()&&(f=b.getChild(0).getHtml())&&(q(a),c?d=b:A=b,c&&b.addClass(D(f)?"cke_colordialog_focused_light":"cke_colordialog_focused_dark"),r(f))}function B(){d&&(d.removeClass("cke_colordialog_focused_light"),d.removeClass("cke_colordialog_focused_dark"));r(!1);d=null}
7
+ function q(a){if(a=!/mouse/.test(a.name)&&d)a.removeClass("cke_colordialog_focused_light"),a.removeClass("cke_colordialog_focused_dark");d||A||r(!1)}function r(a){a?(h.getById(t).setStyle("background-color",a),h.getById(u).setHtml(a)):(h.getById(t).removeStyle("background-color"),h.getById(u).setHtml("\x26nbsp;"))}function E(a){var c=a.data,b=c.getTarget(),f=c.getKeystroke(),d="rtl"==w.lang.dir;switch(f){case 38:if(a=b.getParent().getPrevious())a=a.getChild([b.getIndex()]),a.focus();c.preventDefault();
8
+ break;case 40:(a=b.getParent().getNext())&&(a=a.getChild([b.getIndex()]))&&1==a.type&&a.focus();c.preventDefault();break;case 32:case 13:y(a);c.preventDefault();break;case d?37:39:(a=b.getNext())?1==a.type&&(a.focus(),c.preventDefault(!0)):(a=b.getParent().getNext())&&(a=a.getChild([0]))&&1==a.type&&(a.focus(),c.preventDefault(!0));break;case d?39:37:if(a=b.getPrevious())a.focus(),c.preventDefault(!0);else if(a=b.getParent().getPrevious())a=a.getLast(),a.focus(),c.preventDefault(!0)}}var v=CKEDITOR.dom.element,
9
+ h=CKEDITOR.document,g=w.lang.colordialog,m,e,C={type:"html",html:"\x26nbsp;"},n=function(a){return CKEDITOR.tools.getNextId()+"_"+a},t=n("hicolor"),u=n("hicolortext"),p=n("selhicolor"),k,d,A;(function(){function a(a,d){for(var e=a;e<a+3;e++){var f=new v(k.$.insertRow(-1));f.setAttribute("role","row");for(var g=d;g<d+3;g++)for(var h=0;6>h;h++)c(f.$,"#"+b[g]+b[h]+b[e])}}function c(a,c){var b=new v(a.insertCell(-1));b.setAttribute("class","ColorCell cke_colordialog_colorcell");b.setAttribute("tabIndex",
10
+ -1);b.setAttribute("role","gridcell");b.on("keydown",E);b.on("click",y);b.on("focus",z);b.on("blur",q);b.setStyle("background-color",c);var d=n("color_table_cell");b.setAttribute("aria-labelledby",d);b.append(CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+d+'" class\x3d"cke_voice_label"\x3e'+c+"\x3c/span\x3e",CKEDITOR.document))}k=CKEDITOR.dom.element.createFromHtml('\x3ctable tabIndex\x3d"-1" class\x3d"cke_colordialog_table" aria-label\x3d"'+g.options+'" role\x3d"grid" style\x3d"border-collapse:separate;" cellspacing\x3d"0"\x3e\x3ccaption class\x3d"cke_voice_label"\x3e'+
11
+ g.options+'\x3c/caption\x3e\x3ctbody role\x3d"presentation"\x3e\x3c/tbody\x3e\x3c/table\x3e');k.on("mouseover",z);k.on("mouseout",q);var b="00 33 66 99 cc ff".split(" ");a(0,0);a(3,0);a(0,3);a(3,3);var f=new v(k.$.insertRow(-1));f.setAttribute("role","row");c(f.$,"#000000");for(var d=0;16>d;d++){var e=d.toString(16);c(f.$,"#"+e+e+e+e+e+e)}c(f.$,"#ffffff")})();CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(CKEDITOR.plugins.get("colordialog").path+"dialogs/colordialog.css"));return{title:g.title,
12
+ minWidth:360,minHeight:220,onShow:function(a){if(!a.data.selectionColor||a.data.selectionColor==a.data.automaticTextColor||"#rgba(0, 0, 0, 0)"==a.data.selectionColor&&"back"==a.data.type)l(),B();else{var c=a.data.selectionColor;a=this.parts.contents.getElementsByTag("td").toArray();var b;m.getContentElement("picker","selectedColor").setValue(c);CKEDITOR.tools.array.forEach(a,function(a){b=CKEDITOR.tools.convertRgbToHex(a.getStyle("background-color"));c===b&&(a.focus(),d=a)})}},onLoad:function(){m=
13
+ this},onHide:function(){l();B()},contents:[{id:"picker",label:g.title,accessKey:"I",elements:[{type:"hbox",padding:0,widths:["70%","10%","30%"],children:[{type:"html",html:"\x3cdiv\x3e\x3c/div\x3e",onLoad:function(){CKEDITOR.document.getById(this.domId).append(k)},focus:function(){(d||this.getElement().getElementsByTag("td").getItem(0)).focus()}},C,{type:"vbox",padding:0,widths:["70%","5%","25%"],children:[{type:"html",html:"\x3cspan\x3e"+g.highlight+'\x3c/span\x3e\x3cdiv id\x3d"'+t+'" style\x3d"border: 1px solid; height: 74px; width: 74px;"\x3e\x3c/div\x3e\x3cdiv id\x3d"'+
14
+ u+'"\x3e\x26nbsp;\x3c/div\x3e\x3cspan\x3e'+g.selected+'\x3c/span\x3e\x3cdiv id\x3d"'+p+'" style\x3d"border: 1px solid; height: 20px; width: 74px;"\x3e\x3c/div\x3e'},{type:"text",label:g.selected,labelStyle:"display:none",id:"selectedColor",style:"width: 76px;margin-top:4px",onChange:function(){try{h.getById(p).setStyle("background-color",this.getValue())}catch(a){l()}}},C,{type:"button",id:"clear",label:g.clear,onClick:l}]}]}]}]}});
@@ -1,4 +1,4 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
@@ -0,0 +1,18 @@
1
+ .cke_dialog_open {
2
+ overflow: hidden;
3
+ }
4
+
5
+ .cke_dialog_container {
6
+ position: fixed;
7
+ overflow-y: auto;
8
+ overflow-x: auto;
9
+ width: 100%;
10
+ height: 100%;
11
+ top: 0;
12
+ left: 0;
13
+ z-index: 10010;
14
+ }
15
+
16
+ .cke_dialog_body {
17
+ position: relative;
18
+ }
@@ -1,9 +1,10 @@
1
- (function(){function t(a,m,r){m.is&&m.getCustomData("block_processed")||(m.is&&CKEDITOR.dom.element.setMarker(r,m,"block_processed",!0),a.push(m))}function q(a,m){function r(){this.foreach(function(a){/^(?!vbox|hbox)/.test(a.type)&&(a.setup||(a.setup=function(c){a.setValue(c.getAttribute(a.id)||"",1)}),a.commit||(a.commit=function(c){var g=this.getValue();if("dir"!=a.id||c.getComputedStyle("direction")!=g)g?c.setAttribute(a.id,g):c.removeAttribute(a.id)}))})}var q=function(){var f=CKEDITOR.tools.extend({},
2
- CKEDITOR.dtd.$blockLimit);a.config.div_wrapTable&&(delete f.td,delete f.th);return f}(),u=CKEDITOR.dtd.div,n={},p=[];return{title:a.lang.div.title,minWidth:400,minHeight:165,contents:[{id:"info",label:a.lang.common.generalTab,title:a.lang.common.generalTab,elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"elementStyle",type:"select",style:"width: 100%;",label:a.lang.div.styleSelectLabel,"default":"",items:[[a.lang.common.notSet,""]],onChange:function(){var f=["info:elementStyle","info:class",
3
- "advanced:dir","advanced:style"],c=this.getDialog(),g=c._element&&c._element.clone()||new CKEDITOR.dom.element("div",a.document);this.commit(g,!0);for(var f=[].concat(f),b=f.length,k,e=0;e<b;e++)(k=c.getContentElement.apply(c,f[e].split(":")))&&k.setup&&k.setup(g,!0)},setup:function(f){for(var c in n)n[c].checkElementRemovable(f,!0,a)&&this.setValue(c,1)},commit:function(f){var c;(c=this.getValue())?n[c].applyToObject(f,a):f.removeAttribute("style")}},{id:"class",type:"text",requiredContent:"div(cke-xyz)",
1
+ (function(){function t(a,m,r){m.is&&m.getCustomData("block_processed")||(m.is&&CKEDITOR.dom.element.setMarker(r,m,"block_processed",!0),a.push(m))}function q(a,m){function r(){this.foreach(function(a){/^(?!vbox|hbox)/.test(a.type)&&(a.setup||(a.setup=function(c){a.setValue(c.getAttribute(a.id)||"",1)}),a.commit||(a.commit=function(c){var f=this.getValue();if("dir"!=a.id||c.getComputedStyle("direction")!=f)f?c.setAttribute(a.id,f):c.removeAttribute(a.id)}))})}var q=function(){var g=CKEDITOR.tools.extend({},
2
+ CKEDITOR.dtd.$blockLimit);a.config.div_wrapTable&&(delete g.td,delete g.th);return g}(),u=CKEDITOR.dtd.div,n={},p=[];return{title:a.lang.div.title,minWidth:400,minHeight:165,contents:[{id:"info",label:a.lang.common.generalTab,title:a.lang.common.generalTab,elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"elementStyle",type:"select",style:"width: 100%;",label:a.lang.div.styleSelectLabel,"default":"",items:[[a.lang.common.notSet,""]],onChange:function(){var g=["info:elementStyle","info:class",
3
+ "advanced:dir","advanced:style"],c=this.getDialog(),f=c.getModel(a),f=f&&f.clone()||new CKEDITOR.dom.element("div",a.document);this.commit(f,!0);for(var g=[].concat(g),b=g.length,k,e=0;e<b;e++)(k=c.getContentElement.apply(c,g[e].split(":")))&&k.setup&&k.setup(f,!0)},setup:function(g){for(var c in n)n[c].checkElementRemovable(g,!0,a)&&this.setValue(c,1)},commit:function(g){var c;(c=this.getValue())?n[c].applyToObject(g,a):g.removeAttribute("style")}},{id:"class",type:"text",requiredContent:"div(cke-xyz)",
4
4
  label:a.lang.common.cssClass,"default":""}]}]},{id:"advanced",label:a.lang.common.advancedTab,title:a.lang.common.advancedTab,elements:[{type:"vbox",padding:1,children:[{type:"hbox",widths:["50%","50%"],children:[{type:"text",id:"id",requiredContent:"div[id]",label:a.lang.common.id,"default":""},{type:"text",id:"lang",requiredContent:"div[lang]",label:a.lang.common.langCode,"default":""}]},{type:"hbox",children:[{type:"text",id:"style",requiredContent:"div{cke-xyz}",style:"width: 100%;",label:a.lang.common.cssStyle,
5
- "default":"",commit:function(a){a.setAttribute("style",this.getValue())}}]},{type:"hbox",children:[{type:"text",id:"title",requiredContent:"div[title]",style:"width: 100%;",label:a.lang.common.advisoryTitle,"default":""}]},{type:"select",id:"dir",requiredContent:"div[dir]",style:"width: 100%;",label:a.lang.common.langDir,"default":"",items:[[a.lang.common.notSet,""],[a.lang.common.langDirLtr,"ltr"],[a.lang.common.langDirRtl,"rtl"]]}]}]}],onLoad:function(){r.call(this);var f=this,c=this.getContentElement("info",
6
- "elementStyle");a.getStylesSet(function(g){var b,k;if(g)for(var e=0;e<g.length;e++)k=g[e],k.element&&"div"==k.element&&(b=k.name,n[b]=k=new CKEDITOR.style(k),a.filter.check(k)&&(c.items.push([b,b]),c.add(b,b)));c[1<c.items.length?"enable":"disable"]();setTimeout(function(){f._element&&c.setup(f._element)},0)})},onShow:function(){"editdiv"==m&&this.setupContent(this._element=CKEDITOR.plugins.div.getSurroundDiv(a))},onOk:function(){if("editdiv"==m)p=[this._element];else{var f=[],c={},g=[],b,k=a.getSelection(),
7
- e=k.getRanges(),n=k.createBookmarks(),h,l;for(h=0;h<e.length;h++)for(l=e[h].createIterator();b=l.getNextParagraph();)if(b.getName()in q&&!b.isReadOnly()){var d=b.getChildren();for(b=0;b<d.count();b++)t(g,d.getItem(b),c)}else{for(;!u[b.getName()]&&!b.equals(e[h].root);)b=b.getParent();t(g,b,c)}CKEDITOR.dom.element.clearAllMarkers(c);e=[];h=null;for(l=0;l<g.length;l++)b=g[l],d=a.elementPath(b).blockLimit,d.isReadOnly()&&(d=d.getParent()),a.config.div_wrapTable&&d.is(["td","th"])&&(d=a.elementPath(d.getParent()).blockLimit),
8
- d.equals(h)||(h=d,e.push([])),b.getParent()&&e[e.length-1].push(b);for(h=0;h<e.length;h++)if(e[h].length){d=e[h][0];g=d.getParent();for(b=1;b<e[h].length;b++)g=g.getCommonAncestor(e[h][b]);g||(g=a.editable());l=new CKEDITOR.dom.element("div",a.document);for(b=0;b<e[h].length;b++){for(d=e[h][b];d.getParent()&&!d.getParent().equals(g);)d=d.getParent();e[h][b]=d}for(b=0;b<e[h].length;b++)d=e[h][b],d.getCustomData&&d.getCustomData("block_processed")||(d.is&&CKEDITOR.dom.element.setMarker(c,d,"block_processed",
9
- !0),b||l.insertBefore(d),l.append(d));CKEDITOR.dom.element.clearAllMarkers(c);f.push(l)}k.selectBookmarks(n);p=f}f=p.length;for(c=0;c<f;c++)this.commitContent(p[c]),!p[c].getAttribute("style")&&p[c].removeAttribute("style");this.hide()},onHide:function(){"editdiv"==m&&this._element.removeCustomData("elementStyle");delete this._element}}}CKEDITOR.dialog.add("creatediv",function(a){return q(a,"creatediv")});CKEDITOR.dialog.add("editdiv",function(a){return q(a,"editdiv")})})();
5
+ "default":"",commit:function(a){a.setAttribute("style",this.getValue())}}]},{type:"hbox",children:[{type:"text",id:"title",requiredContent:"div[title]",style:"width: 100%;",label:a.lang.common.advisoryTitle,"default":""}]},{type:"select",id:"dir",requiredContent:"div[dir]",style:"width: 100%;",label:a.lang.common.langDir,"default":"",items:[[a.lang.common.notSet,""],[a.lang.common.langDirLtr,"ltr"],[a.lang.common.langDirRtl,"rtl"]]}]}]}],getModel:function(a){return"editdiv"===m?CKEDITOR.plugins.div.getSurroundDiv(a):
6
+ null},onLoad:function(){r.call(this);var g=this,c=this.getContentElement("info","elementStyle");a.getStylesSet(function(f){var b,k;if(f)for(var e=0;e<f.length;e++)k=f[e],k.element&&"div"==k.element&&(b=k.name,n[b]=k=new CKEDITOR.style(k),a.filter.check(k)&&(c.items.push([b,b]),c.add(b,b)));c[1<c.items.length?"enable":"disable"]();setTimeout(function(){var b=g.getModel(a);b&&c.setup(b)},0)})},onShow:function(){"editdiv"==m&&this.setupContent(this.getModel(a))},onOk:function(){if("editdiv"==m)p=[this.getModel(a)];
7
+ else{var g=[],c={},f=[],b,k=a.getSelection(),e=k.getRanges(),n=k.createBookmarks(),h,l;for(h=0;h<e.length;h++)for(l=e[h].createIterator();b=l.getNextParagraph();)if(b.getName()in q&&!b.isReadOnly()){var d=b.getChildren();for(b=0;b<d.count();b++)t(f,d.getItem(b),c)}else{for(;!u[b.getName()]&&!b.equals(e[h].root);)b=b.getParent();t(f,b,c)}CKEDITOR.dom.element.clearAllMarkers(c);e=[];h=null;for(l=0;l<f.length;l++)b=f[l],d=a.elementPath(b).blockLimit,d.isReadOnly()&&(d=d.getParent()),a.config.div_wrapTable&&
8
+ d.is(["td","th"])&&(d=a.elementPath(d.getParent()).blockLimit),d.equals(h)||(h=d,e.push([])),b.getParent()&&e[e.length-1].push(b);for(h=0;h<e.length;h++)if(e[h].length){d=e[h][0];f=d.getParent();for(b=1;b<e[h].length;b++)f=f.getCommonAncestor(e[h][b]);f||(f=a.editable());l=new CKEDITOR.dom.element("div",a.document);for(b=0;b<e[h].length;b++){for(d=e[h][b];d.getParent()&&!d.getParent().equals(f);)d=d.getParent();e[h][b]=d}for(b=0;b<e[h].length;b++)d=e[h][b],d.getCustomData&&d.getCustomData("block_processed")||
9
+ (d.is&&CKEDITOR.dom.element.setMarker(c,d,"block_processed",!0),b||l.insertBefore(d),l.append(d));CKEDITOR.dom.element.clearAllMarkers(c);g.push(l)}k.selectBookmarks(n);p=g}g=p.length;for(c=0;c<g;c++)this.commitContent(p[c]),!p[c].getAttribute("style")&&p[c].removeAttribute("style");this.hide()},onHide:function(){this.getMode(a)===CKEDITOR.dialog.EDITING_MODE&&this.getModel(a).removeCustomData("elementStyle")}}}CKEDITOR.dialog.add("creatediv",function(a){return q(a,"creatediv")});CKEDITOR.dialog.add("editdiv",
10
+ function(a){return q(a,"editdiv")})})();
@@ -1,25 +1,25 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- (function(){function C(c){return c.type==CKEDITOR.NODE_TEXT&&0<c.getLength()&&(!r||!c.isReadOnly())}function w(c){return!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary(CKEDITOR.tools.extend({},CKEDITOR.dtd.$empty,CKEDITOR.dtd.$nonEditable)))}function q(c,g){function n(a,b){var d=this,c=new CKEDITOR.dom.walker(a);c.guard=b?w:function(a){!w(a)&&(d._.matchBoundary=!0)};c.evaluator=C;c.breakOnFalse=1;a.startContainer.type==CKEDITOR.NODE_TEXT&&(this.textNode=a.startContainer,this.offset=a.startOffset-
6
- 1);this._={matchWord:b,walker:c,matchBoundary:!1}}function q(a,b){var d=c.createRange();d.setStart(a.textNode,b?a.offset:a.offset+1);d.setEndAt(c.editable(),CKEDITOR.POSITION_BEFORE_END);return d}function t(a){var b=c.getSelection().getRanges()[0],d=c.editable();b&&!a?(a=b.clone(),a.collapse(!0)):(a=c.createRange(),a.setStartAt(d,CKEDITOR.POSITION_AFTER_START));a.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);return a}var x=new CKEDITOR.style(CKEDITOR.tools.extend({attributes:{"data-cke-highlight":1},fullMatch:1,
7
- ignoreReadonly:1,childRule:function(){return 0}},c.config.find_highlight,!0));n.prototype={next:function(){return this.move()},back:function(){return this.move(!0)},move:function(a){var b=this.textNode;if(null===b)return y.call(this);this._.matchBoundary=!1;if(b&&a&&0<this.offset)this.offset--;else if(b&&this.offset<b.getLength()-1)this.offset++;else{for(b=null;!b&&!(b=this._.walker[a?"previous":"next"].call(this._.walker),this._.matchWord&&!b||this._.walker._.end););this.offset=(this.textNode=b)?
8
- a?b.getLength()-1:0:0}return y.call(this)}};var u=function(a,b){this._={walker:a,cursors:[],rangeLength:b,highlightRange:null,isMatched:0}};u.prototype={toDomRange:function(){var a=c.createRange(),b=this._.cursors;if(1>b.length){var d=this._.walker.textNode;if(d)a.setStartAfter(d);else return null}else d=b[0],b=b[b.length-1],a.setStart(d.textNode,d.offset),a.setEnd(b.textNode,b.offset+1);return a},updateFromDomRange:function(a){var b=new n(a);this._.cursors=[];do a=b.next(),a.character&&this._.cursors.push(a);
9
- while(a.character);this._.rangeLength=this._.cursors.length},setMatched:function(){this._.isMatched=!0},clearMatched:function(){this._.isMatched=!1},isMatched:function(){return this._.isMatched},highlight:function(){if(!(1>this._.cursors.length)){this._.highlightRange&&this.removeHighlight();var a=this.toDomRange(),b=a.createBookmark();x.applyToRange(a,c);a.moveToBookmark(b);this._.highlightRange=a;b=a.startContainer;b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());b.scrollIntoView();this.updateFromDomRange(a)}},
10
- removeHighlight:function(){if(this._.highlightRange){var a=this._.highlightRange.createBookmark();x.removeFromRange(this._.highlightRange,c);this._.highlightRange.moveToBookmark(a);this.updateFromDomRange(this._.highlightRange);this._.highlightRange=null}},isReadOnly:function(){return this._.highlightRange?this._.highlightRange.startContainer.isReadOnly():0},moveBack:function(){var a=this._.walker.back(),b=this._.cursors;a.hitMatchBoundary&&(this._.cursors=b=[]);b.unshift(a);b.length>this._.rangeLength&&
11
- b.pop();return a},moveNext:function(){var a=this._.walker.next(),b=this._.cursors;a.hitMatchBoundary&&(this._.cursors=b=[]);b.push(a);b.length>this._.rangeLength&&b.shift();return a},getEndCharacter:function(){var a=this._.cursors;return 1>a.length?null:a[a.length-1].character},getNextCharacterRange:function(a){var b,d;d=this._.cursors;d=(b=d[d.length-1])&&b.textNode?new n(q(b)):this._.walker;return new u(d,a)},getCursors:function(){return this._.cursors}};var z=function(a,b){var d=[-1];b&&(a=a.toLowerCase());
12
- for(var c=0;c<a.length;c++)for(d.push(d[c]+1);0<d[c+1]&&a.charAt(c)!=a.charAt(d[c+1]-1);)d[c+1]=d[d[c+1]-1]+1;this._={overlap:d,state:0,ignoreCase:!!b,pattern:a}};z.prototype={feedCharacter:function(a){for(this._.ignoreCase&&(a=a.toLowerCase());;){if(a==this._.pattern.charAt(this._.state))return this._.state++,this._.state==this._.pattern.length?(this._.state=0,2):1;if(this._.state)this._.state=this._.overlap[this._.state];else return 0}},reset:function(){this._.state=0}};var D=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,
13
- A=function(a){if(!a)return!0;var b=a.charCodeAt(0);return 9<=b&&13>=b||8192<=b&&8202>=b||D.test(a)},e={searchRange:null,matchRange:null,find:function(a,b,d,f,e,E){this.matchRange?(this.matchRange.removeHighlight(),this.matchRange=this.matchRange.getNextCharacterRange(a.length)):this.matchRange=new u(new n(this.searchRange),a.length);for(var k=new z(a,!b),l=0,m="%";null!==m;){for(this.matchRange.moveNext();m=this.matchRange.getEndCharacter();){l=k.feedCharacter(m);if(2==l)break;this.matchRange.moveNext().hitMatchBoundary&&
14
- k.reset()}if(2==l){if(d){var h=this.matchRange.getCursors(),p=h[h.length-1],h=h[0],g=c.createRange();g.setStartAt(c.editable(),CKEDITOR.POSITION_AFTER_START);g.setEnd(h.textNode,h.offset);h=g;p=q(p);h.trim();p.trim();h=new n(h,!0);p=new n(p,!0);if(!A(h.back().character)||!A(p.next().character))continue}this.matchRange.setMatched();!1!==e&&this.matchRange.highlight();return!0}}this.matchRange.clearMatched();this.matchRange.removeHighlight();return f&&!E?(this.searchRange=t(1),this.matchRange=null,
15
- arguments.callee.apply(this,Array.prototype.slice.call(arguments).concat([!0]))):!1},replaceCounter:0,replace:function(a,b,d,f,e,g,k){r=1;a=0;a=this.hasMatchOptionsChanged(b,f,e);if(!this.matchRange||!this.matchRange.isMatched()||this.matchRange._.isReplaced||this.matchRange.isReadOnly()||a)a&&this.matchRange&&(this.matchRange.clearMatched(),this.matchRange.removeHighlight(),this.matchRange=null),a=this.find(b,f,e,g,!k);else{this.matchRange.removeHighlight();b=this.matchRange.toDomRange();d=c.document.createText(d);
16
- if(!k){var l=c.getSelection();l.selectRanges([b]);c.fire("saveSnapshot")}b.deleteContents();b.insertNode(d);k||(l.selectRanges([b]),c.fire("saveSnapshot"));this.matchRange.updateFromDomRange(b);k||this.matchRange.highlight();this.matchRange._.isReplaced=!0;this.replaceCounter++;a=1}r=0;return a},matchOptions:null,hasMatchOptionsChanged:function(a,b,c){a=[a,b,c].join(".");b=this.matchOptions&&this.matchOptions!=a;this.matchOptions=a;return b}},f=c.lang.find;return{title:f.title,resizable:CKEDITOR.DIALOG_RESIZE_NONE,
17
- minWidth:350,minHeight:170,buttons:[CKEDITOR.dialog.cancelButton(c,{label:c.lang.common.close})],contents:[{id:"find",label:f.find,title:f.find,accessKey:"",elements:[{type:"hbox",widths:["230px","90px"],children:[{type:"text",id:"txtFindFind",label:f.findWhat,isChanged:!1,labelLayout:"horizontal",accessKey:"F"},{type:"button",id:"btnFind",align:"left",style:"width:100%",label:f.find,onClick:function(){var a=this.getDialog();e.find(a.getValueOf("find","txtFindFind"),a.getValueOf("find","txtFindCaseChk"),
18
- a.getValueOf("find","txtFindWordChk"),a.getValueOf("find","txtFindCyclic"))||alert(f.notFoundMsg)}}]},{type:"fieldset",className:"cke_dialog_find_fieldset",label:CKEDITOR.tools.htmlEncode(f.findOptions),style:"margin-top:29px",children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"txtFindCaseChk",isChanged:!1,label:f.matchCase},{type:"checkbox",id:"txtFindWordChk",isChanged:!1,label:f.matchWord},{type:"checkbox",id:"txtFindCyclic",isChanged:!1,"default":!0,label:f.matchCyclic}]}]}]},{id:"replace",
19
- label:f.replace,accessKey:"M",elements:[{type:"hbox",widths:["230px","90px"],children:[{type:"text",id:"txtFindReplace",label:f.findWhat,isChanged:!1,labelLayout:"horizontal",accessKey:"F"},{type:"button",id:"btnFindReplace",align:"left",style:"width:100%",label:f.replace,onClick:function(){var a=this.getDialog();e.replace(a,a.getValueOf("replace","txtFindReplace"),a.getValueOf("replace","txtReplace"),a.getValueOf("replace","txtReplaceCaseChk"),a.getValueOf("replace","txtReplaceWordChk"),a.getValueOf("replace",
20
- "txtReplaceCyclic"))||alert(f.notFoundMsg)}}]},{type:"hbox",widths:["230px","90px"],children:[{type:"text",id:"txtReplace",label:f.replaceWith,isChanged:!1,labelLayout:"horizontal",accessKey:"R"},{type:"button",id:"btnReplaceAll",align:"left",style:"width:100%",label:f.replaceAll,isChanged:!1,onClick:function(){var a=this.getDialog();e.replaceCounter=0;e.searchRange=t(1);e.matchRange&&(e.matchRange.removeHighlight(),e.matchRange=null);for(c.fire("saveSnapshot");e.replace(a,a.getValueOf("replace",
21
- "txtFindReplace"),a.getValueOf("replace","txtReplace"),a.getValueOf("replace","txtReplaceCaseChk"),a.getValueOf("replace","txtReplaceWordChk"),!1,!0););e.replaceCounter?(alert(f.replaceSuccessMsg.replace(/%1/,e.replaceCounter)),c.fire("saveSnapshot")):alert(f.notFoundMsg)}}]},{type:"fieldset",label:CKEDITOR.tools.htmlEncode(f.findOptions),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"txtReplaceCaseChk",isChanged:!1,label:f.matchCase},{type:"checkbox",id:"txtReplaceWordChk",isChanged:!1,
22
- label:f.matchWord},{type:"checkbox",id:"txtReplaceCyclic",isChanged:!1,"default":!0,label:f.matchCyclic}]}]}]}],onLoad:function(){var a=this,b,c=0;this.on("hide",function(){c=0});this.on("show",function(){c=1});this.selectPage=CKEDITOR.tools.override(this.selectPage,function(f){return function(e){f.call(a,e);var g=a._.tabs[e],k;k="find"===e?"txtFindWordChk":"txtReplaceWordChk";b=a.getContentElement(e,"find"===e?"txtFindFind":"txtFindReplace");a.getContentElement(e,k);g.initialized||(CKEDITOR.document.getById(b._.inputId),
23
- g.initialized=!0);if(c){var l;e="find"===e?1:0;var g=1-e,m,h=v.length;for(m=0;m<h;m++)k=this.getContentElement(B[e],v[m][e]),l=this.getContentElement(B[g],v[m][g]),l.setValue(k.getValue())}}})},onShow:function(){e.searchRange=t();var a=this.getParentEditor().getSelection().getSelectedText(),b=this.getContentElement(g,"find"==g?"txtFindFind":"txtFindReplace");b.setValue(a);b.select();this.selectPage(g);this[("find"==g&&this._.editor.readOnly?"hide":"show")+"Page"]("replace")},onHide:function(){var a;
24
- e.matchRange&&e.matchRange.isMatched()&&(e.matchRange.removeHighlight(),(a=e.matchRange.toDomRange())&&c.getSelection().selectRanges([a]),c.focus());delete e.matchRange},onFocus:function(){return"replace"==g?this.getContentElement("replace","txtFindReplace"):this.getContentElement("find","txtFindFind")}}}var r,y=function(){return{textNode:this.textNode,offset:this.offset,character:this.textNode?this.textNode.getText().charAt(this.offset):null,hitMatchBoundary:this._.matchBoundary}},B=["find","replace"],
25
- v=[["txtFindFind","txtFindReplace"],["txtFindCaseChk","txtReplaceCaseChk"],["txtFindWordChk","txtReplaceWordChk"],["txtFindCyclic","txtReplaceCyclic"]];CKEDITOR.dialog.add("find",function(c){return q(c,"find")});CKEDITOR.dialog.add("replace",function(c){return q(c,"replace")})})();
5
+ (function(){function C(c){return c.type==CKEDITOR.NODE_TEXT&&0<c.getLength()&&(!m||!c.isReadOnly())}function v(c){return!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary(CKEDITOR.tools.extend({},CKEDITOR.dtd.$empty,CKEDITOR.dtd.$nonEditable)))}var m,w=function(){return{textNode:this.textNode,offset:this.offset,character:this.textNode?this.textNode.getText().charAt(this.offset):null,hitMatchBoundary:this._.matchBoundary}},x=["find","replace"],q=[["txtFindFind","txtFindReplace"],["txtFindCaseChk",
6
+ "txtReplaceCaseChk"],["txtFindWordChk","txtReplaceWordChk"],["txtFindCyclic","txtReplaceCyclic"]];CKEDITOR.dialog.add("find",function(c){function n(a,b){var d=this,c=new CKEDITOR.dom.walker(a);c.guard=b?v:function(a){!v(a)&&(d._.matchBoundary=!0)};c.evaluator=C;c.breakOnFalse=1;a.startContainer.type==CKEDITOR.NODE_TEXT&&(this.textNode=a.startContainer,this.offset=a.startOffset-1);this._={matchWord:b,walker:c,matchBoundary:!1}}function y(a,b){var d=c.createRange();d.setStart(a.textNode,b?a.offset:
7
+ a.offset+1);d.setEndAt(c.editable(),CKEDITOR.POSITION_BEFORE_END);return d}function r(a){var b=c.getSelection().getRanges()[0],d=c.editable();b&&!a?(a=b.clone(),a.collapse(!0)):(a=c.createRange(),a.setStartAt(d,CKEDITOR.POSITION_AFTER_START));a.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);return a}var z=new CKEDITOR.style(CKEDITOR.tools.extend({attributes:{"data-cke-highlight":1},fullMatch:1,ignoreReadonly:1,childRule:function(){return 0}},c.config.find_highlight,!0));n.prototype={next:function(){return this.move()},
8
+ back:function(){return this.move(!0)},move:function(a){var b=this.textNode;if(null===b)return w.call(this);this._.matchBoundary=!1;if(b&&a&&0<this.offset)this.offset--;else if(b&&this.offset<b.getLength()-1)this.offset++;else{for(b=null;!b&&!(b=this._.walker[a?"previous":"next"].call(this._.walker),this._.matchWord&&!b||this._.walker._.end););this.offset=(this.textNode=b)?a?b.getLength()-1:0:0}return w.call(this)}};var t=function(a,b){this._={walker:a,cursors:[],rangeLength:b,highlightRange:null,
9
+ isMatched:0}};t.prototype={toDomRange:function(){var a=c.createRange(),b=this._.cursors;if(1>b.length){var d=this._.walker.textNode;if(d)a.setStartAfter(d);else return null}else d=b[0],b=b[b.length-1],a.setStart(d.textNode,d.offset),a.setEnd(b.textNode,b.offset+1);return a},updateFromDomRange:function(a){var b=new n(a);this._.cursors=[];do a=b.next(),a.character&&this._.cursors.push(a);while(a.character);this._.rangeLength=this._.cursors.length},setMatched:function(){this._.isMatched=!0},clearMatched:function(){this._.isMatched=
10
+ !1},isMatched:function(){return this._.isMatched},highlight:function(){if(!(1>this._.cursors.length)){this._.highlightRange&&this.removeHighlight();var a=this.toDomRange(),b=a.createBookmark();z.applyToRange(a,c);a.moveToBookmark(b);this._.highlightRange=a;b=a.startContainer;b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());b.scrollIntoView();this.updateFromDomRange(a)}},removeHighlight:function(){if(this._.highlightRange){var a=this._.highlightRange.createBookmark();z.removeFromRange(this._.highlightRange,
11
+ c);this._.highlightRange.moveToBookmark(a);this.updateFromDomRange(this._.highlightRange);this._.highlightRange=null}},isReadOnly:function(){return this._.highlightRange?this._.highlightRange.startContainer.isReadOnly():0},moveBack:function(){var a=this._.walker.back(),b=this._.cursors;a.hitMatchBoundary&&(this._.cursors=b=[]);b.unshift(a);b.length>this._.rangeLength&&b.pop();return a},moveNext:function(){var a=this._.walker.next(),b=this._.cursors;a.hitMatchBoundary&&(this._.cursors=b=[]);b.push(a);
12
+ b.length>this._.rangeLength&&b.shift();return a},getEndCharacter:function(){var a=this._.cursors;return 1>a.length?null:a[a.length-1].character},getNextCharacterRange:function(a){var b,d;d=this._.cursors;d=(b=d[d.length-1])&&b.textNode?new n(y(b)):this._.walker;return new t(d,a)},getCursors:function(){return this._.cursors}};var A=function(a,b){var d=[-1];b&&(a=a.toLowerCase());for(var c=0;c<a.length;c++)for(d.push(d[c]+1);0<d[c+1]&&a.charAt(c)!=a.charAt(d[c+1]-1);)d[c+1]=d[d[c+1]-1]+1;this._={overlap:d,
13
+ state:0,ignoreCase:!!b,pattern:a}};A.prototype={feedCharacter:function(a){for(this._.ignoreCase&&(a=a.toLowerCase());;){if(a==this._.pattern.charAt(this._.state))return this._.state++,this._.state==this._.pattern.length?(this._.state=0,2):1;if(this._.state)this._.state=this._.overlap[this._.state];else return 0}},reset:function(){this._.state=0}};var E=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,B=function(a){if(!a)return!0;var b=a.charCodeAt(0);return 9<=b&&13>=b||8192<=b&&
14
+ 8202>=b||E.test(a)},f={searchRange:null,matchRange:null,find:function(a,b,d,e,D,u){this.matchRange?(this.matchRange.removeHighlight(),this.matchRange=this.matchRange.getNextCharacterRange(a.length)):this.matchRange=new t(new n(this.searchRange),a.length);for(var h=new A(a,!b),k=0,l="%";null!==l;){for(this.matchRange.moveNext();l=this.matchRange.getEndCharacter();){k=h.feedCharacter(l);if(2==k)break;this.matchRange.moveNext().hitMatchBoundary&&h.reset()}if(2==k){if(d){var g=this.matchRange.getCursors(),
15
+ p=g[g.length-1],g=g[0],m=c.createRange();m.setStartAt(c.editable(),CKEDITOR.POSITION_AFTER_START);m.setEnd(g.textNode,g.offset);g=m;p=y(p);g.trim();p.trim();g=new n(g,!0);p=new n(p,!0);if(!B(g.back().character)||!B(p.next().character))continue}this.matchRange.setMatched();!1!==D&&this.matchRange.highlight();return!0}}this.matchRange.clearMatched();this.matchRange.removeHighlight();return e&&!u?(this.searchRange=r(1),this.matchRange=null,f.find.apply(this,Array.prototype.slice.call(arguments).concat([!0]))):
16
+ !1},replaceCounter:0,replace:function(a,b,d,e,f,u,h){m=1;a=0;a=this.hasMatchOptionsChanged(b,e,f);if(!this.matchRange||!this.matchRange.isMatched()||this.matchRange._.isReplaced||this.matchRange.isReadOnly()||a)a&&this.matchRange&&(this.matchRange.clearMatched(),this.matchRange.removeHighlight(),this.matchRange=null),a=this.find(b,e,f,u,!h);else{this.matchRange.removeHighlight();b=this.matchRange.toDomRange();d=c.document.createText(d);if(!h){var k=c.getSelection();k.selectRanges([b]);c.fire("saveSnapshot")}b.deleteContents();
17
+ b.insertNode(d);h||(k.selectRanges([b]),c.fire("saveSnapshot"));this.matchRange.updateFromDomRange(b);h||this.matchRange.highlight();this.matchRange._.isReplaced=!0;this.replaceCounter++;a=1}m=0;return a},matchOptions:null,hasMatchOptionsChanged:function(a,b,d){a=[a,b,d].join(".");b=this.matchOptions&&this.matchOptions!=a;this.matchOptions=a;return b}},e=c.lang.find;return{title:e.title,resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:350,minHeight:170,buttons:[CKEDITOR.dialog.cancelButton(c,{label:c.lang.common.close})],
18
+ contents:[{id:"find",label:e.find,title:e.find,accessKey:"",elements:[{type:"hbox",widths:["230px","90px"],children:[{type:"text",id:"txtFindFind",label:e.findWhat,isChanged:!1,labelLayout:"horizontal",accessKey:"F"},{type:"button",id:"btnFind",align:"left",style:"width:100%",label:e.find,onClick:function(){var a=this.getDialog();f.find(a.getValueOf("find","txtFindFind"),a.getValueOf("find","txtFindCaseChk"),a.getValueOf("find","txtFindWordChk"),a.getValueOf("find","txtFindCyclic"))||alert(e.notFoundMsg)}}]},
19
+ {type:"fieldset",className:"cke_dialog_find_fieldset",label:CKEDITOR.tools.htmlEncode(e.findOptions),style:"margin-top:29px",children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"txtFindCaseChk",isChanged:!1,label:e.matchCase},{type:"checkbox",id:"txtFindWordChk",isChanged:!1,label:e.matchWord},{type:"checkbox",id:"txtFindCyclic",isChanged:!1,"default":!0,label:e.matchCyclic}]}]}]},{id:"replace",label:e.replace,accessKey:"M",elements:[{type:"hbox",widths:["230px","90px"],children:[{type:"text",
20
+ id:"txtFindReplace",label:e.findWhat,isChanged:!1,labelLayout:"horizontal",accessKey:"F"},{type:"button",id:"btnFindReplace",align:"left",style:"width:100%",label:e.replace,onClick:function(){var a=this.getDialog();f.replace(a,a.getValueOf("replace","txtFindReplace"),a.getValueOf("replace","txtReplace"),a.getValueOf("replace","txtReplaceCaseChk"),a.getValueOf("replace","txtReplaceWordChk"),a.getValueOf("replace","txtReplaceCyclic"))||alert(e.notFoundMsg)}}]},{type:"hbox",widths:["230px","90px"],children:[{type:"text",
21
+ id:"txtReplace",label:e.replaceWith,isChanged:!1,labelLayout:"horizontal",accessKey:"R"},{type:"button",id:"btnReplaceAll",align:"left",style:"width:100%",label:e.replaceAll,isChanged:!1,onClick:function(){var a=this.getDialog();f.replaceCounter=0;f.searchRange=r(1);f.matchRange&&(f.matchRange.removeHighlight(),f.matchRange=null);for(c.fire("saveSnapshot");f.replace(a,a.getValueOf("replace","txtFindReplace"),a.getValueOf("replace","txtReplace"),a.getValueOf("replace","txtReplaceCaseChk"),a.getValueOf("replace",
22
+ "txtReplaceWordChk"),!1,!0););f.replaceCounter?(alert(e.replaceSuccessMsg.replace(/%1/,f.replaceCounter)),c.fire("saveSnapshot")):alert(e.notFoundMsg)}}]},{type:"fieldset",label:CKEDITOR.tools.htmlEncode(e.findOptions),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"txtReplaceCaseChk",isChanged:!1,label:e.matchCase},{type:"checkbox",id:"txtReplaceWordChk",isChanged:!1,label:e.matchWord},{type:"checkbox",id:"txtReplaceCyclic",isChanged:!1,"default":!0,label:e.matchCyclic}]}]}]}],onLoad:function(){var a=
23
+ this,b,d=0;this.on("hide",function(){d=0});this.on("show",function(){d=1});this.selectPage=CKEDITOR.tools.override(this.selectPage,function(c){return function(e){c.call(a,e);var f=a._.tabs[e],h;h="find"===e?"txtFindWordChk":"txtReplaceWordChk";b=a.getContentElement(e,"find"===e?"txtFindFind":"txtFindReplace");a.getContentElement(e,h);f.initialized||(CKEDITOR.document.getById(b._.inputId),f.initialized=!0);if(d){var k;e="find"===e?1:0;var f=1-e,l,g=q.length;for(l=0;l<g;l++)h=this.getContentElement(x[e],
24
+ q[l][e]),k=this.getContentElement(x[f],q[l][f]),k.setValue(h.getValue())}}})},onShow:function(){f.searchRange=r();var a=this._.currentTabId,b=this.getParentEditor().getSelection().getSelectedText(),c=this.getContentElement(a,"find"==a?"txtFindFind":"txtFindReplace");c.setValue(b);c.select();this[("find"==a&&this._.editor.readOnly?"hide":"show")+"Page"]("replace")},onHide:function(){var a;f.matchRange&&f.matchRange.isMatched()&&(f.matchRange.removeHighlight(),(a=f.matchRange.toDomRange())&&c.getSelection().selectRanges([a]),
25
+ c.focus());delete f.matchRange},onFocus:function(){return"replace"==this._.currentTabId?this.getContentElement("replace","txtFindReplace"):this.getContentElement("find","txtFindFind")}}})})();
@@ -1,24 +1,24 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  (function(){function b(a,b,c){var h=n[this.id];if(h)for(var f=this instanceof CKEDITOR.ui.dialog.checkbox,e=0;e<h.length;e++){var d=h[e];switch(d.type){case 1:if(!a)continue;if(null!==a.getAttribute(d.name)){a=a.getAttribute(d.name);f?this.setValue("true"==a.toLowerCase()):this.setValue(a);return}f&&this.setValue(!!d["default"]);break;case 2:if(!a)continue;if(d.name in c){a=c[d.name];f?this.setValue("true"==a.toLowerCase()):this.setValue(a);return}f&&this.setValue(!!d["default"]);break;case 4:if(!b)continue;
6
6
  if(b.getAttribute(d.name)){a=b.getAttribute(d.name);f?this.setValue("true"==a.toLowerCase()):this.setValue(a);return}f&&this.setValue(!!d["default"])}}}function c(a,b,c){var h=n[this.id];if(h)for(var f=""===this.getValue(),e=this instanceof CKEDITOR.ui.dialog.checkbox,d=0;d<h.length;d++){var g=h[d];switch(g.type){case 1:if(!a||"data"==g.name&&b&&!a.hasAttribute("data"))continue;var m=this.getValue();f||e&&m===g["default"]?a.removeAttribute(g.name):a.setAttribute(g.name,m);break;case 2:if(!a)continue;
7
7
  m=this.getValue();if(f||e&&m===g["default"])g.name in c&&c[g.name].remove();else if(g.name in c)c[g.name].setAttribute("value",m);else{var p=CKEDITOR.dom.element.createFromHtml("\x3ccke:param\x3e\x3c/cke:param\x3e",a.getDocument());p.setAttributes({name:g.name,value:m});1>a.getChildCount()?p.appendTo(a):p.insertBefore(a.getFirst())}break;case 4:if(!b)continue;m=this.getValue();f||e&&m===g["default"]?b.removeAttribute(g.name):b.setAttribute(g.name,m)}}}for(var n={id:[{type:1,name:"id"}],classid:[{type:1,
8
8
  name:"classid"}],codebase:[{type:1,name:"codebase"}],pluginspage:[{type:4,name:"pluginspage"}],src:[{type:2,name:"movie"},{type:4,name:"src"},{type:1,name:"data"}],name:[{type:4,name:"name"}],align:[{type:1,name:"align"}],"class":[{type:1,name:"class"},{type:4,name:"class"}],width:[{type:1,name:"width"},{type:4,name:"width"}],height:[{type:1,name:"height"},{type:4,name:"height"}],hSpace:[{type:1,name:"hSpace"},{type:4,name:"hSpace"}],vSpace:[{type:1,name:"vSpace"},{type:4,name:"vSpace"}],style:[{type:1,
9
9
  name:"style"},{type:4,name:"style"}],type:[{type:4,name:"type"}]},k="play loop menu quality scale salign wmode bgcolor base flashvars allowScriptAccess allowFullScreen".split(" "),l=0;l<k.length;l++)n[k[l]]=[{type:4,name:k[l]},{type:2,name:k[l]}];k=["play","loop","menu"];for(l=0;l<k.length;l++)n[k[l]][0]["default"]=n[k[l]][1]["default"]=!0;CKEDITOR.dialog.add("flash",function(a){var l=!a.config.flashEmbedTagOnly,k=a.config.flashAddEmbedTag||a.config.flashEmbedTagOnly,h,f="\x3cdiv\x3e"+CKEDITOR.tools.htmlEncode(a.lang.common.preview)+
10
- '\x3cbr\x3e\x3cdiv id\x3d"cke_FlashPreviewLoader'+CKEDITOR.tools.getNextNumber()+'" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv id\x3d"cke_FlashPreviewBox'+CKEDITOR.tools.getNextNumber()+'" class\x3d"FlashPreviewBox"\x3e\x3c/div\x3e\x3c/div\x3e';return{title:a.lang.flash.title,minWidth:420,minHeight:310,onShow:function(){this.fakeImage=this.objectNode=this.embedNode=null;h=new CKEDITOR.dom.element("embed",a.document);var e=this.getSelectedElement();
11
- if(e&&e.data("cke-real-element-type")&&"flash"==e.data("cke-real-element-type")){this.fakeImage=e;var d=a.restoreRealElement(e),g=null,b=null,c={};if("cke:object"==d.getName()){g=d;d=g.getElementsByTag("embed","cke");0<d.count()&&(b=d.getItem(0));for(var d=g.getElementsByTag("param","cke"),f=0,l=d.count();f<l;f++){var k=d.getItem(f),n=k.getAttribute("name"),k=k.getAttribute("value");c[n]=k}}else"cke:embed"==d.getName()&&(b=d);this.objectNode=g;this.embedNode=b;this.setupContent(g,b,c,e)}},onOk:function(){var e=
12
- null,d=null,b=null;this.fakeImage?(e=this.objectNode,d=this.embedNode):(l&&(e=CKEDITOR.dom.element.createFromHtml("\x3ccke:object\x3e\x3c/cke:object\x3e",a.document),e.setAttributes({classid:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version\x3d6,0,40,0"})),k&&(d=CKEDITOR.dom.element.createFromHtml("\x3ccke:embed\x3e\x3c/cke:embed\x3e",a.document),d.setAttributes({type:"application/x-shockwave-flash",pluginspage:"http://www.macromedia.com/go/getflashplayer"}),
13
- e&&d.appendTo(e)));if(e)for(var b={},c=e.getElementsByTag("param","cke"),f=0,h=c.count();f<h;f++)b[c.getItem(f).getAttribute("name")]=c.getItem(f);c={};f={};this.commitContent(e,d,b,c,f);e=a.createFakeElement(e||d,"cke_flash","flash",!0);e.setAttributes(f);e.setStyles(c);this.fakeImage?(e.replace(this.fakeImage),a.getSelection().selectElement(e)):a.insertElement(e)},onHide:function(){this.preview&&this.preview.setHtml("")},contents:[{id:"info",label:a.lang.common.generalTab,accessKey:"I",elements:[{type:"vbox",
14
- padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",className:"cke_dialog_flash_url",children:[{id:"src",type:"text",label:a.lang.common.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(a.lang.flash.validateSrc),setup:b,commit:c,onLoad:function(){var a=this.getDialog(),b=function(b){h.setAttribute("src",b);a.preview.setHtml('\x3cembed height\x3d"100%" width\x3d"100%" src\x3d"'+CKEDITOR.tools.htmlEncode(h.getAttribute("src"))+'" type\x3d"application/x-shockwave-flash"\x3e\x3c/embed\x3e')};
15
- a.preview=a.getContentElement("info","preview").getElement().getChild(3);this.on("change",function(a){a.data&&a.data.value&&b(a.data.value)});this.getInputElement().on("change",function(){b(this.getValue())},this)}},{type:"button",id:"browse",filebrowser:"info:src",hidden:!0,style:"display:inline-block;margin-top:14px;",label:a.lang.common.browseServer}]}]},{type:"hbox",widths:["25%","25%","25%","25%","25%"],children:[{type:"text",id:"width",requiredContent:"embed[width]",style:"width:95px",label:a.lang.common.width,
16
- validate:CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1",a.lang.common.width)),setup:b,commit:c},{type:"text",id:"height",requiredContent:"embed[height]",style:"width:95px",label:a.lang.common.height,validate:CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1",a.lang.common.height)),setup:b,commit:c},{type:"text",id:"hSpace",requiredContent:"embed[hspace]",style:"width:95px",label:a.lang.flash.hSpace,validate:CKEDITOR.dialog.validate.integer(a.lang.flash.validateHSpace),
17
- setup:b,commit:c},{type:"text",id:"vSpace",requiredContent:"embed[vspace]",style:"width:95px",label:a.lang.flash.vSpace,validate:CKEDITOR.dialog.validate.integer(a.lang.flash.validateVSpace),setup:b,commit:c}]},{type:"vbox",children:[{type:"html",id:"preview",style:"width:95%;",html:f}]}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:a.lang.common.upload,elements:[{type:"file",id:"upload",label:a.lang.common.upload,size:38},{type:"fileButton",id:"uploadButton",label:a.lang.common.uploadSubmit,
18
- filebrowser:"info:src","for":["Upload","upload"]}]},{id:"properties",label:a.lang.flash.propertiesTab,elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"scale",type:"select",requiredContent:"embed[scale]",label:a.lang.flash.scale,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.scaleAll,"showall"],[a.lang.flash.scaleNoBorder,"noborder"],[a.lang.flash.scaleFit,"exactfit"]],setup:b,commit:c},{id:"allowScriptAccess",type:"select",requiredContent:"embed[allowscriptaccess]",
19
- label:a.lang.flash.access,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.accessAlways,"always"],[a.lang.flash.accessSameDomain,"samedomain"],[a.lang.flash.accessNever,"never"]],setup:b,commit:c}]},{type:"hbox",widths:["50%","50%"],children:[{id:"wmode",type:"select",requiredContent:"embed[wmode]",label:a.lang.flash.windowMode,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.windowModeWindow,"window"],[a.lang.flash.windowModeOpaque,
20
- "opaque"],[a.lang.flash.windowModeTransparent,"transparent"]],setup:b,commit:c},{id:"quality",type:"select",requiredContent:"embed[quality]",label:a.lang.flash.quality,"default":"high",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.qualityBest,"best"],[a.lang.flash.qualityHigh,"high"],[a.lang.flash.qualityAutoHigh,"autohigh"],[a.lang.flash.qualityMedium,"medium"],[a.lang.flash.qualityAutoLow,"autolow"],[a.lang.flash.qualityLow,"low"]],setup:b,commit:c}]},{type:"hbox",widths:["50%",
21
- "50%"],children:[{id:"align",type:"select",requiredContent:"object[align]",label:a.lang.common.align,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.common.alignLeft,"left"],[a.lang.flash.alignAbsBottom,"absBottom"],[a.lang.flash.alignAbsMiddle,"absMiddle"],[a.lang.flash.alignBaseline,"baseline"],[a.lang.common.alignBottom,"bottom"],[a.lang.common.alignMiddle,"middle"],[a.lang.common.alignRight,"right"],[a.lang.flash.alignTextTop,"textTop"],[a.lang.common.alignTop,"top"]],
22
- setup:b,commit:function(a,b,f,k,l){var h=this.getValue();c.apply(this,arguments);h&&(l.align=h)}},{type:"html",html:"\x3cdiv\x3e\x3c/div\x3e"}]},{type:"fieldset",label:CKEDITOR.tools.htmlEncode(a.lang.flash.flashvars),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"menu",label:a.lang.flash.chkMenu,"default":!0,setup:b,commit:c},{type:"checkbox",id:"play",label:a.lang.flash.chkPlay,"default":!0,setup:b,commit:c},{type:"checkbox",id:"loop",label:a.lang.flash.chkLoop,"default":!0,setup:b,
23
- commit:c},{type:"checkbox",id:"allowFullScreen",label:a.lang.flash.chkFull,"default":!0,setup:b,commit:c}]}]}]},{id:"advanced",label:a.lang.common.advancedTab,elements:[{type:"hbox",children:[{type:"text",id:"id",requiredContent:"object[id]",label:a.lang.common.id,setup:b,commit:c}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",id:"bgcolor",requiredContent:"embed[bgcolor]",label:a.lang.flash.bgcolor,setup:b,commit:c},{type:"text",id:"class",requiredContent:"embed(cke-xyz)",label:a.lang.common.cssClass,
24
- setup:b,commit:c}]},{type:"text",id:"style",requiredContent:"embed{cke-xyz}",validate:CKEDITOR.dialog.validate.inlineStyle(a.lang.common.invalidInlineStyle),label:a.lang.common.cssStyle,setup:b,commit:c}]}]}})})();
10
+ '\x3cbr\x3e\x3cdiv id\x3d"cke_FlashPreviewLoader'+CKEDITOR.tools.getNextNumber()+'" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv id\x3d"cke_FlashPreviewBox'+CKEDITOR.tools.getNextNumber()+'" class\x3d"FlashPreviewBox"\x3e\x3c/div\x3e\x3c/div\x3e';return{title:a.lang.flash.title,minWidth:420,minHeight:310,getModel:function(a){return(a=a.getSelection().getSelectedElement())&&"flash"===a.data("cke-real-element-type")?a:null},onShow:function(){this.fakeImage=
11
+ this.objectNode=this.embedNode=null;h=new CKEDITOR.dom.element("embed",a.document);var e=this.getModel(a);if(e){this.fakeImage=e;var d=a.restoreRealElement(e),g=null,b=null,c={};if("cke:object"==d.getName()){g=d;d=g.getElementsByTag("embed","cke");0<d.count()&&(b=d.getItem(0));for(var d=g.getElementsByTag("param","cke"),f=0,l=d.count();f<l;f++){var k=d.getItem(f),n=k.getAttribute("name"),k=k.getAttribute("value");c[n]=k}}else"cke:embed"==d.getName()&&(b=d);this.objectNode=g;this.embedNode=b;this.setupContent(g,
12
+ b,c,e)}},onOk:function(){var e=null,d=null,b=null;this.fakeImage?(e=this.objectNode,d=this.embedNode):(l&&(e=CKEDITOR.dom.element.createFromHtml("\x3ccke:object\x3e\x3c/cke:object\x3e",a.document),e.setAttributes({classid:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version\x3d6,0,40,0"})),k&&(d=CKEDITOR.dom.element.createFromHtml("\x3ccke:embed\x3e\x3c/cke:embed\x3e",a.document),d.setAttributes({type:"application/x-shockwave-flash",
13
+ pluginspage:"http://www.macromedia.com/go/getflashplayer"}),e&&d.appendTo(e)));if(e)for(var b={},c=e.getElementsByTag("param","cke"),f=0,h=c.count();f<h;f++)b[c.getItem(f).getAttribute("name")]=c.getItem(f);c={};f={};this.commitContent(e,d,b,c,f);e=a.createFakeElement(e||d,"cke_flash","flash",!0);e.setAttributes(f);e.setStyles(c);this.fakeImage?(e.replace(this.fakeImage),a.getSelection().selectElement(e)):a.insertElement(e)},onHide:function(){this.preview&&this.preview.setHtml("")},contents:[{id:"info",
14
+ label:a.lang.common.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",className:"cke_dialog_flash_url",children:[{id:"src",type:"text",label:a.lang.common.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(a.lang.flash.validateSrc),setup:b,commit:c,onLoad:function(){var a=this.getDialog(),b=function(b){h.setAttribute("src",b);a.preview.setHtml('\x3cembed height\x3d"100%" width\x3d"100%" src\x3d"'+CKEDITOR.tools.htmlEncode(h.getAttribute("src"))+
15
+ '" type\x3d"application/x-shockwave-flash"\x3e\x3c/embed\x3e')};a.preview=a.getContentElement("info","preview").getElement().getChild(3);this.on("change",function(a){a.data&&a.data.value&&b(a.data.value)});this.getInputElement().on("change",function(){b(this.getValue())},this)}},{type:"button",id:"browse",filebrowser:"info:src",hidden:!0,style:"display:inline-block;margin-top:14px;",label:a.lang.common.browseServer}]}]},{type:"hbox",widths:["25%","25%","25%","25%","25%"],children:[{type:"text",id:"width",
16
+ requiredContent:"embed[width]",style:"width:95px",label:a.lang.common.width,validate:CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1",a.lang.common.width)),setup:b,commit:c},{type:"text",id:"height",requiredContent:"embed[height]",style:"width:95px",label:a.lang.common.height,validate:CKEDITOR.dialog.validate.htmlLength(a.lang.common.invalidHtmlLength.replace("%1",a.lang.common.height)),setup:b,commit:c},{type:"text",id:"hSpace",requiredContent:"embed[hspace]",style:"width:95px",
17
+ label:a.lang.flash.hSpace,validate:CKEDITOR.dialog.validate.integer(a.lang.flash.validateHSpace),setup:b,commit:c},{type:"text",id:"vSpace",requiredContent:"embed[vspace]",style:"width:95px",label:a.lang.flash.vSpace,validate:CKEDITOR.dialog.validate.integer(a.lang.flash.validateVSpace),setup:b,commit:c}]},{type:"vbox",children:[{type:"html",id:"preview",style:"width:95%;",html:f}]}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:a.lang.common.upload,elements:[{type:"file",id:"upload",label:a.lang.common.upload,
18
+ size:38},{type:"fileButton",id:"uploadButton",label:a.lang.common.uploadSubmit,filebrowser:"info:src","for":["Upload","upload"]}]},{id:"properties",label:a.lang.flash.propertiesTab,elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"scale",type:"select",requiredContent:"embed[scale]",label:a.lang.flash.scale,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.scaleAll,"showall"],[a.lang.flash.scaleNoBorder,"noborder"],[a.lang.flash.scaleFit,"exactfit"]],setup:b,
19
+ commit:c},{id:"allowScriptAccess",type:"select",requiredContent:"embed[allowscriptaccess]",label:a.lang.flash.access,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.accessAlways,"always"],[a.lang.flash.accessSameDomain,"samedomain"],[a.lang.flash.accessNever,"never"]],setup:b,commit:c}]},{type:"hbox",widths:["50%","50%"],children:[{id:"wmode",type:"select",requiredContent:"embed[wmode]",label:a.lang.flash.windowMode,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,
20
+ ""],[a.lang.flash.windowModeWindow,"window"],[a.lang.flash.windowModeOpaque,"opaque"],[a.lang.flash.windowModeTransparent,"transparent"]],setup:b,commit:c},{id:"quality",type:"select",requiredContent:"embed[quality]",label:a.lang.flash.quality,"default":"high",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.flash.qualityBest,"best"],[a.lang.flash.qualityHigh,"high"],[a.lang.flash.qualityAutoHigh,"autohigh"],[a.lang.flash.qualityMedium,"medium"],[a.lang.flash.qualityAutoLow,"autolow"],
21
+ [a.lang.flash.qualityLow,"low"]],setup:b,commit:c}]},{type:"hbox",widths:["50%","50%"],children:[{id:"align",type:"select",requiredContent:"object[align]",label:a.lang.common.align,"default":"",style:"width : 100%;",items:[[a.lang.common.notSet,""],[a.lang.common.left,"left"],[a.lang.flash.alignAbsBottom,"absBottom"],[a.lang.flash.alignAbsMiddle,"absMiddle"],[a.lang.flash.alignBaseline,"baseline"],[a.lang.common.alignBottom,"bottom"],[a.lang.common.alignMiddle,"middle"],[a.lang.common.right,"right"],
22
+ [a.lang.flash.alignTextTop,"textTop"],[a.lang.common.alignTop,"top"]],setup:b,commit:function(a,b,f,k,l){var h=this.getValue();c.apply(this,arguments);h&&(l.align=h)}},{type:"html",html:"\x3cdiv\x3e\x3c/div\x3e"}]},{type:"fieldset",label:CKEDITOR.tools.htmlEncode(a.lang.flash.flashvars),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"menu",label:a.lang.flash.chkMenu,"default":!0,setup:b,commit:c},{type:"checkbox",id:"play",label:a.lang.flash.chkPlay,"default":!0,setup:b,commit:c},
23
+ {type:"checkbox",id:"loop",label:a.lang.flash.chkLoop,"default":!0,setup:b,commit:c},{type:"checkbox",id:"allowFullScreen",label:a.lang.flash.chkFull,"default":!0,setup:b,commit:c}]}]}]},{id:"advanced",label:a.lang.common.advancedTab,elements:[{type:"hbox",children:[{type:"text",id:"id",requiredContent:"object[id]",label:a.lang.common.id,setup:b,commit:c}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",id:"bgcolor",requiredContent:"embed[bgcolor]",label:a.lang.flash.bgcolor,setup:b,commit:c},
24
+ {type:"text",id:"class",requiredContent:"embed(cke-xyz)",label:a.lang.common.cssClass,setup:b,commit:c}]},{type:"text",id:"style",requiredContent:"embed{cke-xyz}",validate:CKEDITOR.dialog.validate.inlineStyle(a.lang.common.invalidInlineStyle),label:a.lang.common.cssStyle,setup:b,commit:c}]}]}})})();
@@ -1,8 +1,8 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("button",function(b){function d(a){var b=this.getValue();b?(a.attributes[this.id]=b,"name"==this.id&&(a.attributes["data-cke-saved-name"]=b)):(delete a.attributes[this.id],"name"==this.id&&delete a.attributes["data-cke-saved-name"])}return{title:b.lang.forms.button.title,minWidth:350,minHeight:150,onShow:function(){delete this.button;var a=this.getParentEditor().getSelection().getSelectedElement();a&&a.is("input")&&a.getAttribute("type")in{button:1,reset:1,submit:1}&&(this.button=
6
- a,this.setupContent(a))},onOk:function(){var a=this.getParentEditor(),b=this.button,d=!b,c=b?CKEDITOR.htmlParser.fragment.fromHtml(b.getOuterHtml()).children[0]:new CKEDITOR.htmlParser.element("input");this.commitContent(c);var e=new CKEDITOR.htmlParser.basicWriter;c.writeHtml(e);c=CKEDITOR.dom.element.createFromHtml(e.getHtml(),a.document);d?a.insertElement(c):(c.replace(b),a.getSelection().selectElement(c))},contents:[{id:"info",label:b.lang.forms.button.title,title:b.lang.forms.button.title,elements:[{id:"name",
7
- type:"text",bidi:!0,label:b.lang.common.name,"default":"",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:d},{id:"value",type:"text",label:b.lang.forms.button.text,accessKey:"V","default":"",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:d},{id:"type",type:"select",label:b.lang.forms.button.type,"default":"button",accessKey:"T",items:[[b.lang.forms.button.typeBtn,"button"],[b.lang.forms.button.typeSbm,"submit"],[b.lang.forms.button.typeRst,
8
- "reset"]],setup:function(a){this.setValue(a.getAttribute("type")||"")},commit:d}]}]}});
5
+ CKEDITOR.dialog.add("button",function(b){function d(a){var b=this.getValue();b?(a.attributes[this.id]=b,"name"==this.id&&(a.attributes["data-cke-saved-name"]=b)):(delete a.attributes[this.id],"name"==this.id&&delete a.attributes["data-cke-saved-name"])}return{title:b.lang.forms.button.title,minWidth:350,minHeight:150,getModel:function(a){return(a=a.getSelection().getSelectedElement())&&a.is("input")&&a.getAttribute("type")in{button:1,reset:1,submit:1}?a:null},onShow:function(){var a=this.getModel(this.getParentEditor());
6
+ a&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor(),b=this.getModel(a),d=this.getMode(a)==CKEDITOR.dialog.CREATION_MODE,c=b?CKEDITOR.htmlParser.fragment.fromHtml(b.getOuterHtml()).children[0]:new CKEDITOR.htmlParser.element("input");this.commitContent(c);var e=new CKEDITOR.htmlParser.basicWriter;c.writeHtml(e);c=CKEDITOR.dom.element.createFromHtml(e.getHtml(),a.document);d?a.insertElement(c):(c.replace(b),a.getSelection().selectElement(c))},contents:[{id:"info",label:b.lang.forms.button.title,
7
+ title:b.lang.forms.button.title,elements:[{id:"name",type:"text",bidi:!0,label:b.lang.common.name,"default":"",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:d},{id:"value",type:"text",label:b.lang.forms.button.text,accessKey:"V","default":"",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:d},{id:"type",type:"select",label:b.lang.forms.button.type,"default":"button",accessKey:"T",items:[[b.lang.forms.button.typeBtn,"button"],[b.lang.forms.button.typeSbm,
8
+ "submit"],[b.lang.forms.button.typeRst,"reset"]],setup:function(a){this.setValue(a.getAttribute("type")||"")},commit:d}]}]}});
@@ -1,9 +1,9 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("checkbox",function(d){return{title:d.lang.forms.checkboxAndRadio.checkboxTitle,minWidth:350,minHeight:140,onShow:function(){delete this.checkbox;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"checkbox"==a.getAttribute("type")&&(this.checkbox=a,this.setupContent(a))},onOk:function(){var a,b=this.checkbox;b||(a=this.getParentEditor(),b=a.document.createElement("input"),b.setAttribute("type","checkbox"),a.insertElement(b));this.commitContent({element:b})},contents:[{id:"info",
6
- label:d.lang.forms.checkboxAndRadio.checkboxTitle,title:d.lang.forms.checkboxAndRadio.checkboxTitle,startupFocus:"txtName",elements:[{id:"txtName",type:"text",label:d.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"txtValue",type:"text",label:d.lang.forms.checkboxAndRadio.value,
5
+ CKEDITOR.dialog.add("checkbox",function(d){return{title:d.lang.forms.checkboxAndRadio.checkboxTitle,minWidth:350,minHeight:140,getModel:function(a){return(a=a.getSelection().getSelectedElement())&&"checkbox"==a.getAttribute("type")?a:null},onShow:function(){var a=this.getModel(this.getParentEditor());a&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor(),b=this.getModel(a);b||(b=a.document.createElement("input"),b.setAttribute("type","checkbox"),a.insertElement(b));this.commitContent({element:b})},
6
+ contents:[{id:"info",label:d.lang.forms.checkboxAndRadio.checkboxTitle,title:d.lang.forms.checkboxAndRadio.checkboxTitle,startupFocus:"txtName",elements:[{id:"txtName",type:"text",label:d.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"txtValue",type:"text",label:d.lang.forms.checkboxAndRadio.value,
7
7
  "default":"",accessKey:"V",setup:function(a){a=a.getAttribute("value");this.setValue(CKEDITOR.env.ie&&"on"==a?"":a)},commit:function(a){var b=a.element,c=this.getValue();!c||CKEDITOR.env.ie&&"on"==c?CKEDITOR.env.ie?(c=new CKEDITOR.dom.element("input",b.getDocument()),b.copyAttributes(c,{value:1}),c.replace(b),d.getSelection().selectElement(c),a.element=c):b.removeAttribute("value"):b.setAttribute("value",c)}},{id:"cmbSelected",type:"checkbox",label:d.lang.forms.checkboxAndRadio.selected,"default":"",
8
8
  accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var b=a.element;if(CKEDITOR.env.ie){var c=!!b.getAttribute("checked"),e=!!this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"checkbox"'+(e?' checked\x3d"checked"':"")+"/\x3e",d.document),b.copyAttributes(c,{type:1,checked:1}),c.replace(b),d.getSelection().selectElement(c),a.element=c)}else a=this.getValue(),CKEDITOR.env.webkit&&(b.$.checked=a),a?b.setAttribute("checked",
9
- "checked"):b.removeAttribute("checked")}},{id:"required",type:"checkbox",label:d.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
9
+ "checked"):b.removeAttribute("checked")}},{id:"required",type:"checkbox",label:d.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
@@ -1,8 +1,8 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("form",function(a){var d={action:1,id:1,method:1,enctype:1,target:1};return{title:a.lang.forms.form.title,minWidth:350,minHeight:200,onShow:function(){delete this.form;var b=this.getParentEditor().elementPath().contains("form",1);b&&(this.form=b,this.setupContent(b))},onOk:function(){var b,a=this.form,c=!a;c&&(b=this.getParentEditor(),a=b.document.createElement("form"),a.appendBogus());c&&b.insertElement(a);this.commitContent(a)},onLoad:function(){function a(b){this.setValue(b.getAttribute(this.id)||
5
+ CKEDITOR.dialog.add("form",function(a){var d={action:1,id:1,method:1,enctype:1,target:1};return{title:a.lang.forms.form.title,minWidth:350,minHeight:200,getModel:function(b){return b.elementPath().contains("form",1)||null},onShow:function(){var b=this.getModel(this.getParentEditor());b&&this.setupContent(b)},onOk:function(){var b=this.getParentEditor(),a=this.getModel(b);a||(a=b.document.createElement("form"),a.appendBogus(),b.insertElement(a));this.commitContent(a)},onLoad:function(){function a(b){this.setValue(b.getAttribute(this.id)||
6
6
  "")}function e(a){this.getValue()?a.setAttribute(this.id,this.getValue()):a.removeAttribute(this.id)}this.foreach(function(c){d[c.id]&&(c.setup=a,c.commit=e)})},contents:[{id:"info",label:a.lang.forms.form.title,title:a.lang.forms.form.title,elements:[{id:"txtName",bidi:!0,type:"text",label:a.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):
7
7
  (a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"action",type:"text",label:a.lang.forms.form.action,"default":"",accessKey:"T"},{type:"hbox",widths:["45%","55%"],children:[{id:"id",type:"text",label:a.lang.common.id,"default":"",accessKey:"I"},{id:"enctype",type:"select",label:a.lang.forms.form.encoding,style:"width:100%",accessKey:"E","default":"",items:[[""],["text/plain"],["multipart/form-data"],["application/x-www-form-urlencoded"]]}]},{type:"hbox",widths:["45%","55%"],children:[{id:"target",
8
8
  type:"select",label:a.lang.common.target,style:"width:100%",accessKey:"M","default":"",items:[[a.lang.common.notSet,""],[a.lang.common.targetNew,"_blank"],[a.lang.common.targetTop,"_top"],[a.lang.common.targetSelf,"_self"],[a.lang.common.targetParent,"_parent"]]},{id:"method",type:"select",label:a.lang.forms.form.method,accessKey:"M","default":"GET",items:[["GET","get"],["POST","post"]]}]}]}]}});
@@ -1,7 +1,7 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("hiddenfield",function(d){return{title:d.lang.forms.hidden.title,hiddenField:null,minWidth:350,minHeight:110,onShow:function(){delete this.hiddenField;var a=this.getParentEditor(),b=a.getSelection(),c=b.getSelectedElement();c&&c.data("cke-real-element-type")&&"hiddenfield"==c.data("cke-real-element-type")&&(this.hiddenField=c,c=a.restoreRealElement(this.hiddenField),this.setupContent(c),b.selectElement(this.hiddenField))},onOk:function(){var a=this.getValueOf("info","_cke_saved_name"),
6
- b=this.getParentEditor(),a=CKEDITOR.env.ie&&8>CKEDITOR.document.$.documentMode?b.document.createElement('\x3cinput name\x3d"'+CKEDITOR.tools.htmlEncode(a)+'"\x3e'):b.document.createElement("input");a.setAttribute("type","hidden");this.commitContent(a);a=b.createFakeElement(a,"cke_hidden","hiddenfield");this.hiddenField?(a.replace(this.hiddenField),b.getSelection().selectElement(a)):b.insertElement(a);return!0},contents:[{id:"info",label:d.lang.forms.hidden.title,title:d.lang.forms.hidden.title,elements:[{id:"_cke_saved_name",
7
- type:"text",label:d.lang.forms.hidden.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.setAttribute("name",this.getValue()):a.removeAttribute("name")}},{id:"value",type:"text",label:d.lang.forms.hidden.value,"default":"",accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){this.getValue()?a.setAttribute("value",this.getValue()):a.removeAttribute("value")}}]}]}});
5
+ CKEDITOR.dialog.add("hiddenfield",function(c){return{title:c.lang.forms.hidden.title,hiddenField:null,minWidth:350,minHeight:110,getModel:function(a){return(a=a.getSelection().getSelectedElement())&&a.data("cke-real-element-type")&&"hiddenfield"==a.data("cke-real-element-type")?a:null},onShow:function(){var a=this.getParentEditor(),b=this.getModel(a);b&&(this.setupContent(a.restoreRealElement(b)),a.getSelection().selectElement(b))},onOk:function(){var a=this.getValueOf("info","_cke_saved_name"),b=
6
+ this.getParentEditor(),a=CKEDITOR.env.ie&&8>CKEDITOR.document.$.documentMode?b.document.createElement('\x3cinput name\x3d"'+CKEDITOR.tools.htmlEncode(a)+'"\x3e'):b.document.createElement("input");a.setAttribute("type","hidden");this.commitContent(a);var a=b.createFakeElement(a,"cke_hidden","hiddenfield"),c=this.getModel(b);c?(a.replace(c),b.getSelection().selectElement(a)):b.insertElement(a);return!0},contents:[{id:"info",label:c.lang.forms.hidden.title,title:c.lang.forms.hidden.title,elements:[{id:"_cke_saved_name",
7
+ type:"text",label:c.lang.forms.hidden.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.setAttribute("name",this.getValue()):a.removeAttribute("name")}},{id:"value",type:"text",label:c.lang.forms.hidden.value,"default":"",accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){this.getValue()?a.setAttribute("value",this.getValue()):a.removeAttribute("value")}}]}]}});
@@ -1,9 +1,9 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("radio",function(b){return{title:b.lang.forms.checkboxAndRadio.radioTitle,minWidth:350,minHeight:140,onShow:function(){delete this.radioButton;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"input"==a.getName()&&"radio"==a.getAttribute("type")&&(this.radioButton=a,this.setupContent(a))},onOk:function(){var a,c=this.radioButton,b=!c;b&&(a=this.getParentEditor(),c=a.document.createElement("input"),c.setAttribute("type","radio"));b&&a.insertElement(c);this.commitContent({element:c})},
6
- contents:[{id:"info",label:b.lang.forms.checkboxAndRadio.radioTitle,title:b.lang.forms.checkboxAndRadio.radioTitle,elements:[{id:"name",type:"text",label:b.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:b.lang.forms.checkboxAndRadio.value,"default":"",
7
- accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){a=a.element;this.getValue()?a.setAttribute("value",this.getValue()):a.removeAttribute("value")}},{id:"checked",type:"checkbox",label:b.lang.forms.checkboxAndRadio.selected,"default":"",accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var c=a.element;if(CKEDITOR.env.ie){var d=c.getAttribute("checked"),e=!!this.getValue();d!=e&&(d=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"radio"'+
8
- (e?' checked\x3d"checked"':"")+"\x3e\x3c/input\x3e",b.document),c.copyAttributes(d,{type:1,checked:1}),d.replace(c),b.getSelection().selectElement(d),a.element=d)}else a=this.getValue(),CKEDITOR.env.webkit&&(c.$.checked=a),a?c.setAttribute("checked","checked"):c.removeAttribute("checked")}},{id:"required",type:"checkbox",label:b.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},commit:function(a){a=a.element;
9
- this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
5
+ CKEDITOR.dialog.add("radio",function(c){return{title:c.lang.forms.checkboxAndRadio.radioTitle,minWidth:350,minHeight:140,getModel:function(a){return(a=a.getSelection().getSelectedElement())&&"input"==a.getName()&&"radio"==a.getAttribute("type")?a:null},onShow:function(){var a=this.getModel(this.getParentEditor());a&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor(),b=this.getModel(a);b||(b=a.document.createElement("input"),b.setAttribute("type","radio"),a.insertElement(b));this.commitContent({element:b})},
6
+ contents:[{id:"info",label:c.lang.forms.checkboxAndRadio.radioTitle,title:c.lang.forms.checkboxAndRadio.radioTitle,elements:[{id:"name",type:"text",label:c.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:c.lang.forms.checkboxAndRadio.value,"default":"",
7
+ accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){a=a.element;this.getValue()?a.setAttribute("value",this.getValue()):a.removeAttribute("value")}},{id:"checked",type:"checkbox",label:c.lang.forms.checkboxAndRadio.selected,"default":"",accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var b=a.element;if(CKEDITOR.env.ie){var d=b.getAttribute("checked"),e=!!this.getValue();d!=e&&(d=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"radio"'+
8
+ (e?' checked\x3d"checked"':"")+"\x3e\x3c/input\x3e",c.document),b.copyAttributes(d,{type:1,checked:1}),d.replace(b),e&&d.setAttribute("checked","checked"),c.getSelection().selectElement(d),a.element=d)}else a=this.getValue(),CKEDITOR.env.webkit&&(b.$.checked=a),a?b.setAttribute("checked","checked"):b.removeAttribute("checked")}},{id:"required",type:"checkbox",label:c.lang.forms.checkboxAndRadio.required,"default":"",accessKey:"Q",value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,
9
+ commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
@@ -1,20 +1,21 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  CKEDITOR.dialog.add("select",function(c){function h(a,b,e,d,c){a=f(a);d=d?d.createElement("OPTION"):document.createElement("OPTION");if(a&&d&&"option"==d.getName())CKEDITOR.env.ie?(isNaN(parseInt(c,10))?a.$.options.add(d.$):a.$.options.add(d.$,c),d.$.innerHTML=0<b.length?b:"",d.$.value=e):(null!==c&&c<a.getChildCount()?a.getChild(0>c?0:c).insertBeforeMe(d):a.append(d),d.setText(0<b.length?b:""),d.setValue(e));else return!1;return d}function p(a){a=f(a);for(var b=g(a),e=a.getChildren().count()-1;0<=
6
6
  e;e--)a.getChild(e).$.selected&&a.getChild(e).remove();k(a,b)}function q(a,b,e,d){a=f(a);if(0>b)return!1;a=a.getChild(b);a.setText(e);a.setValue(d);return a}function m(a){for(a=f(a);a.getChild(0)&&a.getChild(0).remove(););}function l(a,b,e){a=f(a);var d=g(a);if(0>d)return!1;b=d+b;b=0>b?0:b;b=b>=a.getChildCount()?a.getChildCount()-1:b;if(d==b)return!1;var d=a.getChild(d),c=d.getText(),r=d.getValue();d.remove();d=h(a,c,r,e?e:null,b);k(a,b);return d}function g(a){return(a=f(a))?a.$.selectedIndex:-1}
7
- function k(a,b){a=f(a);if(0>b)return null;var e=a.getChildren().count();a.$.selectedIndex=b>=e?e-1:b;return a}function n(a){return(a=f(a))?a.getChildren():!1}function f(a){return a&&a.domId&&a.getInputElement().$?a.getInputElement():a&&a.$?a:!1}return{title:c.lang.forms.select.title,minWidth:CKEDITOR.env.ie?460:395,minHeight:CKEDITOR.env.ie?320:300,onShow:function(){delete this.selectBox;this.setupContent("clear");var a=this.getParentEditor().getSelection().getSelectedElement();if(a&&"select"==a.getName()){this.selectBox=
8
- a;this.setupContent(a.getName(),a);for(var a=n(a),b=0;b<a.count();b++)this.setupContent("option",a.getItem(b))}},onOk:function(){var a=this.getParentEditor(),b=this.selectBox,e=!b;e&&(b=a.document.createElement("select"));this.commitContent(b);if(e&&(a.insertElement(b),CKEDITOR.env.ie)){var d=a.getSelection(),c=d.createBookmarks();setTimeout(function(){d.selectBookmarks(c)},0)}},contents:[{id:"info",label:c.lang.forms.select.selectInfo,title:c.lang.forms.select.selectInfo,accessKey:"",elements:[{id:"txtName",
9
- type:"text",widths:["25%","75%"],labelLayout:"horizontal",label:c.lang.common.name,"default":"",accessKey:"N",style:"width:350px",setup:function(a,b){"clear"==a?this.setValue(this["default"]||""):"select"==a&&this.setValue(b.data("cke-saved-name")||b.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"txtValue",type:"text",widths:["25%","75%"],labelLayout:"horizontal",label:c.lang.forms.select.value,
10
- style:"width:350px","default":"",className:"cke_disabled",onLoad:function(){this.getInputElement().setAttribute("readOnly",!0)},setup:function(a,b){"clear"==a?this.setValue(""):"option"==a&&b.getAttribute("selected")&&this.setValue(b.$.value)}},{type:"hbox",className:"cke_dialog_forms_select_order_txtsize",widths:["175px","170px"],children:[{id:"txtSize",type:"text",labelLayout:"horizontal",label:c.lang.forms.select.size,"default":"",accessKey:"S",style:"width:175px",validate:function(){var a=CKEDITOR.dialog.validate.integer(c.lang.common.validateNumberFailed);
11
- return""===this.getValue()||a.apply(this)},setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("size")||"");CKEDITOR.env.webkit&&this.getInputElement().setStyle("width","86px")},commit:function(a){this.getValue()?a.setAttribute("size",this.getValue()):a.removeAttribute("size")}},{type:"html",html:"\x3cspan\x3e"+CKEDITOR.tools.htmlEncode(c.lang.forms.select.lines)+"\x3c/span\x3e"}]},{type:"html",html:"\x3cspan\x3e"+CKEDITOR.tools.htmlEncode(c.lang.forms.select.opAvail)+"\x3c/span\x3e"},{type:"hbox",
12
- widths:["115px","115px","100px"],className:"cke_dialog_forms_select_order",children:[{type:"vbox",children:[{id:"txtOptName",type:"text",label:c.lang.forms.select.opText,style:"width:115px",setup:function(a){"clear"==a&&this.setValue("")}},{type:"select",id:"cmbName",label:"",title:"",size:5,style:"width:115px;height:75px",items:[],onChange:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbValue"),e=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue"),
13
- d=g(this);k(b,d);e.setValue(this.getValue());a.setValue(b.getValue())},setup:function(a,b){"clear"==a?m(this):"option"==a&&h(this,b.getText(),b.getText(),this.getDialog().getParentEditor().document)},commit:function(a){var b=this.getDialog(),e=n(this),d=n(b.getContentElement("info","cmbValue")),c=b.getContentElement("info","txtValue").getValue();m(a);for(var f=0;f<e.count();f++){var g=h(a,e.getItem(f).getValue(),d.getItem(f).getValue(),b.getParentEditor().document);d.getItem(f).getValue()==c&&(g.setAttribute("selected",
14
- "selected"),g.selected=!0)}}}]},{type:"vbox",children:[{id:"txtOptValue",type:"text",label:c.lang.forms.select.opValue,style:"width:115px",setup:function(a){"clear"==a&&this.setValue("")}},{type:"select",id:"cmbValue",label:"",size:5,style:"width:115px;height:75px",items:[],onChange:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),e=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue"),d=g(this);k(b,d);e.setValue(b.getValue());a.setValue(this.getValue())},
15
- setup:function(a,b){if("clear"==a)m(this);else if("option"==a){var e=b.getValue();h(this,e,e,this.getDialog().getParentEditor().document);"selected"==b.getAttribute("selected")&&this.getDialog().getContentElement("info","txtValue").setValue(e)}}}]},{type:"vbox",padding:5,children:[{type:"button",id:"btnAdd",label:c.lang.forms.select.btnAdd,title:c.lang.forms.select.btnAdd,style:"width:100%;",onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","txtOptName"),e=a.getContentElement("info",
16
- "txtOptValue"),d=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");h(d,b.getValue(),b.getValue(),a.getParentEditor().document);h(c,e.getValue(),e.getValue(),a.getParentEditor().document);b.setValue("");e.setValue("")}},{type:"button",id:"btnModify",label:c.lang.forms.select.btnModify,title:c.lang.forms.select.btnModify,style:"width:100%;",onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","txtOptName"),e=a.getContentElement("info","txtOptValue"),d=
17
- a.getContentElement("info","cmbName"),a=a.getContentElement("info","cmbValue"),c=g(d);0<=c&&(q(d,c,b.getValue(),b.getValue()),q(a,c,e.getValue(),e.getValue()))}},{type:"button",id:"btnUp",style:"width:100%;",label:c.lang.forms.select.btnUp,title:c.lang.forms.select.btnUp,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");l(b,-1,a.getParentEditor().document);l(c,-1,a.getParentEditor().document)}},{type:"button",id:"btnDown",style:"width:100%;",
18
- label:c.lang.forms.select.btnDown,title:c.lang.forms.select.btnDown,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");l(b,1,a.getParentEditor().document);l(c,1,a.getParentEditor().document)}}]}]},{type:"hbox",widths:["40%","20%","40%"],children:[{type:"button",id:"btnSetValue",label:c.lang.forms.select.btnSetValue,title:c.lang.forms.select.btnSetValue,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbValue");
19
- a.getContentElement("info","txtValue").setValue(b.getValue())}},{type:"button",id:"btnDelete",label:c.lang.forms.select.btnDelete,title:c.lang.forms.select.btnDelete,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue"),d=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue");p(b);p(c);d.setValue("");a.setValue("")}},{type:"vbox",children:[{id:"chkMulti",type:"checkbox",label:c.lang.forms.select.chkMulti,
20
- "default":"",accessKey:"M",value:"checked",setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("multiple"))},commit:function(a){this.getValue()?a.setAttribute("multiple",this.getValue()):a.removeAttribute("multiple")}},{id:"required",type:"checkbox",label:c.lang.forms.select.required,"default":"",accessKey:"Q",value:"checked",setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("required"))},commit:function(a){this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}]}]}});
7
+ function k(a,b){a=f(a);if(0>b)return null;var e=a.getChildren().count();a.$.selectedIndex=b>=e?e-1:b;return a}function n(a){return(a=f(a))?a.getChildren():!1}function f(a){return a&&a.domId&&a.getInputElement().$?a.getInputElement():a&&a.$?a:!1}return{title:c.lang.forms.select.title,minWidth:CKEDITOR.env.ie?460:395,minHeight:CKEDITOR.env.ie?320:300,getModel:function(a){return(a=a.getSelection().getSelectedElement())&&"select"==a.getName()?a:null},onShow:function(){this.setupContent("clear");var a=
8
+ this.getModel(this.getParentEditor());if(a){this.setupContent(a.getName(),a);for(var a=n(a),b=0;b<a.count();b++)this.setupContent("option",a.getItem(b))}},onOk:function(){var a=this.getParentEditor(),b=this.getModel(a),e=this.getMode(a)==CKEDITOR.dialog.CREATION_MODE;e&&(b=a.document.createElement("select"));this.commitContent(b);if(e&&(a.insertElement(b),CKEDITOR.env.ie)){var d=a.getSelection(),c=d.createBookmarks();setTimeout(function(){d.selectBookmarks(c)},0)}},contents:[{id:"info",label:c.lang.forms.select.selectInfo,
9
+ title:c.lang.forms.select.selectInfo,accessKey:"",elements:[{id:"txtName",type:"text",widths:["25%","75%"],labelLayout:"horizontal",label:c.lang.common.name,"default":"",accessKey:"N",style:"width:350px",setup:function(a,b){"clear"==a?this.setValue(this["default"]||""):"select"==a&&this.setValue(b.data("cke-saved-name")||b.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"txtValue",
10
+ type:"text",widths:["25%","75%"],labelLayout:"horizontal",label:c.lang.forms.select.value,style:"width:350px","default":"",className:"cke_disabled",onLoad:function(){this.getInputElement().setAttribute("readOnly",!0)},setup:function(a,b){"clear"==a?this.setValue(""):"option"==a&&b.getAttribute("selected")&&this.setValue(b.$.value)}},{type:"hbox",className:"cke_dialog_forms_select_order_txtsize",widths:["175px","170px"],children:[{id:"txtSize",type:"text",labelLayout:"horizontal",label:c.lang.forms.select.size,
11
+ "default":"",accessKey:"S",style:"width:175px",validate:function(){var a=CKEDITOR.dialog.validate.integer(c.lang.common.validateNumberFailed);return""===this.getValue()||a.apply(this)},setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("size")||"");CKEDITOR.env.webkit&&this.getInputElement().setStyle("width","86px")},commit:function(a){this.getValue()?a.setAttribute("size",this.getValue()):a.removeAttribute("size")}},{type:"html",html:"\x3cspan\x3e"+CKEDITOR.tools.htmlEncode(c.lang.forms.select.lines)+
12
+ "\x3c/span\x3e"}]},{type:"html",html:"\x3cspan\x3e"+CKEDITOR.tools.htmlEncode(c.lang.forms.select.opAvail)+"\x3c/span\x3e"},{type:"hbox",widths:["115px","115px","100px"],className:"cke_dialog_forms_select_order",children:[{type:"vbox",children:[{id:"txtOptName",type:"text",label:c.lang.forms.select.opText,style:"width:115px",setup:function(a){"clear"==a&&this.setValue("")}},{type:"select",id:"cmbName",label:"",title:"",size:5,style:"width:115px;height:75px",items:[],onChange:function(){var a=this.getDialog(),
13
+ b=a.getContentElement("info","cmbValue"),e=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue"),d=g(this);k(b,d);e.setValue(this.getValue());a.setValue(b.getValue())},setup:function(a,b){"clear"==a?m(this):"option"==a&&h(this,b.getText(),b.getText(),this.getDialog().getParentEditor().document)},commit:function(a){var b=this.getDialog(),e=n(this),d=n(b.getContentElement("info","cmbValue")),c=b.getContentElement("info","txtValue").getValue();m(a);for(var f=0;f<e.count();f++){var g=
14
+ h(a,e.getItem(f).getValue(),d.getItem(f).getValue(),b.getParentEditor().document);d.getItem(f).getValue()==c&&(g.setAttribute("selected","selected"),g.selected=!0)}}}]},{type:"vbox",children:[{id:"txtOptValue",type:"text",label:c.lang.forms.select.opValue,style:"width:115px",setup:function(a){"clear"==a&&this.setValue("")}},{type:"select",id:"cmbValue",label:"",size:5,style:"width:115px;height:75px",items:[],onChange:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),e=a.getContentElement("info",
15
+ "txtOptName"),a=a.getContentElement("info","txtOptValue"),d=g(this);k(b,d);e.setValue(b.getValue());a.setValue(this.getValue())},setup:function(a,b){if("clear"==a)m(this);else if("option"==a){var e=b.getValue();h(this,e,e,this.getDialog().getParentEditor().document);"selected"==b.getAttribute("selected")&&this.getDialog().getContentElement("info","txtValue").setValue(e)}}}]},{type:"vbox",padding:5,children:[{type:"button",id:"btnAdd",label:c.lang.forms.select.btnAdd,title:c.lang.forms.select.btnAdd,
16
+ style:"width:100%;",onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","txtOptName"),e=a.getContentElement("info","txtOptValue"),d=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");h(d,b.getValue(),b.getValue(),a.getParentEditor().document);h(c,e.getValue(),e.getValue(),a.getParentEditor().document);b.setValue("");e.setValue("")}},{type:"button",id:"btnModify",label:c.lang.forms.select.btnModify,title:c.lang.forms.select.btnModify,style:"width:100%;",
17
+ onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","txtOptName"),e=a.getContentElement("info","txtOptValue"),d=a.getContentElement("info","cmbName"),a=a.getContentElement("info","cmbValue"),c=g(d);0<=c&&(q(d,c,b.getValue(),b.getValue()),q(a,c,e.getValue(),e.getValue()))}},{type:"button",id:"btnUp",style:"width:100%;",label:c.lang.forms.select.btnUp,title:c.lang.forms.select.btnUp,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info",
18
+ "cmbValue");l(b,-1,a.getParentEditor().document);l(c,-1,a.getParentEditor().document)}},{type:"button",id:"btnDown",style:"width:100%;",label:c.lang.forms.select.btnDown,title:c.lang.forms.select.btnDown,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");l(b,1,a.getParentEditor().document);l(c,1,a.getParentEditor().document)}}]}]},{type:"hbox",widths:["40%","20%","40%"],children:[{type:"button",id:"btnSetValue",label:c.lang.forms.select.btnSetValue,
19
+ title:c.lang.forms.select.btnSetValue,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbValue");a.getContentElement("info","txtValue").setValue(b.getValue())}},{type:"button",id:"btnDelete",label:c.lang.forms.select.btnDelete,title:c.lang.forms.select.btnDelete,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue"),d=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue");p(b);
20
+ p(c);d.setValue("");a.setValue("")}},{type:"vbox",children:[{id:"chkMulti",type:"checkbox",label:c.lang.forms.select.chkMulti,"default":"",accessKey:"M",value:"checked",setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("multiple"))},commit:function(a){this.getValue()?a.setAttribute("multiple",this.getValue()):a.removeAttribute("multiple")}},{id:"required",type:"checkbox",label:c.lang.forms.select.required,"default":"",accessKey:"Q",value:"checked",setup:function(a,b){"select"==a&&CKEDITOR.plugins.forms._setupRequiredAttribute.call(this,
21
+ b)},commit:function(a){this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}]}]}});
@@ -1,8 +1,9 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("textarea",function(b){return{title:b.lang.forms.textarea.title,minWidth:350,minHeight:220,onShow:function(){delete this.textarea;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"textarea"==a.getName()&&(this.textarea=a,this.setupContent(a))},onOk:function(){var a,b=this.textarea,c=!b;c&&(a=this.getParentEditor(),b=a.document.createElement("textarea"));this.commitContent(b);c&&a.insertElement(b)},contents:[{id:"info",label:b.lang.forms.textarea.title,title:b.lang.forms.textarea.title,
6
- elements:[{id:"_cke_saved_name",type:"text",label:b.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{type:"hbox",widths:["50%","50%"],children:[{id:"cols",type:"text",label:b.lang.forms.textarea.cols,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),
7
- setup:function(a){a=a.hasAttribute("cols")&&a.getAttribute("cols");this.setValue(a||"")},commit:function(a){this.getValue()?a.setAttribute("cols",this.getValue()):a.removeAttribute("cols")}},{id:"rows",type:"text",label:b.lang.forms.textarea.rows,"default":"",accessKey:"R",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),setup:function(a){a=a.hasAttribute("rows")&&a.getAttribute("rows");this.setValue(a||"")},commit:function(a){this.getValue()?a.setAttribute("rows",
8
- this.getValue()):a.removeAttribute("rows")}}]},{id:"value",type:"textarea",label:b.lang.forms.textfield.value,"default":"",setup:function(a){this.setValue(a.$.defaultValue)},commit:function(a){a.$.value=a.$.defaultValue=this.getValue()}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},commit:function(a){this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
5
+ CKEDITOR.dialog.add("textarea",function(b){return{title:b.lang.forms.textarea.title,minWidth:350,minHeight:220,getModel:function(a){return(a=a.getSelection().getSelectedElement())&&"textarea"==a.getName()?a:null},onShow:function(){var a=this.getModel(this.getParentEditor());a&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor(),b=this.getModel(a),c=this.getMode(a)==CKEDITOR.dialog.CREATION_MODE;c&&(b=a.document.createElement("textarea"));this.commitContent(b);c&&a.insertElement(b)},
6
+ contents:[{id:"info",label:b.lang.forms.textarea.title,title:b.lang.forms.textarea.title,elements:[{id:"_cke_saved_name",type:"text",label:b.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{type:"hbox",widths:["50%","50%"],children:[{id:"cols",type:"text",label:b.lang.forms.textarea.cols,
7
+ "default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),setup:function(a){a=a.hasAttribute("cols")&&a.getAttribute("cols");this.setValue(a||"")},commit:function(a){this.getValue()?a.setAttribute("cols",this.getValue()):a.removeAttribute("cols")}},{id:"rows",type:"text",label:b.lang.forms.textarea.rows,"default":"",accessKey:"R",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),setup:function(a){a=
8
+ a.hasAttribute("rows")&&a.getAttribute("rows");this.setValue(a||"")},commit:function(a){this.getValue()?a.setAttribute("rows",this.getValue()):a.removeAttribute("rows")}}]},{id:"value",type:"textarea",label:b.lang.forms.textfield.value,"default":"",setup:function(a){this.setValue(a.$.defaultValue)},commit:function(a){a.$.value=a.$.defaultValue=this.getValue()}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,
9
+ commit:function(a){this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
@@ -1,11 +1,11 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- CKEDITOR.dialog.add("textfield",function(b){function e(a){a=a.element;var b=this.getValue();b?a.setAttribute(this.id,b):a.removeAttribute(this.id)}function f(a){a=a.hasAttribute(this.id)&&a.getAttribute(this.id);this.setValue(a||"")}var g={email:1,password:1,search:1,tel:1,text:1,url:1};return{title:b.lang.forms.textfield.title,minWidth:350,minHeight:150,onShow:function(){delete this.textField;var a=this.getParentEditor().getSelection().getSelectedElement();!a||"input"!=a.getName()||!g[a.getAttribute("type")]&&
6
- a.getAttribute("type")||(this.textField=a,this.setupContent(a))},onOk:function(){var a=this.getParentEditor(),b=this.textField,c=!b;c&&(b=a.document.createElement("input"),b.setAttribute("type","text"));b={element:b};c&&a.insertElement(b.element);this.commitContent(b);c||a.getSelection().selectElement(b.element)},onLoad:function(){this.foreach(function(a){a.getValue&&(a.setup||(a.setup=f),a.commit||(a.commit=e))})},contents:[{id:"info",label:b.lang.forms.textfield.title,title:b.lang.forms.textfield.title,
7
- elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"_cke_saved_name",type:"text",label:b.lang.forms.textfield.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:b.lang.forms.textfield.value,"default":"",accessKey:"V",commit:function(a){if(CKEDITOR.env.ie&&
8
- !this.getValue()){var d=a.element,c=new CKEDITOR.dom.element("input",b.document);d.copyAttributes(c,{value:1});c.replace(d);a.element=c}else e.call(this,a)}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"size",type:"text",label:b.lang.forms.textfield.charWidth,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)},{id:"maxLength",type:"text",label:b.lang.forms.textfield.maxChars,"default":"",accessKey:"M",style:"width:50px",
9
- validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)}],onLoad:function(){CKEDITOR.env.ie7Compat&&this.getElement().setStyle("zoom","100%")}},{id:"type",type:"select",label:b.lang.forms.textfield.type,"default":"text",accessKey:"M",items:[[b.lang.forms.textfield.typeEmail,"email"],[b.lang.forms.textfield.typePass,"password"],[b.lang.forms.textfield.typeSearch,"search"],[b.lang.forms.textfield.typeTel,"tel"],[b.lang.forms.textfield.typeText,"text"],[b.lang.forms.textfield.typeUrl,
10
- "url"]],setup:function(a){this.setValue(a.getAttribute("type"))},commit:function(a){var d=a.element;if(CKEDITOR.env.ie){var c=d.getAttribute("type"),e=this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"'+e+'"\x3e\x3c/input\x3e',b.document),d.copyAttributes(c,{type:1}),c.replace(d),a.element=c)}else d.setAttribute("type",this.getValue())}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",value:"required",setup:function(a){this.setValue(a.getAttribute("required"))},
11
- commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
5
+ CKEDITOR.dialog.add("textfield",function(b){function e(a){a=a.element;var b=this.getValue();b?a.setAttribute(this.id,b):a.removeAttribute(this.id)}function f(a){a=a.hasAttribute(this.id)&&a.getAttribute(this.id);this.setValue(a||"")}var g={email:1,password:1,search:1,tel:1,text:1,url:1};return{title:b.lang.forms.textfield.title,minWidth:350,minHeight:150,getModel:function(a){a=a.getSelection().getSelectedElement();return!a||"input"!=a.getName()||!g[a.getAttribute("type")]&&a.getAttribute("type")?
6
+ null:a},onShow:function(){var a=this.getModel(this.getParentEditor());a&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor(),b=this.getModel(a),c=this.getMode(a)==CKEDITOR.dialog.CREATION_MODE;c&&(b=a.document.createElement("input"),b.setAttribute("type","text"));b={element:b};c&&a.insertElement(b.element);this.commitContent(b);c||a.getSelection().selectElement(b.element)},onLoad:function(){this.foreach(function(a){a.getValue&&(a.setup||(a.setup=f),a.commit||(a.commit=e))})},contents:[{id:"info",
7
+ label:b.lang.forms.textfield.title,title:b.lang.forms.textfield.title,elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"_cke_saved_name",type:"text",label:b.lang.forms.textfield.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:b.lang.forms.textfield.value,
8
+ "default":"",accessKey:"V",commit:function(a){if(CKEDITOR.env.ie&&!this.getValue()){var d=a.element,c=new CKEDITOR.dom.element("input",b.document);d.copyAttributes(c,{value:1});c.replace(d);a.element=c}else e.call(this,a)}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"size",type:"text",label:b.lang.forms.textfield.charWidth,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)},{id:"maxLength",type:"text",label:b.lang.forms.textfield.maxChars,
9
+ "default":"",accessKey:"M",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)}],onLoad:function(){CKEDITOR.env.ie7Compat&&this.getElement().setStyle("zoom","100%")}},{id:"type",type:"select",label:b.lang.forms.textfield.type,"default":"text",accessKey:"M",items:[[b.lang.forms.textfield.typeEmail,"email"],[b.lang.forms.textfield.typePass,"password"],[b.lang.forms.textfield.typeSearch,"search"],[b.lang.forms.textfield.typeTel,"tel"],[b.lang.forms.textfield.typeText,
10
+ "text"],[b.lang.forms.textfield.typeUrl,"url"]],setup:function(a){this.setValue(a.getAttribute("type"))},commit:function(a){var d=a.element;if(CKEDITOR.env.ie){var c=d.getAttribute("type"),e=this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('\x3cinput type\x3d"'+e+'"\x3e\x3c/input\x3e',b.document),d.copyAttributes(c,{type:1}),c.replace(d),a.element=c)}else d.setAttribute("type",this.getValue())}},{id:"required",type:"checkbox",label:b.lang.forms.textfield.required,"default":"",accessKey:"Q",
11
+ value:"required",setup:CKEDITOR.plugins.forms._setupRequiredAttribute,commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
@@ -1,10 +1,11 @@
1
1
  /*
2
- Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.md or http://ckeditor.com/license
2
+ Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- (function(){function c(b){var c=this instanceof CKEDITOR.ui.dialog.checkbox;b.hasAttribute(this.id)&&(b=b.getAttribute(this.id),c?this.setValue(e[this.id]["true"]==b.toLowerCase()):this.setValue(b))}function d(b){var c=""===this.getValue(),a=this instanceof CKEDITOR.ui.dialog.checkbox,d=this.getValue();c?b.removeAttribute(this.att||this.id):a?b.setAttribute(this.id,e[this.id][d]):b.setAttribute(this.att||this.id,d)}var e={scrolling:{"true":"yes","false":"no"},frameborder:{"true":"1","false":"0"}};
6
- CKEDITOR.dialog.add("iframe",function(b){var f=b.lang.iframe,a=b.lang.common,e=b.plugins.dialogadvtab;return{title:f.title,minWidth:350,minHeight:260,onShow:function(){this.fakeImage=this.iframeNode=null;var a=this.getSelectedElement();a&&a.data("cke-real-element-type")&&"iframe"==a.data("cke-real-element-type")&&(this.fakeImage=a,this.iframeNode=a=b.restoreRealElement(a),this.setupContent(a))},onOk:function(){var a;a=this.fakeImage?this.iframeNode:new CKEDITOR.dom.element("iframe");var c={},d={};
7
- this.commitContent(a,c,d);a=b.createFakeElement(a,"cke_iframe","iframe",!0);a.setAttributes(d);a.setStyles(c);this.fakeImage?(a.replace(this.fakeImage),b.getSelection().selectElement(a)):b.insertElement(a)},contents:[{id:"info",label:a.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{id:"src",type:"text",label:a.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(f.noUrl),setup:c,commit:d}]},{type:"hbox",children:[{id:"width",type:"text",requiredContent:"iframe[width]",
8
- style:"width:100%",labelLayout:"vertical",label:a.width,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.width)),setup:c,commit:d},{id:"height",type:"text",requiredContent:"iframe[height]",style:"width:100%",labelLayout:"vertical",label:a.height,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.height)),setup:c,commit:d},{id:"align",type:"select",requiredContent:"iframe[align]","default":"",items:[[a.notSet,""],[a.alignLeft,"left"],[a.alignRight,
9
- "right"],[a.alignTop,"top"],[a.alignMiddle,"middle"],[a.alignBottom,"bottom"]],style:"width:100%",labelLayout:"vertical",label:a.align,setup:function(a,b){c.apply(this,arguments);if(b){var d=b.getAttribute("align");this.setValue(d&&d.toLowerCase()||"")}},commit:function(a,b,c){d.apply(this,arguments);this.getValue()&&(c.align=this.getValue())}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"scrolling",type:"checkbox",requiredContent:"iframe[scrolling]",label:f.scrolling,setup:c,commit:d},{id:"frameborder",
10
- type:"checkbox",requiredContent:"iframe[frameborder]",label:f.border,setup:c,commit:d}]},{type:"hbox",widths:["50%","50%"],children:[{id:"name",type:"text",requiredContent:"iframe[name]",label:a.name,setup:c,commit:d},{id:"title",type:"text",requiredContent:"iframe[title]",label:a.advisoryTitle,setup:c,commit:d}]},{id:"longdesc",type:"text",requiredContent:"iframe[longdesc]",label:a.longDescr,setup:c,commit:d}]},e&&e.createAdvancedTab(b,{id:1,classes:1,styles:1},"iframe")]}})})();
5
+ (function(){function d(c){var d=this instanceof CKEDITOR.ui.dialog.checkbox;c.hasAttribute(this.id)&&(c=c.getAttribute(this.id),d?this.setValue(f[this.id]["true"]==c.toLowerCase()):this.setValue(c))}function e(c){var d=""===this.getValue(),a=this instanceof CKEDITOR.ui.dialog.checkbox,e=this.getValue();d?c.removeAttribute(this.att||this.id):a?c.setAttribute(this.id,f[this.id][e]):c.setAttribute(this.att||this.id,e)}var f={scrolling:{"true":"yes","false":"no"},frameborder:{"true":"1","false":"0"}};
6
+ CKEDITOR.dialog.add("iframe",function(c){var g=c.lang.iframe,a=c.lang.common,f=c.plugins.dialogadvtab;return{title:g.title,minWidth:350,minHeight:260,getModel:function(b){return(b=b.getSelection().getSelectedElement())&&"iframe"===b.data("cke-real-element-type")?b:null},onShow:function(){this.fakeImage=this.iframeNode=null;var b=this.getSelectedElement();b&&b.data("cke-real-element-type")&&"iframe"==b.data("cke-real-element-type")&&(this.fakeImage=b,this.iframeNode=b=c.restoreRealElement(b),this.setupContent(b))},
7
+ onOk:function(){var b;b=this.fakeImage?this.iframeNode:new CKEDITOR.dom.element("iframe");var a={},d={};this.commitContent(b,a,d);b=c.createFakeElement(b,"cke_iframe","iframe",!0);b.setAttributes(d);b.setStyles(a);this.fakeImage?(b.replace(this.fakeImage),c.getSelection().selectElement(b)):c.insertElement(b)},contents:[{id:"info",label:a.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{id:"src",type:"text",label:a.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(g.noUrl),
8
+ setup:d,commit:e}]},{type:"hbox",children:[{id:"width",type:"text",requiredContent:"iframe[width]",style:"width:100%",labelLayout:"vertical",label:a.width,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.width)),setup:d,commit:e},{id:"height",type:"text",requiredContent:"iframe[height]",style:"width:100%",labelLayout:"vertical",label:a.height,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.height)),setup:d,commit:e},{id:"align",type:"select",
9
+ requiredContent:"iframe[align]","default":"",items:[[a.notSet,""],[a.left,"left"],[a.right,"right"],[a.alignTop,"top"],[a.alignMiddle,"middle"],[a.alignBottom,"bottom"]],style:"width:100%",labelLayout:"vertical",label:a.align,setup:function(b,a){d.apply(this,arguments);if(a){var c=a.getAttribute("align");this.setValue(c&&c.toLowerCase()||"")}},commit:function(a,c,d){e.apply(this,arguments);this.getValue()&&(d.align=this.getValue())}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"scrolling",type:"checkbox",
10
+ requiredContent:"iframe[scrolling]",label:g.scrolling,setup:d,commit:e},{id:"frameborder",type:"checkbox",requiredContent:"iframe[frameborder]",label:g.border,setup:d,commit:e}]},{type:"hbox",widths:["50%","50%"],children:[{id:"name",type:"text",requiredContent:"iframe[name]",label:a.name,setup:d,commit:e},{id:"title",type:"text",requiredContent:"iframe[title]",label:a.advisoryTitle,setup:d,commit:e}]},{id:"longdesc",type:"text",requiredContent:"iframe[longdesc]",label:a.longDescr,setup:d,commit:e}]},
11
+ f&&f.createAdvancedTab(c,{id:1,classes:1,styles:1},"iframe")]}})})();
@@ -1,44 +1,1271 @@
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
- (function(){var v=function(d,l){function v(){var a=arguments,b=this.getContentElement("advanced","txtdlgGenStyle");b&&b.commit.apply(b,a);this.foreach(function(b){b.commit&&"txtdlgGenStyle"!=b.id&&b.commit.apply(b,a)})}function k(a){if(!w){w=1;var b=this.getDialog(),c=b.imageElement;if(c){this.commit(1,c);a=[].concat(a);for(var d=a.length,f,g=0;g<d;g++)(f=b.getContentElement.apply(b,a[g].split(":")))&&f.setup(1,c)}w=0}}var m=/^\s*(\d+)((px)|\%)?\s*$/i,z=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,r=/^\d+px$/,
6
- A=function(){var a=this.getValue(),b=this.getDialog(),c=a.match(m);c&&("%"==c[2]&&n(b,!1),a=c[1]);b.lockRatio&&(c=b.originalElement,"true"==c.getCustomData("isReady")&&("txtHeight"==this.id?(a&&"0"!=a&&(a=Math.round(a/c.$.height*c.$.width)),isNaN(a)||b.setValueOf("info","txtWidth",a)):(a&&"0"!=a&&(a=Math.round(a/c.$.width*c.$.height)),isNaN(a)||b.setValueOf("info","txtHeight",a))));e(b)},e=function(a){if(!a.originalElement||!a.preview)return 1;a.commitContent(4,a.preview);return 0},w,n=function(a,
7
- b){if(!a.getContentElement("info","ratioLock"))return null;var c=a.originalElement;if(!c)return null;if("check"==b){if(!a.userlockRatio&&"true"==c.getCustomData("isReady")){var d=a.getValueOf("info","txtWidth"),f=a.getValueOf("info","txtHeight"),c=1E3*c.$.width/c.$.height,g=1E3*d/f;a.lockRatio=!1;d||f?isNaN(c)||isNaN(g)||Math.round(c)!=Math.round(g)||(a.lockRatio=!0):a.lockRatio=!0}}else void 0!==b?a.lockRatio=b:(a.userlockRatio=1,a.lockRatio=!a.lockRatio);d=CKEDITOR.document.getById(t);a.lockRatio?
8
- d.removeClass("cke_btn_unlocked"):d.addClass("cke_btn_unlocked");d.setAttribute("aria-checked",a.lockRatio);CKEDITOR.env.hc&&d.getChild(0).setHtml(a.lockRatio?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢");return a.lockRatio},B=function(a,b){var c=a.originalElement;if("true"==c.getCustomData("isReady")){var d=a.getContentElement("info","txtWidth"),f=a.getContentElement("info","txtHeight"),g;b?c=g=0:(g=c.$.width,c=c.$.height);d&&d.setValue(g);f&&f.setValue(c)}e(a)},C=function(a,b){function c(a,b){var c=
9
- a.match(m);return c?("%"==c[2]&&(c[1]+="%",n(d,!1)),c[1]):b}if(1==a){var d=this.getDialog(),f="",g="txtWidth"==this.id?"width":"height",e=b.getAttribute(g);e&&(f=c(e,f));f=c(b.getStyle(g),f);this.setValue(f)}},x,u=function(){var a=this.originalElement,b=CKEDITOR.document.getById(p);a.setCustomData("isReady","true");a.removeListener("load",u);a.removeListener("error",h);a.removeListener("abort",h);b&&b.setStyle("display","none");this.dontResetSize||B(this,!1===d.config.image_prefillDimensions);this.firstLoad&&
10
- CKEDITOR.tools.setTimeout(function(){n(this,"check")},0,this);this.dontResetSize=this.firstLoad=!1;e(this)},h=function(){var a=this.originalElement,b=CKEDITOR.document.getById(p);a.removeListener("load",u);a.removeListener("error",h);a.removeListener("abort",h);a=CKEDITOR.getUrl(CKEDITOR.plugins.get("image").path+"images/noimage.png");this.preview&&this.preview.setAttribute("src",a);b&&b.setStyle("display","none");n(this,!1)},q=function(a){return CKEDITOR.tools.getNextId()+"_"+a},t=q("btnLockSizes"),
11
- y=q("btnResetSize"),p=q("ImagePreviewLoader"),E=q("previewLink"),D=q("previewImage");return{title:d.lang.image["image"==l?"title":"titleButton"],minWidth:"moono-lisa"==(CKEDITOR.skinName||d.config.skin)?500:420,minHeight:360,onShow:function(){this.linkEditMode=this.imageEditMode=this.linkElement=this.imageElement=!1;this.lockRatio=!0;this.userlockRatio=0;this.dontResetSize=!1;this.firstLoad=!0;this.addLink=!1;var a=this.getParentEditor(),b=a.getSelection(),c=(b=b&&b.getSelectedElement())&&a.elementPath(b).contains("a",
12
- 1),d=CKEDITOR.document.getById(p);d&&d.setStyle("display","none");x=new CKEDITOR.dom.element("img",a.document);this.preview=CKEDITOR.document.getById(D);this.originalElement=a.document.createElement("img");this.originalElement.setAttribute("alt","");this.originalElement.setCustomData("isReady","false");c&&(this.linkElement=c,this.addLink=this.linkEditMode=!0,a=c.getChildren(),1==a.count()&&(d=a.getItem(0),d.type==CKEDITOR.NODE_ELEMENT&&(d.is("img")||d.is("input"))&&(this.imageElement=a.getItem(0),
13
- this.imageElement.is("img")?this.imageEditMode="img":this.imageElement.is("input")&&(this.imageEditMode="input"))),"image"==l&&this.setupContent(2,c));if(this.customImageElement)this.imageEditMode="img",this.imageElement=this.customImageElement,delete this.customImageElement;else if(b&&"img"==b.getName()&&!b.data("cke-realelement")||b&&"input"==b.getName()&&"image"==b.getAttribute("type"))this.imageEditMode=b.getName(),this.imageElement=b;this.imageEditMode&&(this.cleanImageElement=this.imageElement,
14
- this.imageElement=this.cleanImageElement.clone(!0,!0),this.setupContent(1,this.imageElement));n(this,!0);CKEDITOR.tools.trim(this.getValueOf("info","txtUrl"))||(this.preview.removeAttribute("src"),this.preview.setStyle("display","none"))},onOk:function(){if(this.imageEditMode){var a=this.imageEditMode;"image"==l&&"input"==a&&confirm(d.lang.image.button2Img)?(this.imageElement=d.document.createElement("img"),this.imageElement.setAttribute("alt",""),d.insertElement(this.imageElement)):"image"!=l&&"img"==
15
- a&&confirm(d.lang.image.img2Button)?(this.imageElement=d.document.createElement("input"),this.imageElement.setAttributes({type:"image",alt:""}),d.insertElement(this.imageElement)):(this.imageElement=this.cleanImageElement,delete this.cleanImageElement)}else"image"==l?this.imageElement=d.document.createElement("img"):(this.imageElement=d.document.createElement("input"),this.imageElement.setAttribute("type","image")),this.imageElement.setAttribute("alt","");this.linkEditMode||(this.linkElement=d.document.createElement("a"));
16
- this.commitContent(1,this.imageElement);this.commitContent(2,this.linkElement);this.imageElement.getAttribute("style")||this.imageElement.removeAttribute("style");this.imageEditMode?!this.linkEditMode&&this.addLink?(d.insertElement(this.linkElement),this.imageElement.appendTo(this.linkElement)):this.linkEditMode&&!this.addLink&&(d.getSelection().selectElement(this.linkElement),d.insertElement(this.imageElement)):this.addLink?this.linkEditMode?this.linkElement.equals(d.getSelection().getSelectedElement())?
17
- (this.linkElement.setHtml(""),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement):(d.insertElement(this.linkElement),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement)},onLoad:function(){"image"!=l&&this.hidePage("Link");var a=this._.element.getDocument();this.getContentElement("info","ratioLock")&&(this.addFocusable(a.getById(y),5),this.addFocusable(a.getById(t),5));this.commitContent=v},onHide:function(){this.preview&&this.commitContent(8,
18
- this.preview);this.originalElement&&(this.originalElement.removeListener("load",u),this.originalElement.removeListener("error",h),this.originalElement.removeListener("abort",h),this.originalElement.remove(),this.originalElement=!1);delete this.imageElement},contents:[{id:"info",label:d.lang.image.infoTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",className:"cke_dialog_image_url",children:[{id:"txtUrl",type:"text",label:d.lang.common.url,
19
- required:!0,onChange:function(){var a=this.getDialog(),b=this.getValue();if(0<b.length){var a=this.getDialog(),c=a.originalElement;a.preview&&a.preview.removeStyle("display");c.setCustomData("isReady","false");var d=CKEDITOR.document.getById(p);d&&d.setStyle("display","");c.on("load",u,a);c.on("error",h,a);c.on("abort",h,a);c.setAttribute("src",b);a.preview&&(x.setAttribute("src",b),a.preview.setAttribute("src",x.$.src),e(a))}else a.preview&&(a.preview.removeAttribute("src"),a.preview.setStyle("display",
20
- "none"))},setup:function(a,b){if(1==a){var c=b.data("cke-saved-src")||b.getAttribute("src");this.getDialog().dontResetSize=!0;this.setValue(c);this.setInitValue()}},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())?(b.data("cke-saved-src",this.getValue()),b.setAttribute("src",this.getValue())):8==a&&(b.setAttribute("src",""),b.removeAttribute("src"))},validate:CKEDITOR.dialog.validate.notEmpty(d.lang.image.urlMissing)},{type:"button",id:"browse",style:"display:inline-block;margin-top:14px;",
21
- align:"center",label:d.lang.common.browseServer,hidden:!0,filebrowser:"info:txtUrl"}]}]},{id:"txtAlt",type:"text",label:d.lang.image.alt,accessKey:"T","default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("alt"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("alt",this.getValue()):4==a?b.setAttribute("alt",this.getValue()):8==a&&b.removeAttribute("alt")}},{type:"hbox",children:[{id:"basic",type:"vbox",children:[{type:"hbox",
22
- requiredContent:"img{width,height}",widths:["50%","50%"],children:[{type:"vbox",padding:1,children:[{type:"text",width:"45px",id:"txtWidth",label:d.lang.common.width,onKeyUp:A,onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(z);(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidWidth);return a},setup:C,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("width",CKEDITOR.tools.cssLength(c)):
23
- b.removeStyle("width"),b.removeAttribute("width")):4==a?c.match(m)?b.setStyle("width",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("width",c.$.width+"px")):8==a&&(b.removeAttribute("width"),b.removeStyle("width"))}},{type:"text",id:"txtHeight",width:"45px",label:d.lang.common.height,onKeyUp:A,onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(z);(a=!(!a||0===parseInt(a[1],10)))||
24
- alert(d.lang.common.invalidHeight);return a},setup:C,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("height",CKEDITOR.tools.cssLength(c)):b.removeStyle("height"),b.removeAttribute("height")):4==a?c.match(m)?b.setStyle("height",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("height",c.$.height+"px")):8==a&&(b.removeAttribute("height"),b.removeStyle("height"))}}]},{id:"ratioLock",
25
- type:"html",className:"cke_dialog_image_ratiolock",style:"margin-top:30px;width:40px;height:40px;",onLoad:function(){var a=CKEDITOR.document.getById(y),b=CKEDITOR.document.getById(t);a&&(a.on("click",function(a){B(this);a.data&&a.data.preventDefault()},this.getDialog()),a.on("mouseover",function(){this.addClass("cke_btn_over")},a),a.on("mouseout",function(){this.removeClass("cke_btn_over")},a));b&&(b.on("click",function(a){n(this);var b=this.originalElement,d=this.getValueOf("info","txtWidth");"true"==
26
- b.getCustomData("isReady")&&d&&(b=b.$.height/b.$.width*d,isNaN(b)||(this.setValueOf("info","txtHeight",Math.round(b)),e(this)));a.data&&a.data.preventDefault()},this.getDialog()),b.on("mouseover",function(){this.addClass("cke_btn_over")},b),b.on("mouseout",function(){this.removeClass("cke_btn_over")},b))},html:'\x3cdiv\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.lockRatio+'" class\x3d"cke_btn_locked" id\x3d"'+t+'" role\x3d"checkbox"\x3e\x3cspan class\x3d"cke_icon"\x3e\x3c/span\x3e\x3cspan class\x3d"cke_label"\x3e'+
27
- d.lang.image.lockRatio+'\x3c/span\x3e\x3c/a\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.resetSize+'" class\x3d"cke_btn_reset" id\x3d"'+y+'" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3e'+d.lang.image.resetSize+"\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e"}]},{type:"vbox",padding:1,children:[{type:"text",id:"txtBorder",requiredContent:"img{border-width}",width:"60px",label:d.lang.image.border,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,
28
- "advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateBorder),setup:function(a,b){if(1==a){var c;c=(c=(c=b.getStyle("border-width"))&&c.match(/^(\d+px)(?: \1 \1 \1)?$/))&&parseInt(c[1],10);isNaN(parseInt(c,10))&&(c=b.getAttribute("border"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&b.removeStyle("border"):(b.setStyle("border-width",CKEDITOR.tools.cssLength(c)),b.setStyle("border-style",
29
- "solid")),1==a&&b.removeAttribute("border")):8==a&&(b.removeAttribute("border"),b.removeStyle("border-width"),b.removeStyle("border-style"),b.removeStyle("border-color"))}},{type:"text",id:"txtHSpace",requiredContent:"img{margin-left,margin-right}",width:"60px",label:d.lang.image.hSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateHSpace),setup:function(a,b){if(1==a){var c,
30
- d;c=b.getStyle("margin-left");d=b.getStyle("margin-right");c=c&&c.match(r);d=d&&d.match(r);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("hspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-left"),b.removeStyle("margin-right")):(b.setStyle("margin-left",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-right",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("hspace")):
31
- 8==a&&(b.removeAttribute("hspace"),b.removeStyle("margin-left"),b.removeStyle("margin-right"))}},{type:"text",id:"txtVSpace",requiredContent:"img{margin-top,margin-bottom}",width:"60px",label:d.lang.image.vSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateVSpace),setup:function(a,b){if(1==a){var c,d;c=b.getStyle("margin-top");d=b.getStyle("margin-bottom");c=c&&c.match(r);
32
- d=d&&d.match(r);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("vspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-top"),b.removeStyle("margin-bottom")):(b.setStyle("margin-top",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-bottom",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("vspace")):8==a&&(b.removeAttribute("vspace"),b.removeStyle("margin-top"),b.removeStyle("margin-bottom"))}},
33
- {id:"cmbAlign",requiredContent:"img{float}",type:"select",widths:["35%","65%"],style:"width:90px",label:d.lang.common.align,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.alignLeft,"left"],[d.lang.common.alignRight,"right"]],onChange:function(){e(this.getDialog());k.call(this,"advanced:txtdlgGenStyle")},setup:function(a,b){if(1==a){var c=b.getStyle("float");switch(c){case "inherit":case "none":c=""}!c&&(c=(b.getAttribute("align")||"").toLowerCase());this.setValue(c)}},commit:function(a,
34
- b){var c=this.getValue();if(1==a||4==a){if(c?b.setStyle("float",c):b.removeStyle("float"),1==a)switch(c=(b.getAttribute("align")||"").toLowerCase(),c){case "left":case "right":b.removeAttribute("align")}}else 8==a&&b.removeStyle("float")}}]}]},{type:"vbox",height:"250px",children:[{type:"html",id:"htmlPreview",style:"width:95%;",html:"\x3cdiv\x3e"+CKEDITOR.tools.htmlEncode(d.lang.common.preview)+'\x3cbr\x3e\x3cdiv id\x3d"'+p+'" class\x3d"ImagePreviewLoader" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"ImagePreviewBox"\x3e\x3ctable\x3e\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"javascript:void(0)" target\x3d"_blank" onclick\x3d"return false;" id\x3d"'+
35
- E+'"\x3e\x3cimg id\x3d"'+D+'" alt\x3d"" /\x3e\x3c/a\x3e'+(d.config.image_previewText||"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.")+
36
- "\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/div\x3e"}]}]}]},{id:"Link",requiredContent:"a[href]",label:d.lang.image.linkTab,padding:0,elements:[{id:"txtUrl",type:"text",label:d.lang.common.url,style:"width: 100%","default":"",setup:function(a,b){if(2==a){var c=b.data("cke-saved-href");c||(c=b.getAttribute("href"));this.setValue(c)}},commit:function(a,b){if(2==a&&(this.getValue()||this.isChanged())){var c=this.getValue();b.data("cke-saved-href",c);b.setAttribute("href",c);this.getValue()||
37
- !d.config.image_removeLinkByEmptyURL?this.getDialog().addLink=!0:this.getDialog().addLink=!1}}},{type:"button",id:"browse",className:"cke_dialog_image_browse",filebrowser:{action:"Browse",target:"Link:txtUrl",url:d.config.filebrowserImageBrowseLinkUrl},style:"float:right",hidden:!0,label:d.lang.common.browseServer},{id:"cmbTarget",type:"select",requiredContent:"a[target]",label:d.lang.common.target,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.targetNew,"_blank"],[d.lang.common.targetTop,
38
- "_top"],[d.lang.common.targetSelf,"_self"],[d.lang.common.targetParent,"_parent"]],setup:function(a,b){2==a&&this.setValue(b.getAttribute("target")||"")},commit:function(a,b){2==a&&(this.getValue()||this.isChanged())&&b.setAttribute("target",this.getValue())}}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:d.lang.image.upload,elements:[{type:"file",id:"upload",label:d.lang.image.btnUpload,style:"height:40px",size:38},{type:"fileButton",id:"uploadButton",filebrowser:"info:txtUrl",label:d.lang.image.btnUpload,
39
- "for":["Upload","upload"]}]},{id:"advanced",label:d.lang.common.advancedTab,elements:[{type:"hbox",widths:["50%","25%","25%"],children:[{type:"text",id:"linkId",requiredContent:"img[id]",label:d.lang.common.id,setup:function(a,b){1==a&&this.setValue(b.getAttribute("id"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("id",this.getValue())}},{id:"cmbLangDir",type:"select",requiredContent:"img[dir]",style:"width : 100px;",label:d.lang.common.langDir,"default":"",items:[[d.lang.common.notSet,
40
- ""],[d.lang.common.langDirLtr,"ltr"],[d.lang.common.langDirRtl,"rtl"]],setup:function(a,b){1==a&&this.setValue(b.getAttribute("dir"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("dir",this.getValue())}},{type:"text",id:"txtLangCode",requiredContent:"img[lang]",label:d.lang.common.langCode,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("lang"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("lang",this.getValue())}}]},
41
- {type:"text",id:"txtGenLongDescr",requiredContent:"img[longdesc]",label:d.lang.common.longDescr,setup:function(a,b){1==a&&this.setValue(b.getAttribute("longDesc"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("longDesc",this.getValue())}},{type:"hbox",widths:["50%","50%"],children:[{type:"text",id:"txtGenClass",requiredContent:"img(cke-xyz)",label:d.lang.common.cssClass,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("class"))},commit:function(a,
42
- b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("class",this.getValue())}},{type:"text",id:"txtGenTitle",requiredContent:"img[title]",label:d.lang.common.advisoryTitle,"default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("title"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("title",this.getValue()):4==a?b.setAttribute("title",this.getValue()):8==a&&b.removeAttribute("title")}}]},{type:"text",id:"txtdlgGenStyle",
43
- requiredContent:"img{cke-xyz}",label:d.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(d.lang.common.invalidInlineStyle),"default":"",setup:function(a,b){if(1==a){var c=b.getAttribute("style");!c&&b.$.style.cssText&&(c=b.$.style.cssText);this.setValue(c);var d=b.$.style.height,c=b.$.style.width,d=(d?d:"").match(m),c=(c?c:"").match(m);this.attributesInStyle={height:!!d,width:!!c}}},onChange:function(){k.call(this,"info:cmbFloat info:cmbAlign info:txtVSpace info:txtHSpace info:txtBorder info:txtWidth info:txtHeight".split(" "));
44
- e(this)},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("style",this.getValue())}}]}]}};CKEDITOR.dialog.add("image",function(d){return v(d,"image")});CKEDITOR.dialog.add("imagebutton",function(d){return v(d,"imagebutton")})})();
1
+ /**
2
+ * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ ( function() {
7
+ var imageDialog = function( editor, dialogType ) {
8
+ // Load image preview.
9
+ var IMAGE = 1,
10
+ LINK = 2,
11
+ PREVIEW = 4,
12
+ CLEANUP = 8,
13
+ regexGetSize = /^\s*(\d+)((px)|\%)?\s*$/i,
14
+ regexGetSizeOrEmpty = /(^\s*(\d+)((px)|\%)?\s*$)|^$/i,
15
+ pxLengthRegex = /^\d+px$/;
16
+
17
+ var onSizeChange = function() {
18
+ var value = this.getValue(),
19
+ // This = input element.
20
+ dialog = this.getDialog(),
21
+ aMatch = value.match( regexGetSize ); // Check value
22
+ if ( aMatch ) {
23
+ if ( aMatch[ 2 ] == '%' ) // % is allowed - > unlock ratio.
24
+ switchLockRatio( dialog, false ); // Unlock.
25
+ value = aMatch[ 1 ];
26
+ }
27
+
28
+ // Only if ratio is locked
29
+ if ( dialog.lockRatio ) {
30
+ var oImageOriginal = dialog.originalElement;
31
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
32
+ if ( this.id == 'txtHeight' ) {
33
+ if ( value && value != '0' )
34
+ value = Math.round( oImageOriginal.$.width * ( value / oImageOriginal.$.height ) );
35
+ if ( !isNaN( value ) )
36
+ dialog.setValueOf( 'info', 'txtWidth', value );
37
+ }
38
+ // this.id = txtWidth.
39
+ else {
40
+ if ( value && value != '0' )
41
+ value = Math.round( oImageOriginal.$.height * ( value / oImageOriginal.$.width ) );
42
+ if ( !isNaN( value ) )
43
+ dialog.setValueOf( 'info', 'txtHeight', value );
44
+ }
45
+ }
46
+ }
47
+ updatePreview( dialog );
48
+ };
49
+
50
+ var updatePreview = function( dialog ) {
51
+ //Don't load before onShow.
52
+ if ( !dialog.originalElement || !dialog.preview )
53
+ return 1;
54
+
55
+ // Read attributes and update imagePreview;
56
+ dialog.commitContent( PREVIEW, dialog.preview );
57
+ return 0;
58
+ };
59
+
60
+ // Custom commit dialog logic, where we're intended to give inline style
61
+ // field (txtdlgGenStyle) higher priority to avoid overwriting styles contribute
62
+ // by other fields.
63
+ function commitContent() {
64
+ var args = arguments;
65
+ var inlineStyleField = this.getContentElement( 'advanced', 'txtdlgGenStyle' );
66
+ inlineStyleField && inlineStyleField.commit.apply( inlineStyleField, args );
67
+
68
+ this.foreach( function( widget ) {
69
+ if ( widget.commit && widget.id != 'txtdlgGenStyle' )
70
+ widget.commit.apply( widget, args );
71
+ } );
72
+ }
73
+
74
+ // Avoid recursions.
75
+ var incommit;
76
+
77
+ // Synchronous field values to other impacted fields is required, e.g. border
78
+ // size change should alter inline-style text as well.
79
+ function commitInternally( targetFields ) {
80
+ if ( incommit )
81
+ return;
82
+
83
+ incommit = 1;
84
+
85
+ var dialog = this.getDialog(),
86
+ element = dialog.imageElement;
87
+ if ( element ) {
88
+ // Commit this field and broadcast to target fields.
89
+ this.commit( IMAGE, element );
90
+
91
+ targetFields = [].concat( targetFields );
92
+ var length = targetFields.length,
93
+ field;
94
+ for ( var i = 0; i < length; i++ ) {
95
+ field = dialog.getContentElement.apply( dialog, targetFields[ i ].split( ':' ) );
96
+ // May cause recursion.
97
+ field && field.setup( IMAGE, element );
98
+ }
99
+ }
100
+
101
+ incommit = 0;
102
+ }
103
+
104
+ var switchLockRatio = function( dialog, value ) {
105
+ if ( !dialog.getContentElement( 'info', 'ratioLock' ) )
106
+ return null;
107
+
108
+ var oImageOriginal = dialog.originalElement;
109
+
110
+ // Dialog may already closed. (https://dev.ckeditor.com/ticket/5505)
111
+ if ( !oImageOriginal )
112
+ return null;
113
+
114
+ // Check image ratio and original image ratio, but respecting user's preference.
115
+ if ( value == 'check' ) {
116
+ if ( !dialog.userlockRatio && oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
117
+ var width = dialog.getValueOf( 'info', 'txtWidth' ),
118
+ height = dialog.getValueOf( 'info', 'txtHeight' ),
119
+ originalRatio = oImageOriginal.$.width / oImageOriginal.$.height,
120
+ thisRatio = width / height;
121
+
122
+ dialog.lockRatio = false; // Default: unlock ratio
123
+
124
+ if ( !width && !height ) {
125
+ dialog.lockRatio = true;
126
+ } else {
127
+ // Round ratio to two decimal places so ratio locking will be less precise (#2254).
128
+ var ratioComparison = Math.round( ( originalRatio / thisRatio ) * 100 ) / 100;
129
+
130
+ if ( ratioComparison == 1 ) {
131
+ dialog.lockRatio = true;
132
+ }
133
+ }
134
+ }
135
+ } else if ( value !== undefined ) {
136
+ dialog.lockRatio = value;
137
+ } else {
138
+ dialog.userlockRatio = 1;
139
+ dialog.lockRatio = !dialog.lockRatio;
140
+ }
141
+
142
+ var ratioButton = CKEDITOR.document.getById( btnLockSizesId );
143
+ if ( dialog.lockRatio )
144
+ ratioButton.removeClass( 'cke_btn_unlocked' );
145
+ else
146
+ ratioButton.addClass( 'cke_btn_unlocked' );
147
+
148
+ ratioButton.setAttribute( 'aria-checked', dialog.lockRatio );
149
+
150
+ // Ratio button hc presentation - WHITE SQUARE / BLACK SQUARE
151
+ if ( CKEDITOR.env.hc ) {
152
+ var icon = ratioButton.getChild( 0 );
153
+ icon.setHtml( dialog.lockRatio ? CKEDITOR.env.ie ? '\u25A0' : '\u25A3' : CKEDITOR.env.ie ? '\u25A1' : '\u25A2' );
154
+ }
155
+
156
+ return dialog.lockRatio;
157
+ };
158
+
159
+ var resetSize = function( dialog, emptyValues ) {
160
+ var oImageOriginal = dialog.originalElement,
161
+ ready = oImageOriginal.getCustomData( 'isReady' ) == 'true';
162
+
163
+ if ( ready ) {
164
+ var widthField = dialog.getContentElement( 'info', 'txtWidth' ),
165
+ heightField = dialog.getContentElement( 'info', 'txtHeight' ),
166
+ widthValue, heightValue;
167
+
168
+ if ( emptyValues ) {
169
+ widthValue = 0;
170
+ heightValue = 0;
171
+ } else {
172
+ widthValue = oImageOriginal.$.width;
173
+ heightValue = oImageOriginal.$.height;
174
+ }
175
+
176
+ widthField && widthField.setValue( widthValue );
177
+ heightField && heightField.setValue( heightValue );
178
+ }
179
+ updatePreview( dialog );
180
+ };
181
+
182
+ var setupDimension = function( type, element ) {
183
+ if ( type != IMAGE )
184
+ return;
185
+
186
+ function checkDimension( size, defaultValue ) {
187
+ var aMatch = size.match( regexGetSize );
188
+ if ( aMatch ) {
189
+ // % is allowed.
190
+ if ( aMatch[ 2 ] == '%' ) {
191
+ aMatch[ 1 ] += '%';
192
+ switchLockRatio( dialog, false ); // Unlock ratio
193
+ }
194
+ return aMatch[ 1 ];
195
+ }
196
+ return defaultValue;
197
+ }
198
+
199
+ var dialog = this.getDialog(),
200
+ value = '',
201
+ dimension = this.id == 'txtWidth' ? 'width' : 'height',
202
+ size = element.getAttribute( dimension );
203
+
204
+ if ( size )
205
+ value = checkDimension( size, value );
206
+ value = checkDimension( element.getStyle( dimension ), value );
207
+
208
+ this.setValue( value );
209
+ };
210
+
211
+ var previewPreloader;
212
+
213
+ var onImgLoadEvent = function() {
214
+ // Image is ready.
215
+ var original = this.originalElement,
216
+ loader = CKEDITOR.document.getById( imagePreviewLoaderId );
217
+
218
+ original.setCustomData( 'isReady', 'true' );
219
+ original.removeListener( 'load', onImgLoadEvent );
220
+ original.removeListener( 'error', onImgLoadErrorEvent );
221
+ original.removeListener( 'abort', onImgLoadErrorEvent );
222
+
223
+ // Hide loader.
224
+ if ( loader )
225
+ loader.setStyle( 'display', 'none' );
226
+
227
+ // New image -> new dimensions
228
+ if ( !this.dontResetSize ) {
229
+ resetSize( this, editor.config.image_prefillDimensions === false );
230
+ }
231
+
232
+ if ( this.firstLoad ) {
233
+ CKEDITOR.tools.setTimeout( function() {
234
+ switchLockRatio( this, 'check' );
235
+ }, 0, this );
236
+ }
237
+
238
+ this.firstLoad = false;
239
+ this.dontResetSize = false;
240
+
241
+ // Possible fix for https://dev.ckeditor.com/ticket/12818.
242
+ updatePreview( this );
243
+ };
244
+
245
+ var onImgLoadErrorEvent = function() {
246
+ // Error. Image is not loaded.
247
+ var original = this.originalElement,
248
+ loader = CKEDITOR.document.getById( imagePreviewLoaderId );
249
+
250
+ original.removeListener( 'load', onImgLoadEvent );
251
+ original.removeListener( 'error', onImgLoadErrorEvent );
252
+ original.removeListener( 'abort', onImgLoadErrorEvent );
253
+
254
+ // Set Error image.
255
+ var noimage = CKEDITOR.getUrl( CKEDITOR.plugins.get( 'image' ).path + 'images/noimage.png' );
256
+
257
+ if ( this.preview )
258
+ this.preview.setAttribute( 'src', noimage );
259
+
260
+ // Hide loader.
261
+ if ( loader )
262
+ loader.setStyle( 'display', 'none' );
263
+
264
+ switchLockRatio( this, false ); // Unlock.
265
+ };
266
+
267
+ var numbering = function( id ) {
268
+ return CKEDITOR.tools.getNextId() + '_' + id;
269
+ },
270
+ btnLockSizesId = numbering( 'btnLockSizes' ),
271
+ btnResetSizeId = numbering( 'btnResetSize' ),
272
+ imagePreviewLoaderId = numbering( 'ImagePreviewLoader' ),
273
+ previewLinkId = numbering( 'previewLink' ),
274
+ previewImageId = numbering( 'previewImage' );
275
+
276
+ return {
277
+ title: editor.lang.image[ dialogType == 'image' ? 'title' : 'titleButton' ],
278
+ minWidth: ( CKEDITOR.skinName || editor.config.skin ) == 'moono-lisa' ? 500 : 420,
279
+ minHeight: 360,
280
+ getModel: function( editor ) {
281
+ var element = editor.getSelection().getSelectedElement(),
282
+ isImage = element && element.getName() === 'img',
283
+ isImageInput = element && element.getName() === 'input' &&
284
+ element.getAttribute( 'type' ) === 'image';
285
+
286
+ if ( isImage ||isImageInput ) {
287
+ return element;
288
+ }
289
+
290
+ return null;
291
+ },
292
+ onShow: function() {
293
+ this.imageElement = false;
294
+ this.linkElement = false;
295
+
296
+ // Default: create a new element.
297
+ this.imageEditMode = false;
298
+ this.linkEditMode = false;
299
+
300
+ this.lockRatio = true;
301
+ this.userlockRatio = 0;
302
+ this.dontResetSize = false;
303
+ this.firstLoad = true;
304
+ this.addLink = false;
305
+
306
+ var editor = this.getParentEditor(),
307
+ sel = editor.getSelection(),
308
+ element = sel && sel.getSelectedElement(),
309
+ link = element && editor.elementPath( element ).contains( 'a', 1 ),
310
+ loader = CKEDITOR.document.getById( imagePreviewLoaderId );
311
+
312
+ // Hide loader.
313
+ if ( loader )
314
+ loader.setStyle( 'display', 'none' );
315
+
316
+ // Create the preview before setup the dialog contents.
317
+ previewPreloader = new CKEDITOR.dom.element( 'img', editor.document );
318
+ this.preview = CKEDITOR.document.getById( previewImageId );
319
+
320
+ // Copy of the image
321
+ this.originalElement = editor.document.createElement( 'img' );
322
+ this.originalElement.setAttribute( 'alt', '' );
323
+ this.originalElement.setCustomData( 'isReady', 'false' );
324
+
325
+ if ( link ) {
326
+ this.linkElement = link;
327
+ this.linkEditMode = true;
328
+
329
+ // If there is an existing link, by default keep it (true).
330
+ // It will be removed if certain conditions are met and Link tab is enabled. (https://dev.ckeditor.com/ticket/13351)
331
+ this.addLink = true;
332
+
333
+ // Look for Image element.
334
+ var linkChildren = link.getChildren();
335
+ if ( linkChildren.count() == 1 ) {
336
+ var childTag = linkChildren.getItem( 0 );
337
+
338
+ if ( childTag.type == CKEDITOR.NODE_ELEMENT ) {
339
+ if ( childTag.is( 'img' ) || childTag.is( 'input' ) ) {
340
+ this.imageElement = linkChildren.getItem( 0 );
341
+ if ( this.imageElement.is( 'img' ) )
342
+ this.imageEditMode = 'img';
343
+ else if ( this.imageElement.is( 'input' ) )
344
+ this.imageEditMode = 'input';
345
+ }
346
+ }
347
+ }
348
+ // Fill out all fields.
349
+ if ( dialogType == 'image' )
350
+ this.setupContent( LINK, link );
351
+ }
352
+
353
+ // Edit given image element instead the one from selection.
354
+ if ( this.customImageElement ) {
355
+ this.imageEditMode = 'img';
356
+ this.imageElement = this.customImageElement;
357
+ delete this.customImageElement;
358
+ }
359
+ else if ( element && element.getName() == 'img' && !element.data( 'cke-realelement' ) ||
360
+ element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'image' ) {
361
+ this.imageEditMode = element.getName();
362
+ this.imageElement = element;
363
+ }
364
+
365
+ if ( this.imageEditMode ) {
366
+ // Use the original element as a buffer from since we don't want
367
+ // temporary changes to be committed, e.g. if the dialog is canceled.
368
+ this.cleanImageElement = this.imageElement;
369
+ this.imageElement = this.cleanImageElement.clone( true, true );
370
+
371
+ // Fill out all fields.
372
+ this.setupContent( IMAGE, this.imageElement );
373
+ }
374
+
375
+ // Refresh LockRatio button
376
+ switchLockRatio( this, true );
377
+
378
+ // Dont show preview if no URL given.
379
+ if ( !CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtUrl' ) ) ) {
380
+ this.preview.removeAttribute( 'src' );
381
+ this.preview.setStyle( 'display', 'none' );
382
+ }
383
+ },
384
+ onOk: function() {
385
+ // Edit existing Image.
386
+ if ( this.imageEditMode ) {
387
+ var imgTagName = this.imageEditMode;
388
+
389
+ // Image dialog and Input element.
390
+ if ( dialogType == 'image' && imgTagName == 'input' && confirm( editor.lang.image.button2Img ) ) { // jshint ignore:line
391
+ // Replace INPUT-> IMG
392
+ imgTagName = 'img';
393
+ this.imageElement = editor.document.createElement( 'img' );
394
+ this.imageElement.setAttribute( 'alt', '' );
395
+ editor.insertElement( this.imageElement );
396
+ }
397
+ // ImageButton dialog and Image element.
398
+ else if ( dialogType != 'image' && imgTagName == 'img' && confirm( editor.lang.image.img2Button ) ) { // jshint ignore:line
399
+ // Replace IMG -> INPUT
400
+ imgTagName = 'input';
401
+ this.imageElement = editor.document.createElement( 'input' );
402
+ this.imageElement.setAttributes( {
403
+ type: 'image',
404
+ alt: ''
405
+ } );
406
+ editor.insertElement( this.imageElement );
407
+ } else {
408
+ // Restore the original element before all commits.
409
+ this.imageElement = this.cleanImageElement;
410
+ delete this.cleanImageElement;
411
+ }
412
+ }
413
+ // Create a new image.
414
+ else {
415
+ // Image dialog -> create IMG element.
416
+ if ( dialogType == 'image' )
417
+ this.imageElement = editor.document.createElement( 'img' );
418
+ else {
419
+ this.imageElement = editor.document.createElement( 'input' );
420
+ this.imageElement.setAttribute( 'type', 'image' );
421
+ }
422
+ this.imageElement.setAttribute( 'alt', '' );
423
+ }
424
+
425
+ // Create a new link.
426
+ if ( !this.linkEditMode )
427
+ this.linkElement = editor.document.createElement( 'a' );
428
+
429
+ // Set attributes.
430
+ this.commitContent( IMAGE, this.imageElement );
431
+ this.commitContent( LINK, this.linkElement );
432
+
433
+ // Remove empty style attribute.
434
+ if ( !this.imageElement.getAttribute( 'style' ) )
435
+ this.imageElement.removeAttribute( 'style' );
436
+
437
+ // Insert a new Image.
438
+ if ( !this.imageEditMode ) {
439
+ if ( this.addLink ) {
440
+ if ( !this.linkEditMode ) {
441
+ // Insert a new link.
442
+ editor.insertElement( this.linkElement );
443
+ this.linkElement.append( this.imageElement, false );
444
+ } else {
445
+ // We already have a link in editor.
446
+ if ( this.linkElement.equals( editor.getSelection().getSelectedElement() ) ) {
447
+ // If the link is selected outside, replace it's content rather than the link itself. ([<a>foo</a>])
448
+ this.linkElement.setHtml( '' );
449
+ this.linkElement.append( this.imageElement, false );
450
+ } else {
451
+ // Only inside of the link is selected, so replace it with image. (<a>[foo]</a>, <a>[f]oo</a>)
452
+ editor.insertElement( this.imageElement );
453
+ }
454
+ }
455
+ } else {
456
+ editor.insertElement( this.imageElement );
457
+ }
458
+ }
459
+ // Image already exists.
460
+ else {
461
+ // Add a new link element.
462
+ if ( !this.linkEditMode && this.addLink ) {
463
+ editor.insertElement( this.linkElement );
464
+ this.imageElement.appendTo( this.linkElement );
465
+ }
466
+ // Remove Link, Image exists.
467
+ else if ( this.linkEditMode && !this.addLink ) {
468
+ editor.getSelection().selectElement( this.linkElement );
469
+ editor.insertElement( this.imageElement );
470
+ }
471
+ }
472
+ },
473
+ onLoad: function() {
474
+ if ( dialogType != 'image' )
475
+ this.hidePage( 'Link' ); //Hide Link tab.
476
+ var doc = this._.element.getDocument();
477
+
478
+ if ( this.getContentElement( 'info', 'ratioLock' ) ) {
479
+ this.addFocusable( doc.getById( btnResetSizeId ), 5 );
480
+ this.addFocusable( doc.getById( btnLockSizesId ), 5 );
481
+ }
482
+
483
+ this.commitContent = commitContent;
484
+ },
485
+ onHide: function() {
486
+ if ( this.preview )
487
+ this.commitContent( CLEANUP, this.preview );
488
+
489
+ if ( this.originalElement ) {
490
+ this.originalElement.removeListener( 'load', onImgLoadEvent );
491
+ this.originalElement.removeListener( 'error', onImgLoadErrorEvent );
492
+ this.originalElement.removeListener( 'abort', onImgLoadErrorEvent );
493
+ this.originalElement.remove();
494
+ this.originalElement = false; // Dialog is closed.
495
+ }
496
+
497
+ delete this.imageElement;
498
+ },
499
+ contents: [ {
500
+ id: 'info',
501
+ label: editor.lang.image.infoTab,
502
+ accessKey: 'I',
503
+ elements: [ {
504
+ type: 'vbox',
505
+ padding: 0,
506
+ children: [ {
507
+ type: 'hbox',
508
+ widths: [ '280px', '110px' ],
509
+ align: 'right',
510
+ className: 'cke_dialog_image_url',
511
+ children: [ {
512
+ id: 'txtUrl',
513
+ type: 'text',
514
+ label: editor.lang.common.url,
515
+ required: true,
516
+ onChange: function() {
517
+ var dialog = this.getDialog(),
518
+ newUrl = this.getValue();
519
+
520
+ // Update original image.
521
+ // Prevent from load before onShow.
522
+ if ( newUrl.length > 0 ) {
523
+ dialog = this.getDialog();
524
+ var original = dialog.originalElement;
525
+
526
+ if ( dialog.preview ) {
527
+ dialog.preview.removeStyle( 'display' );
528
+ }
529
+
530
+ original.setCustomData( 'isReady', 'false' );
531
+ // Show loader.
532
+ var loader = CKEDITOR.document.getById( imagePreviewLoaderId );
533
+ if ( loader )
534
+ loader.setStyle( 'display', '' );
535
+
536
+ original.on( 'load', onImgLoadEvent, dialog );
537
+ original.on( 'error', onImgLoadErrorEvent, dialog );
538
+ original.on( 'abort', onImgLoadErrorEvent, dialog );
539
+ original.setAttribute( 'src', newUrl );
540
+
541
+ if ( dialog.preview ) {
542
+ // Query the preloader to figure out the url impacted by based href.
543
+ previewPreloader.setAttribute( 'src', newUrl );
544
+ dialog.preview.setAttribute( 'src', previewPreloader.$.src );
545
+ updatePreview( dialog );
546
+ }
547
+ }
548
+ // Dont show preview if no URL given.
549
+ else if ( dialog.preview ) {
550
+ dialog.preview.removeAttribute( 'src' );
551
+ dialog.preview.setStyle( 'display', 'none' );
552
+ }
553
+ },
554
+ setup: function( type, element ) {
555
+ if ( type == IMAGE ) {
556
+ var url = element.data( 'cke-saved-src' ) || element.getAttribute( 'src' );
557
+ var field = this;
558
+
559
+ this.getDialog().dontResetSize = true;
560
+
561
+ field.setValue( url ); // And call this.onChange()
562
+ // Manually set the initial value.(https://dev.ckeditor.com/ticket/4191)
563
+ field.setInitValue();
564
+ }
565
+ },
566
+ commit: function( type, element ) {
567
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) ) {
568
+ element.data( 'cke-saved-src', this.getValue() );
569
+ element.setAttribute( 'src', this.getValue() );
570
+ } else if ( type == CLEANUP ) {
571
+ element.setAttribute( 'src', '' ); // If removeAttribute doesn't work.
572
+ element.removeAttribute( 'src' );
573
+ }
574
+ },
575
+ validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.image.urlMissing )
576
+ },
577
+ {
578
+ type: 'button',
579
+ id: 'browse',
580
+ // v-align with the 'txtUrl' field.
581
+ // TODO: We need something better than a fixed size here.
582
+ style: 'display:inline-block;margin-top:14px;',
583
+ align: 'center',
584
+ label: editor.lang.common.browseServer,
585
+ hidden: true,
586
+ filebrowser: 'info:txtUrl'
587
+ } ]
588
+ } ]
589
+ },
590
+ {
591
+ id: 'txtAlt',
592
+ type: 'text',
593
+ label: editor.lang.image.alt,
594
+ accessKey: 'T',
595
+ 'default': '',
596
+ onChange: function() {
597
+ updatePreview( this.getDialog() );
598
+ },
599
+ setup: function( type, element ) {
600
+ if ( type == IMAGE )
601
+ this.setValue( element.getAttribute( 'alt' ) );
602
+ },
603
+ commit: function( type, element ) {
604
+ if ( type == IMAGE ) {
605
+ if ( this.getValue() || this.isChanged() )
606
+ element.setAttribute( 'alt', this.getValue() );
607
+ } else if ( type == PREVIEW )
608
+ element.setAttribute( 'alt', this.getValue() );
609
+ else if ( type == CLEANUP ) {
610
+ element.removeAttribute( 'alt' );
611
+ }
612
+
613
+ }
614
+ },
615
+ {
616
+ type: 'hbox',
617
+ children: [ {
618
+ id: 'basic',
619
+ type: 'vbox',
620
+ children: [ {
621
+ type: 'hbox',
622
+ requiredContent: 'img{width,height}',
623
+ widths: [ '50%', '50%' ],
624
+ children: [ {
625
+ type: 'vbox',
626
+ padding: 1,
627
+ children: [ {
628
+ type: 'text',
629
+ width: '45px',
630
+ id: 'txtWidth',
631
+ label: editor.lang.common.width,
632
+ onKeyUp: onSizeChange,
633
+ onChange: function() {
634
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
635
+ },
636
+ validate: function() {
637
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty ),
638
+ isValid = !!( aMatch && parseInt( aMatch[ 1 ], 10 ) !== 0 );
639
+ if ( !isValid )
640
+ alert( editor.lang.common.invalidLength.replace( '%1', editor.lang.common.width ).replace( '%2', 'px, %' ) ); // jshint ignore:line
641
+ return isValid;
642
+ },
643
+ setup: setupDimension,
644
+ commit: function( type, element ) {
645
+ var value = this.getValue();
646
+ if ( type == IMAGE ) {
647
+ if ( value && editor.activeFilter.check( 'img{width,height}' ) )
648
+ element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
649
+ else
650
+ element.removeStyle( 'width' );
651
+
652
+ element.removeAttribute( 'width' );
653
+ } else if ( type == PREVIEW ) {
654
+ var aMatch = value.match( regexGetSize );
655
+ if ( !aMatch ) {
656
+ var oImageOriginal = this.getDialog().originalElement;
657
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
658
+ element.setStyle( 'width', oImageOriginal.$.width + 'px' );
659
+ } else {
660
+ element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
661
+ }
662
+ } else if ( type == CLEANUP ) {
663
+ element.removeAttribute( 'width' );
664
+ element.removeStyle( 'width' );
665
+ }
666
+ }
667
+ },
668
+ {
669
+ type: 'text',
670
+ id: 'txtHeight',
671
+ width: '45px',
672
+ label: editor.lang.common.height,
673
+ onKeyUp: onSizeChange,
674
+ onChange: function() {
675
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
676
+ },
677
+ validate: function() {
678
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty ),
679
+ isValid = !!( aMatch && parseInt( aMatch[ 1 ], 10 ) !== 0 );
680
+ if ( !isValid )
681
+ alert( editor.lang.common.invalidLength.replace( '%1', editor.lang.common.height ).replace( '%2', 'px, %' ) ); // jshint ignore:line
682
+ return isValid;
683
+ },
684
+ setup: setupDimension,
685
+ commit: function( type, element ) {
686
+ var value = this.getValue();
687
+ if ( type == IMAGE ) {
688
+ if ( value && editor.activeFilter.check( 'img{width,height}' ) )
689
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
690
+ else
691
+ element.removeStyle( 'height' );
692
+
693
+ element.removeAttribute( 'height' );
694
+ } else if ( type == PREVIEW ) {
695
+ var aMatch = value.match( regexGetSize );
696
+ if ( !aMatch ) {
697
+ var oImageOriginal = this.getDialog().originalElement;
698
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
699
+ element.setStyle( 'height', oImageOriginal.$.height + 'px' );
700
+ } else {
701
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
702
+ }
703
+ } else if ( type == CLEANUP ) {
704
+ element.removeAttribute( 'height' );
705
+ element.removeStyle( 'height' );
706
+ }
707
+ }
708
+ } ]
709
+ },
710
+ {
711
+ id: 'ratioLock',
712
+ type: 'html',
713
+ className: 'cke_dialog_image_ratiolock',
714
+ style: 'margin-top:30px;width:40px;height:40px;',
715
+ onLoad: function() {
716
+ // Activate Reset button
717
+ var resetButton = CKEDITOR.document.getById( btnResetSizeId ),
718
+ ratioButton = CKEDITOR.document.getById( btnLockSizesId );
719
+ if ( resetButton ) {
720
+ resetButton.on( 'click', function( evt ) {
721
+ resetSize( this );
722
+ evt.data && evt.data.preventDefault();
723
+ }, this.getDialog() );
724
+ resetButton.on( 'mouseover', function() {
725
+ this.addClass( 'cke_btn_over' );
726
+ }, resetButton );
727
+ resetButton.on( 'mouseout', function() {
728
+ this.removeClass( 'cke_btn_over' );
729
+ }, resetButton );
730
+ }
731
+ // Activate (Un)LockRatio button
732
+ if ( ratioButton ) {
733
+ ratioButton.on( 'click', function( evt ) {
734
+ switchLockRatio( this );
735
+
736
+ var oImageOriginal = this.originalElement,
737
+ width = this.getValueOf( 'info', 'txtWidth' );
738
+
739
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' && width ) {
740
+ var height = oImageOriginal.$.height / oImageOriginal.$.width * width;
741
+ if ( !isNaN( height ) ) {
742
+ this.setValueOf( 'info', 'txtHeight', Math.round( height ) );
743
+ updatePreview( this );
744
+ }
745
+ }
746
+ evt.data && evt.data.preventDefault();
747
+ }, this.getDialog() );
748
+ ratioButton.on( 'mouseover', function() {
749
+ this.addClass( 'cke_btn_over' );
750
+ }, ratioButton );
751
+ ratioButton.on( 'mouseout', function() {
752
+ this.removeClass( 'cke_btn_over' );
753
+ }, ratioButton );
754
+ }
755
+ },
756
+ html: '<div>' +
757
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.lockRatio +
758
+ '" class="cke_btn_locked" id="' + btnLockSizesId + '" role="checkbox"><span class="cke_icon"></span><span class="cke_label">' + editor.lang.image.lockRatio + '</span></a>' +
759
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize +
760
+ '" class="cke_btn_reset" id="' + btnResetSizeId + '" role="button"><span class="cke_label">' + editor.lang.image.resetSize + '</span></a>' +
761
+ '</div>'
762
+ } ]
763
+ },
764
+ {
765
+ type: 'vbox',
766
+ padding: 1,
767
+ children: [ {
768
+ type: 'text',
769
+ id: 'txtBorder',
770
+ requiredContent: 'img{border-width}',
771
+ width: '60px',
772
+ label: editor.lang.image.border,
773
+ 'default': '',
774
+ onKeyUp: function() {
775
+ updatePreview( this.getDialog() );
776
+ },
777
+ onChange: function() {
778
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
779
+ },
780
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateBorder ),
781
+ setup: function( type, element ) {
782
+ if ( type == IMAGE ) {
783
+ var value,
784
+ borderStyle = element.getStyle( 'border-width' );
785
+ borderStyle = borderStyle && borderStyle.match( /^(\d+px)(?: \1 \1 \1)?$/ );
786
+ value = borderStyle && parseInt( borderStyle[ 1 ], 10 );
787
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'border' ) );
788
+ this.setValue( value );
789
+ }
790
+ },
791
+ commit: function( type, element ) {
792
+ var value = parseInt( this.getValue(), 10 );
793
+ if ( type == IMAGE || type == PREVIEW ) {
794
+ if ( !isNaN( value ) ) {
795
+ element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
796
+ element.setStyle( 'border-style', 'solid' );
797
+ } else if ( !value && this.isChanged() ) {
798
+ element.removeStyle( 'border' );
799
+ }
800
+
801
+ if ( type == IMAGE )
802
+ element.removeAttribute( 'border' );
803
+ } else if ( type == CLEANUP ) {
804
+ element.removeAttribute( 'border' );
805
+ element.removeStyle( 'border-width' );
806
+ element.removeStyle( 'border-style' );
807
+ element.removeStyle( 'border-color' );
808
+ }
809
+ }
810
+ },
811
+ {
812
+ type: 'text',
813
+ id: 'txtHSpace',
814
+ requiredContent: 'img{margin-left,margin-right}',
815
+ width: '60px',
816
+ label: editor.lang.image.hSpace,
817
+ 'default': '',
818
+ onKeyUp: function() {
819
+ updatePreview( this.getDialog() );
820
+ },
821
+ onChange: function() {
822
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
823
+ },
824
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateHSpace ),
825
+ setup: function( type, element ) {
826
+ if ( type == IMAGE ) {
827
+ var value, marginLeftPx, marginRightPx,
828
+ marginLeftStyle = element.getStyle( 'margin-left' ),
829
+ marginRightStyle = element.getStyle( 'margin-right' );
830
+
831
+ marginLeftStyle = marginLeftStyle && marginLeftStyle.match( pxLengthRegex );
832
+ marginRightStyle = marginRightStyle && marginRightStyle.match( pxLengthRegex );
833
+ marginLeftPx = parseInt( marginLeftStyle, 10 );
834
+ marginRightPx = parseInt( marginRightStyle, 10 );
835
+
836
+ value = ( marginLeftPx == marginRightPx ) && marginLeftPx;
837
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'hspace' ) );
838
+
839
+ this.setValue( value );
840
+ }
841
+ },
842
+ commit: function( type, element ) {
843
+ var value = parseInt( this.getValue(), 10 );
844
+ if ( type == IMAGE || type == PREVIEW ) {
845
+ if ( !isNaN( value ) ) {
846
+ element.setStyle( 'margin-left', CKEDITOR.tools.cssLength( value ) );
847
+ element.setStyle( 'margin-right', CKEDITOR.tools.cssLength( value ) );
848
+ } else if ( !value && this.isChanged() ) {
849
+ element.removeStyle( 'margin-left' );
850
+ element.removeStyle( 'margin-right' );
851
+ }
852
+
853
+ if ( type == IMAGE )
854
+ element.removeAttribute( 'hspace' );
855
+ } else if ( type == CLEANUP ) {
856
+ element.removeAttribute( 'hspace' );
857
+ element.removeStyle( 'margin-left' );
858
+ element.removeStyle( 'margin-right' );
859
+ }
860
+ }
861
+ },
862
+ {
863
+ type: 'text',
864
+ id: 'txtVSpace',
865
+ requiredContent: 'img{margin-top,margin-bottom}',
866
+ width: '60px',
867
+ label: editor.lang.image.vSpace,
868
+ 'default': '',
869
+ onKeyUp: function() {
870
+ updatePreview( this.getDialog() );
871
+ },
872
+ onChange: function() {
873
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
874
+ },
875
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateVSpace ),
876
+ setup: function( type, element ) {
877
+ if ( type == IMAGE ) {
878
+ var value, marginTopPx, marginBottomPx,
879
+ marginTopStyle = element.getStyle( 'margin-top' ),
880
+ marginBottomStyle = element.getStyle( 'margin-bottom' );
881
+
882
+ marginTopStyle = marginTopStyle && marginTopStyle.match( pxLengthRegex );
883
+ marginBottomStyle = marginBottomStyle && marginBottomStyle.match( pxLengthRegex );
884
+ marginTopPx = parseInt( marginTopStyle, 10 );
885
+ marginBottomPx = parseInt( marginBottomStyle, 10 );
886
+
887
+ value = ( marginTopPx == marginBottomPx ) && marginTopPx;
888
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'vspace' ) );
889
+ this.setValue( value );
890
+ }
891
+ },
892
+ commit: function( type, element ) {
893
+ var value = parseInt( this.getValue(), 10 );
894
+ if ( type == IMAGE || type == PREVIEW ) {
895
+ if ( !isNaN( value ) ) {
896
+ element.setStyle( 'margin-top', CKEDITOR.tools.cssLength( value ) );
897
+ element.setStyle( 'margin-bottom', CKEDITOR.tools.cssLength( value ) );
898
+ } else if ( !value && this.isChanged() ) {
899
+ element.removeStyle( 'margin-top' );
900
+ element.removeStyle( 'margin-bottom' );
901
+ }
902
+
903
+ if ( type == IMAGE )
904
+ element.removeAttribute( 'vspace' );
905
+ } else if ( type == CLEANUP ) {
906
+ element.removeAttribute( 'vspace' );
907
+ element.removeStyle( 'margin-top' );
908
+ element.removeStyle( 'margin-bottom' );
909
+ }
910
+ }
911
+ },
912
+ {
913
+ id: 'cmbAlign',
914
+ requiredContent: 'img{float}',
915
+ type: 'select',
916
+ widths: [ '35%', '65%' ],
917
+ style: 'width:90px',
918
+ label: editor.lang.common.align,
919
+ 'default': '',
920
+ items: [
921
+ [ editor.lang.common.notSet, '' ],
922
+ [ editor.lang.common.left, 'left' ],
923
+ [ editor.lang.common.right, 'right' ]
924
+ // Backward compatible with v2 on setup when specified as attribute value,
925
+ // while these values are no more available as select options.
926
+ // [ editor.lang.image.alignAbsBottom , 'absBottom'],
927
+ // [ editor.lang.image.alignAbsMiddle , 'absMiddle'],
928
+ // [ editor.lang.image.alignBaseline , 'baseline'],
929
+ // [ editor.lang.image.alignTextTop , 'text-top'],
930
+ // [ editor.lang.image.alignBottom , 'bottom'],
931
+ // [ editor.lang.image.alignMiddle , 'middle'],
932
+ // [ editor.lang.image.alignTop , 'top']
933
+ ],
934
+ onChange: function() {
935
+ updatePreview( this.getDialog() );
936
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
937
+ },
938
+ setup: function( type, element ) {
939
+ if ( type == IMAGE ) {
940
+ var value = element.getStyle( 'float' );
941
+ switch ( value ) {
942
+ // Ignore those unrelated values.
943
+ case 'inherit':
944
+ case 'none':
945
+ value = '';
946
+ }
947
+
948
+ !value && ( value = ( element.getAttribute( 'align' ) || '' ).toLowerCase() );
949
+ this.setValue( value );
950
+ }
951
+ },
952
+ commit: function( type, element ) {
953
+ var value = this.getValue();
954
+ if ( type == IMAGE || type == PREVIEW ) {
955
+ if ( value )
956
+ element.setStyle( 'float', value );
957
+ else
958
+ element.removeStyle( 'float' );
959
+
960
+ if ( type == IMAGE ) {
961
+ value = ( element.getAttribute( 'align' ) || '' ).toLowerCase();
962
+ switch ( value ) {
963
+ // we should remove it only if it matches "left" or "right",
964
+ // otherwise leave it intact.
965
+ case 'left':
966
+ case 'right':
967
+ element.removeAttribute( 'align' );
968
+ }
969
+ }
970
+ } else if ( type == CLEANUP ) {
971
+ element.removeStyle( 'float' );
972
+ }
973
+ }
974
+ } ]
975
+ } ]
976
+ },
977
+ {
978
+ type: 'vbox',
979
+ height: '250px',
980
+ children: [ {
981
+ type: 'html',
982
+ id: 'htmlPreview',
983
+ style: 'width:95%;',
984
+ html: '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) + '<br>' +
985
+ '<div id="' + imagePreviewLoaderId + '" class="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>' +
986
+ '<div class="ImagePreviewBox"><table><tr><td>' +
987
+ '<a href="javascript:void(0)" target="_blank" onclick="return false;" id="' + previewLinkId + '">' +
988
+ '<img id="' + previewImageId + '" alt="" /></a>' +
989
+ // jscs:disable maximumLineLength
990
+ ( editor.config.image_previewText || 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ' +
991
+ 'Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, ' +
992
+ 'nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.' ) +
993
+ // jscs:enable maximumLineLength
994
+ '</td></tr></table></div></div>'
995
+ } ]
996
+ } ]
997
+ } ]
998
+ },
999
+ {
1000
+ id: 'Link',
1001
+ requiredContent: 'a[href]',
1002
+ label: editor.lang.image.linkTab,
1003
+ padding: 0,
1004
+ elements: [ {
1005
+ id: 'txtUrl',
1006
+ type: 'text',
1007
+ label: editor.lang.common.url,
1008
+ style: 'width: 100%',
1009
+ 'default': '',
1010
+ setup: function( type, element ) {
1011
+ if ( type == LINK ) {
1012
+ var href = element.data( 'cke-saved-href' );
1013
+ if ( !href )
1014
+ href = element.getAttribute( 'href' );
1015
+ this.setValue( href );
1016
+ }
1017
+ },
1018
+ commit: function( type, element ) {
1019
+ if ( type == LINK ) {
1020
+ if ( this.getValue() || this.isChanged() ) {
1021
+ var url = this.getValue();
1022
+ element.data( 'cke-saved-href', url );
1023
+ element.setAttribute( 'href', url );
1024
+
1025
+ if ( this.getValue() || !editor.config.image_removeLinkByEmptyURL )
1026
+ this.getDialog().addLink = true;
1027
+ else
1028
+ this.getDialog().addLink = false;
1029
+ }
1030
+ }
1031
+ }
1032
+ },
1033
+ {
1034
+ type: 'button',
1035
+ id: 'browse',
1036
+ className: 'cke_dialog_image_browse',
1037
+ filebrowser: {
1038
+ action: 'Browse',
1039
+ target: 'Link:txtUrl',
1040
+ url: editor.config.filebrowserImageBrowseLinkUrl
1041
+ },
1042
+ style: 'float:right',
1043
+ hidden: true,
1044
+ label: editor.lang.common.browseServer
1045
+ },
1046
+ {
1047
+ id: 'cmbTarget',
1048
+ type: 'select',
1049
+ requiredContent: 'a[target]',
1050
+ label: editor.lang.common.target,
1051
+ 'default': '',
1052
+ items: [
1053
+ [ editor.lang.common.notSet, '' ],
1054
+ [ editor.lang.common.targetNew, '_blank' ],
1055
+ [ editor.lang.common.targetTop, '_top' ],
1056
+ [ editor.lang.common.targetSelf, '_self' ],
1057
+ [ editor.lang.common.targetParent, '_parent' ]
1058
+ ],
1059
+ setup: function( type, element ) {
1060
+ if ( type == LINK )
1061
+ this.setValue( element.getAttribute( 'target' ) || '' );
1062
+ },
1063
+ commit: function( type, element ) {
1064
+ if ( type == LINK ) {
1065
+ if ( this.getValue() || this.isChanged() )
1066
+ element.setAttribute( 'target', this.getValue() );
1067
+ }
1068
+ }
1069
+ } ]
1070
+ },
1071
+ {
1072
+ id: 'Upload',
1073
+ hidden: true,
1074
+ filebrowser: 'uploadButton',
1075
+ label: editor.lang.image.upload,
1076
+ elements: [ {
1077
+ type: 'file',
1078
+ id: 'upload',
1079
+ label: editor.lang.image.btnUpload,
1080
+ style: 'height:40px',
1081
+ size: 38
1082
+ },
1083
+ {
1084
+ type: 'fileButton',
1085
+ id: 'uploadButton',
1086
+ filebrowser: 'info:txtUrl',
1087
+ label: editor.lang.image.btnUpload,
1088
+ 'for': [ 'Upload', 'upload' ]
1089
+ } ]
1090
+ },
1091
+ {
1092
+ id: 'advanced',
1093
+ label: editor.lang.common.advancedTab,
1094
+ elements: [ {
1095
+ type: 'hbox',
1096
+ widths: [ '50%', '25%', '25%' ],
1097
+ children: [ {
1098
+ type: 'text',
1099
+ id: 'linkId',
1100
+ requiredContent: 'img[id]',
1101
+ label: editor.lang.common.id,
1102
+ setup: function( type, element ) {
1103
+ if ( type == IMAGE )
1104
+ this.setValue( element.getAttribute( 'id' ) );
1105
+ },
1106
+ commit: function( type, element ) {
1107
+ if ( type == IMAGE ) {
1108
+ if ( this.getValue() || this.isChanged() )
1109
+ element.setAttribute( 'id', this.getValue() );
1110
+ }
1111
+ }
1112
+ },
1113
+ {
1114
+ id: 'cmbLangDir',
1115
+ type: 'select',
1116
+ requiredContent: 'img[dir]',
1117
+ style: 'width : 100px;',
1118
+ label: editor.lang.common.langDir,
1119
+ 'default': '',
1120
+ items: [
1121
+ [ editor.lang.common.notSet, '' ],
1122
+ [ editor.lang.common.langDirLtr, 'ltr' ],
1123
+ [ editor.lang.common.langDirRtl, 'rtl' ]
1124
+ ],
1125
+ setup: function( type, element ) {
1126
+ if ( type == IMAGE )
1127
+ this.setValue( element.getAttribute( 'dir' ) );
1128
+ },
1129
+ commit: function( type, element ) {
1130
+ if ( type == IMAGE ) {
1131
+ if ( this.getValue() || this.isChanged() )
1132
+ element.setAttribute( 'dir', this.getValue() );
1133
+ }
1134
+ }
1135
+ },
1136
+ {
1137
+ type: 'text',
1138
+ id: 'txtLangCode',
1139
+ requiredContent: 'img[lang]',
1140
+ label: editor.lang.common.langCode,
1141
+ 'default': '',
1142
+ setup: function( type, element ) {
1143
+ if ( type == IMAGE )
1144
+ this.setValue( element.getAttribute( 'lang' ) );
1145
+ },
1146
+ commit: function( type, element ) {
1147
+ if ( type == IMAGE ) {
1148
+ if ( this.getValue() || this.isChanged() )
1149
+ element.setAttribute( 'lang', this.getValue() );
1150
+ }
1151
+ }
1152
+ } ]
1153
+ },
1154
+ {
1155
+ type: 'text',
1156
+ id: 'txtGenLongDescr',
1157
+ requiredContent: 'img[longdesc]',
1158
+ label: editor.lang.common.longDescr,
1159
+ setup: function( type, element ) {
1160
+ if ( type == IMAGE )
1161
+ this.setValue( element.getAttribute( 'longDesc' ) );
1162
+ },
1163
+ commit: function( type, element ) {
1164
+ if ( type == IMAGE ) {
1165
+ if ( this.getValue() || this.isChanged() )
1166
+ element.setAttribute( 'longDesc', this.getValue() );
1167
+ }
1168
+ }
1169
+ },
1170
+ {
1171
+ type: 'hbox',
1172
+ widths: [ '50%', '50%' ],
1173
+ children: [ {
1174
+ type: 'text',
1175
+ id: 'txtGenClass',
1176
+ requiredContent: 'img(cke-xyz)', // Random text like 'xyz' will check if all are allowed.
1177
+ label: editor.lang.common.cssClass,
1178
+ 'default': '',
1179
+ setup: function( type, element ) {
1180
+ if ( type == IMAGE )
1181
+ this.setValue( element.getAttribute( 'class' ) );
1182
+ },
1183
+ commit: function( type, element ) {
1184
+ if ( type == IMAGE ) {
1185
+ if ( this.getValue() || this.isChanged() )
1186
+ element.setAttribute( 'class', this.getValue() );
1187
+ }
1188
+ }
1189
+ },
1190
+ {
1191
+ type: 'text',
1192
+ id: 'txtGenTitle',
1193
+ requiredContent: 'img[title]',
1194
+ label: editor.lang.common.advisoryTitle,
1195
+ 'default': '',
1196
+ onChange: function() {
1197
+ updatePreview( this.getDialog() );
1198
+ },
1199
+ setup: function( type, element ) {
1200
+ if ( type == IMAGE )
1201
+ this.setValue( element.getAttribute( 'title' ) );
1202
+ },
1203
+ commit: function( type, element ) {
1204
+ if ( type == IMAGE ) {
1205
+ if ( this.getValue() || this.isChanged() )
1206
+ element.setAttribute( 'title', this.getValue() );
1207
+ } else if ( type == PREVIEW )
1208
+ element.setAttribute( 'title', this.getValue() );
1209
+ else if ( type == CLEANUP ) {
1210
+ element.removeAttribute( 'title' );
1211
+ }
1212
+ }
1213
+ } ]
1214
+ },
1215
+ {
1216
+ type: 'text',
1217
+ id: 'txtdlgGenStyle',
1218
+ requiredContent: 'img{cke-xyz}', // Random text like 'xyz' will check if all are allowed.
1219
+ label: editor.lang.common.cssStyle,
1220
+ validate: CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),
1221
+ 'default': '',
1222
+ setup: function( type, element ) {
1223
+ if ( type == IMAGE ) {
1224
+ var genStyle = element.getAttribute( 'style' );
1225
+ if ( !genStyle && element.$.style.cssText )
1226
+ genStyle = element.$.style.cssText;
1227
+ this.setValue( genStyle );
1228
+
1229
+ var height = element.$.style.height,
1230
+ width = element.$.style.width,
1231
+ aMatchH = ( height ? height : '' ).match( regexGetSize ),
1232
+ aMatchW = ( width ? width : '' ).match( regexGetSize );
1233
+
1234
+ this.attributesInStyle = {
1235
+ height: !!aMatchH,
1236
+ width: !!aMatchW
1237
+ };
1238
+ }
1239
+ },
1240
+ onChange: function() {
1241
+ commitInternally.call(
1242
+ this, [
1243
+ 'info:cmbFloat',
1244
+ 'info:cmbAlign',
1245
+ 'info:txtVSpace',
1246
+ 'info:txtHSpace',
1247
+ 'info:txtBorder',
1248
+ 'info:txtWidth',
1249
+ 'info:txtHeight'
1250
+ ]
1251
+ );
1252
+ updatePreview( this );
1253
+ },
1254
+ commit: function( type, element ) {
1255
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) )
1256
+ element.setAttribute( 'style', this.getValue() );
1257
+
1258
+ }
1259
+ } ]
1260
+ } ]
1261
+ };
1262
+ };
1263
+
1264
+ CKEDITOR.dialog.add( 'image', function( editor ) {
1265
+ return imageDialog( editor, 'image' );
1266
+ } );
1267
+
1268
+ CKEDITOR.dialog.add( 'imagebutton', function( editor ) {
1269
+ return imageDialog( editor, 'imagebutton' );
1270
+ } );
1271
+ } )();