drg_default_html_editor 0.6.0.0 → 0.7.0.3

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