glebtv-ckeditor 4.4.7.4 → 4.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +38 -0
- data/MIT-LICENSE +1 -1
- data/README.md +124 -84
- data/Rakefile +1 -25
- data/app/assets/javascripts/ckeditor/application.js +0 -1
- data/app/assets/javascripts/ckeditor/config.js.erb +5 -59
- data/app/assets/javascripts/ckeditor/config_orig.js +58 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.png +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_del.png +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/preloader.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/avi.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/doc.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/docx.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/exe.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/gz.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/htm.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/jpg.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mpg.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/psd.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/tar.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/txt.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/unknown.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/wmv.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xlsx.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/zip.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/application.js.erb +58 -56
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.endless-scroll.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.erb +12 -6
- data/app/assets/javascripts/ckeditor/init.js.erb +6 -1
- data/app/assets/stylesheets/ckcontent.css +0 -0
- data/app/assets/stylesheets/ckeditor/application.css +0 -0
- data/app/controllers/ckeditor/application_controller.rb +6 -17
- data/app/controllers/ckeditor/attachment_files_controller.rb +10 -3
- data/app/controllers/ckeditor/pictures_controller.rb +9 -2
- data/app/helpers/ckeditor/application_helper.rb +0 -0
- data/app/views/ckeditor/attachment_files/index.html.erb +3 -3
- data/app/views/ckeditor/pictures/index.html.erb +3 -3
- data/app/views/ckeditor/shared/_asset.html.erb +0 -0
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +0 -0
- data/app/views/layouts/ckeditor/application.html.erb +3 -2
- data/app/views/rails_admin/main/_form_ck_editor.html.haml +1 -1
- data/app/views/rails_admin/main/_form_ck_editorml.html.haml +1 -1
- data/config/locales/bg.ckeditor.yml +9 -0
- data/config/locales/cs.ckeditor.yml +0 -0
- data/config/locales/de.ckeditor.yml +0 -0
- data/config/locales/el-GR.cdkeditor.yml +0 -0
- data/config/locales/en.ckeditor.yml +0 -0
- data/config/locales/es.ckeditor.yml +0 -0
- data/config/locales/fr.ckeditor.yml +0 -0
- data/config/locales/hu.ckeditor.yml +0 -0
- data/config/locales/it.ckeditor.yml +0 -0
- data/config/locales/ja.ckeditor.yml +9 -0
- data/config/locales/nb.ckeditor.yml +9 -0
- data/config/locales/nl.ckeditor.yml +0 -0
- data/config/locales/pl.ckeditor.yml +0 -0
- data/config/locales/pt-BR.ckeditor.yml +0 -0
- data/config/locales/pt-PT.ckeditor.yml +0 -0
- data/config/locales/ru.ckeditor.yml +0 -0
- data/config/locales/sv-SE.ckeditor.yml +0 -0
- data/config/locales/tr.ckeditor.yml +9 -0
- data/config/locales/uk.ckeditor.yml +0 -0
- data/config/locales/zh-CN.ckeditor.yml +1 -1
- data/config/locales/zh-TW.ckeditor.yml +9 -0
- data/config/routes.rb +0 -0
- data/lib/ckeditor.rb +39 -5
- data/lib/ckeditor/asset_response.rb +59 -0
- data/lib/ckeditor/backend/carrierwave.rb +1 -8
- data/lib/ckeditor/backend/dragonfly.rb +8 -6
- data/lib/ckeditor/backend/paperclip.rb +7 -11
- data/lib/ckeditor/backend/refile.rb +37 -0
- data/lib/ckeditor/engine.rb +4 -0
- data/lib/ckeditor/helpers/controllers.rb +0 -0
- data/lib/ckeditor/helpers/form_builder.rb +0 -0
- data/lib/ckeditor/helpers/form_helper.rb +0 -0
- data/lib/ckeditor/helpers/view_helper.rb +0 -0
- data/lib/ckeditor/hooks/cancan.rb +4 -1
- data/lib/ckeditor/hooks/formtastic.rb +0 -0
- data/lib/ckeditor/hooks/pundit.rb +0 -0
- data/lib/ckeditor/hooks/simple_form.rb +1 -1
- data/lib/ckeditor/http.rb +1 -3
- data/lib/ckeditor/orm/active_record.rb +0 -0
- data/lib/ckeditor/orm/base.rb +0 -0
- data/lib/ckeditor/orm/mongoid.rb +0 -0
- data/lib/ckeditor/paginatable.rb +0 -0
- data/lib/ckeditor/text_area.rb +2 -1
- data/lib/ckeditor/utils.rb +26 -23
- data/lib/ckeditor/utils/content_type_detector.rb +41 -0
- data/lib/ckeditor/utils/javascript_code.rb +10 -0
- data/lib/ckeditor/version.rb +4 -2
- data/lib/generators/ckeditor/install_generator.rb +1 -1
- data/lib/generators/ckeditor/pundit_policy_generator.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +3 -5
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +3 -5
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +7 -7
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/asset.rb +4 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/attachment_file.rb +7 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +11 -0
- data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +28 -0
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +2 -0
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +0 -0
- data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +13 -19
- data/lib/generators/ckeditor/templates/ckeditor.rb +23 -0
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +0 -0
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +0 -0
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +3 -6
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +3 -5
- data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +3 -3
- data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +3 -3
- data/lib/glebtv-ckeditor.rb +0 -0
- data/lib/tasks/ckeditor.rake +26 -0
- data/test/controllers/attachment_files_controller_test.rb +2 -2
- data/test/controllers/pictures_controller_test.rb +3 -4
- data/test/dummy/Rakefile +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -1
- data/test/dummy/app/assets/stylesheets/application.css +0 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +0 -0
- data/test/dummy/app/controllers/application_controller.rb +0 -1
- data/test/dummy/app/controllers/posts_controller.rb +0 -0
- data/test/dummy/app/helpers/application_helper.rb +0 -0
- data/test/dummy/app/helpers/posts_helper.rb +0 -0
- data/test/dummy/app/models/post.rb +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +2 -2
- data/test/dummy/app/views/posts/_form.html.erb +0 -0
- data/test/dummy/app/views/posts/edit.html.erb +0 -0
- data/test/dummy/app/views/posts/index.html.erb +0 -0
- data/test/dummy/app/views/posts/new.html.erb +0 -0
- data/test/dummy/app/views/posts/show.html.erb +0 -0
- data/test/dummy/config.ru +0 -0
- data/test/dummy/config/application.rb +15 -15
- data/test/dummy/config/boot.rb +0 -0
- data/test/dummy/config/database.yml +0 -0
- data/test/dummy/config/environment.rb +0 -0
- data/test/dummy/config/environments/development.rb +0 -0
- data/test/dummy/config/environments/production.rb +0 -0
- data/test/dummy/config/environments/test.rb +7 -5
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/test/dummy/config/initializers/ckeditor.rb +0 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/inflections.rb +0 -0
- data/test/dummy/config/initializers/mime_types.rb +0 -0
- data/test/dummy/config/initializers/session_store.rb +0 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -0
- data/test/dummy/config/locales/en.yml +0 -0
- data/test/dummy/config/mongoid.yml +135 -1
- data/test/dummy/config/routes.rb +3 -3
- data/test/dummy/config/secrets.yml +8 -0
- data/test/dummy/db/migrate/20110623120047_create_posts.rb +1 -1
- data/test/dummy/public/404.html +0 -0
- data/test/dummy/public/422.html +0 -0
- data/test/dummy/public/500.html +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -0
- data/test/dummy/test/fixtures/files/rails.png +0 -0
- data/test/dummy/test/fixtures/files/rails.tar.gz +0 -0
- data/test/functional/posts_controller_test.rb +6 -6
- data/test/generators/install_generator_test.rb +14 -0
- data/test/integration/navigation_test.rb +0 -0
- data/test/models/attachment_file_test.rb +2 -2
- data/test/{ckeditor_test.rb → models/ckeditor_test.rb} +35 -0
- data/test/models/picture_test.rb +6 -1
- data/test/models/utils_test.rb +6 -6
- data/test/orm/active_record.rb +0 -0
- data/test/orm/mongoid.rb +0 -0
- data/test/support/helpers.rb +0 -0
- data/test/support/integration_case.rb +0 -0
- data/test/support/raw_post.rb +0 -0
- data/test/support/routes.txt +0 -0
- data/test/test_helper.rb +3 -5
- data/vendor/assets/javascripts/ckeditor/LICENSE.md +159 -3
- data/vendor/assets/javascripts/ckeditor/README.md +39 -0
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +7 -7
- data/vendor/assets/javascripts/ckeditor/build-config.js +4 -3
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +1028 -964
- data/vendor/assets/javascripts/ckeditor/config.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en.js +3 -3
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +4 -4
- 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 +9 -8
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autocomplete.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/commentselectedrange.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/js/beautify.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -1
- 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 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcode.min.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -1
- 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 +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +49 -29
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +7 -8
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +33 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +3 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +4 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +95 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +3 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +3 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +9 -9
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-bright.css +35 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +65 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/zenburn.css +37 -0
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +10 -10
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +8 -8
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +16 -16
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +14 -14
- data/vendor/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +4 -3
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +6 -5
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +15 -15
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +6 -5
- data/vendor/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- 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/iframe/images/placeholder.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +29 -34
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +41 -40
- data/vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/LICENSE +22 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/README.md +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/en.js +3 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +3 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/plugin.js +81 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/readme.txt +30 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +20 -20
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -7
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/hidpi/loremipsum.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/loremipsum.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/en.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/ru.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +131 -0
- data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon-rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +923 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +29 -28
- data/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/CHANGELOG.md +20 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +28 -28
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +19 -17
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +8 -7
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +10 -10
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +9 -3
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +17 -17
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +12 -12
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +7 -7
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +4 -3
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +4 -2
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +4 -2
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +286 -145
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +88 -70
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc_ie.js +7 -7
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +388 -388
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/spinner.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +49 -0
- data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
- metadata +105 -130
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.min.js +0 -4
- data/app/assets/javascripts/ckeditor/override.js.erb +0 -21
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/support/controller_hooks.rb +0 -27
- data/vendor/assets/javascripts/ckeditor/plugins/ipsum/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/ipsum/plugin.js +0 -63
- data/vendor/assets/javascripts/ckeditor/plugins/map/example_usage.js +0 -30
- data/vendor/assets/javascripts/ckeditor/plugins/map/map.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/map/plugin.js +0 -187
- data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/icons/hidpi/mediaembed.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/icons/mediaembed.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/plugin.js +0 -64
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css.scss +0 -771
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css.scss +0 -812
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css.scss +0 -844
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css.scss +0 -825
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css.scss +0 -816
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css.scss +0 -2136
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css.scss +0 -2145
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css.scss +0 -2194
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css.scss +0 -2362
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css.scss +0 -2206
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css.scss +0 -2254
@@ -1,17 +1,17 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
2
|
+
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
4
4
|
*/
|
5
|
-
CKEDITOR.dialog.add("cellProperties",function(g){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&&
|
6
|
-
g.lang.dir,
|
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)
|
8
|
-
label:g.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(
|
9
|
-
parseInt(a.getAttribute("height"),10)
|
10
|
-
b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"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",
|
11
|
-
a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign")
|
12
|
-
f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:
|
13
|
-
a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:
|
14
|
-
return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},
|
15
|
-
{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",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")}},
|
5
|
+
CKEDITOR.dialog.add("cellProperties",function(g){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=g.lang.table,c=h.cell,e=g.lang.common,k=CKEDITOR.dialog.validate,n=/^(\d+(?:\.\d+)?)(px|%)$/,f={type:"html",html:"\x26nbsp;"},p="rtl"==
|
6
|
+
g.lang.dir,m=g.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",label:e.width,validate:k.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info",
|
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")},"default":""},{type:"select",id:"widthType",
|
8
|
+
label:g.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",label:e.height,width:"100px","default":"",validate:k.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=
|
9
|
+
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);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"\x3cbr /\x3e"+h.widthPx}]},f,{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"==
|
10
|
+
a.getStyle("white-space")||b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"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",
|
11
|
+
b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[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");
|
12
|
+
a.removeAttribute("vAlign")}}]},f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{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",
|
13
|
+
this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",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")}},f,{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");
|
14
|
+
return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",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(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,
|
15
|
+
{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",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",
|
16
16
|
"bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:f]}]}]}]}],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()},
|
17
17
|
onLoad:function(){var a={};this.foreach(function(b){b.setup&&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,10 +1,10 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
2
|
+
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
4
4
|
*/
|
5
|
-
(function(){CKEDITOR.dialog.add("templates",function(c){function
|
6
|
-
a.title+"
|
7
|
-
c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+
|
8
|
-
minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:"
|
9
|
-
"default":
|
10
|
-
|
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
|
+
"")+' 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();
|
7
|
+
a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function k(a){var b=a.data.getTarget(),c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+
|
8
|
+
"dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,n=c.config;return{title:c.lang.templates.title,minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:"\x3cspan\x3e"+f.selectPromptMsg+"\x3c/span\x3e"},{id:"templatesList",type:"html",focus:!0,html:'\x3cdiv class\x3d"cke_tpl_list" tabIndex\x3d"-1" role\x3d"listbox" aria-labelledby\x3d"'+
|
9
|
+
h+'"\x3e\x3cdiv class\x3d"cke_tpl_loading"\x3e\x3cspan\x3e\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e\x3cspan class\x3d"cke_voice_label" id\x3d"'+h+'"\x3e'+f.options+"\x3c/span\x3e"},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption,"default":n.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(n.templates_files,function(){var b=(n.templates||"default").split(",");
|
10
|
+
if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;d<h;d++)for(var e=CKEDITOR.getTemplates(b[d]),k=e.imagesPath,e=e.templates,q=e.length,l=0;l<q;l++){var p=r(e[l],k);p.setAttribute("aria-posinset",l+1);p.setAttribute("aria-setsize",q);c.append(p)}a.focus()}else g.setHtml('\x3cdiv class\x3d"cke_tpl_empty"\x3e\x3cspan\x3e'+f.emptyListMsg+"\x3c/span\x3e\x3c/div\x3e")});this._.element.on("keydown",k)},onHide:function(){this._.element.removeListener("keydown",k)}}})})();
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
2
|
+
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
4
4
|
*/
|
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:'
|
6
|
-
html:'
|
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 colums, each one with a title, and some text.",
|
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.",
|
7
|
+
html:'\x3cdiv style\x3d"width: 80%"\x3e\x3ch3\x3eTitle goes here\x3c/h3\x3e\x3ctable style\x3d"width:150px;float: right" cellspacing\x3d"0" cellpadding\x3d"0" border\x3d"1"\x3e\x3ccaption style\x3d"border:solid 1px black"\x3e\x3cstrong\x3eTable title\x3c/strong\x3e\x3c/caption\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3ctd\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cp\x3eType the text here\x3c/p\x3e\x3c/div\x3e'}]});
|
File without changes
|
File without changes
|
File without changes
|
@@ -5,7 +5,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
5
5
|
CKEDITOR.plugins.setLang('wordcount', 'en', {
|
6
6
|
WordCount: 'Words:',
|
7
7
|
CharCount: 'Characters:',
|
8
|
-
CharCountWithHTML: '
|
9
|
-
|
8
|
+
CharCountWithHTML: ' (with HTML: %charCountHTML%)',
|
9
|
+
Paragraphs: 'Paragraphs:',
|
10
|
+
pasteWarning: 'Content can not be pasted because it is above the allowed limit',
|
11
|
+
Selected: 'Selected: ',
|
10
12
|
title: 'Statistics'
|
11
13
|
});
|
@@ -5,7 +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: '
|
9
|
-
|
8
|
+
CharCountWithHTML: ' (включая HTML разметку: %charCountHTML%)',
|
9
|
+
Paragraphs: 'Параграфов:',
|
10
|
+
pasteWarning: 'Контент не может быть вставлен, т.к. привышает допустимый лимит',
|
11
|
+
Selected: 'Выделено: ',
|
10
12
|
title: 'Статистика'
|
11
13
|
});
|
@@ -3,64 +3,120 @@
|
|
3
3
|
* For licensing, see LICENSE.html or http://ckeditor.com/license
|
4
4
|
*/
|
5
5
|
|
6
|
-
CKEDITOR.plugins.add(
|
7
|
-
lang:
|
8
|
-
version: 1.
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
13
|
-
|
14
|
-
var defaultFormat = '<span class="cke_path_item">',
|
6
|
+
CKEDITOR.plugins.add("wordcount", {
|
7
|
+
lang: "ca,de,el,en,es,fr,he,hr,it,jp,nl,no,pl,pt-br,ru,sv,tr,zh-cn", // %REMOVE_LINE_CORE%
|
8
|
+
version: 1.14,
|
9
|
+
requires: 'htmlwriter,notification,undo',
|
10
|
+
init: function (editor) {
|
11
|
+
var defaultFormat = "",
|
15
12
|
intervalId,
|
16
|
-
lastWordCount,
|
17
|
-
lastCharCount =
|
13
|
+
lastWordCount = -1,
|
14
|
+
lastCharCount = -1,
|
18
15
|
limitReachedNotified = false,
|
19
|
-
limitRestoredNotified = false
|
16
|
+
limitRestoredNotified = false,
|
17
|
+
snapShot = editor.getSnapshot();
|
18
|
+
|
19
|
+
var dispatchEvent = function (type, currentLength, maxLength) {
|
20
|
+
if (typeof document.dispatchEvent == 'undefined') {
|
21
|
+
return;
|
22
|
+
}
|
23
|
+
|
24
|
+
type = 'ckeditor.wordcount.' + type;
|
25
|
+
|
26
|
+
var cEvent;
|
27
|
+
var eventInitDict = {
|
28
|
+
bubbles: false,
|
29
|
+
cancelable: true,
|
30
|
+
detail: {
|
31
|
+
currentLength: currentLength,
|
32
|
+
maxLength: maxLength
|
33
|
+
}
|
34
|
+
};
|
35
|
+
|
36
|
+
try {
|
37
|
+
cEvent = new CustomEvent(type, eventInitDict);
|
38
|
+
} catch (o_O) {
|
39
|
+
cEvent = document.createEvent('CustomEvent');
|
40
|
+
cEvent.initCustomEvent(
|
41
|
+
type,
|
42
|
+
eventInitDict.bubbles,
|
43
|
+
eventInitDict.cancelable,
|
44
|
+
eventInitDict.detail
|
45
|
+
);
|
46
|
+
}
|
47
|
+
|
48
|
+
document.dispatchEvent(cEvent);
|
49
|
+
};
|
20
50
|
|
21
51
|
// Default Config
|
22
52
|
var defaultConfig = {
|
53
|
+
showParagraphs: true,
|
23
54
|
showWordCount: true,
|
24
55
|
showCharCount: false,
|
25
56
|
countSpacesAsChars: false,
|
26
|
-
|
27
|
-
|
28
|
-
|
57
|
+
countHTML: false,
|
58
|
+
hardLimit: true,
|
59
|
+
|
60
|
+
//MAXLENGTH Properties
|
61
|
+
maxWordCount: -1,
|
62
|
+
maxCharCount: -1,
|
63
|
+
|
64
|
+
//DisAllowed functions
|
65
|
+
wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
66
|
+
dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
67
|
+
},
|
68
|
+
charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
69
|
+
dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
70
|
+
},
|
71
|
+
|
72
|
+
//Allowed Functions
|
73
|
+
wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
74
|
+
dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
|
75
|
+
},
|
76
|
+
charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
77
|
+
dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
|
78
|
+
}
|
29
79
|
};
|
30
80
|
|
31
81
|
// Get Config & Lang
|
32
82
|
var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true);
|
33
83
|
|
34
|
-
if (config.
|
35
|
-
|
84
|
+
if (config.showParagraphs) {
|
85
|
+
defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphs%";
|
86
|
+
}
|
36
87
|
|
37
|
-
|
88
|
+
if (config.showParagraphs && (config.showWordCount || config.showCharCount)) {
|
89
|
+
defaultFormat += ", ";
|
90
|
+
}
|
38
91
|
|
39
|
-
|
40
|
-
|
41
|
-
|
92
|
+
if (config.showWordCount) {
|
93
|
+
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
94
|
+
if (config.maxWordCount > -1) {
|
95
|
+
defaultFormat += "/" + config.maxWordCount;
|
96
|
+
}
|
42
97
|
}
|
43
98
|
|
44
99
|
if (config.showCharCount && config.showWordCount) {
|
45
|
-
defaultFormat +=
|
100
|
+
defaultFormat += ", ";
|
46
101
|
}
|
47
102
|
|
48
|
-
if (config.
|
49
|
-
|
103
|
+
if (config.showCharCount) {
|
104
|
+
var charLabel = editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"];
|
50
105
|
|
51
|
-
|
52
|
-
|
53
|
-
|
106
|
+
defaultFormat += charLabel + " %charCount%";
|
107
|
+
if (config.maxCharCount > -1) {
|
108
|
+
defaultFormat += "/" + config.maxCharCount;
|
109
|
+
}
|
54
110
|
}
|
55
111
|
|
56
|
-
defaultFormat += '</span>';
|
57
|
-
|
58
112
|
var format = defaultFormat;
|
59
113
|
|
60
|
-
|
114
|
+
if (config.loadCss === undefined || config.loadCss) {
|
115
|
+
CKEDITOR.document.appendStyleSheet(this.path + "css/wordcount.css");
|
116
|
+
}
|
61
117
|
|
62
118
|
function counterId(editorInstance) {
|
63
|
-
return
|
119
|
+
return "cke_wordcount_" + editorInstance.name;
|
64
120
|
}
|
65
121
|
|
66
122
|
function counterElement(editorInstance) {
|
@@ -71,172 +127,257 @@ CKEDITOR.plugins.add('wordcount', {
|
|
71
127
|
var tmp = document.createElement("div");
|
72
128
|
tmp.innerHTML = html;
|
73
129
|
|
74
|
-
if (tmp.textContent ==
|
75
|
-
return
|
130
|
+
if (tmp.textContent == "" && typeof tmp.innerText == "undefined") {
|
131
|
+
return "";
|
76
132
|
}
|
77
133
|
|
78
134
|
return tmp.textContent || tmp.innerText;
|
79
135
|
}
|
80
136
|
|
81
|
-
function
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
if (config.
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
if (editor.config.fullPage) {
|
94
|
-
var i = text.search(new RegExp("<body>", "i"));
|
95
|
-
if (i != -1) {
|
96
|
-
var j = text.search(new RegExp("</body>", "i"));
|
97
|
-
text = text.substring(i + 6, j);
|
98
|
-
}
|
99
|
-
|
100
|
-
}
|
101
|
-
|
102
|
-
normalizedText = text.
|
103
|
-
replace(/(\r\n|\n|\r)/gm, "").
|
104
|
-
replace(/^\s+|\s+$/g, "").
|
105
|
-
replace(" ", "");
|
106
|
-
|
107
|
-
if (!config.countSpacesAsChars) {
|
108
|
-
normalizedText = text.
|
109
|
-
replace(/\s/g, "");
|
110
|
-
}
|
111
|
-
|
112
|
-
normalizedText = strip(normalizedText).replace(/^([\s\t\r\n]*)$/, "");
|
113
|
-
|
114
|
-
charCount = normalizedText.length;
|
137
|
+
function countCharacters(text, editorInstance) {
|
138
|
+
if (config.countHTML) {
|
139
|
+
return (text.length);
|
140
|
+
} else {
|
141
|
+
var normalizedText;
|
142
|
+
|
143
|
+
// strip body tags
|
144
|
+
if (editor.config.fullPage) {
|
145
|
+
var i = text.search(new RegExp("<body>", "i"));
|
146
|
+
if (i != -1) {
|
147
|
+
var j = text.search(new RegExp("</body>", "i"));
|
148
|
+
text = text.substring(i + 6, j);
|
115
149
|
}
|
150
|
+
|
116
151
|
}
|
117
152
|
|
118
|
-
|
119
|
-
normalizedText = text.
|
120
|
-
replace(/(\r\n|\n|\r)/gm, " ").
|
121
|
-
replace(/^\s+|\s+$/g, "").
|
122
|
-
replace(" ", " ");
|
153
|
+
normalizedText = text;
|
123
154
|
|
124
|
-
|
155
|
+
if (!config.countSpacesAsChars) {
|
156
|
+
normalizedText = text.
|
157
|
+
replace(/\s/g, "").
|
158
|
+
replace(/ /g, "");
|
159
|
+
}
|
125
160
|
|
126
|
-
|
161
|
+
normalizedText = normalizedText.
|
162
|
+
replace(/(\r\n|\n|\r)/gm, "").
|
163
|
+
replace(/ /gi, " ");
|
127
164
|
|
128
|
-
|
129
|
-
if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
|
130
|
-
words.splice(wordIndex, 1);
|
131
|
-
}
|
132
|
-
}
|
165
|
+
normalizedText = strip(normalizedText).replace(/^([\t\r\n]*)$/, "");
|
133
166
|
|
134
|
-
|
135
|
-
}
|
167
|
+
return(normalizedText.length);
|
136
168
|
}
|
169
|
+
}
|
137
170
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
editor.plugins.wordcount.charCount = charCount;
|
171
|
+
function countParagraphs(text) {
|
172
|
+
return (text.replace(/ /g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++").split("++").length);
|
173
|
+
}
|
142
174
|
|
143
|
-
|
175
|
+
function countWords(text) {
|
176
|
+
var normalizedText = text.
|
177
|
+
replace(/(\r\n|\n|\r)/gm, " ").
|
178
|
+
replace(/^\s+|\s+$/g, "").
|
179
|
+
replace(" ", " ");
|
144
180
|
|
145
|
-
|
146
|
-
return true;
|
147
|
-
}
|
181
|
+
normalizedText = strip(normalizedText);
|
148
182
|
|
149
|
-
|
150
|
-
lastCharCount = charCount;
|
183
|
+
var words = normalizedText.split(/\s+/);
|
151
184
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
editorInstance.fire('saveSnapshot');
|
158
|
-
} else if (!limitRestoredNotified && wordCount < config.wordLimit) {
|
159
|
-
limitRestored(editor);
|
160
|
-
}*/
|
161
|
-
|
162
|
-
// Check for char limit
|
163
|
-
/*if (config.showCharCount && charCount > config.charLimit) {
|
164
|
-
limitReached(editor, limitReachedNotified);
|
165
|
-
} else if (config.showCharCount && charCount == config.charLimit) {
|
166
|
-
// create snapshot to make sure only the content after the limit gets deleted
|
167
|
-
editorInstance.fire('saveSnapshot');
|
168
|
-
} else if (!limitRestoredNotified && charCount < config.charLimit) {
|
169
|
-
limitRestored(editor);
|
170
|
-
}*/
|
185
|
+
for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
|
186
|
+
if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
|
187
|
+
words.splice(wordIndex, 1);
|
188
|
+
}
|
189
|
+
}
|
171
190
|
|
172
|
-
return
|
191
|
+
return (words.length);
|
173
192
|
}
|
174
193
|
|
175
|
-
|
194
|
+
function limitReached(editorInstance, notify) {
|
176
195
|
limitReachedNotified = true;
|
177
196
|
limitRestoredNotified = false;
|
178
197
|
|
179
|
-
|
198
|
+
if (config.hardLimit) {
|
199
|
+
editorInstance.loadSnapshot(snapShot);
|
200
|
+
// lock editor
|
201
|
+
editorInstance.config.Locked = 1;
|
202
|
+
}
|
180
203
|
|
181
204
|
if (!notify) {
|
182
|
-
|
183
|
-
|
184
|
-
editorInstance.fire('limitReached', {}, editor);
|
205
|
+
counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
|
206
|
+
editorInstance.fire("limitReached", {}, editor);
|
185
207
|
}
|
186
|
-
|
187
|
-
// lock editor
|
188
|
-
editorInstance.config.Locked = 1;
|
189
208
|
}
|
190
209
|
|
191
210
|
function limitRestored(editorInstance) {
|
192
|
-
|
193
211
|
limitRestoredNotified = true;
|
194
212
|
limitReachedNotified = false;
|
195
213
|
editorInstance.config.Locked = 0;
|
196
|
-
|
197
|
-
|
198
|
-
|
214
|
+
snapShot = editor.getSnapshot();
|
215
|
+
|
216
|
+
counterElement(editorInstance).className = "cke_path_item";
|
217
|
+
}
|
218
|
+
|
219
|
+
function updateCounter(editorInstance) {
|
220
|
+
var paragraphs = 0,
|
221
|
+
wordCount = 0,
|
222
|
+
charCount = 0,
|
223
|
+
text;
|
199
224
|
|
200
|
-
|
201
|
-
|
225
|
+
if (text = editorInstance.getData()) {
|
226
|
+
if (config.showCharCount) {
|
227
|
+
charCount = countCharacters(text, editorInstance);
|
228
|
+
}
|
229
|
+
|
230
|
+
if (config.showParagraphs) {
|
231
|
+
paragraphs = countParagraphs(text);
|
232
|
+
}
|
233
|
+
|
234
|
+
if (config.showWordCount) {
|
235
|
+
wordCount = countWords(text);
|
236
|
+
}
|
237
|
+
}
|
238
|
+
|
239
|
+
var html = format.replace("%wordCount%", wordCount).replace("%charCount%", charCount).replace("%paragraphs%", paragraphs);
|
240
|
+
|
241
|
+
editorInstance.plugins.wordcount.wordCount = wordCount;
|
242
|
+
editorInstance.plugins.wordcount.charCount = charCount;
|
243
|
+
|
244
|
+
if (CKEDITOR.env.gecko) {
|
245
|
+
counterElement(editorInstance).innerHTML = html;
|
246
|
+
} else {
|
247
|
+
counterElement(editorInstance).innerText = html;
|
248
|
+
}
|
249
|
+
|
250
|
+
if (charCount == lastCharCount && wordCount == lastWordCount) {
|
251
|
+
return true;
|
252
|
+
}
|
253
|
+
|
254
|
+
//If the limit is already over, allow the deletion of characters/words. Otherwise,
|
255
|
+
//the user would have to delete at one go the number of offending characters
|
256
|
+
var deltaWord = wordCount - lastWordCount;
|
257
|
+
var deltaChar = charCount - lastCharCount;
|
258
|
+
|
259
|
+
lastWordCount = wordCount;
|
260
|
+
lastCharCount = charCount;
|
261
|
+
|
262
|
+
if (lastWordCount == -1) {
|
263
|
+
lastWordCount = wordCount;
|
264
|
+
}
|
265
|
+
if (lastCharCount == -1) {
|
266
|
+
lastCharCount = charCount;
|
267
|
+
}
|
268
|
+
|
269
|
+
// Check for word limit and/or char limit
|
270
|
+
if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
|
271
|
+
(config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
|
272
|
+
|
273
|
+
limitReached(editorInstance, limitReachedNotified);
|
274
|
+
} else if ((config.maxWordCount == -1 || wordCount < config.maxWordCount) &&
|
275
|
+
(config.maxCharCount == -1 || charCount < config.maxCharCount)) {
|
276
|
+
|
277
|
+
limitRestored(editorInstance);
|
278
|
+
} else {
|
279
|
+
snapShot = editorInstance.getSnapshot();
|
280
|
+
}
|
281
|
+
|
282
|
+
// Fire Custom Events
|
283
|
+
if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
|
284
|
+
if (charCount > config.maxCharCount && config.maxCharCount > -1) {
|
285
|
+
config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
|
286
|
+
} else {
|
287
|
+
config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
|
288
|
+
}
|
289
|
+
}
|
290
|
+
|
291
|
+
if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
|
292
|
+
if (wordCount > config.maxWordCount && config.maxWordCount > -1) {
|
293
|
+
config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
|
294
|
+
|
295
|
+
} else {
|
296
|
+
config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
|
297
|
+
}
|
298
|
+
}
|
299
|
+
|
300
|
+
return true;
|
301
|
+
}
|
302
|
+
|
303
|
+
editor.on("key", function (event) {
|
304
|
+
if (editor.mode === "source") {
|
202
305
|
updateCounter(event.editor);
|
203
306
|
}
|
204
307
|
}, editor, null, 100);
|
205
308
|
|
206
|
-
editor.on(
|
207
|
-
|
309
|
+
editor.on("change", function (event) {
|
208
310
|
updateCounter(event.editor);
|
209
311
|
}, editor, null, 100);
|
210
312
|
|
211
|
-
editor.on(
|
212
|
-
if (
|
213
|
-
event.data.
|
313
|
+
editor.on("uiSpace", function (event) {
|
314
|
+
if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
|
315
|
+
if (event.data.space == "top") {
|
316
|
+
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
317
|
+
" title=\"" +
|
318
|
+
editor.lang.wordcount.title +
|
319
|
+
"\"" +
|
320
|
+
"><span id=\"" +
|
321
|
+
counterId(event.editor) +
|
322
|
+
"\" class=\"cke_path_item\"> </span></div>";
|
323
|
+
}
|
324
|
+
} else {
|
325
|
+
if (event.data.space == "bottom") {
|
326
|
+
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
327
|
+
" title=\"" +
|
328
|
+
editor.lang.wordcount.title +
|
329
|
+
"\"" +
|
330
|
+
"><span id=\"" +
|
331
|
+
counterId(event.editor) +
|
332
|
+
"\" class=\"cke_path_item\"> </span></div>";
|
333
|
+
}
|
214
334
|
}
|
335
|
+
|
215
336
|
}, editor, null, 100);
|
216
337
|
|
217
|
-
editor.on(
|
338
|
+
editor.on("dataReady", function (event) {
|
218
339
|
updateCounter(event.editor);
|
219
340
|
}, editor, null, 100);
|
220
341
|
|
221
|
-
editor.on(
|
342
|
+
editor.on("paste", function(event) {
|
343
|
+
if (config.maxWordCount > 0 || config.maxCharCount > 0) {
|
344
|
+
|
345
|
+
// Check if pasted content is above the limits
|
346
|
+
var wordCount = -1,
|
347
|
+
charCount = -1,
|
348
|
+
text = event.editor.getData() + event.data.dataValue;
|
349
|
+
|
350
|
+
|
351
|
+
if (config.showCharCount) {
|
352
|
+
charCount = countCharacters(text, event.editor);
|
353
|
+
}
|
354
|
+
|
355
|
+
if (config.showWordCount) {
|
356
|
+
wordCount = countWords(text);
|
357
|
+
}
|
358
|
+
|
359
|
+
var notification = new CKEDITOR.plugins.notification(event.editor, { message: event.editor.lang.wordcount.pasteWarning, type: 'warning' });
|
360
|
+
|
361
|
+
if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
|
362
|
+
notification.show();
|
363
|
+
event.cancel();
|
364
|
+
}
|
365
|
+
|
366
|
+
if (config.maxWordCount > 0 && wordCount > config.maxWordCount && config.hardLimit) {
|
367
|
+
notification.show();
|
368
|
+
event.cancel();
|
369
|
+
}
|
370
|
+
}
|
371
|
+
}, editor, null, 100);
|
372
|
+
|
373
|
+
editor.on("afterPaste", function (event) {
|
222
374
|
updateCounter(event.editor);
|
223
375
|
}, editor, null, 100);
|
224
|
-
|
225
|
-
|
226
|
-
intervalId = window.setInterval(function () {
|
227
|
-
updateCounter(editor);
|
228
|
-
}, 300, event.editor);
|
229
|
-
}, editor, null, 300);*/
|
230
|
-
editor.on('blur', function() {
|
376
|
+
|
377
|
+
editor.on("blur", function () {
|
231
378
|
if (intervalId) {
|
232
379
|
window.clearInterval(intervalId);
|
233
380
|
}
|
234
381
|
}, editor, null, 300);
|
235
|
-
|
236
|
-
if (!String.prototype.trim) {
|
237
|
-
String.prototype.trim = function() {
|
238
|
-
return this.replace(/^\s+|\s+$/g, '');
|
239
|
-
};
|
240
|
-
}
|
241
382
|
}
|
242
383
|
});
|