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.
- checksums.yaml +4 -4
- data/app/assets/images/close.png +0 -0
- data/app/assets/images/lock-open.png +0 -0
- data/app/assets/images/lock.png +0 -0
- data/app/assets/images/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/CHANGES.md +832 -163
- data/app/assets/javascripts/ckeditor/LICENSE.md +23 -7
- data/app/assets/javascripts/ckeditor/README.md +5 -5
- data/app/assets/javascripts/ckeditor/SECURITY.md +10 -0
- data/app/assets/javascripts/ckeditor/adapters/jquery.js +6 -6
- data/app/assets/javascripts/ckeditor/bender-runner.config.json +16 -0
- data/app/assets/javascripts/ckeditor/build-config.js +30 -12
- data/app/assets/javascripts/ckeditor/ckeditor.js +1216 -1040
- data/app/assets/javascripts/ckeditor/config.js +9 -32
- data/app/assets/javascripts/ckeditor/contents.css +1 -1
- data/app/assets/javascripts/ckeditor/lang/af.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ar.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/az.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/bg.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/bn.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/bs.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ca.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/cs.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/cy.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/da.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/de-ch.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/de.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/el.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/en-au.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/en-ca.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/en-gb.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/en.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/eo.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/es-mx.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/es.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/et.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/eu.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/fa.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/fi.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/fo.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/fr-ca.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/fr.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/gl.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/gu.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/he.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/hi.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/hr.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/hu.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/id.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/is.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/it.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ja.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ka.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/km.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ko.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ku.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/lt.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/lv.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/mk.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/mn.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ms.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/nb.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/nl.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/no.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/oc.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/pl.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/pt-br.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/pt.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ro.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ru.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/si.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/sk.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/sl.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/sq.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/sr-latn.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/sr.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/sv.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/th.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/tr.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/tt.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/ug.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/uk.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/vi.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/zh-cn.js +3 -3
- data/app/assets/javascripts/ckeditor/lang/zh.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +6 -6
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/af.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +8 -7
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/az.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +9 -8
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +6 -6
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de-ch.js +10 -9
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en-au.js +8 -8
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en-gb.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es-mx.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +8 -8
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eu.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fo.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr-ca.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gl.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/id.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +4 -3
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +9 -8
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +8 -7
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/oc.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/si.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +4 -3
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sq.js +8 -7
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js +9 -8
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js +9 -8
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tt.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +4 -4
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js +6 -6
- data/app/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +1 -1
- data/app/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +11 -11
- data/app/assets/javascripts/ckeditor/plugins/copyformatting/cursors/cursor-disabled.svg +25 -0
- data/app/assets/javascripts/ckeditor/plugins/copyformatting/cursors/cursor.svg +14 -0
- data/app/assets/javascripts/ckeditor/plugins/copyformatting/styles/copyformatting.css +45 -0
- data/app/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/dialog/styles/dialog.css +18 -0
- data/app/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -8
- data/app/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +26 -0
- data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image-org.js +44 -0
- data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +1286 -44
- data/app/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +5 -5
- data/app/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +26 -24
- data/app/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -0
- data/app/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/pastefromgdocs/filter/default.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/pastefromlibreoffice/filter/default.js +11 -0
- data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +39 -52
- data/app/assets/javascripts/ckeditor/plugins/pastetools/filter/common.js +24 -0
- data/app/assets/javascripts/ckeditor/plugins/pastetools/filter/image.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/preview/images/pagebreak.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/preview/preview.html +13 -0
- data/app/assets/javascripts/ckeditor/plugins/preview/styles/screen.css +10 -0
- data/app/assets/javascripts/ckeditor/plugins/scayt/CHANGELOG.md +1 -17
- data/app/assets/javascripts/ckeditor/plugins/scayt/README.md +63 -7
- data/app/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +32 -32
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/af.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ar.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/az.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/bg.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ca.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cs.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cy.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/da.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/de-ch.js +6 -6
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/de.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/el.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en-au.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en-ca.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en-gb.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/eo.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/es-mx.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/es.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/et.js +8 -10
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/eu.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fa.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fi.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr-ca.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/gl.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hu.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/id.js +10 -10
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/it.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ja.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/km.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ko.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/lt.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/lv.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nb.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nl.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/no.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/oc.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pl.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ro.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/si.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sk.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sl.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sq.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sr-latn.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sr.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sv.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/th.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/tr.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/tt.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/uk.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/vi.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +11 -11
- data/app/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +19 -18
- data/app/assets/javascripts/ckeditor/plugins/tableselection/styles/tableselection.css +10 -0
- data/app/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +15 -15
- data/app/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +84 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +11 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/templatedefinition.js +4 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/default.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/app/assets/javascripts/ckeditor/samples/css/samples.css +1 -1
- data/app/assets/javascripts/ckeditor/samples/index.html +11 -9
- data/app/assets/javascripts/ckeditor/samples/js/sample.js +1 -1
- data/app/assets/javascripts/ckeditor/samples/js/sf.js +1 -1
- data/app/assets/javascripts/ckeditor/samples/old/ajax.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/api.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/appendto.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +1 -1
- data/app/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +4 -3
- data/app/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +1 -1
- data/app/assets/javascripts/ckeditor/samples/old/datafiltering.html +8 -8
- data/app/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +1 -1
- data/app/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/divreplace.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/index.html +11 -13
- data/app/assets/javascripts/ckeditor/samples/old/inlineall.html +6 -6
- data/app/assets/javascripts/ckeditor/samples/old/inlinebycode.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/jquery.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/readonly.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/replacebyclass.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/replacebycode.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/sample.css +1 -1
- data/app/assets/javascripts/ckeditor/samples/old/sample.js +1 -1
- data/app/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +1 -1
- data/app/assets/javascripts/ckeditor/samples/old/tabindex.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +4 -4
- data/app/assets/javascripts/ckeditor/samples/old/uicolor.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/uilanguages.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +5 -5
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +7 -6
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +4 -4
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/arrow.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-lisa/images/spinner.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/{moono → moono-lisa}/readme.md +9 -12
- data/app/assets/javascripts/ckeditor/styles.js +1 -1
- data/app/assets/javascripts/ckeditor/vendor/promise.js +13 -0
- data/app/assets/javascripts/drg_default_html_editor_cms.js +1 -4
- data/app/assets/stylesheets/drg_default_html_editor_cms.css +3 -3
- data/app/models/drgcms_form_fields/ckeditor.rb +12 -13
- data/lib/drg_default_html_editor/version.rb +1 -1
- data/lib/drg_default_html_editor.rb +2 -2
- data/lib/tasks/drg_default_html_editor_tasks.rake +16 -4
- metadata +95 -166
- data/app/assets/javascripts/ckeditor/plugins/dialogadvtab/plugin.js +0 -196
- data/app/assets/javascripts/ckeditor/plugins/pastecode/CHANGES.md +0 -8
- data/app/assets/javascripts/ckeditor/plugins/pastefromexcel/LICENSE.md +0 -1242
- data/app/assets/javascripts/ckeditor/plugins/pastefromexcel/README.md +0 -23
- data/app/assets/javascripts/ckeditor/plugins/pastefromexcel/tests/pastefromexcel.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +0 -28
- data/app/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -25
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -66
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -52
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -82
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -91
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc_ie.js +0 -11
- data/app/assets/javascripts/ckeditor/plugins/wsc/skins/moono-lisa/wsc.css +0 -43
- data/app/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
- data/app/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
- data/app/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/swfobject.js +0 -19
- data/app/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +0 -283
- data/app/assets/javascripts/ckeditor/skins/moono/dialog.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_ie.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/anchor.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
- data/app/assets/javascripts/elfinder/Changelog +0 -494
- data/app/assets/javascripts/elfinder/LICENSE.md +0 -15
- data/app/assets/javascripts/elfinder/README.md +0 -209
- data/app/assets/javascripts/elfinder/bower.json +0 -28
- data/app/assets/javascripts/elfinder/composer.json +0 -39
- data/app/assets/javascripts/elfinder/css/elfinder.full.css +0 -3034
- data/app/assets/javascripts/elfinder/css/elfinder.min.css +0 -9
- data/app/assets/javascripts/elfinder/css/theme.css +0 -68
- data/app/assets/javascripts/elfinder/elfinder.html +0 -61
- data/app/assets/javascripts/elfinder/img/arrows-active.png +0 -0
- data/app/assets/javascripts/elfinder/img/arrows-normal.png +0 -0
- data/app/assets/javascripts/elfinder/img/crop.gif +0 -0
- data/app/assets/javascripts/elfinder/img/dialogs.png +0 -0
- data/app/assets/javascripts/elfinder/img/icons-big.png +0 -0
- data/app/assets/javascripts/elfinder/img/icons-small.png +0 -0
- data/app/assets/javascripts/elfinder/img/logo.png +0 -0
- data/app/assets/javascripts/elfinder/img/progress.gif +0 -0
- data/app/assets/javascripts/elfinder/img/quicklook-bg.png +0 -0
- data/app/assets/javascripts/elfinder/img/quicklook-icons.png +0 -0
- data/app/assets/javascripts/elfinder/img/resize.png +0 -0
- data/app/assets/javascripts/elfinder/img/spinner-mini.gif +0 -0
- data/app/assets/javascripts/elfinder/img/toolbar.png +0 -0
- data/app/assets/javascripts/elfinder/img/volume_icon_box.png +0 -0
- data/app/assets/javascripts/elfinder/img/volume_icon_dropbox.png +0 -0
- data/app/assets/javascripts/elfinder/img/volume_icon_ftp.png +0 -0
- data/app/assets/javascripts/elfinder/img/volume_icon_googledrive.png +0 -0
- data/app/assets/javascripts/elfinder/img/volume_icon_local.png +0 -0
- data/app/assets/javascripts/elfinder/img/volume_icon_onedrive.png +0 -0
- data/app/assets/javascripts/elfinder/img/volume_icon_sql.png +0 -0
- data/app/assets/javascripts/elfinder/js/elfinder.full.js +0 -23025
- data/app/assets/javascripts/elfinder/js/elfinder.min.js +0 -20
- data/app/assets/javascripts/elfinder/js/extras/encoding-japanese.min.js +0 -35
- data/app/assets/javascripts/elfinder/js/extras/quicklook.googledocs.js +0 -69
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.LANG.js +0 -479
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.ar.js +0 -375
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.bg.js +0 -412
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.ca.js +0 -375
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.cs.js +0 -469
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.da.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.de.js +0 -457
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.el.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.es.js +0 -433
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.fa.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.fallback.js +0 -11
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.fo.js +0 -419
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.fr.js +0 -419
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.he.js +0 -375
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.hr.js +0 -434
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.hu.js +0 -447
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.id.js +0 -373
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.it.js +0 -448
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.jp.js +0 -474
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.ko.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.nl.js +0 -419
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.no.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.pl.js +0 -455
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.pt_BR.js +0 -438
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.ro.js +0 -417
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.ru.js +0 -440
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.sk.js +0 -469
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.sl.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.sr.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.sv.js +0 -375
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.tr.js +0 -468
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.ug_CN.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.uk.js +0 -391
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.vi.js +0 -374
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.zh_CN.js +0 -467
- data/app/assets/javascripts/elfinder/js/i18n/elfinder.zh_TW.js +0 -472
- data/app/assets/javascripts/elfinder/js/proxy/elFinderSupportVer1.js +0 -420
- data/app/assets/javascripts/elfinder/main.default.js +0 -94
- data/app/assets/javascripts/elfinder/package.json +0 -13
- data/app/assets/javascripts/elfinder/sounds/rm.wav +0 -0
- data/app/controllers/dc_elfinder_controller.rb +0 -62
- data/app/models/drgcms_form_fields/elfinder.rb +0 -88
- data/config/initializers/load_patches.rb +0 -30
- data/config/routes.rb +0 -2
- data/lib/drg_default_html_editor.rb~ +0 -6
- data/lib/patches/patch_for_elfinder.rb +0 -114
- data/lib/tasks/drg_default_html_editor_copy_assets.rake +0 -18
- /data/app/assets/{javascripts/ckeditor/skins/moono/images → images}/arrow.png +0 -0
- /data/app/assets/{javascripts/ckeditor/skins/moono/images → images}/spinner.gif +0 -0
@@ -1,44 +1,1286 @@
|
|
1
|
-
|
2
|
-
Copyright (c) 2003-
|
3
|
-
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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"> </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
|
+
} )();
|