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,3 +1,8 @@
|
|
1
|
-
//=
|
1
|
+
//= require_self
|
2
2
|
//= require ckeditor/ckeditor
|
3
3
|
|
4
|
+
(function() {
|
5
|
+
if (typeof window['CKEDITOR_BASEPATH'] === "undefined" || window['CKEDITOR_BASEPATH'] === null) {
|
6
|
+
window['CKEDITOR_BASEPATH'] = "<%= Ckeditor.base_path %>";
|
7
|
+
}
|
8
|
+
}).call(this);
|
File without changes
|
File without changes
|
@@ -1,5 +1,4 @@
|
|
1
|
-
class Ckeditor::ApplicationController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class Ckeditor::ApplicationController < Ckeditor.parent_controller.constantize
|
3
2
|
layout 'ckeditor/application'
|
4
3
|
|
5
4
|
before_filter :find_asset, :only => [:destroy]
|
@@ -9,23 +8,13 @@ class Ckeditor::ApplicationController < ::ApplicationController
|
|
9
8
|
protected
|
10
9
|
|
11
10
|
def respond_with_asset(asset)
|
12
|
-
|
13
|
-
|
11
|
+
_response = Ckeditor::AssetResponse.new(asset, request)
|
12
|
+
_callback = ckeditor_before_create_asset(asset)
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
if callback && asset.save
|
18
|
-
body = params[:CKEditor].blank? ? asset.to_json(:only=>[:id, :type]) : %Q"<script type='text/javascript'>
|
19
|
-
window.parent.CKEDITOR.tools.callFunction(#{params[:CKEditorFuncNum]}, '#{config.relative_url_root}#{Ckeditor::Utils.escape_single_quotes(asset.url_content)}');
|
20
|
-
</script>"
|
21
|
-
|
22
|
-
render :text => body
|
14
|
+
if _callback && asset.save
|
15
|
+
render _response.success(config.relative_url_root)
|
23
16
|
else
|
24
|
-
|
25
|
-
render text: "Error: #{asset.errors.full_messages.join(", ")}", status: 422
|
26
|
-
else
|
27
|
-
render text: "Error: callback is false", status: 422
|
28
|
-
end
|
17
|
+
render _response.errors
|
29
18
|
end
|
30
19
|
end
|
31
20
|
end
|
@@ -1,10 +1,13 @@
|
|
1
1
|
class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController
|
2
|
-
|
2
|
+
skip_before_filter :verify_authenticity_token, only: :create
|
3
|
+
|
3
4
|
def index
|
4
5
|
@attachments = Ckeditor.attachment_file_adapter.find_all(ckeditor_attachment_files_scope)
|
5
6
|
@attachments = Ckeditor::Paginatable.new(@attachments).page(params[:page])
|
6
7
|
|
7
|
-
|
8
|
+
respond_to do |format|
|
9
|
+
format.html { render :layout => @attachments.first_page? }
|
10
|
+
end
|
8
11
|
end
|
9
12
|
|
10
13
|
def create
|
@@ -14,7 +17,11 @@ class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController
|
|
14
17
|
|
15
18
|
def destroy
|
16
19
|
@attachment.destroy
|
17
|
-
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html { redirect_to attachment_files_path }
|
23
|
+
format.json { render :nothing => true, :status => 204 }
|
24
|
+
end
|
18
25
|
end
|
19
26
|
|
20
27
|
protected
|
@@ -1,10 +1,13 @@
|
|
1
1
|
class Ckeditor::PicturesController < Ckeditor::ApplicationController
|
2
|
+
skip_before_filter :verify_authenticity_token, only: :create
|
2
3
|
|
3
4
|
def index
|
4
5
|
@pictures = Ckeditor.picture_adapter.find_all(ckeditor_pictures_scope)
|
5
6
|
@pictures = Ckeditor::Paginatable.new(@pictures).page(params[:page])
|
6
7
|
|
7
|
-
|
8
|
+
respond_to do |format|
|
9
|
+
format.html { render :layout => @pictures.first_page? }
|
10
|
+
end
|
8
11
|
end
|
9
12
|
|
10
13
|
def create
|
@@ -14,7 +17,11 @@ class Ckeditor::PicturesController < Ckeditor::ApplicationController
|
|
14
17
|
|
15
18
|
def destroy
|
16
19
|
@picture.destroy
|
17
|
-
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html { redirect_to pictures_path }
|
23
|
+
format.json { render :nothing => true, :status => 204 }
|
24
|
+
end
|
18
25
|
end
|
19
26
|
|
20
27
|
protected
|
File without changes
|
@@ -4,14 +4,14 @@
|
|
4
4
|
<%= link_to I18n.t(:upload, :scope => [:ckeditor, :buttons]), 'javascript:void(0)', :class => "add" %>
|
5
5
|
</div>
|
6
6
|
</div>
|
7
|
-
|
7
|
+
|
8
8
|
<div class="fileupload-list">
|
9
|
-
<%= render :partial => 'ckeditor/shared/asset', :collection => @attachments.scoped %>
|
9
|
+
<%= render :partial => 'ckeditor/shared/asset', :collection => @attachments.scoped %>
|
10
10
|
</div>
|
11
11
|
|
12
12
|
<% unless @attachments.last_page? %>
|
13
13
|
<div class="pagination">
|
14
|
-
<%= link_to I18n.t("ckeditor.buttons.next"), params.merge(:page => @attachments.next_page), :class => "next", :rel => "next" %>
|
14
|
+
<%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.attachment_files_path(params.merge(:page => @attachments.next_page)), :class => "next", :rel => "next" %>
|
15
15
|
</div>
|
16
16
|
<% end -%>
|
17
17
|
|
@@ -4,14 +4,14 @@
|
|
4
4
|
<%= link_to I18n.t(:upload, :scope => [:ckeditor, :buttons]), 'javascript:void(0)', :class => "add" %>
|
5
5
|
</div>
|
6
6
|
</div>
|
7
|
-
|
7
|
+
|
8
8
|
<div class="fileupload-list" data-endless="true">
|
9
|
-
<%= render :partial => 'ckeditor/shared/asset', :collection => @pictures.scoped %>
|
9
|
+
<%= render :partial => 'ckeditor/shared/asset', :collection => @pictures.scoped %>
|
10
10
|
</div>
|
11
11
|
|
12
12
|
<% unless @pictures.last_page? %>
|
13
13
|
<div class="pagination">
|
14
|
-
<%= link_to I18n.t("ckeditor.buttons.next"), params.merge(:page => @pictures.next_page), :class => "next", :rel => "next" %>
|
14
|
+
<%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.pictures_path(params.merge(:page => @pictures.next_page)), :class => "next", :rel => "next" %>
|
15
15
|
</div>
|
16
16
|
<% end -%>
|
17
17
|
|
File without changes
|
File without changes
|
@@ -5,17 +5,18 @@
|
|
5
5
|
<meta name="robots" content="noindex, nofollow">
|
6
6
|
<%= csrf_meta_tag %>
|
7
7
|
<title><%= I18n.t('page_title', :scope => [:ckeditor]) %></title>
|
8
|
+
<script src="//code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
|
8
9
|
|
9
10
|
<% if assets_pipeline_enabled? -%>
|
10
11
|
<%= stylesheet_link_tag "ckeditor/application" %>
|
11
12
|
<%= javascript_include_tag "ckeditor/application" %>
|
12
13
|
<% else -%>
|
13
14
|
<link href="/javascripts/ckeditor/filebrowser/stylesheets/uploader.css" type="text/css" rel="stylesheet">
|
14
|
-
<% ["jquery.
|
15
|
+
<% ["jquery.tmpl.js", "fileuploader.js", "rails.js", "application.js"].each do |js| -%>
|
15
16
|
<script src="/javascripts/ckeditor/filebrowser/javascripts/<%= js %>" type="text/javascript"></script>
|
16
17
|
<% end -%>
|
17
18
|
<% end -%>
|
18
|
-
|
19
|
+
|
19
20
|
<script type="text/javascript">
|
20
21
|
var CKEditorFuncNum = $.QueryString["CKEditorFuncNum"];
|
21
22
|
var CKEditorName = $.QueryString["CKEditor"];
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/config/routes.rb
CHANGED
File without changes
|
data/lib/ckeditor.rb
CHANGED
@@ -6,6 +6,7 @@ module Ckeditor
|
|
6
6
|
autoload :Http, 'ckeditor/http'
|
7
7
|
autoload :TextArea, 'ckeditor/text_area'
|
8
8
|
autoload :Paginatable, 'ckeditor/paginatable'
|
9
|
+
autoload :AssetResponse, 'ckeditor/asset_response'
|
9
10
|
|
10
11
|
module Helpers
|
11
12
|
autoload :ViewHelper, 'ckeditor/helpers/view_helper'
|
@@ -24,6 +25,7 @@ module Ckeditor
|
|
24
25
|
autoload :Paperclip, 'ckeditor/backend/paperclip'
|
25
26
|
autoload :CarrierWave, 'ckeditor/backend/carrierwave'
|
26
27
|
autoload :Dragonfly, 'ckeditor/backend/dragonfly'
|
28
|
+
autoload :Refile, 'ckeditor/backend/refile'
|
27
29
|
end
|
28
30
|
|
29
31
|
IMAGE_TYPES = %w(image/jpeg image/png image/gif image/jpg image/pjpeg image/tiff image/x-png)
|
@@ -44,20 +46,24 @@ module Ckeditor
|
|
44
46
|
# Allowed attachment file types for upload.
|
45
47
|
# Set to nil or [] (empty array) for all file types
|
46
48
|
mattr_accessor :attachment_file_types
|
47
|
-
@@attachment_file_types = %w(doc docx xls odt ods pdf rar zip tar tar.gz swf
|
49
|
+
@@attachment_file_types = %w(doc docx xls odt ods pdf rar zip tar tar.gz swf)
|
48
50
|
|
49
51
|
# Ckeditor files destination path
|
50
52
|
mattr_accessor :relative_path
|
51
|
-
@@relative_path = '
|
53
|
+
@@relative_path = 'ckeditor'
|
52
54
|
|
53
55
|
# Ckeditor assets path
|
54
56
|
mattr_accessor :asset_path
|
55
|
-
@@asset_path =
|
57
|
+
@@asset_path = nil
|
56
58
|
|
57
59
|
# Ckeditor assets for precompilation
|
58
60
|
mattr_accessor :assets
|
59
61
|
@@assets = nil
|
60
62
|
|
63
|
+
# Remove digest from ckeditor asset files while running assets:precompile task?
|
64
|
+
mattr_accessor :run_on_precompile
|
65
|
+
@@run_on_precompile = true
|
66
|
+
|
61
67
|
# Turn on/off filename parameterize
|
62
68
|
mattr_accessor :parameterize_filenames
|
63
69
|
@@parameterize_filenames = true
|
@@ -72,10 +78,22 @@ module Ckeditor
|
|
72
78
|
@@assets_languages = nil
|
73
79
|
@@assets_plugins = nil
|
74
80
|
|
81
|
+
# CKEditor CDN
|
82
|
+
mattr_accessor :cdn_url
|
83
|
+
@@cdn_url = nil
|
84
|
+
|
85
|
+
# Url to ckeditor config, used when CDN enabled
|
86
|
+
mattr_accessor :js_config_url
|
87
|
+
@@js_config_url = '/assets/ckeditor/config.js'
|
88
|
+
|
75
89
|
# Model classes
|
76
90
|
@@picture_model = nil
|
77
91
|
@@attachment_file_model = nil
|
78
92
|
|
93
|
+
# Configurable parent controller
|
94
|
+
mattr_accessor :parent_controller
|
95
|
+
@@parent_controller = 'ApplicationController'
|
96
|
+
|
79
97
|
# Default way to setup Ckeditor. Run rails generate ckeditor to create
|
80
98
|
# a fresh initializer with all configuration values.
|
81
99
|
#
|
@@ -93,9 +111,25 @@ module Ckeditor
|
|
93
111
|
@root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
|
94
112
|
end
|
95
113
|
|
114
|
+
def self.base_path
|
115
|
+
@base_path ||= (asset_path || File.join([Rails.application.config.assets.prefix, '/ckeditor/']))
|
116
|
+
end
|
117
|
+
|
96
118
|
# All css and js files from ckeditor folder
|
97
119
|
def self.assets
|
98
|
-
@@assets ||=
|
120
|
+
@@assets ||= if Ckeditor.cdn_enabled?
|
121
|
+
["ckeditor/config.js"]
|
122
|
+
else
|
123
|
+
Utils.select_assets("ckeditor", "vendor/assets/javascripts") << "ckeditor/init.js"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.run_on_precompile?
|
128
|
+
@@run_on_precompile
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.cdn_enabled?
|
132
|
+
!@@cdn_url.nil?
|
99
133
|
end
|
100
134
|
|
101
135
|
def self.picture_model(&block)
|
@@ -201,4 +235,4 @@ require 'ckeditor/version'
|
|
201
235
|
|
202
236
|
if Object.const_defined?("RailsAdmin")
|
203
237
|
require "ckeditor/rails_admin/field"
|
204
|
-
end
|
238
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Ckeditor
|
2
|
+
class AssetResponse
|
3
|
+
attr_reader :asset, :params
|
4
|
+
|
5
|
+
def initialize(asset, request)
|
6
|
+
@asset = asset
|
7
|
+
@request = request
|
8
|
+
@params = request.params
|
9
|
+
|
10
|
+
@asset.data = Ckeditor::Http.normalize_param(file, @request)
|
11
|
+
end
|
12
|
+
|
13
|
+
def json?
|
14
|
+
params[:responseType] == 'json'
|
15
|
+
end
|
16
|
+
|
17
|
+
def ckeditor?
|
18
|
+
!params[:CKEditor].blank?
|
19
|
+
end
|
20
|
+
|
21
|
+
def file
|
22
|
+
!(ckeditor? || json?) ? params[:qqfile] : params[:upload]
|
23
|
+
end
|
24
|
+
|
25
|
+
def success(relative_url_root = nil)
|
26
|
+
if json?
|
27
|
+
{
|
28
|
+
json: { "uploaded" => 1, "fileName" => asset.filename, "url" => asset.url }.to_json
|
29
|
+
}
|
30
|
+
elsif ckeditor?
|
31
|
+
{
|
32
|
+
text: %Q"<script type='text/javascript'>
|
33
|
+
window.parent.CKEDITOR.tools.callFunction(#{params[:CKEditorFuncNum]}, '#{relative_url_root}#{Ckeditor::Utils.escape_single_quotes(asset.url_content)}');
|
34
|
+
</script>"
|
35
|
+
}
|
36
|
+
else
|
37
|
+
{
|
38
|
+
json: asset.to_json(only: [:id, :type])
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def errors
|
44
|
+
if json?
|
45
|
+
{
|
46
|
+
json: { "uploaded" => 0, "error" => { "message" => "Upload failed"} }.to_json
|
47
|
+
}
|
48
|
+
elsif ckeditor?
|
49
|
+
{
|
50
|
+
text: %Q"<script type='text/javascript'>
|
51
|
+
window.parent.CKEDITOR.tools.callFunction(#{params[:CKEditorFuncNum]}, null, '#{Ckeditor::Utils.escape_single_quotes(asset.errors.full_messages.first)}');
|
52
|
+
</script>"
|
53
|
+
}
|
54
|
+
else
|
55
|
+
{nothing: true, format: :json}
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|