glebtv-ckeditor 4.7.3.1 → 4.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +0 -9
- data/app/assets/javascripts/ckeditor/config.js.erb +3 -3
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +317 -313
- data/config/locales/bg.ckeditor.yml +9 -0
- data/config/locales/cs.ckeditor.yml +9 -0
- data/config/locales/de.ckeditor.yml +9 -0
- data/config/locales/el-GR.cdkeditor.yml +9 -0
- data/config/locales/es.ckeditor.yml +9 -0
- data/config/locales/fr.ckeditor.yml +9 -0
- data/config/locales/hu.ckeditor.yml +9 -0
- data/config/locales/it.ckeditor.yml +9 -0
- data/config/locales/ja.ckeditor.yml +9 -0
- data/config/locales/nb.ckeditor.yml +9 -0
- data/config/locales/nl.ckeditor.yml +9 -0
- data/config/locales/pl.ckeditor.yml +9 -0
- data/config/locales/pt-BR.ckeditor.yml +9 -0
- data/config/locales/pt-PT.ckeditor.yml +9 -0
- data/config/locales/pt.ckeditor.yml +9 -0
- data/config/locales/sq.ckeditor.yml +9 -0
- data/config/locales/sv-SE.ckeditor.yml +9 -0
- data/config/locales/tr.ckeditor.yml +9 -0
- data/config/locales/uk.ckeditor.yml +9 -0
- data/config/locales/zh-CN.ckeditor.yml +9 -0
- data/config/locales/zh-TW.ckeditor.yml +9 -0
- data/lib/ckeditor/asset_response.rb +6 -2
- data/lib/ckeditor/http.rb +5 -7
- data/lib/ckeditor/utils/content_type_detector.rb +3 -3
- data/lib/ckeditor/version.rb +2 -2
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +1128 -849
- data/vendor/assets/javascripts/ckeditor/LICENSE.md +3 -3
- data/vendor/assets/javascripts/ckeditor/README.md +6 -6
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +2 -2
- data/vendor/assets/javascripts/ckeditor/build-config.js +11 -6
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +825 -688
- data/vendor/assets/javascripts/ckeditor/config.js +2 -2
- data/vendor/assets/javascripts/ckeditor/contents.css +7 -7
- data/vendor/assets/javascripts/ckeditor/lang/af.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ar.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/az.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/bg.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/bn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/bs.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/da.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/de-ch.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/de.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/el.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en.js +3 -3
- data/vendor/assets/javascripts/ckeditor/lang/eo.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/es-mx.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/es.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/et.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/eu.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fa.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fo.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/gl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/gu.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/he.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/hi.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/hr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/hu.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/id.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/is.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/it.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ka.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/km.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ko.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ku.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/lt.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/lv.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/mk.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/mn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ms.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/no.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/oc.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/pl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/pt.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ro.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/lang/si.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sk.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sq.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/th.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/tt.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ug.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/uk.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/vi.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -7
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autocomplete.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autoformat.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/commentselectedrange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/searchcode.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/uncommentselectedrange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -6
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +231 -217
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +46 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +34 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +42 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -0
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +11 -11
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +23 -23
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +7 -7
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +4 -3
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +1259 -44
- data/vendor/assets/javascripts/ckeditor/plugins/image/icons/hidpi/image.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/icons/image.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/lang/en.js +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/lang/ru.js +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/plugin.js +184 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +35 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +339 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +553 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/image.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/en.js +21 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +21 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/plugin.js +1720 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +68 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +28 -26
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -7
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +53 -51
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +31 -32
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -6
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +6 -6
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -15
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +468 -377
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/maxParagraphs.html +26 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +82 -82
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +449 -448
- data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +28 -23
- data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/logo.svg +13 -0
- data/vendor/assets/javascripts/ckeditor/samples/index.html +16 -16
- data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +4 -4
- data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +2 -2
- data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +5 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/api.html +14 -14
- data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +7 -7
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +2 -2
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +4 -4
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +2 -2
- data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +14 -14
- data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +2 -2
- data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +8 -8
- data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +5 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +8 -8
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +6 -6
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +7 -7
- data/vendor/assets/javascripts/ckeditor/samples/old/index.html +8 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +10 -10
- data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +6 -6
- data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +6 -6
- data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +6 -6
- data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +5 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +8 -8
- data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +5 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +5 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +2 -2
- data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +2 -2
- data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +2 -2
- data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/assets/sample.css +70 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/stylesheetparser.html +85 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +5 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +8 -8
- data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +6 -6
- data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +8 -8
- data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +5 -5
- data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +6 -6
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +12 -12
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +123 -1
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +3 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +4 -4
- data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/styles.js +4 -4
- metadata +179 -56
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -169
- data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +0 -929
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
3
|
-
For licensing, see LICENSE.md or
|
2
|
+
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
4
|
*/
|
5
5
|
(function(){function v(a){for(var f=0,n=0,l=0,p,e=a.$.rows.length;l<e;l++){p=a.$.rows[l];for(var d=f=0,b,c=p.cells.length;d<c;d++)b=p.cells[d],f+=b.colSpan;f>n&&(n=f)}return n}function r(a){return function(){var f=this.getValue(),f=!!(CKEDITOR.dialog.validate.integer()(f)&&0<f);f||(alert(a),this.select());return f}}function q(a,f){var n=function(e){return new CKEDITOR.dom.element(e,a.document)},q=a.editable(),p=a.plugins.dialogadvtab;return{title:a.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?
|
6
6
|
310:280,onLoad:function(){var e=this,a=e.getContentElement("advanced","advStyles");if(a)a.on("change",function(){var a=this.getStyle("width",""),c=e.getContentElement("info","txtWidth");c&&c.setValue(a,!0);a=this.getStyle("height","");(c=e.getContentElement("info","txtHeight"))&&c.setValue(a,!0)})},onShow:function(){var e=a.getSelection(),d=e.getRanges(),b,c=this.getContentElement("info","txtRows"),g=this.getContentElement("info","txtCols"),t=this.getContentElement("info","txtWidth"),m=this.getContentElement("info",
|
@@ -11,8 +11,8 @@ f))for(h=0;h<b.$.rows.length;h++)g=new CKEDITOR.dom.element(b.$.rows[h].cells[0]
|
|
11
11
|
b.getAttribute("style")||b.removeAttribute("style")}if(this._.selectedElement)try{e.selectBookmarks(d)}catch(p){}else a.insertElement(b),setTimeout(function(){var e=new CKEDITOR.dom.element(b.$.rows[0].cells[0]),c=a.createRange();c.moveToPosition(e,CKEDITOR.POSITION_AFTER_START);c.select()},0)},contents:[{id:"info",label:a.lang.table.title,elements:[{type:"hbox",widths:[null,null],styles:["vertical-align:top"],children:[{type:"vbox",padding:0,children:[{type:"text",id:"txtRows","default":3,label:a.lang.table.rows,
|
12
12
|
required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidRows),setup:function(e){this.setValue(e.$.rows.length)},commit:l},{type:"text",id:"txtCols","default":2,label:a.lang.table.columns,required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidCols),setup:function(e){this.setValue(v(e))},commit:l},{type:"html",html:"\x26nbsp;"},{type:"select",id:"selHeaders",requiredContent:"th","default":"",label:a.lang.table.headers,items:[[a.lang.table.headersNone,""],[a.lang.table.headersRow,
|
13
13
|
"row"],[a.lang.table.headersColumn,"col"],[a.lang.table.headersBoth,"both"]],setup:function(e){var a=this.getDialog();a.hasColumnHeaders=!0;for(var b=0;b<e.$.rows.length;b++){var c=e.$.rows[b].cells[0];if(c&&"th"!=c.nodeName.toLowerCase()){a.hasColumnHeaders=!1;break}}null!==e.$.tHead?this.setValue(a.hasColumnHeaders?"both":"row"):this.setValue(a.hasColumnHeaders?"col":"")},commit:l},{type:"text",id:"txtBorder",requiredContent:"table[border]","default":a.filter.check("table[border]")?1:0,label:a.lang.table.border,
|
14
|
-
controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||"")},commit:function(a,d){this.getValue()?d.setAttribute("border",this.getValue()):d.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align,items:[[a.lang.common.notSet,""],[a.lang.common.
|
15
|
-
|
14
|
+
controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||"")},commit:function(a,d){this.getValue()?d.setAttribute("border",this.getValue()):d.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align,items:[[a.lang.common.notSet,""],[a.lang.common.left,"left"],[a.lang.common.center,"center"],[a.lang.common.right,"right"]],setup:function(a){this.setValue(a.getAttribute("align")||
|
15
|
+
"")},commit:function(a,d){this.getValue()?d.setAttribute("align",this.getValue()):d.removeAttribute("align")}}]},{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip,"default":a.filter.check("table{width}")?500>q.getSize("width")?"100%":500:0,getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",
|
16
16
|
a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("width",this.getValue())},setup:function(a){a=a.getStyle("width");this.setValue(a)},commit:l}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",
|
17
17
|
a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:l}]},{type:"html",html:"\x26nbsp;"},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),
|
18
18
|
setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellSpacing",this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,
|
@@ -1,17 +1,18 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
3
|
-
For licensing, see LICENSE.md or
|
2
|
+
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
4
|
*/
|
5
|
-
CKEDITOR.dialog.add("cellProperties",function(
|
6
|
-
|
7
|
-
"widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10);a=parseInt(a.getStyle("width"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||l(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},
|
8
|
-
label:
|
9
|
-
|
10
|
-
a.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
5
|
+
CKEDITOR.dialog.add("cellProperties",function(f){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&"select"==this.type&&!c&&(this.getInputElement().$.selectedIndex=-1))}}function l(a){if(a=n.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=f.lang.table,c=h.cell,e=f.lang.common,k=CKEDITOR.dialog.validate,n=/^(\d+(?:\.\d+)?)(px|%)$/,g={type:"html",html:"\x26nbsp;"},p="rtl"==
|
6
|
+
f.lang.dir,m=f.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",requiredContent:"td{width,height}",label:e.width,validate:k.number(c.invalidWidth),onLoad:function(){var a=
|
7
|
+
this.getDialog().getContentElement("info","widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10);a=parseInt(a.getStyle("width"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||l(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},
|
8
|
+
"default":""},{type:"select",id:"widthType",requiredContent:"td{width,height}",label:f.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(l)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",requiredContent:"td{width,height}",label:e.height,width:"100px","default":"",validate:k.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),
|
9
|
+
c=b.getAttribute("aria-labelledby");this.getDialog().getContentElement("info","height").isVisible()&&(a.setHtml("\x3cbr /\x3e"+h.widthPx),a.setStyle("display","block"),this.getDialog().getContentElement("info","hiddenSpacer").getElement().setStyle("display","block"));b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("height"),10);a=parseInt(a.getStyle("height"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),
|
10
|
+
10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"",style:"display: none"}]},{type:"html",id:"hiddenSpacer",html:"\x26nbsp;",style:"display: none"},{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==a.getStyle("white-space")||b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space",
|
11
|
+
"nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},g,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.left,"left"],[e.center,"center"],[e.right,"right"],[e.justify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,
|
12
|
+
""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign");a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},g,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,
|
13
|
+
"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},g,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:k.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",
|
14
|
+
validate:k.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},g,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",
|
15
|
+
this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},m?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:g]},g,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",
|
16
|
+
setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},m?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(p?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&
|
17
|
+
this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:g]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells)},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()},onLoad:function(){var a={};this.foreach(function(b){b.setup&&
|
18
|
+
b.commit&&(b.setup=CKEDITOR.tools.override(b.setup,function(c){return function(){c.apply(this,arguments);a[b.id]=b.getValue()}}),b.commit=CKEDITOR.tools.override(b.commit,function(c){return function(){a[b.id]!==b.getValue()&&c.apply(this,arguments)}}))})}}});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
3
|
-
For licensing, see LICENSE.md or
|
2
|
+
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
4
|
*/
|
5
5
|
|
6
6
|
.cke_tpl_list
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
3
|
-
For licensing, see LICENSE.md or
|
2
|
+
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
4
|
*/
|
5
5
|
(function(){CKEDITOR.dialog.add("templates",function(c){function r(a,b){var m=CKEDITOR.dom.element.createFromHtml('\x3ca href\x3d"javascript:void(0)" tabIndex\x3d"-1" role\x3d"option" \x3e\x3cdiv class\x3d"cke_tpl_item"\x3e\x3c/div\x3e\x3c/a\x3e'),d='\x3ctable style\x3d"width:350px;" class\x3d"cke_tpl_preview" role\x3d"presentation"\x3e\x3ctr\x3e';a.image&&b&&(d+='\x3ctd class\x3d"cke_tpl_preview_img"\x3e\x3cimg src\x3d"'+CKEDITOR.getUrl(b+a.image)+'"'+(CKEDITOR.env.ie6Compat?' onload\x3d"this.width\x3dthis.width"':
|
6
6
|
"")+' alt\x3d"" title\x3d""\x3e\x3c/td\x3e');d+='\x3ctd style\x3d"white-space:normal;"\x3e\x3cspan class\x3d"cke_tpl_title"\x3e'+a.title+"\x3c/span\x3e\x3cbr/\x3e";a.description&&(d+="\x3cspan\x3e"+a.description+"\x3c/span\x3e");d+="\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e";m.getFirst().setHtml(d);m.on("click",function(){t(a.html)});return m}function t(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
3
|
-
For licensing, see LICENSE.md or
|
2
|
+
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
4
|
*/
|
5
5
|
CKEDITOR.addTemplates("default",{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath("templates")+"templates/images/"),templates:[{title:"Image and Title",image:"template1.gif",description:"One main image with a title and text that surround the image.",html:'\x3ch3\x3e\x3cimg src\x3d" " alt\x3d"" style\x3d"margin-right: 10px" height\x3d"100" width\x3d"100" align\x3d"left" /\x3eType the title here\x3c/h3\x3e\x3cp\x3eType the text here\x3c/p\x3e'},{title:"Strange Template",image:"template2.gif",description:"A template that defines two columns, each one with a title, and some text.",
|
6
6
|
html:'\x3ctable cellspacing\x3d"0" cellpadding\x3d"0" style\x3d"width:100%" border\x3d"0"\x3e\x3ctr\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 1\x3c/h3\x3e\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd style\x3d"width:50%"\x3e\x3ch3\x3eTitle 2\x3c/h3\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3eText 1\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3eText 2\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cp\x3eMore text goes here.\x3c/p\x3e'},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.",
|
Binary file
|
@@ -10,6 +10,7 @@ CKEDITOR.plugins.setLang('wordcount', 'en', {
|
|
10
10
|
CharCountWithHTML: 'Characters (with HTML):',
|
11
11
|
CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
|
12
12
|
Paragraphs: 'Paragraphs:',
|
13
|
+
ParagraphsRemaining: 'Paragraphs remaining',
|
13
14
|
pasteWarning: 'Content cannot be pasted because it is above the allowed limit',
|
14
15
|
Selected: 'Selected: ',
|
15
16
|
title: 'Statistics'
|
@@ -5,8 +5,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
5
5
|
CKEDITOR.plugins.setLang('wordcount', 'ru', {
|
6
6
|
WordCount: 'Слов:',
|
7
7
|
CharCount: 'Символов:',
|
8
|
-
CharCountWithHTML: ' (включая HTML
|
8
|
+
CharCountWithHTML: ' (включая HTML-разметку):',
|
9
9
|
Paragraphs: 'Параграфов:',
|
10
|
+
ParagraphsRemaining: 'Параграфов осталось',
|
10
11
|
pasteWarning: 'Контент не может быть вставлен, т.к. привышает допустимый лимит',
|
11
12
|
Selected: 'Выделено: ',
|
12
13
|
title: 'Статистика'
|
@@ -3,195 +3,211 @@
|
|
3
3
|
* For licensing, see LICENSE.html or http://ckeditor.com/license
|
4
4
|
*/
|
5
5
|
|
6
|
-
CKEDITOR.plugins.add("wordcount",
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
6
|
+
CKEDITOR.plugins.add("wordcount",
|
7
|
+
{
|
8
|
+
lang: "ar,bg,ca,cs,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ko,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,uk,zh-cn,zh,ro", // %REMOVE_LINE_CORE%
|
9
|
+
version: "1.17.4",
|
10
|
+
requires: 'htmlwriter,notification,undo',
|
11
|
+
bbcodePluginLoaded: false,
|
12
|
+
onLoad: function() {
|
13
|
+
CKEDITOR.document.appendStyleSheet(this.path + "css/wordcount.css");
|
14
|
+
},
|
15
|
+
init: function(editor) {
|
16
|
+
var defaultFormat = "",
|
17
|
+
lastWordCount = -1,
|
18
|
+
lastCharCount = -1,
|
19
|
+
lastParagraphs = -1,
|
20
|
+
limitReachedNotified = false,
|
21
|
+
limitRestoredNotified = false,
|
22
|
+
timeoutId = 0,
|
23
|
+
notification = null;
|
24
|
+
|
25
|
+
|
26
|
+
var dispatchEvent = function(type, currentLength, maxLength) {
|
27
|
+
if (typeof document.dispatchEvent == 'undefined') {
|
28
|
+
return;
|
29
|
+
}
|
29
30
|
|
30
|
-
|
31
|
+
type = 'ckeditor.wordcount.' + type;
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
var cEvent;
|
34
|
+
var eventInitDict = {
|
35
|
+
bubbles: false,
|
36
|
+
cancelable: true,
|
37
|
+
detail: {
|
38
|
+
currentLength: currentLength,
|
39
|
+
maxLength: maxLength
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
try {
|
44
|
+
cEvent = new CustomEvent(type, eventInitDict);
|
45
|
+
} catch (o_O) {
|
46
|
+
cEvent = document.createEvent('CustomEvent');
|
47
|
+
cEvent.initCustomEvent(
|
48
|
+
type,
|
49
|
+
eventInitDict.bubbles,
|
50
|
+
eventInitDict.cancelable,
|
51
|
+
eventInitDict.detail
|
52
|
+
);
|
39
53
|
}
|
54
|
+
|
55
|
+
document.dispatchEvent(cEvent);
|
40
56
|
};
|
41
57
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
58
|
+
// Default Config
|
59
|
+
var defaultConfig = {
|
60
|
+
showRemaining: false,
|
61
|
+
showParagraphs: true,
|
62
|
+
showWordCount: true,
|
63
|
+
showCharCount: false,
|
64
|
+
countBytesAsChars: false,
|
65
|
+
countSpacesAsChars: false,
|
66
|
+
countHTML: false,
|
67
|
+
countLineBreaks: false,
|
68
|
+
hardLimit: true,
|
69
|
+
|
70
|
+
//MAXLENGTH Properties
|
71
|
+
maxWordCount: -1,
|
72
|
+
maxCharCount: -1,
|
73
|
+
maxParagraphs: -1,
|
74
|
+
|
75
|
+
// Filter
|
76
|
+
filter: null,
|
77
|
+
|
78
|
+
// How long to show the 'paste' warning
|
79
|
+
pasteWarningDuration: 0,
|
80
|
+
|
81
|
+
//DisAllowed functions
|
82
|
+
wordCountGreaterThanMaxLengthEvent: function(currentLength, maxLength) {
|
83
|
+
dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
84
|
+
},
|
85
|
+
charCountGreaterThanMaxLengthEvent: function(currentLength, maxLength) {
|
86
|
+
dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
87
|
+
},
|
88
|
+
|
89
|
+
//Allowed Functions
|
90
|
+
wordCountLessThanMaxLengthEvent: function(currentLength, maxLength) {
|
91
|
+
dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
|
92
|
+
},
|
93
|
+
charCountLessThanMaxLengthEvent: function(currentLength, maxLength) {
|
94
|
+
dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
|
95
|
+
}
|
96
|
+
};
|
53
97
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
//MAXLENGTH Properties
|
70
|
-
maxWordCount: -1,
|
71
|
-
maxCharCount: -1,
|
72
|
-
|
73
|
-
// Filter
|
74
|
-
filter: null,
|
75
|
-
|
76
|
-
// How long to show the 'paste' warning
|
77
|
-
pasteWarningDuration: 0,
|
78
|
-
|
79
|
-
//DisAllowed functions
|
80
|
-
wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
81
|
-
dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
82
|
-
},
|
83
|
-
charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
84
|
-
dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
85
|
-
},
|
86
|
-
|
87
|
-
//Allowed Functions
|
88
|
-
wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
89
|
-
dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
|
90
|
-
},
|
91
|
-
charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
92
|
-
dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
|
98
|
+
// Get Config & Lang
|
99
|
+
var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true);
|
100
|
+
|
101
|
+
if (config.showParagraphs) {
|
102
|
+
if (config.maxParagraphs > -1) {
|
103
|
+
if (config.showRemaining) {
|
104
|
+
defaultFormat += "%paragraphsCount% " + editor.lang.wordcount.ParagraphsRemaining;
|
105
|
+
} else {
|
106
|
+
defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphsCount%";
|
107
|
+
|
108
|
+
defaultFormat += "/" + config.maxParagraphs;
|
109
|
+
}
|
110
|
+
} else {
|
111
|
+
defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphsCount%";
|
112
|
+
}
|
93
113
|
}
|
94
|
-
};
|
95
|
-
|
96
|
-
// Get Config & Lang
|
97
|
-
var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true);
|
98
114
|
|
99
|
-
|
100
|
-
|
101
|
-
|
115
|
+
if (config.showParagraphs && (config.showWordCount || config.showCharCount)) {
|
116
|
+
defaultFormat += ", ";
|
117
|
+
}
|
102
118
|
|
103
|
-
|
104
|
-
|
105
|
-
|
119
|
+
if (config.showWordCount) {
|
120
|
+
if (config.maxWordCount > -1) {
|
121
|
+
if (config.showRemaining) {
|
122
|
+
defaultFormat += "%wordCount% " + editor.lang.wordcount.WordCountRemaining;
|
123
|
+
} else {
|
124
|
+
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
106
125
|
|
107
|
-
|
108
|
-
|
109
|
-
if (config.showRemaining) {
|
110
|
-
defaultFormat += "%wordCount% " + editor.lang.wordcount.WordCountRemaining;
|
126
|
+
defaultFormat += "/" + config.maxWordCount;
|
127
|
+
}
|
111
128
|
} else {
|
112
129
|
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
113
|
-
|
114
|
-
defaultFormat += "/" + config.maxWordCount;
|
115
130
|
}
|
116
|
-
} else {
|
117
|
-
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
118
131
|
}
|
119
|
-
}
|
120
132
|
|
121
|
-
|
122
|
-
|
123
|
-
|
133
|
+
if (config.showCharCount && config.showWordCount) {
|
134
|
+
defaultFormat += ", ";
|
135
|
+
}
|
124
136
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
137
|
+
if (config.showCharCount) {
|
138
|
+
if (config.maxCharCount > -1) {
|
139
|
+
if (config.showRemaining) {
|
140
|
+
defaultFormat += "%charCount% " +
|
141
|
+
editor.lang.wordcount[config.countHTML
|
142
|
+
? "CharCountWithHTMLRemaining"
|
143
|
+
: "CharCountRemaining"];
|
144
|
+
} else {
|
145
|
+
defaultFormat += editor.lang.wordcount[config.countHTML
|
146
|
+
? "CharCountWithHTML"
|
147
|
+
: "CharCount"] +
|
148
|
+
" %charCount%";
|
149
|
+
|
150
|
+
defaultFormat += "/" + config.maxCharCount;
|
151
|
+
}
|
131
152
|
} else {
|
132
|
-
defaultFormat += editor.lang.wordcount[config.countHTML
|
133
|
-
|
134
|
-
: "CharCount"] + " %charCount%";
|
135
|
-
|
136
|
-
defaultFormat += "/" + config.maxCharCount;
|
153
|
+
defaultFormat += editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"] +
|
154
|
+
" %charCount%";
|
137
155
|
}
|
138
|
-
} else {
|
139
|
-
defaultFormat += editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"] + " %charCount%";
|
140
156
|
}
|
141
|
-
}
|
142
|
-
|
143
|
-
var format = defaultFormat;
|
144
157
|
|
145
|
-
|
158
|
+
var format = defaultFormat;
|
146
159
|
|
147
|
-
|
148
|
-
return "cke_wordcount_" + editorInstance.name;
|
149
|
-
}
|
160
|
+
bbcodePluginLoaded = typeof editor.plugins.bbcode != 'undefined';
|
150
161
|
|
151
|
-
|
152
|
-
|
153
|
-
|
162
|
+
function counterId(editorInstance) {
|
163
|
+
return "cke_wordcount_" + editorInstance.name;
|
164
|
+
}
|
154
165
|
|
155
|
-
|
156
|
-
|
157
|
-
// stripping out BBCode tags [...][/...]
|
158
|
-
return html.replace(/\[.*?\]/gi, '');
|
166
|
+
function counterElement(editorInstance) {
|
167
|
+
return document.getElementById(counterId(editorInstance));
|
159
168
|
}
|
160
169
|
|
161
|
-
|
170
|
+
function strip(html) {
|
171
|
+
if (bbcodePluginLoaded) {
|
172
|
+
// stripping out BBCode tags [...][/...]
|
173
|
+
return html.replace(/\[.*?\]/gi, '');
|
174
|
+
}
|
162
175
|
|
163
|
-
|
164
|
-
html = filter(html);
|
176
|
+
var tmp = document.createElement("div");
|
165
177
|
|
166
|
-
|
178
|
+
// Add filter before strip
|
179
|
+
html = filter(html);
|
167
180
|
|
168
|
-
|
169
|
-
return "";
|
170
|
-
}
|
181
|
+
tmp.innerHTML = html;
|
171
182
|
|
172
|
-
|
173
|
-
|
183
|
+
if (tmp.textContent == "" && typeof tmp.innerText == "undefined") {
|
184
|
+
return "";
|
185
|
+
}
|
174
186
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
config.filter
|
185
|
-
|
186
|
-
|
187
|
+
return tmp.textContent || tmp.innerText;
|
188
|
+
}
|
189
|
+
|
190
|
+
/**
|
191
|
+
* Implement filter to add or remove before counting
|
192
|
+
* @param html
|
193
|
+
* @returns string
|
194
|
+
*/
|
195
|
+
function filter(html) {
|
196
|
+
if (config.filter instanceof CKEDITOR.htmlParser.filter) {
|
197
|
+
var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html),
|
198
|
+
writer = new CKEDITOR.htmlParser.basicWriter();
|
199
|
+
config.filter.applyTo(fragment);
|
200
|
+
fragment.writeHtml(writer);
|
201
|
+
return writer.getHtml();
|
202
|
+
}
|
203
|
+
return html;
|
187
204
|
}
|
188
|
-
return html;
|
189
|
-
}
|
190
205
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
206
|
+
function countCharacters(text) {
|
207
|
+
if (config.countHTML) {
|
208
|
+
return (filter(text).length);
|
209
|
+
}
|
210
|
+
|
195
211
|
var normalizedText;
|
196
212
|
|
197
213
|
// strip body tags
|
@@ -211,7 +227,7 @@ CKEDITOR.plugins.add("wordcount", {
|
|
211
227
|
}
|
212
228
|
|
213
229
|
if (config.countLineBreaks) {
|
214
|
-
normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "");
|
230
|
+
normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, " ");
|
215
231
|
} else {
|
216
232
|
normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "").replace(/ /gi, " ");
|
217
233
|
}
|
@@ -220,280 +236,355 @@ CKEDITOR.plugins.add("wordcount", {
|
|
220
236
|
|
221
237
|
return config.countBytesAsChars ? (countBytes(normalizedText)) : (normalizedText.length);
|
222
238
|
}
|
223
|
-
}
|
224
|
-
|
225
|
-
function countBytes(text) {
|
226
|
-
var count = 0, stringLength = text.length, i;
|
227
|
-
text = String(text || "");
|
228
|
-
for (i = 0; i < stringLength; i++) {
|
229
|
-
var partCount = encodeURI(text[i]).split("%").length;
|
230
|
-
count += partCount == 1 ? 1 : partCount - 1;
|
231
|
-
}
|
232
|
-
return count;
|
233
|
-
}
|
234
|
-
|
235
|
-
function countParagraphs(text) {
|
236
|
-
return (text.replace(/ /g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++").split("++").length);
|
237
|
-
}
|
238
|
-
|
239
|
-
function countWords(text) {
|
240
|
-
var normalizedText = text.
|
241
|
-
replace(/(\r\n|\n|\r)/gm, " ").
|
242
|
-
replace(/^\s+|\s+$/g, "").
|
243
|
-
replace(" ", " ");
|
244
|
-
|
245
|
-
normalizedText = strip(normalizedText);
|
246
239
|
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
240
|
+
function countBytes(text) {
|
241
|
+
var count = 0, stringLength = text.length, i;
|
242
|
+
text = String(text || "");
|
243
|
+
for (i = 0; i < stringLength; i++) {
|
244
|
+
var partCount = encodeURI(text[i]).split("%").length;
|
245
|
+
count += partCount == 1 ? 1 : partCount - 1;
|
252
246
|
}
|
247
|
+
return count;
|
253
248
|
}
|
254
249
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
function limitReached(editorInstance, notify) {
|
259
|
-
limitReachedNotified = true;
|
260
|
-
limitRestoredNotified = false;
|
261
|
-
|
262
|
-
if (config.hardLimit) {
|
263
|
-
editorInstance.loadSnapshot(snapShot);
|
264
|
-
// lock editor
|
265
|
-
editorInstance.config.Locked = 1;
|
250
|
+
function countParagraphs(text) {
|
251
|
+
return (text.replace(/ /g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++")
|
252
|
+
.split("++").length);
|
266
253
|
}
|
267
254
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
}
|
272
|
-
}
|
273
|
-
|
274
|
-
function limitRestored(editorInstance) {
|
275
|
-
limitRestoredNotified = true;
|
276
|
-
limitReachedNotified = false;
|
277
|
-
editorInstance.config.Locked = 0;
|
278
|
-
snapShot = editor.getSnapshot();
|
255
|
+
function countWords(text) {
|
256
|
+
var normalizedText = text.replace(/(\r\n|\n|\r)/gm, " ").replace(/^\s+|\s+$/g, "")
|
257
|
+
.replace(" ", " ");
|
279
258
|
|
280
|
-
|
281
|
-
}
|
259
|
+
normalizedText = strip(normalizedText);
|
282
260
|
|
283
|
-
|
284
|
-
var paragraphs = 0,
|
285
|
-
wordCount = 0,
|
286
|
-
charCount = 0,
|
287
|
-
text;
|
288
|
-
|
289
|
-
// BeforeGetData and getData events are fired when calling
|
290
|
-
// getData(). We can prevent this by passing true as an
|
291
|
-
// argument to getData(). This allows us to fire the events
|
292
|
-
// manually with additional event data: firedBy. This additional
|
293
|
-
// data helps differentiate calls to getData() made by
|
294
|
-
// wordCount plugin from calls made by other plugins/code.
|
295
|
-
editorInstance.fire("beforeGetData", {firedBy: "wordCount.updateCounter"}, editor);
|
296
|
-
text = editorInstance.getData(true);
|
297
|
-
editorInstance.fire("getData", {dataValue: text, firedBy: "wordCount.updateCounter"}, editor);
|
298
|
-
|
299
|
-
if (text) {
|
300
|
-
if (config.showCharCount) {
|
301
|
-
charCount = countCharacters(text, editorInstance);
|
302
|
-
}
|
261
|
+
var words = normalizedText.split(/\s+/);
|
303
262
|
|
304
|
-
|
305
|
-
|
263
|
+
for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
|
264
|
+
if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
|
265
|
+
words.splice(wordIndex, 1);
|
266
|
+
}
|
306
267
|
}
|
307
268
|
|
308
|
-
|
309
|
-
wordCount = countWords(text);
|
310
|
-
}
|
269
|
+
return (words.length);
|
311
270
|
}
|
312
271
|
|
272
|
+
function limitReached(editorInstance, notify) {
|
273
|
+
limitReachedNotified = true;
|
274
|
+
limitRestoredNotified = false;
|
313
275
|
|
314
|
-
|
315
|
-
|
316
|
-
if (config.showRemaining) {
|
317
|
-
if (config.maxCharCount >= 0) {
|
318
|
-
html = html.replace("%charCount%", config.maxCharCount - charCount);
|
319
|
-
} else {
|
320
|
-
html = html.replace("%charCount%", charCount);
|
276
|
+
if (config.hardLimit) {
|
277
|
+
editorInstance.execCommand('undo');
|
321
278
|
}
|
322
279
|
|
323
|
-
if (
|
324
|
-
|
325
|
-
|
326
|
-
html = html.replace("%wordCount%", wordCount);
|
280
|
+
if (!notify) {
|
281
|
+
counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
|
282
|
+
editorInstance.fire("limitReached", { firedBy: "wordCount.limitReached" }, editor);
|
327
283
|
}
|
328
|
-
} else {
|
329
|
-
html = html.replace("%wordCount%", wordCount).replace("%charCount%", charCount);
|
330
284
|
}
|
331
285
|
|
332
|
-
|
333
|
-
|
286
|
+
function limitRestored(editorInstance) {
|
287
|
+
limitRestoredNotified = true;
|
288
|
+
limitReachedNotified = false;
|
289
|
+
editorInstance.fire('saveSnapshot');
|
334
290
|
|
335
|
-
|
336
|
-
counterElement(editorInstance).innerHTML = html;
|
337
|
-
} else {
|
338
|
-
counterElement(editorInstance).innerText = html;
|
291
|
+
counterElement(editorInstance).className = "cke_path_item";
|
339
292
|
}
|
340
293
|
|
341
|
-
|
342
|
-
if (
|
343
|
-
|
294
|
+
function updateCounter(editorInstance) {
|
295
|
+
if (!counterElement(editorInstance)) {
|
296
|
+
return;
|
344
297
|
}
|
345
|
-
return true;
|
346
|
-
}
|
347
298
|
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
299
|
+
var paragraphs = 0,
|
300
|
+
wordCount = 0,
|
301
|
+
charCount = 0,
|
302
|
+
text;
|
303
|
+
|
304
|
+
// BeforeGetData and getData events are fired when calling
|
305
|
+
// getData(). We can prevent this by passing true as an
|
306
|
+
// argument to getData(). This allows us to fire the events
|
307
|
+
// manually with additional event data: firedBy. This additional
|
308
|
+
// data helps differentiate calls to getData() made by
|
309
|
+
// wordCount plugin from calls made by other plugins/code.
|
310
|
+
editorInstance.fire("beforeGetData", { firedBy: "wordCount.updateCounter" }, editor);
|
311
|
+
text = editorInstance.getData(true);
|
312
|
+
editorInstance.fire("getData", { dataValue: text, firedBy: "wordCount.updateCounter" }, editor);
|
352
313
|
|
353
|
-
|
354
|
-
|
314
|
+
if (text) {
|
315
|
+
if (config.showCharCount) {
|
316
|
+
charCount = countCharacters(text);
|
317
|
+
}
|
355
318
|
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
if (lastCharCount == -1) {
|
360
|
-
lastCharCount = charCount;
|
361
|
-
}
|
319
|
+
if (config.showParagraphs) {
|
320
|
+
paragraphs = countParagraphs(text);
|
321
|
+
}
|
362
322
|
|
363
|
-
|
364
|
-
|
365
|
-
|
323
|
+
if (config.showWordCount) {
|
324
|
+
wordCount = countWords(text);
|
325
|
+
}
|
326
|
+
}
|
366
327
|
|
367
|
-
|
368
|
-
|
369
|
-
|
328
|
+
var html = format;
|
329
|
+
if (config.showRemaining) {
|
330
|
+
if (config.maxCharCount >= 0) {
|
331
|
+
html = html.replace("%charCount%", config.maxCharCount - charCount);
|
332
|
+
} else {
|
333
|
+
html = html.replace("%charCount%", charCount);
|
334
|
+
}
|
370
335
|
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
336
|
+
if (config.maxWordCount >= 0) {
|
337
|
+
html = html.replace("%wordCount%", config.maxWordCount - wordCount);
|
338
|
+
} else {
|
339
|
+
html = html.replace("%wordCount%", wordCount);
|
340
|
+
}
|
375
341
|
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
342
|
+
if (config.maxParagraphs >= 0) {
|
343
|
+
html = html.replace("%paragraphsCount%", config.maxParagraphs - paragraphs);
|
344
|
+
} else {
|
345
|
+
html = html.replace("%paragraphsCount%", paragraphs);
|
346
|
+
}
|
380
347
|
} else {
|
381
|
-
|
348
|
+
html = html.replace("%wordCount%", wordCount).replace("%charCount%", charCount).replace("%paragraphsCount%", paragraphs);
|
382
349
|
}
|
383
|
-
}
|
384
350
|
|
385
|
-
|
386
|
-
|
387
|
-
config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
|
351
|
+
(editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).wordCount = wordCount;
|
352
|
+
(editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).charCount = charCount;
|
388
353
|
|
354
|
+
if (CKEDITOR.env.gecko) {
|
355
|
+
counterElement(editorInstance).innerHTML = html;
|
389
356
|
} else {
|
390
|
-
|
357
|
+
counterElement(editorInstance).innerText = html;
|
391
358
|
}
|
392
|
-
}
|
393
359
|
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
updateCounter(event.editor);
|
400
|
-
}
|
401
|
-
}, editor, null, 100);
|
402
|
-
|
403
|
-
editor.on("change", function (event) {
|
404
|
-
updateCounter(event.editor);
|
405
|
-
}, editor, null, 100);
|
406
|
-
|
407
|
-
editor.on("uiSpace", function (event) {
|
408
|
-
if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
|
409
|
-
if (event.data.space == "top") {
|
410
|
-
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
411
|
-
" title=\"" +
|
412
|
-
editor.lang.wordcount.title +
|
413
|
-
"\"" +
|
414
|
-
"><span id=\"" +
|
415
|
-
counterId(event.editor) +
|
416
|
-
"\" class=\"cke_path_item\"> </span></div>";
|
417
|
-
}
|
418
|
-
} else {
|
419
|
-
if (event.data.space == "bottom") {
|
420
|
-
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
421
|
-
" title=\"" +
|
422
|
-
editor.lang.wordcount.title +
|
423
|
-
"\"" +
|
424
|
-
"><span id=\"" +
|
425
|
-
counterId(event.editor) +
|
426
|
-
"\" class=\"cke_path_item\"> </span></div>";
|
360
|
+
if (charCount == lastCharCount && wordCount == lastWordCount && paragraphs == lastParagraphs) {
|
361
|
+
if (charCount == config.maxCharCount || wordCount == config.maxWordCount || paragraphs > config.maxParagraphs) {
|
362
|
+
editorInstance.fire('saveSnapshot');
|
363
|
+
}
|
364
|
+
return true;
|
427
365
|
}
|
428
|
-
}
|
429
366
|
|
430
|
-
|
367
|
+
//If the limit is already over, allow the deletion of characters/words. Otherwise,
|
368
|
+
//the user would have to delete at one go the number of offending characters
|
369
|
+
var deltaWord = wordCount - lastWordCount;
|
370
|
+
var deltaChar = charCount - lastCharCount;
|
371
|
+
var deltaParagraphs = paragraphs - lastParagraphs;
|
431
372
|
|
432
|
-
|
433
|
-
|
434
|
-
|
373
|
+
lastWordCount = wordCount;
|
374
|
+
lastCharCount = charCount;
|
375
|
+
lastParagraphs = paragraphs;
|
435
376
|
|
436
|
-
|
437
|
-
|
377
|
+
if (lastWordCount == -1) {
|
378
|
+
lastWordCount = wordCount;
|
379
|
+
}
|
380
|
+
if (lastCharCount == -1) {
|
381
|
+
lastCharCount = charCount;
|
382
|
+
}
|
383
|
+
if (lastParagraphs == -1) {
|
384
|
+
lastParagraphs = paragraphs;
|
385
|
+
}
|
438
386
|
|
439
|
-
// Check
|
440
|
-
|
441
|
-
|
387
|
+
// Check for word limit and/or char limit
|
388
|
+
if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
|
389
|
+
(config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0) ||
|
390
|
+
(config.maxParagraphs > -1 && paragraphs > config.maxParagraphs && deltaParagraphs > 0)) {
|
442
391
|
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
// data helps differentiate calls to getData() made by
|
448
|
-
// wordCount plugin from calls made by other plugins/code.
|
449
|
-
event.editor.fire("beforeGetData", {firedBy: "wordCount.onPaste"}, event.editor);
|
450
|
-
var text = event.editor.getData(true);
|
451
|
-
event.editor.fire("getData", {dataValue: text, firedBy: "wordCount.onPaste"}, event.editor);
|
392
|
+
limitReached(editorInstance, limitReachedNotified);
|
393
|
+
} else if ((config.maxWordCount == -1 || wordCount <= config.maxWordCount) &&
|
394
|
+
(config.maxCharCount == -1 || charCount <= config.maxCharCount) &&
|
395
|
+
(config.maxParagraphs == -1 || paragraphs <= config.maxParagraphs)) {
|
452
396
|
|
453
|
-
|
397
|
+
limitRestored(editorInstance);
|
398
|
+
} else {
|
399
|
+
editorInstance.fire('saveSnapshot');
|
400
|
+
}
|
454
401
|
|
455
|
-
|
456
|
-
|
402
|
+
// update instance
|
403
|
+
editorInstance.wordCount =
|
404
|
+
{
|
405
|
+
paragraphs: paragraphs,
|
406
|
+
wordCount: wordCount,
|
407
|
+
charCount: charCount
|
408
|
+
};
|
409
|
+
|
410
|
+
|
411
|
+
// Fire Custom Events
|
412
|
+
if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
|
413
|
+
if (charCount > config.maxCharCount && config.maxCharCount > -1) {
|
414
|
+
config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
|
415
|
+
} else {
|
416
|
+
config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
|
417
|
+
}
|
457
418
|
}
|
458
419
|
|
459
|
-
if (config.
|
460
|
-
wordCount
|
420
|
+
if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
|
421
|
+
if (wordCount > config.maxWordCount && config.maxWordCount > -1) {
|
422
|
+
config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
|
423
|
+
|
424
|
+
} else {
|
425
|
+
config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
|
426
|
+
}
|
461
427
|
}
|
462
428
|
|
429
|
+
return true;
|
430
|
+
}
|
463
431
|
|
464
|
-
|
465
|
-
if(
|
466
|
-
|
467
|
-
message: event.editor.lang.wordcount.pasteWarning,
|
468
|
-
type: 'warning',
|
469
|
-
duration: config.pasteWarningDuration
|
470
|
-
});
|
432
|
+
function isCloseToLimits() {
|
433
|
+
if (config.maxWordCount > -1 && config.maxWordCount - lastWordCount < 5) {
|
434
|
+
return true;
|
471
435
|
}
|
472
436
|
|
473
|
-
if (config.maxCharCount >
|
474
|
-
|
475
|
-
notification.show();
|
476
|
-
}
|
477
|
-
event.cancel();
|
437
|
+
if (config.maxCharCount > -1 && config.maxCharCount - lastCharCount < 20) {
|
438
|
+
return true;
|
478
439
|
}
|
479
440
|
|
480
|
-
if (config.
|
481
|
-
|
482
|
-
notification.show();
|
483
|
-
}
|
484
|
-
event.cancel();
|
441
|
+
if (config.maxParagraphs > -1 && config.maxParagraphs - lastParagraphs < 1) {
|
442
|
+
return true;
|
485
443
|
}
|
444
|
+
|
445
|
+
return false;
|
486
446
|
}
|
487
|
-
}, editor, null, 100);
|
488
447
|
|
489
|
-
|
490
|
-
|
491
|
-
|
448
|
+
editor.on("key",
|
449
|
+
function(event) {
|
450
|
+
if (editor.mode === "source") {
|
451
|
+
clearTimeout(timeoutId);
|
452
|
+
timeoutId = setTimeout(
|
453
|
+
updateCounter.bind(this, event.editor),
|
454
|
+
250
|
455
|
+
);
|
456
|
+
}
|
457
|
+
},
|
458
|
+
editor,
|
459
|
+
null,
|
460
|
+
100);
|
461
|
+
|
462
|
+
editor.on("change",
|
463
|
+
function(event) {
|
464
|
+
var ms = isCloseToLimits() ? 5 : 250;
|
465
|
+
clearTimeout(timeoutId);
|
466
|
+
timeoutId = setTimeout(
|
467
|
+
updateCounter.bind(this, event.editor),
|
468
|
+
ms
|
469
|
+
);
|
470
|
+
},
|
471
|
+
editor,
|
472
|
+
null,
|
473
|
+
100);
|
474
|
+
|
475
|
+
editor.on("uiSpace",
|
476
|
+
function(event) {
|
477
|
+
if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
|
478
|
+
if (event.data.space == "top") {
|
479
|
+
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
480
|
+
" title=\"" +
|
481
|
+
editor.lang.wordcount.title +
|
482
|
+
"\"" +
|
483
|
+
"><span id=\"" +
|
484
|
+
counterId(event.editor) +
|
485
|
+
"\" class=\"cke_path_item\"> </span></div>";
|
486
|
+
}
|
487
|
+
} else {
|
488
|
+
if (event.data.space == "bottom") {
|
489
|
+
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
490
|
+
" title=\"" +
|
491
|
+
editor.lang.wordcount.title +
|
492
|
+
"\"" +
|
493
|
+
"><span id=\"" +
|
494
|
+
counterId(event.editor) +
|
495
|
+
"\" class=\"cke_path_item\"> </span></div>";
|
496
|
+
}
|
497
|
+
}
|
492
498
|
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
499
|
+
},
|
500
|
+
editor,
|
501
|
+
null,
|
502
|
+
100);
|
503
|
+
|
504
|
+
editor.on("dataReady",
|
505
|
+
function(event) {
|
506
|
+
updateCounter(event.editor);
|
507
|
+
},
|
508
|
+
editor,
|
509
|
+
null,
|
510
|
+
100);
|
511
|
+
|
512
|
+
editor.on("paste",
|
513
|
+
function(event) {
|
514
|
+
if (config.maxWordCount > 0 || config.maxCharCount > 0 || config.maxParagraphs > 0) {
|
515
|
+
|
516
|
+
// Check if pasted content is above the limits
|
517
|
+
var wordCount = -1,
|
518
|
+
charCount = -1,
|
519
|
+
paragraphs = -1;
|
520
|
+
|
521
|
+
// BeforeGetData and getData events are fired when calling
|
522
|
+
// getData(). We can prevent this by passing true as an
|
523
|
+
// argument to getData(). This allows us to fire the events
|
524
|
+
// manually with additional event data: firedBy. This additional
|
525
|
+
// data helps differentiate calls to getData() made by
|
526
|
+
// wordCount plugin from calls made by other plugins/code.
|
527
|
+
event.editor.fire("beforeGetData", { firedBy: "wordCount.onPaste" }, event.editor);
|
528
|
+
var text = event.editor.getData(true);
|
529
|
+
event.editor.fire("getData", { dataValue: text, firedBy: "wordCount.onPaste" }, event.editor);
|
530
|
+
|
531
|
+
text += event.data.dataValue;
|
532
|
+
|
533
|
+
if (config.showCharCount) {
|
534
|
+
charCount = countCharacters(text);
|
535
|
+
}
|
536
|
+
|
537
|
+
if (config.showWordCount) {
|
538
|
+
wordCount = countWords(text);
|
539
|
+
}
|
540
|
+
|
541
|
+
if (config.showParagraphs) {
|
542
|
+
paragraphs = countParagraphs(text);
|
543
|
+
}
|
544
|
+
|
545
|
+
|
546
|
+
// Instantiate the notification when needed and only have one instance
|
547
|
+
if (notification === null) {
|
548
|
+
notification = new CKEDITOR.plugins.notification(event.editor,
|
549
|
+
{
|
550
|
+
message: event.editor.lang.wordcount.pasteWarning,
|
551
|
+
type: 'warning',
|
552
|
+
duration: config.pasteWarningDuration
|
553
|
+
});
|
554
|
+
}
|
555
|
+
|
556
|
+
if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
|
557
|
+
if (!notification.isVisible()) {
|
558
|
+
notification.show();
|
559
|
+
}
|
560
|
+
event.cancel();
|
561
|
+
}
|
562
|
+
|
563
|
+
if (config.maxWordCount > 0 && wordCount > config.maxWordCount && config.hardLimit) {
|
564
|
+
if (!notification.isVisible()) {
|
565
|
+
notification.show();
|
566
|
+
}
|
567
|
+
event.cancel();
|
568
|
+
}
|
569
|
+
|
570
|
+
if (config.maxParagraphs > 0 && paragraphs > config.maxParagraphs && config.hardLimit) {
|
571
|
+
if (!notification.isVisible()) {
|
572
|
+
notification.show();
|
573
|
+
}
|
574
|
+
event.cancel();
|
575
|
+
}
|
576
|
+
}
|
577
|
+
},
|
578
|
+
editor,
|
579
|
+
null,
|
580
|
+
100);
|
581
|
+
|
582
|
+
editor.on("afterPaste",
|
583
|
+
function(event) {
|
584
|
+
updateCounter(event.editor);
|
585
|
+
},
|
586
|
+
editor,
|
587
|
+
null,
|
588
|
+
100);
|
589
|
+
}
|
590
|
+
});
|