glebtv-ckeditor 4.6.0 → 4.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +15 -22
- data/MIT-LICENSE +0 -0
- data/README.md +2 -325
- data/Rakefile +1 -2
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.jpg +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.png +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_del.png +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_more.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/preloader.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/avi.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/ckfnothumb.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/doc.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/docx.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/exe.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/gz.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/htm.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/jpg.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mp3.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mpg.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/pdf.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/psd.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/rar.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/swf.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/tar.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/txt.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/unknown.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/wmv.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xls.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xlsx.gif +0 -0
- data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/zip.gif +0 -0
- data/app/assets/javascripts/ckeditor/application.js +0 -0
- data/app/assets/javascripts/ckeditor/config.js.erb +1 -2
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/{application.js.erb → application.js} +4 -6
- 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/init.js.erb +0 -0
- data/app/assets/stylesheets/ckeditor/application.css +1 -1
- data/app/assets/stylesheets/ckeditor/filebrowser/uploader.scss +172 -0
- data/app/controllers/ckeditor/application_controller.rb +9 -10
- data/app/controllers/ckeditor/attachment_files_controller.rb +11 -12
- data/app/controllers/ckeditor/pictures_controller.rb +10 -12
- data/app/helpers/ckeditor/application_helper.rb +1 -10
- data/app/views/ckeditor/attachment_files/index.html.erb +5 -5
- data/app/views/ckeditor/pictures/index.html.erb +5 -5
- data/app/views/ckeditor/shared/_asset.html.erb +18 -21
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +17 -20
- data/app/views/layouts/ckeditor/application.html.erb +3 -3
- data/config/locales/en.ckeditor.yml +0 -0
- data/config/locales/ru.ckeditor.yml +0 -0
- data/config/routes.rb +2 -2
- data/lib/ckeditor.rb +42 -34
- data/lib/ckeditor/asset_response.rb +74 -25
- data/lib/ckeditor/backend/carrierwave.rb +8 -5
- data/lib/ckeditor/backend/dragonfly.rb +5 -3
- data/lib/ckeditor/backend/paperclip.rb +15 -22
- data/lib/ckeditor/backend/refile.rb +6 -4
- data/lib/ckeditor/helpers/controllers.rb +15 -20
- data/lib/ckeditor/helpers/form_builder.rb +1 -1
- data/lib/ckeditor/helpers/form_helper.rb +0 -0
- data/lib/ckeditor/helpers/view_helper.rb +0 -0
- data/lib/ckeditor/hooks/cancan.rb +0 -2
- data/lib/ckeditor/hooks/formtastic.rb +2 -2
- data/lib/ckeditor/hooks/pundit.rb +1 -4
- data/lib/ckeditor/hooks/simple_form.rb +9 -14
- data/lib/ckeditor/http.rb +9 -11
- data/lib/ckeditor/orm/active_record.rb +1 -3
- data/lib/ckeditor/orm/base.rb +5 -5
- data/lib/ckeditor/orm/mongoid.rb +4 -6
- data/lib/ckeditor/paginatable.rb +3 -1
- data/lib/ckeditor/rails.rb +39 -0
- data/lib/ckeditor/text_area.rb +16 -15
- data/lib/ckeditor/utils.rb +45 -39
- data/lib/ckeditor/utils/content_type_detector.rb +7 -10
- data/lib/ckeditor/utils/javascript_code.rb +8 -3
- data/lib/ckeditor/version.rb +2 -2
- data/lib/generators/ckeditor/install_generator.rb +52 -30
- data/lib/generators/ckeditor/pundit_policy_generator.rb +1 -3
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -2
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +6 -10
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration_versioned.rb +22 -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 +4 -4
- data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +6 -10
- data/lib/generators/ckeditor/templates/active_record/dragonfly/migration_versioned.rb +23 -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 -3
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +5 -5
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +2 -5
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration_versioned.rb +23 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/attachment_file.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +0 -0
- data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +7 -12
- data/lib/generators/ckeditor/templates/active_record/refile/migration_versioned.rb +23 -0
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +0 -0
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +4 -4
- data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +4 -5
- data/lib/generators/ckeditor/templates/ckeditor.rb +16 -7
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +2 -2
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +1 -1
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +1 -1
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +0 -0
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +5 -5
- data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +5 -5
- data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +2 -2
- data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +2 -2
- data/lib/glebtv-ckeditor.rb +0 -0
- data/lib/tasks/ckeditor.rake +6 -14
- data/test/controllers/attachment_files_controller_test.rb +0 -0
- data/test/controllers/pictures_controller_test.rb +0 -0
- data/test/dummy/Rakefile +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -0
- 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 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- data/test/dummy/config/initializers/assets.rb +1 -0
- 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 +0 -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/paperclip.rb +3 -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 +0 -0
- data/test/dummy/config/routes.rb +0 -0
- data/test/dummy/config/secrets.yml +0 -0
- data/test/dummy/db/migrate/20110623120047_create_posts.rb +0 -0
- 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 +2 -3
- data/test/generators/install_generator_test.rb +2 -2
- data/test/integration/navigation_test.rb +0 -0
- data/test/models/attachment_file_test.rb +3 -8
- data/test/models/ckeditor_test.rb +1 -1
- data/test/models/picture_test.rb +0 -0
- 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 +1 -1
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +1358 -0
- data/vendor/assets/javascripts/ckeditor/README.md +39 -0
- data/vendor/assets/javascripts/ckeditor/build-config.js +31 -30
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +709 -675
- data/vendor/assets/javascripts/ckeditor/config.js +10 -0
- data/vendor/assets/javascripts/ckeditor/contents.css +208 -0
- data/vendor/assets/javascripts/ckeditor/lang/en.js +4 -4
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -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 +6 -1
- 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.htmlmixed.min.js +2 -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 +3 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +230 -74
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +2 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +0 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +2 -2
- 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/lineheight/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +4 -3
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +23 -23
- 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 +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/ru.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +13 -7
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +49 -39
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/dialog.css +23 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +33 -19
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +6 -1
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +92 -23
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +81 -82
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon-hdpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +448 -448
- data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +1632 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/index.html +128 -0
- data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +53 -0
- data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +17 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +85 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/api.html +210 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +59 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +59 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +508 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +190 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +144 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +106 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/swfobject.js +19 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +283 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +224 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/index.html +131 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +314 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +124 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +113 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +103 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +209 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +76 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +60 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +59 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +357 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +50 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +16 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +78 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +235 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +72 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +122 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
- data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +234 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +446 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
- data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/LICENSE.md → samples/toolbarconfigurator/lib/codemirror/LICENSE} +19 -21
- data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/css → samples/toolbarconfigurator/lib/codemirror}/codemirror.css +325 -341
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
- data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/js/addon/hint → samples/toolbarconfigurator/lib/codemirror}/show-hint.css +38 -36
- data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +5 -0
- 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/minimalist/images/arrow.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/minimalist/readme.md +7 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.svg +2374 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.svg +2722 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dev/locations.json +145 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +1 -1
- 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/skin.js +10 -0
- data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
- metadata +182 -177
- data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.erb +0 -128
- data/app/views/rails_admin/main/_form_ck_editor.html.haml +0 -10
- data/app/views/rails_admin/main/_form_ck_editorml.html.haml +0 -11
- data/config/locales/bg.ckeditor.yml +0 -9
- data/config/locales/cs.ckeditor.yml +0 -9
- data/config/locales/de.ckeditor.yml +0 -9
- data/config/locales/el-GR.cdkeditor.yml +0 -9
- data/config/locales/es.ckeditor.yml +0 -9
- data/config/locales/fr.ckeditor.yml +0 -9
- data/config/locales/hu.ckeditor.yml +0 -9
- data/config/locales/it.ckeditor.yml +0 -9
- data/config/locales/ja.ckeditor.yml +0 -9
- data/config/locales/nb.ckeditor.yml +0 -9
- data/config/locales/nl.ckeditor.yml +0 -9
- data/config/locales/pl.ckeditor.yml +0 -9
- data/config/locales/pt-BR.ckeditor.yml +0 -9
- data/config/locales/pt-PT.ckeditor.yml +0 -9
- data/config/locales/sv-SE.ckeditor.yml +0 -9
- data/config/locales/tr.ckeditor.yml +0 -9
- data/config/locales/uk.ckeditor.yml +0 -9
- data/config/locales/zh-CN.ckeditor.yml +0 -9
- data/config/locales/zh-TW.ckeditor.yml +0 -9
- data/lib/ckeditor/engine.rb +0 -46
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +0 -183
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/comment.js +0 -206
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/continuecomment.js +0 -85
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.css +0 -32
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +0 -157
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +0 -202
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +0 -169
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +0 -51
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +0 -122
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchtags.js +0 -66
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/trailingspace.js +0 -27
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +0 -105
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/comment-fold.js +0 -59
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +0 -150
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.css +0 -20
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.js +0 -146
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/indent-fold.js +0 -44
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/markdown-fold.js +0 -49
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +0 -182
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +0 -43
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +0 -226
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/anyword-hint.js +0 -41
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/css-hint.js +0 -60
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/html-hint.js +0 -348
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/javascript-hint.js +0 -155
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.js +0 -438
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/sql-hint.js +0 -271
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/xml-hint.js +0 -110
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/loadmode.js +0 -64
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex.js +0 -123
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex_test.js +0 -33
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/overlay.js +0 -85
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/simple.js +0 -213
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/jump-to-line.js +0 -49
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +0 -165
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.css +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.js +0 -97
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +0 -252
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +0 -189
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/active-line.js +0 -74
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/mark-selection.js +0 -118
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/selection-pointer.js +0 -98
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify-html.js +0 -952
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.js +0 -2087
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +0 -9109
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/bbcode.js +0 -137
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/index.html +0 -73
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/bbcodemixed.js +0 -161
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/index.html +0 -128
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/clike.js +0 -785
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/index.html +0 -360
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/scala.html +0 -767
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/test.js +0 -55
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/css.js +0 -825
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss.html +0 -103
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss_test.js +0 -17
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/index.html +0 -75
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less.html +0 -152
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less_test.js +0 -54
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss.html +0 -157
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss_test.js +0 -110
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/test.js +0 -200
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/htmlembedded.js +0 -28
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/index.html +0 -60
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/htmlmixed.js +0 -152
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/index.html +0 -89
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/index.html +0 -114
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/javascript.js +0 -784
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/json-ld.html +0 -72
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/test.js +0 -247
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/typescript.html +0 -61
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/index.html +0 -64
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/php.js +0 -234
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/test.js +0 -154
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/index.html +0 -61
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/test.js +0 -51
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/xml.js +0 -394
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +0 -15
@@ -11,8 +11,7 @@
|
|
11
11
|
'use strict';
|
12
12
|
|
13
13
|
CKEDITOR.plugins.add( 'notification', {
|
14
|
-
lang: '
|
15
|
-
requires: 'toolbar',
|
14
|
+
lang: 'en,ru', // %REMOVE_LINE_CORE%
|
16
15
|
|
17
16
|
init: function( editor ) {
|
18
17
|
editor._.notificationArea = new Area( editor );
|
@@ -128,7 +127,7 @@ function Notification( editor, options ) {
|
|
128
127
|
|
129
128
|
this.element = this._createElement();
|
130
129
|
|
131
|
-
// Don't allow dragging on notification (
|
130
|
+
// Don't allow dragging on notification (http://dev.ckeditor.com/ticket/13184).
|
132
131
|
editor.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement( this.element );
|
133
132
|
}
|
134
133
|
|
@@ -356,7 +355,7 @@ Notification.prototype = {
|
|
356
355
|
notificationElement.append( notificationCloseElement );
|
357
356
|
|
358
357
|
notificationCloseElement.on( 'click', function() {
|
359
|
-
// Focus editor on close (
|
358
|
+
// Focus editor on close (http://dev.ckeditor.com/ticket/12865)
|
360
359
|
notification.editor.focus();
|
361
360
|
|
362
361
|
notification.hide();
|
@@ -613,8 +612,8 @@ Area.prototype = {
|
|
613
612
|
editor = this.editor,
|
614
613
|
contentsRect = editor.ui.contentsElement.getClientRect(),
|
615
614
|
contentsPos = editor.ui.contentsElement.getDocumentPosition(),
|
616
|
-
top
|
617
|
-
topRect
|
615
|
+
top,
|
616
|
+
topRect,
|
618
617
|
areaRect = area.getClientRect(),
|
619
618
|
notification,
|
620
619
|
notificationWidth = this._notificationWidth,
|
@@ -635,6 +634,13 @@ Area.prototype = {
|
|
635
634
|
parseInt( notification.getComputedStyle( 'margin-right' ), 10 );
|
636
635
|
}
|
637
636
|
|
637
|
+
// Check if toolbar exist and if so, then assign values to it (#491).
|
638
|
+
if ( editor.toolbar ) {
|
639
|
+
top = editor.ui.space( 'top' );
|
640
|
+
topRect = top.getClientRect();
|
641
|
+
}
|
642
|
+
|
643
|
+
|
638
644
|
// --------------------------------------- Horizontal layout ----------------------------------------
|
639
645
|
|
640
646
|
// +---Viewport-------------------------------+ +---Viewport-------------------------------+
|
@@ -651,7 +657,7 @@ Area.prototype = {
|
|
651
657
|
// | | | | | | | |
|
652
658
|
// | +--------------------------------------+ | | +--------------------------------------+ |
|
653
659
|
// +------------------------------------------+ +------------------------------------------+
|
654
|
-
if ( top.isVisible() &&
|
660
|
+
if ( top && top.isVisible() &&
|
655
661
|
topRect.bottom > contentsRect.top &&
|
656
662
|
topRect.bottom < contentsRect.bottom - areaRect.height ) {
|
657
663
|
setBelowToolbar();
|
@@ -2,42 +2,52 @@
|
|
2
2
|
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
4
4
|
*/
|
5
|
-
(function(){function
|
6
|
-
a=a.replace(/<!\[/g,"\x3c!--[").replace(/\]>/g,"]--\x3e");var d=CKEDITOR.htmlParser.fragment.fromHtml(a);
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
a.
|
11
|
-
a
|
12
|
-
|
13
|
-
a.attributes.
|
14
|
-
|
15
|
-
|
16
|
-
"
|
17
|
-
|
18
|
-
|
19
|
-
a.
|
20
|
-
|
21
|
-
"
|
22
|
-
(a.
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
a}
|
33
|
-
|
34
|
-
{
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
a
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
5
|
+
(function(){function u(){return!1}function x(a,b){var c,d=[];a.filterChildren(b);for(c=a.children.length-1;0<=c;c--)d.unshift(a.children[c]),a.children[c].remove();c=a.attributes;var f=a,e=!0,h;for(h in c)if(e)e=!1;else{var l=new CKEDITOR.htmlParser.element(a.name);l.attributes[h]=c[h];f.add(l);f=l;delete c[h]}for(c=0;c<d.length;c++)f.add(d[c])}var g,k,t,q,n=CKEDITOR.tools,y=["o:p","xml","script","meta","link"],w={},v=0;CKEDITOR.plugins.pastefromword={};CKEDITOR.cleanWord=function(a,b){var c=Boolean(a.match(/mso-list:\s*l\d+\s+level\d+\s+lfo\d+/));
|
6
|
+
CKEDITOR.plugins.clipboard.isCustomDataTypesSupported&&(a=CKEDITOR.plugins.pastefromword.styles.inliner.inline(a).getBody().getHtml());a=a.replace(/<!\[/g,"\x3c!--[").replace(/\]>/g,"]--\x3e");var d=CKEDITOR.htmlParser.fragment.fromHtml(a);q=new CKEDITOR.htmlParser.filter({root:function(e){e.filterChildren(q);CKEDITOR.plugins.pastefromword.lists.cleanup(g.createLists(e))},elementNames:[[/^\?xml:namespace$/,""],[/^v:shapetype/,""],[new RegExp(y.join("|")),""]],elements:{a:function(e){if(e.attributes.name){if("_GoBack"==
|
7
|
+
e.attributes.name){delete e.name;return}if(e.attributes.name.match(/^OLE_LINK\d+$/)){delete e.name;return}}if(e.attributes.href&&e.attributes.href.match(/#.+$/)){var a=e.attributes.href.match(/#(.+)$/)[1];w[a]=e}e.attributes.name&&w[e.attributes.name]&&(e=w[e.attributes.name],e.attributes.href=e.attributes.href.replace(/.*#(.*)$/,"#$1"))},div:function(e){k.createStyleStack(e,q,b)},img:function(e){if(e.parent&&e.parent.attributes){var a=e.parent.attributes;(a=a.style||a.STYLE)&&a.match(/mso\-list:\s?Ignore/)&&
|
8
|
+
(e.attributes["cke-ignored"]=!0)}k.mapStyles(e,{width:function(a){k.setStyle(e,"width",a+"px")},height:function(a){k.setStyle(e,"height",a+"px")}});e.attributes.src&&e.attributes.src.match(/^file:\/\//)&&e.attributes.alt&&e.attributes.alt.match(/^https?:\/\//)&&(e.attributes.src=e.attributes.alt)},p:function(a){a.filterChildren(q);if(a.attributes.style&&a.attributes.style.match(/display:\s*none/i))return!1;if(g.thisIsAListItem(b,a))t.isEdgeListItem(b,a)&&t.cleanupEdgeListItem(a),g.convertToFakeListItem(b,
|
9
|
+
a),n.array.reduce(a.children,function(a,b){"p"===b.name&&(0<a&&(new CKEDITOR.htmlParser.element("br")).insertBefore(b),b.replaceWithChildren(),a+=1);return a},0);else{var c=a.getAscendant(function(a){return"ul"==a.name||"ol"==a.name}),d=n.parseCssText(a.attributes.style);c&&!c.attributes["cke-list-level"]&&d["mso-list"]&&d["mso-list"].match(/level/)&&(c.attributes["cke-list-level"]=d["mso-list"].match(/level(\d+)/)[1]);b.config.enterMode==CKEDITOR.ENTER_BR&&(delete a.name,a.add(new CKEDITOR.htmlParser.element("br")))}k.createStyleStack(a,
|
10
|
+
q,b)},pre:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h1:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h2:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h3:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h4:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h5:function(a){g.thisIsAListItem(b,
|
11
|
+
a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},h6:function(a){g.thisIsAListItem(b,a)&&g.convertToFakeListItem(b,a);k.createStyleStack(a,q,b)},font:function(a){if(a.getHtml().match(/^\s*$/))return(new CKEDITOR.htmlParser.text(" ")).insertAfter(a),!1;b&&!0===b.config.pasteFromWordRemoveFontStyles&&a.attributes.size&&delete a.attributes.size;CKEDITOR.dtd.tr[a.parent.name]&&CKEDITOR.tools.arrayCompare(CKEDITOR.tools.objectKeys(a.attributes),["class","style"])?k.createStyleStack(a,q,b):x(a,
|
12
|
+
q)},ul:function(a){if(c)return"li"==a.parent.name&&0===n.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),g.dissolveList(a),!1},li:function(a){t.correctLevelShift(a);c&&(a.attributes.style=k.normalizedStyles(a,b),k.pushStylesLower(a))},ol:function(a){if(c)return"li"==a.parent.name&&0===n.indexOf(a.parent.children,a)&&k.setStyle(a.parent,"list-style-type","none"),g.dissolveList(a),!1},span:function(a){a.filterChildren(q);a.attributes.style=k.normalizedStyles(a,b);if(!a.attributes.style||
|
13
|
+
a.attributes.style.match(/^mso\-bookmark:OLE_LINK\d+$/)||a.getHtml().match(/^(\s| )+$/)){for(var c=a.children.length-1;0<=c;c--)a.children[c].insertAfter(a);return!1}a.attributes.style.match(/FONT-FAMILY:\s*Symbol/i)&&a.forEach(function(a){a.value=a.value.replace(/ /g,"")},CKEDITOR.NODE_TEXT,!0);k.createStyleStack(a,q,b)},table:function(a){a._tdBorders={};a.filterChildren(q);var b,c=0,d;for(d in a._tdBorders)a._tdBorders[d]>c&&(c=a._tdBorders[d],b=d);k.setStyle(a,"border",b);c=(b=a.parent)&&
|
14
|
+
b.parent;if(b.name&&"div"===b.name&&b.attributes.align&&1===n.objectKeys(b.attributes).length&&1===b.children.length){a.attributes.align=b.attributes.align;d=b.children.splice(0);a.remove();for(a=d.length-1;0<=a;a--)c.add(d[a],b.getIndex());b.remove()}},td:function(a){var c=a.getAscendant("table"),d=c._tdBorders,f=["border","border-top","border-right","border-bottom","border-left"],c=n.parseCssText(c.attributes.style),m=c.background||c.BACKGROUND;m&&k.setStyle(a,"background",m,!0);(c=c["background-color"]||
|
15
|
+
c["BACKGROUND-COLOR"])&&k.setStyle(a,"background-color",c,!0);var c=n.parseCssText(a.attributes.style),p;for(p in c)m=c[p],delete c[p],c[p.toLowerCase()]=m;for(p=0;p<f.length;p++)c[f[p]]&&(m=c[f[p]],d[m]=d[m]?d[m]+1:1);k.createStyleStack(a,q,b,/margin|text\-align|padding|list\-style\-type|width|height|border|white\-space|vertical\-align|background/i)},"v:imagedata":u,"v:shape":function(a){var b=!1;a.parent.getFirst(function(c){"img"==c.name&&c.attributes&&c.attributes["v:shapes"]==a.attributes.id&&
|
16
|
+
(b=!0)});if(b)return!1;var c="";a.forEach(function(a){a.attributes&&a.attributes.src&&(c=a.attributes.src)},CKEDITOR.NODE_ELEMENT,!0);a.filterChildren(q);a.name="img";a.attributes.src=a.attributes.src||c;delete a.attributes.type},style:function(){return!1},object:function(a){return!(!a.attributes||!a.attributes.data)}},attributes:{style:function(a,c){return k.normalizedStyles(c,b)||!1},"class":function(a){a=a.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/ig,"");return""===a?!1:a},cellspacing:u,
|
17
|
+
cellpadding:u,border:u,"v:shapes":u,"o:spid":u},comment:function(a){a.match(/\[if.* supportFields.*\]/)&&v++;"[endif]"==a&&(v=0<v?v-1:0);return!1},text:function(a,b){if(v)return"";var c=b.parent&&b.parent.parent;return c&&c.attributes&&c.attributes.style&&c.attributes.style.match(/mso-list:\s*ignore/i)?a.replace(/ /g," "):a}});var f=new CKEDITOR.htmlParser.basicWriter;q.applyTo(d);d.writeHtml(f);return f.getHtml()};CKEDITOR.plugins.pastefromword.styles={setStyle:function(a,b,c,d){var f=n.parseCssText(a.attributes.style);
|
18
|
+
d&&f[b]||(""===c?delete f[b]:f[b]=c,a.attributes.style=CKEDITOR.tools.writeCssText(f))},mapStyles:function(a,b){for(var c in b)if(a.attributes[c]){if("function"===typeof b[c])b[c](a.attributes[c]);else k.setStyle(a,b[c],a.attributes[c]);delete a.attributes[c]}},normalizedStyles:function(a,b){var c="background-color:transparent border-image:none color:windowtext direction:ltr mso- text-indent visibility:visible div:border:none".split(" "),d="font-family font font-size color background-color line-height text-decoration".split(" "),
|
19
|
+
f=function(){for(var a=[],b=0;b<arguments.length;b++)arguments[b]&&a.push(arguments[b]);return-1!==n.indexOf(c,a.join(":"))},e=b&&!0===b.config.pasteFromWordRemoveFontStyles,h=n.parseCssText(a.attributes.style);"cke:li"==a.name&&h["TEXT-INDENT"]&&h.MARGIN&&(a.attributes["cke-indentation"]=g.getElementIndentation(a),h.MARGIN=h.MARGIN.replace(/(([\w\.]+ ){3,3})[\d\.]+(\w+$)/,"$10$3"));for(var l=n.objectKeys(h),r=0;r<l.length;r++){var m=l[r].toLowerCase(),p=h[l[r]],k=CKEDITOR.tools.indexOf;(e&&-1!==
|
20
|
+
k(d,m.toLowerCase())||f(null,m,p)||f(null,m.replace(/\-.*$/,"-"))||f(null,m)||f(a.name,m,p)||f(a.name,m.replace(/\-.*$/,"-"))||f(a.name,m)||f(p))&&delete h[l[r]]}return CKEDITOR.tools.writeCssText(h)},createStyleStack:function(a,b,c,d){var f=[];a.filterChildren(b);for(b=a.children.length-1;0<=b;b--)f.unshift(a.children[b]),a.children[b].remove();k.sortStyles(a);b=n.parseCssText(k.normalizedStyles(a,c));c=a;var e="span"===a.name,h;for(h in b)if(!h.match(d||/margin|text\-align|width|border|padding/i))if(e)e=
|
21
|
+
!1;else{var l=new CKEDITOR.htmlParser.element("span");l.attributes.style=h+":"+b[h];c.add(l);c=l;delete b[h]}CKEDITOR.tools.isEmpty(b)?delete a.attributes.style:a.attributes.style=CKEDITOR.tools.writeCssText(b);for(b=0;b<f.length;b++)c.add(f[b])},sortStyles:function(a){for(var b=["border","border-bottom","font-size","background"],c=n.parseCssText(a.attributes.style),d=n.objectKeys(c),f=[],e=[],h=0;h<d.length;h++)-1!==n.indexOf(b,d[h].toLowerCase())?f.push(d[h]):e.push(d[h]);f.sort(function(a,c){var d=
|
22
|
+
n.indexOf(b,a.toLowerCase()),f=n.indexOf(b,c.toLowerCase());return d-f});d=[].concat(f,e);f={};for(h=0;h<d.length;h++)f[d[h]]=c[d[h]];a.attributes.style=CKEDITOR.tools.writeCssText(f)},pushStylesLower:function(a,b,c){if(!a.attributes.style||0===a.children.length)return!1;b=b||{};var d={"list-style-type":!0,width:!0,height:!0,border:!0,"border-":!0},f=n.parseCssText(a.attributes.style),e;for(e in f)if(!(e.toLowerCase()in d||d[e.toLowerCase().replace(/\-.*$/,"-")]||e.toLowerCase()in b)){for(var h=!1,
|
23
|
+
l=0;l<a.children.length;l++){var g=a.children[l];if(g.type===CKEDITOR.NODE_TEXT&&c){var m=new CKEDITOR.htmlParser.element("span");m.setHtml(g.value);g.replaceWith(m);g=m}g.type===CKEDITOR.NODE_ELEMENT&&(h=!0,k.setStyle(g,e,f[e]))}h&&delete f[e]}a.attributes.style=CKEDITOR.tools.writeCssText(f);return!0},inliner:{filtered:"break-before break-after break-inside page-break page-break-before page-break-after page-break-inside".split(" "),parse:function(a){function b(a){var b=new CKEDITOR.dom.element("style"),
|
24
|
+
c=new CKEDITOR.dom.element("iframe");c.hide();CKEDITOR.document.getBody().append(c);c.$.contentDocument.documentElement.appendChild(b.$);b.$.textContent=a;c.remove();return b.$.sheet}function c(a){var b=a.indexOf("{"),c=a.indexOf("}");return d(a.substring(b+1,c),!0)}var d=CKEDITOR.tools.parseCssText,f=CKEDITOR.plugins.pastefromword.styles.inliner.filter,e=a.is?a.$.sheet:b(a);a=[];var h;if(e)for(e=e.cssRules,h=0;h<e.length;h++)e[h].type===window.CSSRule.STYLE_RULE&&a.push({selector:e[h].selectorText,
|
25
|
+
styles:f(c(e[h].cssText))});return a},filter:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.filtered,c=n.array.indexOf,d={},f;for(f in a)-1===c(b,f)&&(d[f]=a[f]);return d},sort:function(a){return a.sort(function(a){var c=CKEDITOR.tools.array.map(a,function(a){return a.selector});return function(a,b){var e=-1!==(""+a.selector).indexOf(".")?1:0,e=(-1!==(""+b.selector).indexOf(".")?1:0)-e;return 0!==e?e:c.indexOf(b.selector)-c.indexOf(a.selector)}}(a))},inline:function(a){var b=CKEDITOR.plugins.pastefromword.styles.inliner.parse,
|
26
|
+
c=CKEDITOR.plugins.pastefromword.styles.inliner.sort,d=function(a){a=(new DOMParser).parseFromString(a,"text/html");return new CKEDITOR.dom.document(a)}(a);a=d.find("style");c=c(function(a){var c=[],d;for(d=0;d<a.count();d++)c=c.concat(b(a.getItem(d)));return c}(a));CKEDITOR.tools.array.forEach(c,function(a){var b=a.styles;a=d.find(a.selector);var c,g,r;for(r=0;r<a.count();r++)c=a.getItem(r),g=CKEDITOR.tools.parseCssText(c.getAttribute("style")),g=CKEDITOR.tools.extend({},g,b),c.setAttribute("style",
|
27
|
+
CKEDITOR.tools.writeCssText(g))});return d}}};k=CKEDITOR.plugins.pastefromword.styles;CKEDITOR.plugins.pastefromword.lists={thisIsAListItem:function(a,b){return t.isEdgeListItem(a,b)||b.attributes.style&&b.attributes.style.match(/mso\-list:\s?l\d/)&&"li"!==b.parent.name||b.attributes["cke-dissolved"]||b.getHtml().match(/<!\-\-\[if !supportLists]\-\->/)?!0:!1},convertToFakeListItem:function(a,b){t.isDegenerateListItem(a,b)&&t.assignListLevels(a,b);this.getListItemInfo(b);if(!b.attributes["cke-dissolved"]){var c;
|
28
|
+
b.forEach(function(a){!c&&"img"==a.name&&a.attributes["cke-ignored"]&&"*"==a.attributes.alt&&(c="·",a.remove())},CKEDITOR.NODE_ELEMENT);b.forEach(function(a){c||a.value.match(/^ /)||(c=a.value)},CKEDITOR.NODE_TEXT);if("undefined"==typeof c)return;b.attributes["cke-symbol"]=c.replace(/(?: | ).*$/,"");g.removeSymbolText(b)}if(b.attributes.style){var d=n.parseCssText(b.attributes.style);d["margin-left"]&&(delete d["margin-left"],b.attributes.style=CKEDITOR.tools.writeCssText(d))}b.name="cke:li"},
|
29
|
+
convertToRealListItems:function(a){var b=[];a.forEach(function(a){"cke:li"==a.name&&(a.name="li",b.push(a))},CKEDITOR.NODE_ELEMENT,!1);return b},removeSymbolText:function(a){var b,c=a.attributes["cke-symbol"];a.forEach(function(d){!b&&d.value.match(c.replace(")","\\)").replace("(",""))&&(d.value=d.value.replace(c,""),d.parent.getHtml().match(/^(\s| )*$/)&&(b=d.parent!==a?d.parent:null))},CKEDITOR.NODE_TEXT);b&&b.remove()},setListSymbol:function(a,b,c){c=c||1;var d=n.parseCssText(a.attributes.style);
|
30
|
+
if("ol"==a.name){if(a.attributes.type||d["list-style-type"])return;var f={"[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"},e;for(e in f)if(g.getSubsectionSymbol(b).match(new RegExp(e))){d["list-style-type"]=f[e];break}a.attributes["cke-list-style-type"]=d["list-style-type"]}else f={"·":"disc",o:"circle","§":"square"},!d["list-style-type"]&&f[b]&&(d["list-style-type"]=f[b]);g.setListSymbol.removeRedundancies(d,c);(a.attributes.style=CKEDITOR.tools.writeCssText(d))||
|
31
|
+
delete a.attributes.style},setListStart:function(a){for(var b=[],c=0,d=0;d<a.children.length;d++)b.push(a.children[d].attributes["cke-symbol"]||"");b[0]||c++;switch(a.attributes["cke-list-style-type"]){case "lower-roman":case "upper-roman":a.attributes.start=g.toArabic(g.getSubsectionSymbol(b[c]))-c;break;case "lower-alpha":case "upper-alpha":a.attributes.start=g.getSubsectionSymbol(b[c]).replace(/\W/g,"").toLowerCase().charCodeAt(0)-96-c;break;case "decimal":a.attributes.start=parseInt(g.getSubsectionSymbol(b[c]),
|
32
|
+
10)-c||1}"1"==a.attributes.start&&delete a.attributes.start;delete a.attributes["cke-list-style-type"]},numbering:{toNumber:function(a,b){function c(a){a=a.toUpperCase();for(var b=1,c=1;0<a.length;c*=26)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.charAt(a.length-1))*c,a=a.substr(0,a.length-1);return b}function d(a){var b=[[1E3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];a=a.toUpperCase();for(var c=b.length,d=0,g=0;g<c;++g)for(var m=
|
33
|
+
b[g],p=m[1].length;a.substr(0,p)==m[1];a=a.substr(p))d+=m[0];return d}return"decimal"==b?Number(a):"upper-roman"==b||"lower-roman"==b?d(a.toUpperCase()):"lower-alpha"==b||"upper-alpha"==b?c(a):1},getStyle:function(a){a=a.slice(0,1);var b={i:"lower-roman",v:"lower-roman",x:"lower-roman",l:"lower-roman",m:"lower-roman",I:"upper-roman",V:"upper-roman",X:"upper-roman",L:"upper-roman",M:"upper-roman"}[a];b||(b="decimal",a.match(/[a-z]/)&&(b="lower-alpha"),a.match(/[A-Z]/)&&(b="upper-alpha"));return b}},
|
34
|
+
getSubsectionSymbol:function(a){return(a.match(/([\da-zA-Z]+).?$/)||["placeholder","1"])[1]},setListDir:function(a){var b=0,c=0;a.forEach(function(a){"li"==a.name&&("rtl"==(a.attributes.dir||a.attributes.DIR||"").toLowerCase()?c++:b++)},CKEDITOR.ELEMENT_NODE);c>b&&(a.attributes.dir="rtl")},createList:function(a){return(a.attributes["cke-symbol"].match(/([\da-np-zA-NP-Z]).?/)||[])[1]?new CKEDITOR.htmlParser.element("ol"):new CKEDITOR.htmlParser.element("ul")},createLists:function(a){var b,c,d,f=g.convertToRealListItems(a);
|
35
|
+
if(0===f.length)return[];var e=g.groupLists(f);for(a=0;a<e.length;a++){var h=e[a],l=h[0];for(d=0;d<h.length;d++)if(1==h[d].attributes["cke-list-level"]){l=h[d];break}var l=[g.createList(l)],k=l[0],m=[l[0]];k.insertBefore(h[0]);for(d=0;d<h.length;d++){b=h[d];for(c=b.attributes["cke-list-level"];c>l.length;){var p=g.createList(b),n=k.children;0<n.length?n[n.length-1].add(p):(n=new CKEDITOR.htmlParser.element("li",{style:"list-style-type:none"}),n.add(p),k.add(n));l.push(p);m.push(p);k=p;c==l.length&&
|
36
|
+
g.setListSymbol(p,b.attributes["cke-symbol"],c)}for(;c<l.length;)l.pop(),k=l[l.length-1],c==l.length&&g.setListSymbol(k,b.attributes["cke-symbol"],c);b.remove();k.add(b)}l[0].children.length&&(d=l[0].children[0].attributes["cke-symbol"],!d&&1<l[0].children.length&&(d=l[0].children[1].attributes["cke-symbol"]),d&&g.setListSymbol(l[0],d));for(d=0;d<m.length;d++)g.setListStart(m[d]);for(d=0;d<h.length;d++)this.determineListItemValue(h[d])}return f},cleanup:function(a){var b=["cke-list-level","cke-symbol",
|
37
|
+
"cke-list-id","cke-indentation","cke-dissolved"],c,d;for(c=0;c<a.length;c++)for(d=0;d<b.length;d++)delete a[c].attributes[b[d]]},determineListItemValue:function(a){if("ol"===a.parent.name){var b=this.calculateValue(a),c=a.attributes["cke-symbol"].match(/[a-z0-9]+/gi),d;c&&(c=c[c.length-1],d=a.parent.attributes["cke-list-style-type"]||this.numbering.getStyle(c),c=this.numbering.toNumber(c,d),c!==b&&(a.attributes.value=c))}},calculateValue:function(a){if(!a.parent)return 1;var b=a.parent;a=a.getIndex();
|
38
|
+
var c=null,d,f,e;for(e=a;0<=e&&null===c;e--)f=b.children[e],f.attributes&&void 0!==f.attributes.value&&(d=e,c=parseInt(f.attributes.value,10));null===c&&(c=void 0!==b.attributes.start?parseInt(b.attributes.start,10):1,d=0);return c+(a-d)},dissolveList:function(a){function b(a){return 50<=a?"l"+b(a-50):40<=a?"xl"+b(a-40):10<=a?"x"+b(a-10):9==a?"ix":5<=a?"v"+b(a-5):4==a?"iv":1<=a?"i"+b(a-1):""}function c(a,b){function c(b,d){return b&&b.parent?a(b.parent)?c(b.parent,d+1):c(b.parent,d):d}return c(b,
|
39
|
+
0)}var d=function(a){return function(b){return b.name==a}},f=function(a){return d("ul")(a)||d("ol")(a)},e=CKEDITOR.tools.array,g=[],l,r;a.forEach(function(a){g.push(a)},CKEDITOR.NODE_ELEMENT,!1);l=e.filter(g,d("li"));var m=e.filter(g,f);e.forEach(m,function(a){var g=a.attributes.type,h=parseInt(a.attributes.start,10)||1,m=c(f,a)+1;g||(g=n.parseCssText(a.attributes.style)["list-style-type"]);e.forEach(e.filter(a.children,d("li")),function(c,d){var e;switch(g){case "disc":e="·";break;case "circle":e=
|
40
|
+
"o";break;case "square":e="§";break;case "1":case "decimal":e=h+d+".";break;case "a":case "lower-alpha":e=String.fromCharCode(97+h-1+d)+".";break;case "A":case "upper-alpha":e=String.fromCharCode(65+h-1+d)+".";break;case "i":case "lower-roman":e=b(h+d)+".";break;case "I":case "upper-roman":e=b(h+d).toUpperCase()+".";break;default:e="ul"==a.name?"·":h+d+"."}c.attributes["cke-symbol"]=e;c.attributes["cke-list-level"]=m})});l=e.reduce(l,function(a,b){var c=b.children[0];if(c&&c.name&&c.attributes.style&&
|
41
|
+
c.attributes.style.match(/mso-list:/i)){k.pushStylesLower(b,{"list-style-type":!0,display:!0});var d=n.parseCssText(c.attributes.style,!0);k.setStyle(b,"mso-list",d["mso-list"],!0);k.setStyle(c,"mso-list","");delete b["cke-list-level"];(c=d.display?"display":d.DISPLAY?"DISPLAY":"")&&k.setStyle(b,"display",d[c],!0)}if(1===b.children.length&&f(b.children[0]))return a;b.name="p";b.attributes["cke-dissolved"]=!0;a.push(b);return a},[]);for(r=l.length-1;0<=r;r--)l[r].insertAfter(a);for(r=m.length-1;0<=
|
42
|
+
r;r--)delete m[r].name},groupLists:function(a){var b,c,d=[[a[0]]],f=d[0];c=a[0];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||g.getElementIndentation(c);for(b=1;b<a.length;b++){c=a[b];var e=a[b-1];c.attributes["cke-indentation"]=c.attributes["cke-indentation"]||g.getElementIndentation(c);c.previous!==e&&(g.chopDiscontinuousLists(f,d),d.push(f=[]));f.push(c)}g.chopDiscontinuousLists(f,d);return d},chopDiscontinuousLists:function(a,b){for(var c={},d=[[]],f,e=0;e<a.length;e++){var h=
|
43
|
+
c[a[e].attributes["cke-list-level"]],l=this.getListItemInfo(a[e]),k,m;h?(m=h.type.match(/alpha/)&&7==h.index?"alpha":m,m="o"==a[e].attributes["cke-symbol"]&&14==h.index?"alpha":m,k=g.getSymbolInfo(a[e].attributes["cke-symbol"],m),l=this.getListItemInfo(a[e]),(h.type!=k.type||f&&l.id!=f.id&&!this.isAListContinuation(a[e]))&&d.push([])):k=g.getSymbolInfo(a[e].attributes["cke-symbol"]);for(f=parseInt(a[e].attributes["cke-list-level"],10)+1;20>f;f++)c[f]&&delete c[f];c[a[e].attributes["cke-list-level"]]=
|
44
|
+
k;d[d.length-1].push(a[e]);f=l}[].splice.apply(b,[].concat([n.indexOf(b,a),1],d))},isAListContinuation:function(a){var b=a;do if((b=b.previous)&&b.type===CKEDITOR.NODE_ELEMENT){if(void 0===b.attributes["cke-list-level"])break;if(b.attributes["cke-list-level"]===a.attributes["cke-list-level"])return b.attributes["cke-list-id"]===a.attributes["cke-list-id"]}while(b);return!1},getElementIndentation:function(a){a=n.parseCssText(a.attributes.style);if(a.margin||a.MARGIN){a.margin=a.margin||a.MARGIN;var b=
|
45
|
+
{styles:{margin:a.margin}};CKEDITOR.filter.transformationsTools.splitMarginShorthand(b);a["margin-left"]=b.styles["margin-left"]}return parseInt(n.convertToPx(a["margin-left"]||"0px"),10)},toArabic:function(a){return a.match(/[ivxl]/i)?a.match(/^l/i)?50+g.toArabic(a.slice(1)):a.match(/^lx/i)?40+g.toArabic(a.slice(1)):a.match(/^x/i)?10+g.toArabic(a.slice(1)):a.match(/^ix/i)?9+g.toArabic(a.slice(2)):a.match(/^v/i)?5+g.toArabic(a.slice(1)):a.match(/^iv/i)?4+g.toArabic(a.slice(2)):a.match(/^i/i)?1+g.toArabic(a.slice(1)):
|
46
|
+
g.toArabic(a.slice(1)):0},getSymbolInfo:function(a,b){var c=a.toUpperCase()==a?"upper-":"lower-",d={"·":["disc",-1],o:["circle",-2],"§":["square",-3]};if(a in d||b&&b.match(/(disc|circle|square)/))return{index:d[a][1],type:d[a][0]};if(a.match(/\d/))return{index:a?parseInt(g.getSubsectionSymbol(a),10):0,type:"decimal"};a=a.replace(/\W/g,"").toLowerCase();return!b&&a.match(/[ivxl]+/i)||b&&"alpha"!=b||"roman"==b?{index:g.toArabic(a),type:c+"roman"}:a.match(/[a-z]/i)?{index:a.charCodeAt(0)-97,type:c+
|
47
|
+
"alpha"}:{index:-1,type:"disc"}},getListItemInfo:function(a){if(void 0!==a.attributes["cke-list-id"])return{id:a.attributes["cke-list-id"],level:a.attributes["cke-list-level"]};var b=n.parseCssText(a.attributes.style)["mso-list"],c={id:"0",level:"1"};b&&(b+=" ",c.level=b.match(/level(.+?)\s+/)[1],c.id=b.match(/l(\d+?)\s+/)[1]);a.attributes["cke-list-level"]=void 0!==a.attributes["cke-list-level"]?a.attributes["cke-list-level"]:c.level;a.attributes["cke-list-id"]=c.id;return c}};g=CKEDITOR.plugins.pastefromword.lists;
|
48
|
+
CKEDITOR.plugins.pastefromword.heuristics={isEdgeListItem:function(a,b){if(!CKEDITOR.env.edge||!a.config.pasteFromWord_heuristicsEdgeList)return!1;var c="";b.forEach&&b.forEach(function(a){c+=a.value},CKEDITOR.NODE_TEXT);return c.match(/^(?: | )*\(?[a-zA-Z0-9]+?[\.\)](?: | ){2,}/)?!0:t.isDegenerateListItem(a,b)},cleanupEdgeListItem:function(a){var b=!1;a.forEach(function(a){b||(a.value=a.value.replace(/^(?: |[\s])+/,""),a.value.length&&(b=!0))},CKEDITOR.NODE_TEXT)},isDegenerateListItem:function(a,
|
49
|
+
b){return!!b.attributes["cke-list-level"]||b.attributes.style&&!b.attributes.style.match(/mso\-list/)&&!!b.find(function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&b.name.match(/h\d/i)&&a.getHtml().match(/^[a-zA-Z0-9]+?[\.\)]$/))return!0;var d=n.parseCssText(a.attributes&&a.attributes.style,!0);if(!d)return!1;var f=d["font-family"]||"";return(d.font||d["font-size"]||"").match(/7pt/i)&&!!a.previous||f.match(/symbol/i)},!0).length},assignListLevels:function(a,b){if(!b.attributes||void 0===b.attributes["cke-list-level"]){for(var c=
|
50
|
+
[g.getElementIndentation(b)],d=[b],f=[],e=CKEDITOR.tools.array,h=e.map;b.next&&b.next.attributes&&!b.next.attributes["cke-list-level"]&&t.isDegenerateListItem(a,b.next);)b=b.next,c.push(g.getElementIndentation(b)),d.push(b);var k=h(c,function(a,b){return 0===b?0:a-c[b-1]}),n=this.guessIndentationStep(e.filter(c,function(a){return 0!==a})),f=h(c,function(a){return Math.round(a/n)});-1!==e.indexOf(f,0)&&(f=h(f,function(a){return a+1}));e.forEach(d,function(a,b){a.attributes["cke-list-level"]=f[b]});
|
51
|
+
return{indents:c,levels:f,diffs:k}}},guessIndentationStep:function(a){return a.length?Math.min.apply(null,a):null},correctLevelShift:function(a){if(this.isShifted(a)){var b=CKEDITOR.tools.array.filter(a.children,function(a){return"ul"==a.name||"ol"==a.name}),c=CKEDITOR.tools.array.reduce(b,function(a,b){return(b.children&&1==b.children.length&&t.isShifted(b.children[0])?[b]:b.children).concat(a)},[]);CKEDITOR.tools.array.forEach(b,function(a){a.remove()});CKEDITOR.tools.array.forEach(c,function(b){a.add(b,
|
52
|
+
0)});delete a.name}},isShifted:function(a){return"li"!==a.name?!1:0===CKEDITOR.tools.array.filter(a.children,function(a){return a.name&&("ul"==a.name||"ol"==a.name||"p"==a.name&&0===a.children.length)?!1:!0}).length}};t=CKEDITOR.plugins.pastefromword.heuristics;g.setListSymbol.removeRedundancies=function(a,b){(1===b&&"disc"===a["list-style-type"]||"decimal"===a["list-style-type"])&&delete a["list-style-type"]};CKEDITOR.plugins.pastefromword.createAttributeStack=x;CKEDITOR.config.pasteFromWord_heuristicsEdgeList=
|
53
|
+
!0})();
|
@@ -0,0 +1,23 @@
|
|
1
|
+
div.cke_dialog_ui_scaytItemList {
|
2
|
+
border: 1px solid #c9cccf;
|
3
|
+
}
|
4
|
+
|
5
|
+
.cke_scaytItemList-child {
|
6
|
+
position: relative;
|
7
|
+
padding: 6px 30px 6px 5px;
|
8
|
+
overflow: hidden;
|
9
|
+
text-overflow: ellipsis;
|
10
|
+
white-space: nowrap;
|
11
|
+
}
|
12
|
+
|
13
|
+
.cke_scaytItemList-child:hover {
|
14
|
+
background: #ebebeb;
|
15
|
+
}
|
16
|
+
|
17
|
+
.cke_scaytItemList-child .cke_scaytItemList_remove {
|
18
|
+
position: absolute;
|
19
|
+
top: 0;
|
20
|
+
right: 5px;
|
21
|
+
width: 26px;
|
22
|
+
height: 26px;
|
23
|
+
}
|
@@ -1,19 +1,33 @@
|
|
1
|
-
CKEDITOR.dialog.add("scaytDialog",function(
|
2
|
-
onShow:function(){},elements:[{type:"vbox",id:"scaytOptions",children:function(){var
|
3
|
-
{id:"langs",label:
|
4
|
-
onShow:function(){var
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
b.error||
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
c=
|
18
|
-
|
19
|
-
|
1
|
+
CKEDITOR.dialog.add("scaytDialog",function(c){var d=c.scayt,k='\x3cp\x3e\x3cimg src\x3d"'+d.getLogo()+'" /\x3e\x3c/p\x3e\x3cp\x3e'+d.getLocal("version")+d.getVersion()+"\x3c/p\x3e\x3cp\x3e"+d.getLocal("text_copyrights")+"\x3c/p\x3e",n=CKEDITOR.document,p={isChanged:function(){return null===this.newLang||this.currentLang===this.newLang?!1:!0},currentLang:d.getLang(),newLang:null,reset:function(){this.currentLang=d.getLang();this.newLang=null},id:"lang"},k=[{id:"options",label:d.getLocal("tab_options"),
|
2
|
+
onShow:function(){},elements:[{type:"vbox",id:"scaytOptions",children:function(){var b=d.getApplicationConfig(),a=[],c={"ignore-all-caps-words":"label_allCaps","ignore-domain-names":"label_ignoreDomainNames","ignore-words-with-mixed-cases":"label_mixedCase","ignore-words-with-numbers":"label_mixedWithDigits"},f;for(f in b)b={type:"checkbox"},b.id=f,b.label=d.getLocal(c[f]),a.push(b);return a}(),onShow:function(){this.getChild();for(var b=c.scayt,a=0;a<this.getChild().length;a++)this.getChild()[a].setValue(b.getApplicationConfig()[this.getChild()[a].id])}}]},
|
3
|
+
{id:"langs",label:d.getLocal("tab_languages"),elements:[{id:"leftLangColumn",type:"vbox",align:"left",widths:["100"],children:[{type:"html",id:"langBox",style:"overflow: hidden; white-space: normal;margin-bottom:15px;",html:'\x3cdiv\x3e\x3cdiv style\x3d"float:left;width:45%;margin-left:5px;" id\x3d"left-col-'+c.name+'" class\x3d"scayt-lang-list"\x3e\x3c/div\x3e\x3cdiv style\x3d"float:left;width:45%;margin-left:15px;" id\x3d"right-col-'+c.name+'" class\x3d"scayt-lang-list"\x3e\x3c/div\x3e\x3c/div\x3e',
|
4
|
+
onShow:function(){var b=c.scayt.getLang();n.getById("scaytLang_"+c.name+"_"+b).$.checked=!0}},{type:"html",id:"graytLanguagesHint",html:'\x3cdiv style\x3d"margin:5px auto; width:95%;white-space:normal;" id\x3d"'+c.name+'graytLanguagesHint"\x3e\x3cspan style\x3d"width:10px;height:10px;display: inline-block; background:#02b620;vertical-align:top;margin-top:2px;"\x3e\x3c/span\x3e - This languages are supported by Grammar As You Type(GRAYT).\x3c/div\x3e',onShow:function(){var b=n.getById(c.name+"graytLanguagesHint");
|
5
|
+
c.config.grayt_autoStartup||(b.$.style.display="none")}}]}]},{id:"dictionaries",label:d.getLocal("tab_dictionaries"),elements:[{type:"vbox",id:"rightCol_col__left",children:[{type:"html",id:"dictionaryNote",html:""},{type:"text",id:"dictionaryName",label:d.getLocal("label_fieldNameDic")||"Dictionary name",onShow:function(b){var a=b.sender,h=c.scayt;b=SCAYT.prototype.UILib;var f=a.getContentElement("dictionaries","dictionaryName").getInputElement().$;h.isLicensed()||(f.disabled=!0,b.css(f,{cursor:"not-allowed"}));
|
6
|
+
setTimeout(function(){a.getContentElement("dictionaries","dictionaryNote").getElement().setText("");null!=h.getUserDictionaryName()&&""!=h.getUserDictionaryName()&&a.getContentElement("dictionaries","dictionaryName").setValue(h.getUserDictionaryName())},0)}},{type:"hbox",id:"udButtonsHolder",align:"left",widths:["auto"],style:"width:auto;",children:[{type:"button",id:"createDic",label:d.getLocal("btn_createDic"),title:d.getLocal("btn_createDic"),onLoad:function(){this.getDialog();var b=c.scayt,a=
|
7
|
+
SCAYT.prototype.UILib,h=this.getElement().$,f=this.getElement().getChild(0).$;b.isLicensed()||(a.css(h,{cursor:"not-allowed"}),a.css(f,{cursor:"not-allowed"}))},onClick:function(){var b=this.getDialog(),a=g,h=c.scayt,f=b.getContentElement("dictionaries","dictionaryName").getValue();h.isLicensed()&&h.createUserDictionary(f,function(e){e.error||a.toggleDictionaryState.call(b,"dictionaryState");e.dialog=b;e.command="create";e.name=f;c.fire("scaytUserDictionaryAction",e)},function(a){a.dialog=b;a.command=
|
8
|
+
"create";a.name=f;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"restoreDic",label:d.getLocal("btn_connectDic"),title:d.getLocal("btn_connectDic"),onLoad:function(){this.getDialog();var b=c.scayt,a=SCAYT.prototype.UILib,h=this.getElement().$,f=this.getElement().getChild(0).$;b.isLicensed()||(a.css(h,{cursor:"not-allowed"}),a.css(f,{cursor:"not-allowed"}))},onClick:function(){var b=this.getDialog(),a=c.scayt,h=g,f=b.getContentElement("dictionaries","dictionaryName").getValue();a.isLicensed()&&
|
9
|
+
a.restoreUserDictionary(f,function(a){a.dialog=b;a.error||h.toggleDictionaryState.call(b,"dictionaryState");a.command="restore";a.name=f;c.fire("scaytUserDictionaryAction",a)},function(a){a.dialog=b;a.command="restore";a.name=f;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"disconnectDic",label:d.getLocal("btn_disconnectDic"),title:d.getLocal("btn_disconnectDic"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=g,f=b.getContentElement("dictionaries","dictionaryName"),e=f.getValue();
|
10
|
+
a.isLicensed()&&(a.disconnectFromUserDictionary({}),f.setValue(""),h.toggleDictionaryState.call(b,"initialState"),c.fire("scaytUserDictionaryAction",{dialog:b,command:"disconnect",name:e}))}},{type:"button",id:"removeDic",label:d.getLocal("btn_deleteDic"),title:d.getLocal("btn_deleteDic"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=g,f=b.getContentElement("dictionaries","dictionaryName"),e=f.getValue();a.isLicensed()&&a.removeUserDictionary(e,function(a){f.setValue("");a.error||h.toggleDictionaryState.call(b,
|
11
|
+
"initialState");a.dialog=b;a.command="remove";a.name=e;c.fire("scaytUserDictionaryAction",a)},function(a){a.dialog=b;a.command="remove";a.name=e;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"renameDic",label:d.getLocal("btn_renameDic"),title:d.getLocal("btn_renameDic"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=b.getContentElement("dictionaries","dictionaryName").getValue();a.isLicensed()&&a.renameUserDictionary(h,function(a){a.dialog=b;a.command="rename";a.name=h;c.fire("scaytUserDictionaryAction",
|
12
|
+
a)},function(a){a.dialog=b;a.command="rename";a.name=h;c.fire("scaytUserDictionaryActionError",a)})}},{type:"button",id:"editDic",label:d.getLocal("btn_goToDic"),title:d.getLocal("btn_goToDic"),onLoad:function(){this.getDialog()},onClick:function(){var b=this.getDialog(),a=b.getContentElement("dictionaries","addWordField");g.clearWordList.call(b);a.setValue("");g.getUserDictionary.call(b);g.toggleDictionaryState.call(b,"wordsState")}}]},{type:"hbox",id:"dicInfo",align:"left",children:[{type:"html",
|
13
|
+
id:"dicInfoHtml",html:'\x3cdiv id\x3d"dic_info_editor1" style\x3d"margin:5px auto; width:95%;white-space:normal;"\x3e'+(c.scayt.isLicensed&&c.scayt.isLicensed()?d.getLocal("text_descriptionDicForPaid"):d.getLocal("text_descriptionDicForFree"))+"\x3c/div\x3e"}]},{id:"addWordAction",type:"hbox",style:"width: 100%; margin-bottom: 0;",widths:["40%","60%"],children:[{id:"addWord",type:"vbox",style:"min-width: 150px;",children:[{type:"text",id:"addWordField",label:"Add word",maxLength:"64"}]},{id:"addWordButtons",
|
14
|
+
type:"vbox",style:"margin-top: 20px;",children:[{type:"hbox",id:"addWordButton",align:"left",children:[{type:"button",id:"addWord",label:d.getLocal("btn_addWord"),title:d.getLocal("btn_addWord"),onClick:function(){var b=this.getDialog(),a=c.scayt,h=b.getContentElement("dictionaries","itemList"),f=b.getContentElement("dictionaries","addWordField"),e=f.getValue(),d=a.getOption("wordBoundaryRegex"),g=this;e&&(-1!==e.search(d)?c.fire("scaytUserDictionaryAction",{dialog:b,command:"wordWithBannedSymbols",
|
15
|
+
name:e,error:!0}):h.inChildren(e)?(f.setValue(""),c.fire("scaytUserDictionaryAction",{dialog:b,command:"wordAlreadyAdded",name:e})):(this.disable(),a.addWordToUserDictionary(e,function(a){a.error||(f.setValue(""),h.addChild(e,!0));a.dialog=b;a.command="addWord";a.name=e;g.enable();c.fire("scaytUserDictionaryAction",a)},function(a){a.dialog=b;a.command="addWord";a.name=e;g.enable();c.fire("scaytUserDictionaryActionError",a)})))}},{type:"button",id:"backToDic",label:d.getLocal("btn_dictionaryPreferences"),
|
16
|
+
title:d.getLocal("btn_dictionaryPreferences"),align:"right",onClick:function(){var b=this.getDialog(),a=c.scayt;null!=a.getUserDictionaryName()&&""!=a.getUserDictionaryName()?g.toggleDictionaryState.call(b,"dictionaryState"):g.toggleDictionaryState.call(b,"initialState")}}]}]}]},{id:"wordsHolder",type:"hbox",style:"width: 100%; height: 170px; margin-bottom: 0;",children:[{type:"scaytItemList",id:"itemList",align:"left",style:"width: 100%; height: 170px; overflow: auto",onClick:function(b){b=b.data.$;
|
17
|
+
var a=c.scayt,h=SCAYT.prototype.UILib,f=h.parent(b.target)[0],e=h.attr(f,"data-cke-scayt-ud-word"),d=this.getDialog(),g=d.getContentElement("dictionaries","itemList"),m=this;h.hasClass(b.target,"cke_scaytItemList_remove")&&!this.isBlocked()&&(this.block(),a.deleteWordFromUserDictionary(e,function(a){a.error||g.removeChild(f,e);m.unblock();a.dialog=d;a.command="deleteWord";a.name=e;c.fire("scaytUserDictionaryAction",a)},function(a){m.unblock();a.dialog=d;a.command="deleteWord";a.name=e;c.fire("scaytUserDictionaryActionError",
|
18
|
+
a)}))}}]}]}]},{id:"about",label:d.getLocal("tab_about"),elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'\x3cdiv\x3e\x3cdiv id\x3d"scayt_about_"\x3e'+k+"\x3c/div\x3e\x3c/div\x3e"}]}];c.on("scaytUserDictionaryAction",function(b){var a=SCAYT.prototype.UILib,c=b.data.dialog,f=c.getContentElement("dictionaries","dictionaryNote").getElement(),e=b.editor.scayt,d;void 0===b.data.error?(d=e.getLocal("message_success_"+b.data.command+"Dic"),d=d.replace("%s",b.data.name),f.setText(d),a.css(f.$,
|
19
|
+
{color:"blue"})):(""===b.data.name?f.setText(e.getLocal("message_info_emptyDic")):(d=e.getLocal("message_error_"+b.data.command+"Dic"),d=d.replace("%s",b.data.name),f.setText(d)),a.css(f.$,{color:"red"}),null!=e.getUserDictionaryName()&&""!=e.getUserDictionaryName()?c.getContentElement("dictionaries","dictionaryName").setValue(e.getUserDictionaryName()):c.getContentElement("dictionaries","dictionaryName").setValue(""))});c.on("scaytUserDictionaryActionError",function(b){var a=SCAYT.prototype.UILib,
|
20
|
+
c=b.data.dialog,d=c.getContentElement("dictionaries","dictionaryNote").getElement(),e=b.editor.scayt,g;""===b.data.name?d.setText(e.getLocal("message_info_emptyDic")):(g=e.getLocal("message_error_"+b.data.command+"Dic"),g=g.replace("%s",b.data.name),d.setText(g));a.css(d.$,{color:"red"});null!=e.getUserDictionaryName()&&""!=e.getUserDictionaryName()?c.getContentElement("dictionaries","dictionaryName").setValue(e.getUserDictionaryName()):c.getContentElement("dictionaries","dictionaryName").setValue("")});
|
21
|
+
var g={title:d.getLocal("text_title"),resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:"moono-lisa"==(CKEDITOR.skinName||c.config.skin)?450:340,minHeight:300,onLoad:function(){if(0!=c.config.scayt_uiTabs[1]){var b=g,a=b.getLangBoxes.call(this);this.getContentElement("dictionaries","addWordField");a.getParent().setStyle("white-space","normal");b.renderLangList(a);this.definition.minWidth=this.getSize().width;this.resize(this.definition.minWidth,this.definition.minHeight)}},onCancel:function(){p.reset()},
|
22
|
+
onHide:function(){c.unlockSelection()},onShow:function(){c.fire("scaytDialogShown",this);if(0!=c.config.scayt_uiTabs[2]){var b=this.getContentElement("dictionaries","addWordField");g.clearWordList.call(this);b.setValue("");g.getUserDictionary.call(this);g.toggleDictionaryState.call(this,"wordsState")}},onOk:function(){var b=g,a=c.scayt;this.getContentElement("options","scaytOptions");b=b.getChangedOption.call(this);a.commitOption({changedOptions:b})},toggleDictionaryButtons:function(b){var a=this.getContentElement("dictionaries",
|
23
|
+
"existDic").getElement().getParent(),c=this.getContentElement("dictionaries","notExistDic").getElement().getParent();b?(a.show(),c.hide()):(a.hide(),c.show())},getChangedOption:function(){var b={};if(1==c.config.scayt_uiTabs[0])for(var a=this.getContentElement("options","scaytOptions").getChild(),d=0;d<a.length;d++)a[d].isChanged()&&(b[a[d].id]=a[d].getValue());p.isChanged()&&(b[p.id]=c.config.scayt_sLang=p.currentLang=p.newLang);return b},buildRadioInputs:function(b,a,d){var f=new CKEDITOR.dom.element("div"),
|
24
|
+
e="scaytLang_"+c.name+"_"+a,g=CKEDITOR.dom.element.createFromHtml('\x3cinput id\x3d"'+e+'" type\x3d"radio" value\x3d"'+a+'" name\x3d"scayt_lang" /\x3e'),k=new CKEDITOR.dom.element("label"),m=c.scayt;f.setStyles({"white-space":"normal",position:"relative","padding-bottom":"2px"});g.on("click",function(a){p.newLang=a.sender.getValue()});k.appendText(b);k.setAttribute("for",e);d&&c.config.grayt_autoStartup&&k.setStyles({color:"#02b620"});f.append(g);f.append(k);a===m.getLang()&&(g.setAttribute("checked",
|
25
|
+
!0),g.setAttribute("defaultChecked","defaultChecked"));return f},renderLangList:function(b){var a=b.find("#left-col-"+c.name).getItem(0);b=b.find("#right-col-"+c.name).getItem(0);var h=d.getScaytLangList(),f=d.getGraytLangList(),e={},g=[],k=0,m=!1,l;for(l in h.ltr)e[l]=h.ltr[l];for(l in h.rtl)e[l]=h.rtl[l];for(l in e)g.push([l,e[l]]);g.sort(function(a,b){var c=0;a[1]>b[1]?c=1:a[1]<b[1]&&(c=-1);return c});e={};for(m=0;m<g.length;m++)e[g[m][0]]=g[m][1];g=Math.round(g.length/2);for(l in e)k++,m=l in
|
26
|
+
f.ltr||l in f.rtl,this.buildRadioInputs(e[l],l,m).appendTo(k<=g?a:b)},getLangBoxes:function(){return this.getContentElement("langs","langBox").getElement()},toggleDictionaryState:function(b){var a=this.getContentElement("dictionaries","dictionaryName").getElement().getParent(),c=this.getContentElement("dictionaries","udButtonsHolder").getElement().getParent(),d=this.getContentElement("dictionaries","createDic").getElement().getParent(),e=this.getContentElement("dictionaries","restoreDic").getElement().getParent(),
|
27
|
+
g=this.getContentElement("dictionaries","disconnectDic").getElement().getParent(),k=this.getContentElement("dictionaries","removeDic").getElement().getParent(),m=this.getContentElement("dictionaries","renameDic").getElement().getParent(),l=this.getContentElement("dictionaries","dicInfo").getElement().getParent(),p=this.getContentElement("dictionaries","addWordAction").getElement().getParent(),n=this.getContentElement("dictionaries","wordsHolder").getElement().getParent();switch(b){case "initialState":a.show();
|
28
|
+
c.show();d.show();e.show();g.hide();k.hide();m.hide();l.show();p.hide();n.hide();break;case "wordsState":a.hide();c.hide();l.hide();p.show();n.show();break;case "dictionaryState":a.show(),c.show(),d.hide(),e.hide(),g.show(),k.show(),m.show(),l.show(),p.hide(),n.hide()}},clearWordList:function(){this.getContentElement("dictionaries","itemList").removeAllChild()},getUserDictionary:function(){var b=this;c.scayt.getUserDictionary("",function(a){a.error||g.renderItemList.call(b,a.wordlist)})},renderItemList:function(b){for(var a=
|
29
|
+
this.getContentElement("dictionaries","itemList"),c=0;c<b.length;c++)a.addChild(b[c])},contents:function(b,a){var c=[],d=a.config.scayt_uiTabs;if(d){for(var e in d)1==d[e]&&c.push(b[e]);c.push(b[b.length-1])}else return b;return c}(k,c)};return g});
|
30
|
+
CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{scaytItemList:function(c,d,k){if(arguments.length){var n=this;c.on("load",function(){n.getElement().on("click",function(c){})});CKEDITOR.ui.dialog.uiElement.call(this,c,d,k,"",null,null,function(){var c=['\x3cp class\x3d"cke_dialog_ui_',d.type,'"'];d.style&&c.push('style\x3d"'+d.style+'" ');c.push("\x3e");c.push("\x3c/p\x3e");return c.join("")})}}});
|
31
|
+
CKEDITOR.ui.dialog.scaytItemList.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{children:[],blocked:!1,addChild:function(c,d){var k=new CKEDITOR.dom.element("p"),n=new CKEDITOR.dom.element("a"),p=this.getElement().getChildren().getItem(0);this.children.push(c);k.addClass("cke_scaytItemList-child");k.setAttribute("data-cke-scayt-ud-word",c);k.appendText(c);n.addClass("cke_scaytItemList_remove");n.addClass("cke_dialog_close_button");n.setAttribute("href","javascript:void(0)");k.append(n);
|
32
|
+
p.append(k,d?!0:!1)},inChildren:function(c){return SCAYT.prototype.Utils.inArray(this.children,c)},removeChild:function(c,d){this.children.splice(SCAYT.prototype.Utils.indexOf(this.children,d),1);this.getElement().getChildren().getItem(0).$.removeChild(c)},removeAllChild:function(){this.children=[];this.getElement().getChildren().getItem(0).setHtml("")},block:function(){this.blocked=!0},unblock:function(){this.blocked=!1},isBlocked:function(){return this.blocked}});
|
33
|
+
(function(){commonBuilder={build:function(c,d,k){return new CKEDITOR.ui.dialog[d.type](c,d,k)}};CKEDITOR.dialog.addUIElement("scaytItemList",commonBuilder)})();
|
@@ -10,10 +10,15 @@
|
|
10
10
|
|
11
11
|
#scayt_about_
|
12
12
|
{
|
13
|
-
width: 190px;
|
14
13
|
margin: 30px auto 0 auto;
|
15
14
|
}
|
16
15
|
|
16
|
+
#scayt_about_ p
|
17
|
+
{
|
18
|
+
text-align: center;
|
19
|
+
margin-bottom: 10px;
|
20
|
+
}
|
21
|
+
|
17
22
|
.cke_dialog_contents_body div[name=dictionaries] .cke_dialog_ui_hbox_last > a.cke_dialog_ui_button
|
18
23
|
{
|
19
24
|
margin-top: 0;
|
@@ -88,7 +88,7 @@
|
|
88
88
|
// Register a plugin named "stylesheetparser".
|
89
89
|
CKEDITOR.plugins.add( 'stylesheetparser', {
|
90
90
|
init: function( editor ) {
|
91
|
-
// Stylesheet parser is incompatible with filter (
|
91
|
+
// Stylesheet parser is incompatible with filter (http://dev.ckeditor.com/ticket/10136).
|
92
92
|
editor.filter.disable();
|
93
93
|
|
94
94
|
var cachedDefinitions;
|
@@ -4,10 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
4
4
|
*/
|
5
5
|
CKEDITOR.plugins.setLang('wordcount', 'en', {
|
6
6
|
WordCount: 'Words:',
|
7
|
+
WordCountRemaining: 'Words remaining',
|
7
8
|
CharCount: 'Characters:',
|
9
|
+
CharCountRemaining: 'Characters remaining',
|
8
10
|
CharCountWithHTML: 'Characters (with HTML):',
|
11
|
+
CharCountWithHTMLRemaining: 'Characters (with HTML) remaining',
|
9
12
|
Paragraphs: 'Paragraphs:',
|
10
|
-
pasteWarning: 'Content
|
13
|
+
pasteWarning: 'Content cannot be pasted because it is above the allowed limit',
|
11
14
|
Selected: 'Selected: ',
|
12
15
|
title: 'Statistics'
|
13
16
|
});
|
@@ -4,8 +4,8 @@
|
|
4
4
|
*/
|
5
5
|
|
6
6
|
CKEDITOR.plugins.add("wordcount", {
|
7
|
-
lang: "
|
8
|
-
version: 1.
|
7
|
+
lang: "en,ru", // %REMOVE_LINE_CORE%
|
8
|
+
version: 1.17,
|
9
9
|
requires: 'htmlwriter,notification,undo',
|
10
10
|
bbcodePluginLoaded: false,
|
11
11
|
onLoad: function(editor) {
|
@@ -56,11 +56,14 @@ CKEDITOR.plugins.add("wordcount", {
|
|
56
56
|
|
57
57
|
// Default Config
|
58
58
|
var defaultConfig = {
|
59
|
+
showRemaining: false,
|
59
60
|
showParagraphs: true,
|
60
61
|
showWordCount: true,
|
61
62
|
showCharCount: false,
|
63
|
+
countBytesAsChars: false,
|
62
64
|
countSpacesAsChars: false,
|
63
65
|
countHTML: false,
|
66
|
+
countLineBreaks: false,
|
64
67
|
hardLimit: true,
|
65
68
|
|
66
69
|
//MAXLENGTH Properties
|
@@ -102,9 +105,16 @@ CKEDITOR.plugins.add("wordcount", {
|
|
102
105
|
}
|
103
106
|
|
104
107
|
if (config.showWordCount) {
|
105
|
-
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
106
108
|
if (config.maxWordCount > -1) {
|
107
|
-
|
109
|
+
if (config.showRemaining) {
|
110
|
+
defaultFormat += "%wordCount% " + editor.lang.wordcount.WordCountRemaining;
|
111
|
+
} else {
|
112
|
+
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
113
|
+
|
114
|
+
defaultFormat += "/" + config.maxWordCount;
|
115
|
+
}
|
116
|
+
} else {
|
117
|
+
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
108
118
|
}
|
109
119
|
}
|
110
120
|
|
@@ -113,11 +123,20 @@ CKEDITOR.plugins.add("wordcount", {
|
|
113
123
|
}
|
114
124
|
|
115
125
|
if (config.showCharCount) {
|
116
|
-
var charLabel = editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"];
|
117
|
-
|
118
|
-
defaultFormat += charLabel + " %charCount%";
|
119
126
|
if (config.maxCharCount > -1) {
|
120
|
-
|
127
|
+
if (config.showRemaining) {
|
128
|
+
defaultFormat += "%charCount% " + editor.lang.wordcount[config.countHTML
|
129
|
+
? "CharCountWithHTMLRemaining"
|
130
|
+
: "CharCountRemaining"];
|
131
|
+
} else {
|
132
|
+
defaultFormat += editor.lang.wordcount[config.countHTML
|
133
|
+
? "CharCountWithHTML"
|
134
|
+
: "CharCount"] + " %charCount%";
|
135
|
+
|
136
|
+
defaultFormat += "/" + config.maxCharCount;
|
137
|
+
}
|
138
|
+
} else {
|
139
|
+
defaultFormat += editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"] + " %charCount%";
|
121
140
|
}
|
122
141
|
}
|
123
142
|
|
@@ -188,21 +207,31 @@ CKEDITOR.plugins.add("wordcount", {
|
|
188
207
|
normalizedText = text;
|
189
208
|
|
190
209
|
if (!config.countSpacesAsChars) {
|
191
|
-
normalizedText = text.
|
192
|
-
replace(/\s/g, "").
|
193
|
-
replace(/ /g, "");
|
210
|
+
normalizedText = text.replace(/\s/g, "").replace(/ /g, "");
|
194
211
|
}
|
195
212
|
|
196
|
-
|
197
|
-
replace(/(\r\n|\n|\r)/gm, "")
|
198
|
-
|
213
|
+
if (config.countLineBreaks) {
|
214
|
+
normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "");
|
215
|
+
} else {
|
216
|
+
normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "").replace(/ /gi, " ");
|
217
|
+
}
|
199
218
|
|
200
219
|
normalizedText = strip(normalizedText).replace(/^([\t\r\n]*)$/, "");
|
201
220
|
|
202
|
-
return(normalizedText.length);
|
221
|
+
return config.countBytesAsChars ? (countBytes(normalizedText)) : (normalizedText.length);
|
203
222
|
}
|
204
223
|
}
|
205
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
|
+
|
206
235
|
function countParagraphs(text) {
|
207
236
|
return (text.replace(/ /g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++").split("++").length);
|
208
237
|
}
|
@@ -238,7 +267,7 @@ CKEDITOR.plugins.add("wordcount", {
|
|
238
267
|
|
239
268
|
if (!notify) {
|
240
269
|
counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
|
241
|
-
editorInstance.fire("limitReached", {}, editor);
|
270
|
+
editorInstance.fire("limitReached", {firedBy: "wordCount.limitReached"}, editor);
|
242
271
|
}
|
243
272
|
}
|
244
273
|
|
@@ -257,7 +286,17 @@ CKEDITOR.plugins.add("wordcount", {
|
|
257
286
|
charCount = 0,
|
258
287
|
text;
|
259
288
|
|
260
|
-
|
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) {
|
261
300
|
if (config.showCharCount) {
|
262
301
|
charCount = countCharacters(text, editorInstance);
|
263
302
|
}
|
@@ -271,7 +310,24 @@ CKEDITOR.plugins.add("wordcount", {
|
|
271
310
|
}
|
272
311
|
}
|
273
312
|
|
274
|
-
|
313
|
+
|
314
|
+
var html = format.replace("%paragraphs%", paragraphs);
|
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);
|
321
|
+
}
|
322
|
+
|
323
|
+
if (config.maxWordCount >= 0) {
|
324
|
+
html = html.replace("%wordCount%", config.maxWordCount - wordCount);
|
325
|
+
} else {
|
326
|
+
html = html.replace("%wordCount%", wordCount);
|
327
|
+
}
|
328
|
+
} else {
|
329
|
+
html = html.replace("%wordCount%", wordCount).replace("%charCount%", charCount);
|
330
|
+
}
|
275
331
|
|
276
332
|
(editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).wordCount = wordCount;
|
277
333
|
(editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).charCount = charCount;
|
@@ -283,6 +339,9 @@ CKEDITOR.plugins.add("wordcount", {
|
|
283
339
|
}
|
284
340
|
|
285
341
|
if (charCount == lastCharCount && wordCount == lastWordCount) {
|
342
|
+
if (charCount == config.maxCharCount || wordCount == config.maxWordCount) {
|
343
|
+
snapShot = editor.getSnapshot();
|
344
|
+
}
|
286
345
|
return true;
|
287
346
|
}
|
288
347
|
|
@@ -306,8 +365,8 @@ CKEDITOR.plugins.add("wordcount", {
|
|
306
365
|
(config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
|
307
366
|
|
308
367
|
limitReached(editorInstance, limitReachedNotified);
|
309
|
-
} else if ((config.maxWordCount == -1 || wordCount
|
310
|
-
(config.maxCharCount == -1 || charCount
|
368
|
+
} else if ((config.maxWordCount == -1 || wordCount <= config.maxWordCount) &&
|
369
|
+
(config.maxCharCount == -1 || charCount <= config.maxCharCount)) {
|
311
370
|
|
312
371
|
limitRestored(editorInstance);
|
313
372
|
} else {
|
@@ -379,9 +438,19 @@ CKEDITOR.plugins.add("wordcount", {
|
|
379
438
|
|
380
439
|
// Check if pasted content is above the limits
|
381
440
|
var wordCount = -1,
|
382
|
-
charCount = -1
|
383
|
-
|
384
|
-
|
441
|
+
charCount = -1;
|
442
|
+
|
443
|
+
// BeforeGetData and getData events are fired when calling
|
444
|
+
// getData(). We can prevent this by passing true as an
|
445
|
+
// argument to getData(). This allows us to fire the events
|
446
|
+
// manually with additional event data: firedBy. This additional
|
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);
|
452
|
+
|
453
|
+
text += event.data.dataValue;
|
385
454
|
|
386
455
|
if (config.showCharCount) {
|
387
456
|
charCount = countCharacters(text, event.editor);
|