glebtv-ckeditor 4.7.3.1 → 4.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +0 -9
  3. data/app/assets/javascripts/ckeditor/config.js.erb +3 -3
  4. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +317 -313
  5. data/config/locales/bg.ckeditor.yml +9 -0
  6. data/config/locales/cs.ckeditor.yml +9 -0
  7. data/config/locales/de.ckeditor.yml +9 -0
  8. data/config/locales/el-GR.cdkeditor.yml +9 -0
  9. data/config/locales/es.ckeditor.yml +9 -0
  10. data/config/locales/fr.ckeditor.yml +9 -0
  11. data/config/locales/hu.ckeditor.yml +9 -0
  12. data/config/locales/it.ckeditor.yml +9 -0
  13. data/config/locales/ja.ckeditor.yml +9 -0
  14. data/config/locales/nb.ckeditor.yml +9 -0
  15. data/config/locales/nl.ckeditor.yml +9 -0
  16. data/config/locales/pl.ckeditor.yml +9 -0
  17. data/config/locales/pt-BR.ckeditor.yml +9 -0
  18. data/config/locales/pt-PT.ckeditor.yml +9 -0
  19. data/config/locales/pt.ckeditor.yml +9 -0
  20. data/config/locales/sq.ckeditor.yml +9 -0
  21. data/config/locales/sv-SE.ckeditor.yml +9 -0
  22. data/config/locales/tr.ckeditor.yml +9 -0
  23. data/config/locales/uk.ckeditor.yml +9 -0
  24. data/config/locales/zh-CN.ckeditor.yml +9 -0
  25. data/config/locales/zh-TW.ckeditor.yml +9 -0
  26. data/lib/ckeditor/asset_response.rb +6 -2
  27. data/lib/ckeditor/http.rb +5 -7
  28. data/lib/ckeditor/utils/content_type_detector.rb +3 -3
  29. data/lib/ckeditor/version.rb +2 -2
  30. data/vendor/assets/javascripts/ckeditor/CHANGES.md +1128 -849
  31. data/vendor/assets/javascripts/ckeditor/LICENSE.md +3 -3
  32. data/vendor/assets/javascripts/ckeditor/README.md +6 -6
  33. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +2 -2
  34. data/vendor/assets/javascripts/ckeditor/build-config.js +11 -6
  35. data/vendor/assets/javascripts/ckeditor/ckeditor.js +825 -688
  36. data/vendor/assets/javascripts/ckeditor/config.js +2 -2
  37. data/vendor/assets/javascripts/ckeditor/contents.css +7 -7
  38. data/vendor/assets/javascripts/ckeditor/lang/af.js +5 -0
  39. data/vendor/assets/javascripts/ckeditor/lang/ar.js +5 -0
  40. data/vendor/assets/javascripts/ckeditor/lang/az.js +5 -0
  41. data/vendor/assets/javascripts/ckeditor/lang/bg.js +5 -0
  42. data/vendor/assets/javascripts/ckeditor/lang/bn.js +5 -0
  43. data/vendor/assets/javascripts/ckeditor/lang/bs.js +5 -0
  44. data/vendor/assets/javascripts/ckeditor/lang/ca.js +5 -0
  45. data/vendor/assets/javascripts/ckeditor/lang/cs.js +5 -0
  46. data/vendor/assets/javascripts/ckeditor/lang/cy.js +5 -0
  47. data/vendor/assets/javascripts/ckeditor/lang/da.js +5 -0
  48. data/vendor/assets/javascripts/ckeditor/lang/de-ch.js +5 -0
  49. data/vendor/assets/javascripts/ckeditor/lang/de.js +5 -0
  50. data/vendor/assets/javascripts/ckeditor/lang/el.js +5 -0
  51. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +5 -0
  52. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +5 -0
  53. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +5 -0
  54. data/vendor/assets/javascripts/ckeditor/lang/en.js +3 -3
  55. data/vendor/assets/javascripts/ckeditor/lang/eo.js +5 -0
  56. data/vendor/assets/javascripts/ckeditor/lang/es-mx.js +5 -0
  57. data/vendor/assets/javascripts/ckeditor/lang/es.js +5 -0
  58. data/vendor/assets/javascripts/ckeditor/lang/et.js +5 -0
  59. data/vendor/assets/javascripts/ckeditor/lang/eu.js +5 -0
  60. data/vendor/assets/javascripts/ckeditor/lang/fa.js +5 -0
  61. data/vendor/assets/javascripts/ckeditor/lang/fi.js +5 -0
  62. data/vendor/assets/javascripts/ckeditor/lang/fo.js +5 -0
  63. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +5 -0
  64. data/vendor/assets/javascripts/ckeditor/lang/fr.js +5 -0
  65. data/vendor/assets/javascripts/ckeditor/lang/gl.js +5 -0
  66. data/vendor/assets/javascripts/ckeditor/lang/gu.js +5 -0
  67. data/vendor/assets/javascripts/ckeditor/lang/he.js +5 -0
  68. data/vendor/assets/javascripts/ckeditor/lang/hi.js +5 -0
  69. data/vendor/assets/javascripts/ckeditor/lang/hr.js +5 -0
  70. data/vendor/assets/javascripts/ckeditor/lang/hu.js +5 -0
  71. data/vendor/assets/javascripts/ckeditor/lang/id.js +5 -0
  72. data/vendor/assets/javascripts/ckeditor/lang/is.js +5 -0
  73. data/vendor/assets/javascripts/ckeditor/lang/it.js +5 -0
  74. data/vendor/assets/javascripts/ckeditor/lang/ja.js +5 -0
  75. data/vendor/assets/javascripts/ckeditor/lang/ka.js +5 -0
  76. data/vendor/assets/javascripts/ckeditor/lang/km.js +5 -0
  77. data/vendor/assets/javascripts/ckeditor/lang/ko.js +5 -0
  78. data/vendor/assets/javascripts/ckeditor/lang/ku.js +5 -0
  79. data/vendor/assets/javascripts/ckeditor/lang/lt.js +5 -0
  80. data/vendor/assets/javascripts/ckeditor/lang/lv.js +5 -0
  81. data/vendor/assets/javascripts/ckeditor/lang/mk.js +5 -0
  82. data/vendor/assets/javascripts/ckeditor/lang/mn.js +5 -0
  83. data/vendor/assets/javascripts/ckeditor/lang/ms.js +5 -0
  84. data/vendor/assets/javascripts/ckeditor/lang/nb.js +5 -0
  85. data/vendor/assets/javascripts/ckeditor/lang/nl.js +5 -0
  86. data/vendor/assets/javascripts/ckeditor/lang/no.js +5 -0
  87. data/vendor/assets/javascripts/ckeditor/lang/oc.js +5 -0
  88. data/vendor/assets/javascripts/ckeditor/lang/pl.js +5 -0
  89. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +5 -0
  90. data/vendor/assets/javascripts/ckeditor/lang/pt.js +5 -0
  91. data/vendor/assets/javascripts/ckeditor/lang/ro.js +5 -0
  92. data/vendor/assets/javascripts/ckeditor/lang/ru.js +3 -3
  93. data/vendor/assets/javascripts/ckeditor/lang/si.js +5 -0
  94. data/vendor/assets/javascripts/ckeditor/lang/sk.js +5 -0
  95. data/vendor/assets/javascripts/ckeditor/lang/sl.js +5 -0
  96. data/vendor/assets/javascripts/ckeditor/lang/sq.js +5 -0
  97. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +5 -0
  98. data/vendor/assets/javascripts/ckeditor/lang/sr.js +5 -0
  99. data/vendor/assets/javascripts/ckeditor/lang/sv.js +5 -0
  100. data/vendor/assets/javascripts/ckeditor/lang/th.js +5 -0
  101. data/vendor/assets/javascripts/ckeditor/lang/tr.js +5 -0
  102. data/vendor/assets/javascripts/ckeditor/lang/tt.js +5 -0
  103. data/vendor/assets/javascripts/ckeditor/lang/ug.js +5 -0
  104. data/vendor/assets/javascripts/ckeditor/lang/uk.js +5 -0
  105. data/vendor/assets/javascripts/ckeditor/lang/vi.js +5 -0
  106. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +5 -0
  107. data/vendor/assets/javascripts/ckeditor/lang/zh.js +5 -0
  108. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -7
  109. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +2 -2
  110. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  111. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +5 -5
  112. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
  113. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  114. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  116. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  117. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  118. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  119. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autocomplete.png +0 -0
  120. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autoformat.png +0 -0
  121. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/commentselectedrange.png +0 -0
  122. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/searchcode.png +0 -0
  123. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/uncommentselectedrange.png +0 -0
  124. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -2
  125. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -2
  126. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  127. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -6
  128. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  129. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -0
  130. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
  131. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  132. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
  133. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
  134. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +231 -217
  135. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +46 -0
  136. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +34 -0
  137. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +42 -0
  138. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
  139. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -0
  140. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -0
  141. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -0
  142. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -0
  143. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -1
  144. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +2 -2
  146. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +11 -11
  147. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +2 -2
  148. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +23 -23
  149. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +5 -5
  150. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +2 -2
  151. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +3 -3
  152. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +2 -2
  153. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +2 -2
  154. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +7 -7
  155. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +4 -3
  156. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +3 -3
  157. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +3 -3
  158. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +3 -3
  161. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +1259 -44
  162. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/hidpi/image.png +0 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/image.png +0 -0
  164. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/en.js +25 -0
  165. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/ru.js +25 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/image/plugin.js +184 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +35 -0
  170. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +339 -0
  171. data/vendor/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +553 -0
  172. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/image.png +0 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/en.js +21 -0
  175. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +21 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/image2/plugin.js +1720 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
  179. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +68 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +1 -1
  181. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +2 -2
  182. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +28 -26
  183. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -7
  184. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
  185. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +53 -51
  186. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +31 -32
  187. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +2 -2
  188. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
  189. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +2 -2
  190. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +2 -2
  191. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -6
  192. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +6 -6
  193. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +4 -4
  194. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -15
  195. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +2 -2
  196. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +2 -2
  197. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
  198. data/vendor/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
  199. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -0
  200. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +2 -1
  201. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +468 -377
  202. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/maxParagraphs.html +26 -0
  203. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +82 -82
  204. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +449 -448
  205. data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +28 -23
  206. data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  207. data/vendor/assets/javascripts/ckeditor/samples/img/logo.svg +13 -0
  208. data/vendor/assets/javascripts/ckeditor/samples/index.html +16 -16
  209. data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +4 -4
  210. data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +2 -2
  211. data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +5 -5
  212. data/vendor/assets/javascripts/ckeditor/samples/old/api.html +14 -14
  213. data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +7 -7
  214. data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +2 -2
  215. data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +4 -4
  216. data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +2 -2
  217. data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +14 -14
  218. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +2 -2
  219. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +8 -8
  220. data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +5 -5
  221. data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +8 -8
  222. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +6 -6
  223. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +7 -7
  224. data/vendor/assets/javascripts/ckeditor/samples/old/index.html +8 -5
  225. data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +10 -10
  226. data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +6 -6
  227. data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +6 -6
  228. data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +6 -6
  229. data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +5 -5
  230. data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +8 -8
  231. data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +5 -5
  232. data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +5 -5
  233. data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +2 -2
  234. data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +2 -2
  235. data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +2 -2
  236. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/assets/sample.css +70 -0
  237. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/stylesheetparser.html +85 -0
  238. data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +5 -5
  239. data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +8 -8
  240. data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +6 -6
  241. data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +8 -8
  242. data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +5 -5
  243. data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +6 -6
  244. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +12 -12
  245. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +123 -1
  246. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +1 -1
  247. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +1 -1
  248. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +1 -1
  249. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +1 -1
  250. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +1 -1
  251. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  252. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  253. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +3 -3
  254. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +3 -3
  255. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +3 -3
  256. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +3 -3
  257. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +3 -3
  258. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +3 -3
  259. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +3 -3
  260. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +3 -3
  261. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +3 -3
  262. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons.png +0 -0
  263. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
  264. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +3 -3
  265. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +2 -2
  266. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +3 -3
  267. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +3 -3
  268. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +3 -3
  269. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +3 -3
  270. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +3 -3
  271. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +3 -3
  272. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +3 -3
  273. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +3 -3
  274. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +3 -3
  275. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +3 -3
  276. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +3 -3
  277. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +4 -4
  278. data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +2 -2
  279. data/vendor/assets/javascripts/ckeditor/styles.js +4 -4
  280. metadata +179 -56
  281. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -169
  282. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +0 -7
  283. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +0 -7
  284. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +0 -929
@@ -1,6 +1,6 @@
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-2018, 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("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)||
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()):
@@ -1,6 +1,6 @@
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-2018, 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("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
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",
@@ -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-2018, 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,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,b=this.radioButton;b||(a=this.getParentEditor(),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,6 +1,6 @@
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-2018, 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}
@@ -17,4 +17,5 @@ setup:function(a,b){if("clear"==a)m(this);else if("option"==a){var e=b.getValue(
17
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
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
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")}}]}]}]}]}});
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&&CKEDITOR.plugins.forms._setupRequiredAttribute.call(this,b)},commit:function(a){this.getValue()?a.setAttribute("required","required"):
21
+ 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-2018, 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("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
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
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")}}]}]}});
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:CKEDITOR.plugins.forms._setupRequiredAttribute,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-2018, 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("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
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
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
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
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"))},
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:CKEDITOR.plugins.forms._setupRequiredAttribute,
11
11
  commit:function(a){a=a.element;this.getValue()?a.setAttribute("required","required"):a.removeAttribute("required")}}]}]}});
@@ -1,10 +1,10 @@
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-2018, 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 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
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
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,
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.left,"left"],[a.right,
9
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
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")]}})})();
@@ -1,44 +1,1259 @@
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-2018, 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
+ onShow: function() {
281
+ this.imageElement = false;
282
+ this.linkElement = false;
283
+
284
+ // Default: create a new element.
285
+ this.imageEditMode = false;
286
+ this.linkEditMode = false;
287
+
288
+ this.lockRatio = true;
289
+ this.userlockRatio = 0;
290
+ this.dontResetSize = false;
291
+ this.firstLoad = true;
292
+ this.addLink = false;
293
+
294
+ var editor = this.getParentEditor(),
295
+ sel = editor.getSelection(),
296
+ element = sel && sel.getSelectedElement(),
297
+ link = element && editor.elementPath( element ).contains( 'a', 1 ),
298
+ loader = CKEDITOR.document.getById( imagePreviewLoaderId );
299
+
300
+ // Hide loader.
301
+ if ( loader )
302
+ loader.setStyle( 'display', 'none' );
303
+
304
+ // Create the preview before setup the dialog contents.
305
+ previewPreloader = new CKEDITOR.dom.element( 'img', editor.document );
306
+ this.preview = CKEDITOR.document.getById( previewImageId );
307
+
308
+ // Copy of the image
309
+ this.originalElement = editor.document.createElement( 'img' );
310
+ this.originalElement.setAttribute( 'alt', '' );
311
+ this.originalElement.setCustomData( 'isReady', 'false' );
312
+
313
+ if ( link ) {
314
+ this.linkElement = link;
315
+ this.linkEditMode = true;
316
+
317
+ // If there is an existing link, by default keep it (true).
318
+ // It will be removed if certain conditions are met and Link tab is enabled. (https://dev.ckeditor.com/ticket/13351)
319
+ this.addLink = true;
320
+
321
+ // Look for Image element.
322
+ var linkChildren = link.getChildren();
323
+ if ( linkChildren.count() == 1 ) {
324
+ var childTag = linkChildren.getItem( 0 );
325
+
326
+ if ( childTag.type == CKEDITOR.NODE_ELEMENT ) {
327
+ if ( childTag.is( 'img' ) || childTag.is( 'input' ) ) {
328
+ this.imageElement = linkChildren.getItem( 0 );
329
+ if ( this.imageElement.is( 'img' ) )
330
+ this.imageEditMode = 'img';
331
+ else if ( this.imageElement.is( 'input' ) )
332
+ this.imageEditMode = 'input';
333
+ }
334
+ }
335
+ }
336
+ // Fill out all fields.
337
+ if ( dialogType == 'image' )
338
+ this.setupContent( LINK, link );
339
+ }
340
+
341
+ // Edit given image element instead the one from selection.
342
+ if ( this.customImageElement ) {
343
+ this.imageEditMode = 'img';
344
+ this.imageElement = this.customImageElement;
345
+ delete this.customImageElement;
346
+ }
347
+ else if ( element && element.getName() == 'img' && !element.data( 'cke-realelement' ) ||
348
+ element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'image' ) {
349
+ this.imageEditMode = element.getName();
350
+ this.imageElement = element;
351
+ }
352
+
353
+ if ( this.imageEditMode ) {
354
+ // Use the original element as a buffer from since we don't want
355
+ // temporary changes to be committed, e.g. if the dialog is canceled.
356
+ this.cleanImageElement = this.imageElement;
357
+ this.imageElement = this.cleanImageElement.clone( true, true );
358
+
359
+ // Fill out all fields.
360
+ this.setupContent( IMAGE, this.imageElement );
361
+ }
362
+
363
+ // Refresh LockRatio button
364
+ switchLockRatio( this, true );
365
+
366
+ // Dont show preview if no URL given.
367
+ if ( !CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtUrl' ) ) ) {
368
+ this.preview.removeAttribute( 'src' );
369
+ this.preview.setStyle( 'display', 'none' );
370
+ }
371
+ },
372
+ onOk: function() {
373
+ // Edit existing Image.
374
+ if ( this.imageEditMode ) {
375
+ var imgTagName = this.imageEditMode;
376
+
377
+ // Image dialog and Input element.
378
+ if ( dialogType == 'image' && imgTagName == 'input' && confirm( editor.lang.image.button2Img ) ) { // jshint ignore:line
379
+ // Replace INPUT-> IMG
380
+ imgTagName = 'img';
381
+ this.imageElement = editor.document.createElement( 'img' );
382
+ this.imageElement.setAttribute( 'alt', '' );
383
+ editor.insertElement( this.imageElement );
384
+ }
385
+ // ImageButton dialog and Image element.
386
+ else if ( dialogType != 'image' && imgTagName == 'img' && confirm( editor.lang.image.img2Button ) ) { // jshint ignore:line
387
+ // Replace IMG -> INPUT
388
+ imgTagName = 'input';
389
+ this.imageElement = editor.document.createElement( 'input' );
390
+ this.imageElement.setAttributes( {
391
+ type: 'image',
392
+ alt: ''
393
+ } );
394
+ editor.insertElement( this.imageElement );
395
+ } else {
396
+ // Restore the original element before all commits.
397
+ this.imageElement = this.cleanImageElement;
398
+ delete this.cleanImageElement;
399
+ }
400
+ }
401
+ // Create a new image.
402
+ else {
403
+ // Image dialog -> create IMG element.
404
+ if ( dialogType == 'image' )
405
+ this.imageElement = editor.document.createElement( 'img' );
406
+ else {
407
+ this.imageElement = editor.document.createElement( 'input' );
408
+ this.imageElement.setAttribute( 'type', 'image' );
409
+ }
410
+ this.imageElement.setAttribute( 'alt', '' );
411
+ }
412
+
413
+ // Create a new link.
414
+ if ( !this.linkEditMode )
415
+ this.linkElement = editor.document.createElement( 'a' );
416
+
417
+ // Set attributes.
418
+ this.commitContent( IMAGE, this.imageElement );
419
+ this.commitContent( LINK, this.linkElement );
420
+
421
+ // Remove empty style attribute.
422
+ if ( !this.imageElement.getAttribute( 'style' ) )
423
+ this.imageElement.removeAttribute( 'style' );
424
+
425
+ // Insert a new Image.
426
+ if ( !this.imageEditMode ) {
427
+ if ( this.addLink ) {
428
+ if ( !this.linkEditMode ) {
429
+ // Insert a new link.
430
+ editor.insertElement( this.linkElement );
431
+ this.linkElement.append( this.imageElement, false );
432
+ } else {
433
+ // We already have a link in editor.
434
+ if ( this.linkElement.equals( editor.getSelection().getSelectedElement() ) ) {
435
+ // If the link is selected outside, replace it's content rather than the link itself. ([<a>foo</a>])
436
+ this.linkElement.setHtml( '' );
437
+ this.linkElement.append( this.imageElement, false );
438
+ } else {
439
+ // Only inside of the link is selected, so replace it with image. (<a>[foo]</a>, <a>[f]oo</a>)
440
+ editor.insertElement( this.imageElement );
441
+ }
442
+ }
443
+ } else {
444
+ editor.insertElement( this.imageElement );
445
+ }
446
+ }
447
+ // Image already exists.
448
+ else {
449
+ // Add a new link element.
450
+ if ( !this.linkEditMode && this.addLink ) {
451
+ editor.insertElement( this.linkElement );
452
+ this.imageElement.appendTo( this.linkElement );
453
+ }
454
+ // Remove Link, Image exists.
455
+ else if ( this.linkEditMode && !this.addLink ) {
456
+ editor.getSelection().selectElement( this.linkElement );
457
+ editor.insertElement( this.imageElement );
458
+ }
459
+ }
460
+ },
461
+ onLoad: function() {
462
+ if ( dialogType != 'image' )
463
+ this.hidePage( 'Link' ); //Hide Link tab.
464
+ var doc = this._.element.getDocument();
465
+
466
+ if ( this.getContentElement( 'info', 'ratioLock' ) ) {
467
+ this.addFocusable( doc.getById( btnResetSizeId ), 5 );
468
+ this.addFocusable( doc.getById( btnLockSizesId ), 5 );
469
+ }
470
+
471
+ this.commitContent = commitContent;
472
+ },
473
+ onHide: function() {
474
+ if ( this.preview )
475
+ this.commitContent( CLEANUP, this.preview );
476
+
477
+ if ( this.originalElement ) {
478
+ this.originalElement.removeListener( 'load', onImgLoadEvent );
479
+ this.originalElement.removeListener( 'error', onImgLoadErrorEvent );
480
+ this.originalElement.removeListener( 'abort', onImgLoadErrorEvent );
481
+ this.originalElement.remove();
482
+ this.originalElement = false; // Dialog is closed.
483
+ }
484
+
485
+ delete this.imageElement;
486
+ },
487
+ contents: [ {
488
+ id: 'info',
489
+ label: editor.lang.image.infoTab,
490
+ accessKey: 'I',
491
+ elements: [ {
492
+ type: 'vbox',
493
+ padding: 0,
494
+ children: [ {
495
+ type: 'hbox',
496
+ widths: [ '280px', '110px' ],
497
+ align: 'right',
498
+ className: 'cke_dialog_image_url',
499
+ children: [ {
500
+ id: 'txtUrl',
501
+ type: 'text',
502
+ label: editor.lang.common.url,
503
+ required: true,
504
+ onChange: function() {
505
+ var dialog = this.getDialog(),
506
+ newUrl = this.getValue();
507
+
508
+ // Update original image.
509
+ // Prevent from load before onShow.
510
+ if ( newUrl.length > 0 ) {
511
+ dialog = this.getDialog();
512
+ var original = dialog.originalElement;
513
+
514
+ if ( dialog.preview ) {
515
+ dialog.preview.removeStyle( 'display' );
516
+ }
517
+
518
+ original.setCustomData( 'isReady', 'false' );
519
+ // Show loader.
520
+ var loader = CKEDITOR.document.getById( imagePreviewLoaderId );
521
+ if ( loader )
522
+ loader.setStyle( 'display', '' );
523
+
524
+ original.on( 'load', onImgLoadEvent, dialog );
525
+ original.on( 'error', onImgLoadErrorEvent, dialog );
526
+ original.on( 'abort', onImgLoadErrorEvent, dialog );
527
+ original.setAttribute( 'src', newUrl );
528
+
529
+ if ( dialog.preview ) {
530
+ // Query the preloader to figure out the url impacted by based href.
531
+ previewPreloader.setAttribute( 'src', newUrl );
532
+ dialog.preview.setAttribute( 'src', previewPreloader.$.src );
533
+ updatePreview( dialog );
534
+ }
535
+ }
536
+ // Dont show preview if no URL given.
537
+ else if ( dialog.preview ) {
538
+ dialog.preview.removeAttribute( 'src' );
539
+ dialog.preview.setStyle( 'display', 'none' );
540
+ }
541
+ },
542
+ setup: function( type, element ) {
543
+ if ( type == IMAGE ) {
544
+ var url = element.data( 'cke-saved-src' ) || element.getAttribute( 'src' );
545
+ var field = this;
546
+
547
+ this.getDialog().dontResetSize = true;
548
+
549
+ field.setValue( url ); // And call this.onChange()
550
+ // Manually set the initial value.(https://dev.ckeditor.com/ticket/4191)
551
+ field.setInitValue();
552
+ }
553
+ },
554
+ commit: function( type, element ) {
555
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) ) {
556
+ element.data( 'cke-saved-src', this.getValue() );
557
+ element.setAttribute( 'src', this.getValue() );
558
+ } else if ( type == CLEANUP ) {
559
+ element.setAttribute( 'src', '' ); // If removeAttribute doesn't work.
560
+ element.removeAttribute( 'src' );
561
+ }
562
+ },
563
+ validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.image.urlMissing )
564
+ },
565
+ {
566
+ type: 'button',
567
+ id: 'browse',
568
+ // v-align with the 'txtUrl' field.
569
+ // TODO: We need something better than a fixed size here.
570
+ style: 'display:inline-block;margin-top:14px;',
571
+ align: 'center',
572
+ label: editor.lang.common.browseServer,
573
+ hidden: true,
574
+ filebrowser: 'info:txtUrl'
575
+ } ]
576
+ } ]
577
+ },
578
+ {
579
+ id: 'txtAlt',
580
+ type: 'text',
581
+ label: editor.lang.image.alt,
582
+ accessKey: 'T',
583
+ 'default': '',
584
+ onChange: function() {
585
+ updatePreview( this.getDialog() );
586
+ },
587
+ setup: function( type, element ) {
588
+ if ( type == IMAGE )
589
+ this.setValue( element.getAttribute( 'alt' ) );
590
+ },
591
+ commit: function( type, element ) {
592
+ if ( type == IMAGE ) {
593
+ if ( this.getValue() || this.isChanged() )
594
+ element.setAttribute( 'alt', this.getValue() );
595
+ } else if ( type == PREVIEW )
596
+ element.setAttribute( 'alt', this.getValue() );
597
+ else if ( type == CLEANUP ) {
598
+ element.removeAttribute( 'alt' );
599
+ }
600
+
601
+ }
602
+ },
603
+ {
604
+ type: 'hbox',
605
+ children: [ {
606
+ id: 'basic',
607
+ type: 'vbox',
608
+ children: [ {
609
+ type: 'hbox',
610
+ requiredContent: 'img{width,height}',
611
+ widths: [ '50%', '50%' ],
612
+ children: [ {
613
+ type: 'vbox',
614
+ padding: 1,
615
+ children: [ {
616
+ type: 'text',
617
+ width: '45px',
618
+ id: 'txtWidth',
619
+ label: editor.lang.common.width,
620
+ onKeyUp: onSizeChange,
621
+ onChange: function() {
622
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
623
+ },
624
+ validate: function() {
625
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty ),
626
+ isValid = !!( aMatch && parseInt( aMatch[ 1 ], 10 ) !== 0 );
627
+ if ( !isValid )
628
+ alert( editor.lang.common.invalidLength.replace( '%1', editor.lang.common.width ).replace( '%2', 'px, %' ) ); // jshint ignore:line
629
+ return isValid;
630
+ },
631
+ setup: setupDimension,
632
+ commit: function( type, element ) {
633
+ var value = this.getValue();
634
+ if ( type == IMAGE ) {
635
+ if ( value && editor.activeFilter.check( 'img{width,height}' ) )
636
+ element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
637
+ else
638
+ element.removeStyle( 'width' );
639
+
640
+ element.removeAttribute( 'width' );
641
+ } else if ( type == PREVIEW ) {
642
+ var aMatch = value.match( regexGetSize );
643
+ if ( !aMatch ) {
644
+ var oImageOriginal = this.getDialog().originalElement;
645
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
646
+ element.setStyle( 'width', oImageOriginal.$.width + 'px' );
647
+ } else {
648
+ element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
649
+ }
650
+ } else if ( type == CLEANUP ) {
651
+ element.removeAttribute( 'width' );
652
+ element.removeStyle( 'width' );
653
+ }
654
+ }
655
+ },
656
+ {
657
+ type: 'text',
658
+ id: 'txtHeight',
659
+ width: '45px',
660
+ label: editor.lang.common.height,
661
+ onKeyUp: onSizeChange,
662
+ onChange: function() {
663
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
664
+ },
665
+ validate: function() {
666
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty ),
667
+ isValid = !!( aMatch && parseInt( aMatch[ 1 ], 10 ) !== 0 );
668
+ if ( !isValid )
669
+ alert( editor.lang.common.invalidLength.replace( '%1', editor.lang.common.height ).replace( '%2', 'px, %' ) ); // jshint ignore:line
670
+ return isValid;
671
+ },
672
+ setup: setupDimension,
673
+ commit: function( type, element ) {
674
+ var value = this.getValue();
675
+ if ( type == IMAGE ) {
676
+ if ( value && editor.activeFilter.check( 'img{width,height}' ) )
677
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
678
+ else
679
+ element.removeStyle( 'height' );
680
+
681
+ element.removeAttribute( 'height' );
682
+ } else if ( type == PREVIEW ) {
683
+ var aMatch = value.match( regexGetSize );
684
+ if ( !aMatch ) {
685
+ var oImageOriginal = this.getDialog().originalElement;
686
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
687
+ element.setStyle( 'height', oImageOriginal.$.height + 'px' );
688
+ } else {
689
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
690
+ }
691
+ } else if ( type == CLEANUP ) {
692
+ element.removeAttribute( 'height' );
693
+ element.removeStyle( 'height' );
694
+ }
695
+ }
696
+ } ]
697
+ },
698
+ {
699
+ id: 'ratioLock',
700
+ type: 'html',
701
+ className: 'cke_dialog_image_ratiolock',
702
+ style: 'margin-top:30px;width:40px;height:40px;',
703
+ onLoad: function() {
704
+ // Activate Reset button
705
+ var resetButton = CKEDITOR.document.getById( btnResetSizeId ),
706
+ ratioButton = CKEDITOR.document.getById( btnLockSizesId );
707
+ if ( resetButton ) {
708
+ resetButton.on( 'click', function( evt ) {
709
+ resetSize( this );
710
+ evt.data && evt.data.preventDefault();
711
+ }, this.getDialog() );
712
+ resetButton.on( 'mouseover', function() {
713
+ this.addClass( 'cke_btn_over' );
714
+ }, resetButton );
715
+ resetButton.on( 'mouseout', function() {
716
+ this.removeClass( 'cke_btn_over' );
717
+ }, resetButton );
718
+ }
719
+ // Activate (Un)LockRatio button
720
+ if ( ratioButton ) {
721
+ ratioButton.on( 'click', function( evt ) {
722
+ switchLockRatio( this );
723
+
724
+ var oImageOriginal = this.originalElement,
725
+ width = this.getValueOf( 'info', 'txtWidth' );
726
+
727
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' && width ) {
728
+ var height = oImageOriginal.$.height / oImageOriginal.$.width * width;
729
+ if ( !isNaN( height ) ) {
730
+ this.setValueOf( 'info', 'txtHeight', Math.round( height ) );
731
+ updatePreview( this );
732
+ }
733
+ }
734
+ evt.data && evt.data.preventDefault();
735
+ }, this.getDialog() );
736
+ ratioButton.on( 'mouseover', function() {
737
+ this.addClass( 'cke_btn_over' );
738
+ }, ratioButton );
739
+ ratioButton.on( 'mouseout', function() {
740
+ this.removeClass( 'cke_btn_over' );
741
+ }, ratioButton );
742
+ }
743
+ },
744
+ html: '<div>' +
745
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.lockRatio +
746
+ '" class="cke_btn_locked" id="' + btnLockSizesId + '" role="checkbox"><span class="cke_icon"></span><span class="cke_label">' + editor.lang.image.lockRatio + '</span></a>' +
747
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize +
748
+ '" class="cke_btn_reset" id="' + btnResetSizeId + '" role="button"><span class="cke_label">' + editor.lang.image.resetSize + '</span></a>' +
749
+ '</div>'
750
+ } ]
751
+ },
752
+ {
753
+ type: 'vbox',
754
+ padding: 1,
755
+ children: [ {
756
+ type: 'text',
757
+ id: 'txtBorder',
758
+ requiredContent: 'img{border-width}',
759
+ width: '60px',
760
+ label: editor.lang.image.border,
761
+ 'default': '',
762
+ onKeyUp: function() {
763
+ updatePreview( this.getDialog() );
764
+ },
765
+ onChange: function() {
766
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
767
+ },
768
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateBorder ),
769
+ setup: function( type, element ) {
770
+ if ( type == IMAGE ) {
771
+ var value,
772
+ borderStyle = element.getStyle( 'border-width' );
773
+ borderStyle = borderStyle && borderStyle.match( /^(\d+px)(?: \1 \1 \1)?$/ );
774
+ value = borderStyle && parseInt( borderStyle[ 1 ], 10 );
775
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'border' ) );
776
+ this.setValue( value );
777
+ }
778
+ },
779
+ commit: function( type, element ) {
780
+ var value = parseInt( this.getValue(), 10 );
781
+ if ( type == IMAGE || type == PREVIEW ) {
782
+ if ( !isNaN( value ) ) {
783
+ element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
784
+ element.setStyle( 'border-style', 'solid' );
785
+ } else if ( !value && this.isChanged() ) {
786
+ element.removeStyle( 'border' );
787
+ }
788
+
789
+ if ( type == IMAGE )
790
+ element.removeAttribute( 'border' );
791
+ } else if ( type == CLEANUP ) {
792
+ element.removeAttribute( 'border' );
793
+ element.removeStyle( 'border-width' );
794
+ element.removeStyle( 'border-style' );
795
+ element.removeStyle( 'border-color' );
796
+ }
797
+ }
798
+ },
799
+ {
800
+ type: 'text',
801
+ id: 'txtHSpace',
802
+ requiredContent: 'img{margin-left,margin-right}',
803
+ width: '60px',
804
+ label: editor.lang.image.hSpace,
805
+ 'default': '',
806
+ onKeyUp: function() {
807
+ updatePreview( this.getDialog() );
808
+ },
809
+ onChange: function() {
810
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
811
+ },
812
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateHSpace ),
813
+ setup: function( type, element ) {
814
+ if ( type == IMAGE ) {
815
+ var value, marginLeftPx, marginRightPx,
816
+ marginLeftStyle = element.getStyle( 'margin-left' ),
817
+ marginRightStyle = element.getStyle( 'margin-right' );
818
+
819
+ marginLeftStyle = marginLeftStyle && marginLeftStyle.match( pxLengthRegex );
820
+ marginRightStyle = marginRightStyle && marginRightStyle.match( pxLengthRegex );
821
+ marginLeftPx = parseInt( marginLeftStyle, 10 );
822
+ marginRightPx = parseInt( marginRightStyle, 10 );
823
+
824
+ value = ( marginLeftPx == marginRightPx ) && marginLeftPx;
825
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'hspace' ) );
826
+
827
+ this.setValue( value );
828
+ }
829
+ },
830
+ commit: function( type, element ) {
831
+ var value = parseInt( this.getValue(), 10 );
832
+ if ( type == IMAGE || type == PREVIEW ) {
833
+ if ( !isNaN( value ) ) {
834
+ element.setStyle( 'margin-left', CKEDITOR.tools.cssLength( value ) );
835
+ element.setStyle( 'margin-right', CKEDITOR.tools.cssLength( value ) );
836
+ } else if ( !value && this.isChanged() ) {
837
+ element.removeStyle( 'margin-left' );
838
+ element.removeStyle( 'margin-right' );
839
+ }
840
+
841
+ if ( type == IMAGE )
842
+ element.removeAttribute( 'hspace' );
843
+ } else if ( type == CLEANUP ) {
844
+ element.removeAttribute( 'hspace' );
845
+ element.removeStyle( 'margin-left' );
846
+ element.removeStyle( 'margin-right' );
847
+ }
848
+ }
849
+ },
850
+ {
851
+ type: 'text',
852
+ id: 'txtVSpace',
853
+ requiredContent: 'img{margin-top,margin-bottom}',
854
+ width: '60px',
855
+ label: editor.lang.image.vSpace,
856
+ 'default': '',
857
+ onKeyUp: function() {
858
+ updatePreview( this.getDialog() );
859
+ },
860
+ onChange: function() {
861
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
862
+ },
863
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateVSpace ),
864
+ setup: function( type, element ) {
865
+ if ( type == IMAGE ) {
866
+ var value, marginTopPx, marginBottomPx,
867
+ marginTopStyle = element.getStyle( 'margin-top' ),
868
+ marginBottomStyle = element.getStyle( 'margin-bottom' );
869
+
870
+ marginTopStyle = marginTopStyle && marginTopStyle.match( pxLengthRegex );
871
+ marginBottomStyle = marginBottomStyle && marginBottomStyle.match( pxLengthRegex );
872
+ marginTopPx = parseInt( marginTopStyle, 10 );
873
+ marginBottomPx = parseInt( marginBottomStyle, 10 );
874
+
875
+ value = ( marginTopPx == marginBottomPx ) && marginTopPx;
876
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'vspace' ) );
877
+ this.setValue( value );
878
+ }
879
+ },
880
+ commit: function( type, element ) {
881
+ var value = parseInt( this.getValue(), 10 );
882
+ if ( type == IMAGE || type == PREVIEW ) {
883
+ if ( !isNaN( value ) ) {
884
+ element.setStyle( 'margin-top', CKEDITOR.tools.cssLength( value ) );
885
+ element.setStyle( 'margin-bottom', CKEDITOR.tools.cssLength( value ) );
886
+ } else if ( !value && this.isChanged() ) {
887
+ element.removeStyle( 'margin-top' );
888
+ element.removeStyle( 'margin-bottom' );
889
+ }
890
+
891
+ if ( type == IMAGE )
892
+ element.removeAttribute( 'vspace' );
893
+ } else if ( type == CLEANUP ) {
894
+ element.removeAttribute( 'vspace' );
895
+ element.removeStyle( 'margin-top' );
896
+ element.removeStyle( 'margin-bottom' );
897
+ }
898
+ }
899
+ },
900
+ {
901
+ id: 'cmbAlign',
902
+ requiredContent: 'img{float}',
903
+ type: 'select',
904
+ widths: [ '35%', '65%' ],
905
+ style: 'width:90px',
906
+ label: editor.lang.common.align,
907
+ 'default': '',
908
+ items: [
909
+ [ editor.lang.common.notSet, '' ],
910
+ [ editor.lang.common.left, 'left' ],
911
+ [ editor.lang.common.right, 'right' ]
912
+ // Backward compatible with v2 on setup when specified as attribute value,
913
+ // while these values are no more available as select options.
914
+ // [ editor.lang.image.alignAbsBottom , 'absBottom'],
915
+ // [ editor.lang.image.alignAbsMiddle , 'absMiddle'],
916
+ // [ editor.lang.image.alignBaseline , 'baseline'],
917
+ // [ editor.lang.image.alignTextTop , 'text-top'],
918
+ // [ editor.lang.image.alignBottom , 'bottom'],
919
+ // [ editor.lang.image.alignMiddle , 'middle'],
920
+ // [ editor.lang.image.alignTop , 'top']
921
+ ],
922
+ onChange: function() {
923
+ updatePreview( this.getDialog() );
924
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
925
+ },
926
+ setup: function( type, element ) {
927
+ if ( type == IMAGE ) {
928
+ var value = element.getStyle( 'float' );
929
+ switch ( value ) {
930
+ // Ignore those unrelated values.
931
+ case 'inherit':
932
+ case 'none':
933
+ value = '';
934
+ }
935
+
936
+ !value && ( value = ( element.getAttribute( 'align' ) || '' ).toLowerCase() );
937
+ this.setValue( value );
938
+ }
939
+ },
940
+ commit: function( type, element ) {
941
+ var value = this.getValue();
942
+ if ( type == IMAGE || type == PREVIEW ) {
943
+ if ( value )
944
+ element.setStyle( 'float', value );
945
+ else
946
+ element.removeStyle( 'float' );
947
+
948
+ if ( type == IMAGE ) {
949
+ value = ( element.getAttribute( 'align' ) || '' ).toLowerCase();
950
+ switch ( value ) {
951
+ // we should remove it only if it matches "left" or "right",
952
+ // otherwise leave it intact.
953
+ case 'left':
954
+ case 'right':
955
+ element.removeAttribute( 'align' );
956
+ }
957
+ }
958
+ } else if ( type == CLEANUP ) {
959
+ element.removeStyle( 'float' );
960
+ }
961
+ }
962
+ } ]
963
+ } ]
964
+ },
965
+ {
966
+ type: 'vbox',
967
+ height: '250px',
968
+ children: [ {
969
+ type: 'html',
970
+ id: 'htmlPreview',
971
+ style: 'width:95%;',
972
+ html: '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) + '<br>' +
973
+ '<div id="' + imagePreviewLoaderId + '" class="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>' +
974
+ '<div class="ImagePreviewBox"><table><tr><td>' +
975
+ '<a href="javascript:void(0)" target="_blank" onclick="return false;" id="' + previewLinkId + '">' +
976
+ '<img id="' + previewImageId + '" alt="" /></a>' +
977
+ // jscs:disable maximumLineLength
978
+ ( editor.config.image_previewText || 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ' +
979
+ 'Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, ' +
980
+ '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.' ) +
981
+ // jscs:enable maximumLineLength
982
+ '</td></tr></table></div></div>'
983
+ } ]
984
+ } ]
985
+ } ]
986
+ },
987
+ {
988
+ id: 'Link',
989
+ requiredContent: 'a[href]',
990
+ label: editor.lang.image.linkTab,
991
+ padding: 0,
992
+ elements: [ {
993
+ id: 'txtUrl',
994
+ type: 'text',
995
+ label: editor.lang.common.url,
996
+ style: 'width: 100%',
997
+ 'default': '',
998
+ setup: function( type, element ) {
999
+ if ( type == LINK ) {
1000
+ var href = element.data( 'cke-saved-href' );
1001
+ if ( !href )
1002
+ href = element.getAttribute( 'href' );
1003
+ this.setValue( href );
1004
+ }
1005
+ },
1006
+ commit: function( type, element ) {
1007
+ if ( type == LINK ) {
1008
+ if ( this.getValue() || this.isChanged() ) {
1009
+ var url = this.getValue();
1010
+ element.data( 'cke-saved-href', url );
1011
+ element.setAttribute( 'href', url );
1012
+
1013
+ if ( this.getValue() || !editor.config.image_removeLinkByEmptyURL )
1014
+ this.getDialog().addLink = true;
1015
+ else
1016
+ this.getDialog().addLink = false;
1017
+ }
1018
+ }
1019
+ }
1020
+ },
1021
+ {
1022
+ type: 'button',
1023
+ id: 'browse',
1024
+ className: 'cke_dialog_image_browse',
1025
+ filebrowser: {
1026
+ action: 'Browse',
1027
+ target: 'Link:txtUrl',
1028
+ url: editor.config.filebrowserImageBrowseLinkUrl
1029
+ },
1030
+ style: 'float:right',
1031
+ hidden: true,
1032
+ label: editor.lang.common.browseServer
1033
+ },
1034
+ {
1035
+ id: 'cmbTarget',
1036
+ type: 'select',
1037
+ requiredContent: 'a[target]',
1038
+ label: editor.lang.common.target,
1039
+ 'default': '',
1040
+ items: [
1041
+ [ editor.lang.common.notSet, '' ],
1042
+ [ editor.lang.common.targetNew, '_blank' ],
1043
+ [ editor.lang.common.targetTop, '_top' ],
1044
+ [ editor.lang.common.targetSelf, '_self' ],
1045
+ [ editor.lang.common.targetParent, '_parent' ]
1046
+ ],
1047
+ setup: function( type, element ) {
1048
+ if ( type == LINK )
1049
+ this.setValue( element.getAttribute( 'target' ) || '' );
1050
+ },
1051
+ commit: function( type, element ) {
1052
+ if ( type == LINK ) {
1053
+ if ( this.getValue() || this.isChanged() )
1054
+ element.setAttribute( 'target', this.getValue() );
1055
+ }
1056
+ }
1057
+ } ]
1058
+ },
1059
+ {
1060
+ id: 'Upload',
1061
+ hidden: true,
1062
+ filebrowser: 'uploadButton',
1063
+ label: editor.lang.image.upload,
1064
+ elements: [ {
1065
+ type: 'file',
1066
+ id: 'upload',
1067
+ label: editor.lang.image.btnUpload,
1068
+ style: 'height:40px',
1069
+ size: 38
1070
+ },
1071
+ {
1072
+ type: 'fileButton',
1073
+ id: 'uploadButton',
1074
+ filebrowser: 'info:txtUrl',
1075
+ label: editor.lang.image.btnUpload,
1076
+ 'for': [ 'Upload', 'upload' ]
1077
+ } ]
1078
+ },
1079
+ {
1080
+ id: 'advanced',
1081
+ label: editor.lang.common.advancedTab,
1082
+ elements: [ {
1083
+ type: 'hbox',
1084
+ widths: [ '50%', '25%', '25%' ],
1085
+ children: [ {
1086
+ type: 'text',
1087
+ id: 'linkId',
1088
+ requiredContent: 'img[id]',
1089
+ label: editor.lang.common.id,
1090
+ setup: function( type, element ) {
1091
+ if ( type == IMAGE )
1092
+ this.setValue( element.getAttribute( 'id' ) );
1093
+ },
1094
+ commit: function( type, element ) {
1095
+ if ( type == IMAGE ) {
1096
+ if ( this.getValue() || this.isChanged() )
1097
+ element.setAttribute( 'id', this.getValue() );
1098
+ }
1099
+ }
1100
+ },
1101
+ {
1102
+ id: 'cmbLangDir',
1103
+ type: 'select',
1104
+ requiredContent: 'img[dir]',
1105
+ style: 'width : 100px;',
1106
+ label: editor.lang.common.langDir,
1107
+ 'default': '',
1108
+ items: [
1109
+ [ editor.lang.common.notSet, '' ],
1110
+ [ editor.lang.common.langDirLtr, 'ltr' ],
1111
+ [ editor.lang.common.langDirRtl, 'rtl' ]
1112
+ ],
1113
+ setup: function( type, element ) {
1114
+ if ( type == IMAGE )
1115
+ this.setValue( element.getAttribute( 'dir' ) );
1116
+ },
1117
+ commit: function( type, element ) {
1118
+ if ( type == IMAGE ) {
1119
+ if ( this.getValue() || this.isChanged() )
1120
+ element.setAttribute( 'dir', this.getValue() );
1121
+ }
1122
+ }
1123
+ },
1124
+ {
1125
+ type: 'text',
1126
+ id: 'txtLangCode',
1127
+ requiredContent: 'img[lang]',
1128
+ label: editor.lang.common.langCode,
1129
+ 'default': '',
1130
+ setup: function( type, element ) {
1131
+ if ( type == IMAGE )
1132
+ this.setValue( element.getAttribute( 'lang' ) );
1133
+ },
1134
+ commit: function( type, element ) {
1135
+ if ( type == IMAGE ) {
1136
+ if ( this.getValue() || this.isChanged() )
1137
+ element.setAttribute( 'lang', this.getValue() );
1138
+ }
1139
+ }
1140
+ } ]
1141
+ },
1142
+ {
1143
+ type: 'text',
1144
+ id: 'txtGenLongDescr',
1145
+ requiredContent: 'img[longdesc]',
1146
+ label: editor.lang.common.longDescr,
1147
+ setup: function( type, element ) {
1148
+ if ( type == IMAGE )
1149
+ this.setValue( element.getAttribute( 'longDesc' ) );
1150
+ },
1151
+ commit: function( type, element ) {
1152
+ if ( type == IMAGE ) {
1153
+ if ( this.getValue() || this.isChanged() )
1154
+ element.setAttribute( 'longDesc', this.getValue() );
1155
+ }
1156
+ }
1157
+ },
1158
+ {
1159
+ type: 'hbox',
1160
+ widths: [ '50%', '50%' ],
1161
+ children: [ {
1162
+ type: 'text',
1163
+ id: 'txtGenClass',
1164
+ requiredContent: 'img(cke-xyz)', // Random text like 'xyz' will check if all are allowed.
1165
+ label: editor.lang.common.cssClass,
1166
+ 'default': '',
1167
+ setup: function( type, element ) {
1168
+ if ( type == IMAGE )
1169
+ this.setValue( element.getAttribute( 'class' ) );
1170
+ },
1171
+ commit: function( type, element ) {
1172
+ if ( type == IMAGE ) {
1173
+ if ( this.getValue() || this.isChanged() )
1174
+ element.setAttribute( 'class', this.getValue() );
1175
+ }
1176
+ }
1177
+ },
1178
+ {
1179
+ type: 'text',
1180
+ id: 'txtGenTitle',
1181
+ requiredContent: 'img[title]',
1182
+ label: editor.lang.common.advisoryTitle,
1183
+ 'default': '',
1184
+ onChange: function() {
1185
+ updatePreview( this.getDialog() );
1186
+ },
1187
+ setup: function( type, element ) {
1188
+ if ( type == IMAGE )
1189
+ this.setValue( element.getAttribute( 'title' ) );
1190
+ },
1191
+ commit: function( type, element ) {
1192
+ if ( type == IMAGE ) {
1193
+ if ( this.getValue() || this.isChanged() )
1194
+ element.setAttribute( 'title', this.getValue() );
1195
+ } else if ( type == PREVIEW )
1196
+ element.setAttribute( 'title', this.getValue() );
1197
+ else if ( type == CLEANUP ) {
1198
+ element.removeAttribute( 'title' );
1199
+ }
1200
+ }
1201
+ } ]
1202
+ },
1203
+ {
1204
+ type: 'text',
1205
+ id: 'txtdlgGenStyle',
1206
+ requiredContent: 'img{cke-xyz}', // Random text like 'xyz' will check if all are allowed.
1207
+ label: editor.lang.common.cssStyle,
1208
+ validate: CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),
1209
+ 'default': '',
1210
+ setup: function( type, element ) {
1211
+ if ( type == IMAGE ) {
1212
+ var genStyle = element.getAttribute( 'style' );
1213
+ if ( !genStyle && element.$.style.cssText )
1214
+ genStyle = element.$.style.cssText;
1215
+ this.setValue( genStyle );
1216
+
1217
+ var height = element.$.style.height,
1218
+ width = element.$.style.width,
1219
+ aMatchH = ( height ? height : '' ).match( regexGetSize ),
1220
+ aMatchW = ( width ? width : '' ).match( regexGetSize );
1221
+
1222
+ this.attributesInStyle = {
1223
+ height: !!aMatchH,
1224
+ width: !!aMatchW
1225
+ };
1226
+ }
1227
+ },
1228
+ onChange: function() {
1229
+ commitInternally.call(
1230
+ this, [
1231
+ 'info:cmbFloat',
1232
+ 'info:cmbAlign',
1233
+ 'info:txtVSpace',
1234
+ 'info:txtHSpace',
1235
+ 'info:txtBorder',
1236
+ 'info:txtWidth',
1237
+ 'info:txtHeight'
1238
+ ]
1239
+ );
1240
+ updatePreview( this );
1241
+ },
1242
+ commit: function( type, element ) {
1243
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) )
1244
+ element.setAttribute( 'style', this.getValue() );
1245
+
1246
+ }
1247
+ } ]
1248
+ } ]
1249
+ };
1250
+ };
1251
+
1252
+ CKEDITOR.dialog.add( 'image', function( editor ) {
1253
+ return imageDialog( editor, 'image' );
1254
+ } );
1255
+
1256
+ CKEDITOR.dialog.add( 'imagebutton', function( editor ) {
1257
+ return imageDialog( editor, 'imagebutton' );
1258
+ } );
1259
+ } )();