glebtv-ckeditor 4.2.1.5 → 4.3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +37 -1
- data/README.md +286 -0
- data/Rakefile +76 -63
- data/app/assets/javascripts/ckeditor/application.js +1 -0
- data/app/assets/javascripts/ckeditor/config.js.erb +59 -20
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/{application.js → application.js.erb} +11 -2
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.endless-scroll.js +300 -0
- data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/{uploader.css → uploader.css.erb} +6 -2
- data/app/assets/javascripts/ckeditor/init.js.erb +1 -6
- data/app/assets/javascripts/ckeditor/override.js.erb +22 -0
- data/app/assets/stylesheets/ckcontent.css +103 -0
- data/app/controllers/ckeditor/application_controller.rb +5 -4
- data/app/controllers/ckeditor/attachment_files_controller.rb +12 -10
- data/app/controllers/ckeditor/pictures_controller.rb +12 -10
- data/app/helpers/ckeditor/application_helper.rb +1 -1
- data/app/views/ckeditor/attachment_files/index.html.erb +11 -5
- data/app/views/ckeditor/pictures/index.html.erb +12 -6
- data/app/views/ckeditor/shared/_asset.html.erb +2 -2
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +3 -3
- data/app/views/layouts/ckeditor/application.html.erb +0 -1
- data/config/locales/cs.ckeditor.yml +1 -0
- data/config/locales/de.ckeditor.yml +9 -0
- data/config/locales/el-GR.cdkeditor.yml +9 -0
- data/config/locales/en.ckeditor.yml +1 -0
- data/config/locales/es.ckeditor.yml +1 -0
- data/config/locales/fr.ckeditor.yml +1 -0
- data/config/locales/hu.ckeditor.yml +9 -0
- data/config/locales/it.ckeditor.yml +1 -0
- data/config/locales/nl.ckeditor.yml +2 -1
- data/config/locales/pl.ckeditor.yml +1 -0
- data/config/locales/pt-BR.ckeditor.yml +2 -1
- data/config/locales/pt-PT.ckeditor.yml +9 -0
- data/config/locales/ru.ckeditor.yml +1 -0
- data/config/locales/sv-SE.ckeditor.yml +1 -0
- data/config/locales/uk.ckeditor.yml +1 -0
- data/config/locales/zh-CN.ckeditor.yml +1 -0
- data/lib/ckeditor.rb +63 -13
- data/lib/ckeditor/backend/carrierwave.rb +9 -9
- data/lib/ckeditor/backend/dragonfly.rb +2 -2
- data/lib/ckeditor/backend/paperclip.rb +4 -4
- data/lib/ckeditor/engine.rb +6 -6
- data/lib/ckeditor/helpers/controllers.rb +7 -7
- data/lib/ckeditor/helpers/form_builder.rb +1 -1
- data/lib/ckeditor/helpers/form_helper.rb +2 -21
- data/lib/ckeditor/helpers/view_helper.rb +2 -13
- data/lib/ckeditor/hooks/cancan.rb +2 -2
- data/lib/ckeditor/hooks/formtastic.rb +1 -1
- data/lib/ckeditor/hooks/pundit.rb +47 -0
- data/lib/ckeditor/http.rb +8 -7
- data/lib/ckeditor/orm/active_record.rb +3 -3
- data/lib/ckeditor/orm/base.rb +4 -6
- data/lib/ckeditor/orm/mongoid.rb +4 -4
- data/lib/ckeditor/paginatable.rb +56 -0
- data/lib/ckeditor/text_area.rb +52 -0
- data/lib/ckeditor/utils.rb +54 -36
- data/lib/ckeditor/version.rb +1 -4
- data/lib/generators/ckeditor/install_generator.rb +10 -10
- data/lib/generators/ckeditor/pundit_policy_generator.rb +22 -0
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +4 -4
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +2 -2
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +1 -1
- data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +1 -1
- data/lib/generators/ckeditor/templates/ckeditor.rb +21 -16
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +1 -1
- data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +20 -0
- data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +20 -0
- data/test/ckeditor_test.rb +54 -1
- data/test/controllers/attachment_files_controller_test.rb +15 -15
- data/test/controllers/pictures_controller_test.rb +15 -15
- data/test/dummy/app/views/posts/index.html.erb +1 -1
- data/test/dummy/config/routes.rb +1 -1
- data/test/dummy/log/test.log +301 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/0ff571a66f03f4c98305b82fbc097934 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/1c2a2034cd1d6490a47e1f2b22a328f3 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/233a499dd1009ab5b2a8040346715629 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2a79c1fcf4595c4bfb3a1e77a732b9e9 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2bb1e656d1d1c20542dd47020608ce4b +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3c088129885aa2261da0ab21707aa851 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/5296ab0e7196335ed50f33e398de0470 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/62133d9323b94de8b0cd2a3e490e0374 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/70f2d021b0f59639252116032aa12a5d +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/73eff3be45044b7438486d533547c02c +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7869bf4c6f26bcd697a78ffd20655de5 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/88d81ff5585179f4acb7ba76bdcb1244 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/990c65e42e2a681340e62644dd07782b +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/aaf14684bcb6dafb17154d27c3d5a5de +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/b2141ea733727ae31693b5129d431629 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c1469bfe5d5645440961cc1e8fd48120 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c479f0465142b7c9c5a9c58a256335d7 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c73d53992216d52410b542dce76742ad +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c7476f60577593bf79ca5b6334b86903 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cb4a5e7fc592c6023ed2acc5953b4685 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d7e7d3b3729ff516f81682711ea8a53a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d9b8613a01ff7c7d9fe1a6b7cd5497ff +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e4513c04c145290b038978a8f471d244 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e65823156ac3891c4779224e828d4877 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f20469686afebc55828d93a978e5ff20 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f24d6c64fd96102c27c1f10e82ebf864 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f33022711bcfc1cae3955a1de79fe280 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f69b1a9a1323d97109283e5bd378c23d +0 -0
- data/test/functional/posts_controller_test.rb +4 -4
- data/test/generators/install_generator_test.rb +7 -7
- data/test/models/attachment_file_test.rb +2 -2
- data/test/models/picture_test.rb +2 -2
- data/test/models/utils_test.rb +4 -5
- data/test/support/helpers.rb +8 -8
- data/test/tmp/app/models/ckeditor/asset.rb +5 -0
- data/test/tmp/app/models/ckeditor/attachment_file.rb +12 -0
- data/test/tmp/app/models/ckeditor/picture.rb +13 -0
- data/test/tmp/config/initializers/ckeditor.rb +26 -0
- data/test/tmp/config/routes.rb +5 -0
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +414 -0
- data/{app → vendor}/assets/javascripts/ckeditor/LICENSE.md +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/README.md +1 -1
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +10 -0
- data/vendor/assets/javascripts/ckeditor/build-config.js +165 -0
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +978 -0
- data/vendor/assets/javascripts/ckeditor/config.js +10 -0
- data/vendor/assets/javascripts/ckeditor/lang/en.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +5 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/CKCss/ckcss.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/CKCss/css/styles.css +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/CKCss/dialogs/ckcss.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/CKCss/lang/en.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/CKCss/lang/ru.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/CKCss/plugin.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +4 -2
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +4 -2
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoComplete.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoFormat.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/icons/CommentSelectedRange.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/icons/SearchCode.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/icons/UncommentSelectedRange.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +1 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +3 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +335 -90
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +34 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +34 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +5 -5
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +75 -75
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +34 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +34 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +28 -25
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +21 -18
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +23 -25
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +13 -10
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +30 -21
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +47 -44
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +37 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +43 -52
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +29 -28
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +12 -9
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +24 -21
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +34 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +34 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +23 -21
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +180 -207
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +26 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +34 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +28 -26
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +30 -27
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +49 -46
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -43
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +5 -5
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +2 -2
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/{app/assets/javascripts/ckeditor/skins/moono → vendor/assets/javascripts/ckeditor/plugins}/icons_hidpi.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +13 -13
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/ipsum/icon.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/ipsum/plugin.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +8 -7
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/map/example_usage.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/map/map.gif +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/map/plugin.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/mediaembed/icons/hidpi/mediaembed.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/mediaembed/icons/mediaembed.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/mediaembed/plugin.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/preview/preview.html +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/scayt/README.md +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +20 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
- 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/{app → vendor}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -6
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +4 -4
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +11 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +72 -31
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmp.html +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +31 -31
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc_ie.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/youtube/lang/en.js +1 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +1 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/youtube/plugin.js +56 -15
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css.scss +768 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css.scss +809 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css.scss +841 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css.scss +822 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css.scss +813 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_opera.css.scss +781 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css.scss +2125 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css.scss +2134 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css.scss +2183 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css.scss +2351 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css.scss +2195 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css.scss +2243 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/{app/assets/javascripts/ckeditor/plugins → vendor/assets/javascripts/ckeditor/skins/moono}/icons_hidpi.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/skins/moono/readme.md +1 -1
- data/{app → vendor}/assets/javascripts/ckeditor/styles.js +2 -2
- metadata +445 -352
- data/README.rdoc +0 -12
- data/app/assets/javascripts/ckeditor/CHANGES.md +0 -233
- data/app/assets/javascripts/ckeditor/build-config.js +0 -103
- data/app/assets/javascripts/ckeditor/ckeditor.js +0 -929
- data/app/assets/javascripts/ckeditor/contents.css +0 -103
- data/app/assets/javascripts/ckeditor/lang/en.js +0 -5
- data/app/assets/javascripts/ckeditor/lang/ru.js +0 -5
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +0 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +0 -5637
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/font/lang/en.js +0 -14
- data/app/assets/javascripts/ckeditor/plugins/font/lang/ru.js +0 -14
- data/app/assets/javascripts/ckeditor/plugins/font/plugin.js +0 -225
- data/app/assets/javascripts/ckeditor/plugins/highslide/dialogs/hs.js +0 -73
- data/app/assets/javascripts/ckeditor/plugins/highslide/icon.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/highslide/lang/en.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/highslide/lang/ru.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/highslide/plugin.js +0 -26
- data/app/assets/javascripts/ckeditor/plugins/highslide/readme.txt +0 -55
- data/app/assets/javascripts/ckeditor/plugins/htmlbuttons/docs/install.html +0 -93
- data/app/assets/javascripts/ckeditor/plugins/htmlbuttons/docs/styles.css +0 -59
- data/app/assets/javascripts/ckeditor/plugins/htmlbuttons/icon1.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/htmlbuttons/icon2.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/htmlbuttons/icon3.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/iframe/icons/hidpi/iframe.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/iframe/icons/iframe.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/iframe/lang/en.js +0 -11
- data/app/assets/javascripts/ckeditor/plugins/iframe/lang/ru.js +0 -11
- data/app/assets/javascripts/ckeditor/plugins/iframe/plugin.js +0 -83
- data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -43
- data/app/assets/javascripts/ckeditor/plugins/oembed/images/icon.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/oembed/images/placeholder.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +0 -70
- data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +0 -71
- data/app/assets/javascripts/ckeditor/plugins/oembed/oembed/images/icon.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/oembed/oembed/images/placeholder.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/oembed/oembed/lang/en.js +0 -23
- data/app/assets/javascripts/ckeditor/plugins/oembed/oembed/lang/ru.js +0 -23
- data/app/assets/javascripts/ckeditor/plugins/oembed/oembed/libs/jquery.oembed.js +0 -971
- data/app/assets/javascripts/ckeditor/plugins/oembed/oembed/libs/jquery.oembed.min.js +0 -11
- data/app/assets/javascripts/ckeditor/plugins/oembed/oembed/plugin.js +0 -373
- data/app/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -20
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/assets/sample.css +0 -70
- data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +0 -82
- data/app/assets/javascripts/ckeditor/plugins/symbol/dialogs/lang/en.js +0 -181
- data/app/assets/javascripts/ckeditor/plugins/symbol/dialogs/symbol.js +0 -18
- data/app/assets/javascripts/ckeditor/plugins/symbol/icons/symbol.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/symbol/lang/en.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/symbol/plugin.js +0 -15
- data/app/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +0 -15
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +0 -225
- data/app/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono/dialog.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/dialog_opera.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_ie.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +0 -5
- data/app/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/lib/ckeditor/tasks.rake +0 -11
data/lib/ckeditor.rb
CHANGED
@@ -4,6 +4,8 @@ require 'pathname'
|
|
4
4
|
module Ckeditor
|
5
5
|
autoload :Utils, 'ckeditor/utils'
|
6
6
|
autoload :Http, 'ckeditor/http'
|
7
|
+
autoload :TextArea, 'ckeditor/text_area'
|
8
|
+
autoload :Paginatable, 'ckeditor/paginatable'
|
7
9
|
|
8
10
|
module Helpers
|
9
11
|
autoload :ViewHelper, 'ckeditor/helpers/view_helper'
|
@@ -15,6 +17,7 @@ module Ckeditor
|
|
15
17
|
module Hooks
|
16
18
|
autoload :SimpleFormBuilder, 'ckeditor/hooks/simple_form'
|
17
19
|
autoload :CanCanAuthorization, 'ckeditor/hooks/cancan'
|
20
|
+
autoload :PunditAuthorization, 'ckeditor/hooks/pundit'
|
18
21
|
end
|
19
22
|
|
20
23
|
module Backend
|
@@ -23,7 +26,7 @@ module Ckeditor
|
|
23
26
|
autoload :Dragonfly, 'ckeditor/backend/dragonfly'
|
24
27
|
end
|
25
28
|
|
26
|
-
IMAGE_TYPES =
|
29
|
+
IMAGE_TYPES = %w(image/jpeg image/png image/gif image/jpg image/pjpeg image/tiff image/x-png)
|
27
30
|
|
28
31
|
DEFAULT_AUTHORIZE = Proc.new {}
|
29
32
|
|
@@ -36,17 +39,21 @@ module Ckeditor
|
|
36
39
|
# Allowed image file types for upload.
|
37
40
|
# Set to nil or [] (empty array) for all file types
|
38
41
|
mattr_accessor :image_file_types
|
39
|
-
@@image_file_types =
|
42
|
+
@@image_file_types = %w(jpg jpeg png gif tiff)
|
40
43
|
|
41
44
|
# Allowed attachment file types for upload.
|
42
45
|
# Set to nil or [] (empty array) for all file types
|
43
46
|
mattr_accessor :attachment_file_types
|
44
|
-
@@attachment_file_types =
|
47
|
+
@@attachment_file_types = %w(doc docx xls odt ods pdf rar zip tar tar.gz swf)
|
45
48
|
|
46
49
|
# Ckeditor files destination path
|
47
50
|
mattr_accessor :relative_path
|
48
51
|
@@relative_path = '/assets/ckeditor'
|
49
52
|
|
53
|
+
# Ckeditor assets path
|
54
|
+
mattr_accessor :asset_path
|
55
|
+
@@asset_path = (Rails::VERSION::MAJOR == 4 ? 'assets/ckeditor' : 'ckeditor')
|
56
|
+
|
50
57
|
# Ckeditor assets for precompilation
|
51
58
|
mattr_accessor :assets
|
52
59
|
@@assets = nil
|
@@ -55,6 +62,20 @@ module Ckeditor
|
|
55
62
|
mattr_accessor :parameterize_filenames
|
56
63
|
@@parameterize_filenames = true
|
57
64
|
|
65
|
+
# Paginate assets
|
66
|
+
mattr_accessor :default_per_page
|
67
|
+
@@default_per_page = 24
|
68
|
+
|
69
|
+
# Asset restrictions
|
70
|
+
mattr_accessor :assets_languages
|
71
|
+
mattr_accessor :assets_plugins
|
72
|
+
@@assets_languages = nil
|
73
|
+
@@assets_plugins = nil
|
74
|
+
|
75
|
+
# Model classes
|
76
|
+
@@picture_model = nil
|
77
|
+
@@attachment_file_model = nil
|
78
|
+
|
58
79
|
# Default way to setup Ckeditor. Run rails generate ckeditor to create
|
59
80
|
# a fresh initializer with all configuration values.
|
60
81
|
#
|
@@ -74,24 +95,53 @@ module Ckeditor
|
|
74
95
|
|
75
96
|
# All css and js files from ckeditor folder
|
76
97
|
def self.assets
|
77
|
-
@@assets ||=
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
98
|
+
@@assets ||= Utils.select_assets("ckeditor", "vendor/assets/javascripts") + ["ckeditor/init.js", 'ckcontent.css']
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.picture_model(&block)
|
102
|
+
if block_given?
|
103
|
+
self.picture_model = block
|
104
|
+
else
|
105
|
+
@@picture_model_class ||= begin
|
106
|
+
if @@picture_model.respond_to? :call
|
107
|
+
@@picture_model.call
|
108
|
+
else
|
109
|
+
@@picture_model || Ckeditor::Picture
|
82
110
|
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def self.picture_model=(value)
|
116
|
+
@@picture_model_class = nil
|
117
|
+
@@picture_model = value
|
118
|
+
end
|
83
119
|
|
84
|
-
|
120
|
+
def self.picture_adapter
|
121
|
+
picture_model.to_adapter
|
122
|
+
end
|
123
|
+
|
124
|
+
def self.attachment_file_model(&block)
|
125
|
+
if block_given?
|
126
|
+
self.attachment_file_model = block
|
127
|
+
else
|
128
|
+
@@attachment_file_model_class ||= begin
|
129
|
+
if @@attachment_file_model.respond_to? :call
|
130
|
+
@@attachment_file_model.call
|
131
|
+
else
|
132
|
+
@@attachment_file_model || Ckeditor::AttachmentFile
|
133
|
+
end
|
85
134
|
end
|
86
135
|
end
|
87
136
|
end
|
88
137
|
|
89
|
-
def self.
|
90
|
-
|
138
|
+
def self.attachment_file_model=(value)
|
139
|
+
@@attachment_file_model_class = nil
|
140
|
+
@@attachment_file_model = value
|
91
141
|
end
|
92
142
|
|
93
|
-
def self.
|
94
|
-
|
143
|
+
def self.attachment_file_adapter
|
144
|
+
attachment_file_model.to_adapter
|
95
145
|
end
|
96
146
|
|
97
147
|
# Setup authorization to be run as a before filter
|
@@ -8,7 +8,7 @@ module Ckeditor
|
|
8
8
|
base.send(:include, InstanceMethods)
|
9
9
|
base.send(:extend, ClassMethods)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
module ClassMethods
|
13
13
|
def self.extended(base)
|
14
14
|
base.class_eval do
|
@@ -17,7 +17,7 @@ module Ckeditor
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
module InstanceMethods
|
22
22
|
# process :strip
|
23
23
|
def strip
|
@@ -27,7 +27,7 @@ module Ckeditor
|
|
27
27
|
img
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
# process :quality => 85
|
32
32
|
def quality(percentage)
|
33
33
|
manipulate! do |img|
|
@@ -36,28 +36,28 @@ module Ckeditor
|
|
36
36
|
img
|
37
37
|
end
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
def extract_content_type
|
41
41
|
if file.content_type == 'application/octet-stream' || file.content_type.blank?
|
42
42
|
content_type = MIME::Types.type_for(original_filename).first
|
43
43
|
else
|
44
44
|
content_type = file.content_type
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
model.data_content_type = content_type.to_s
|
48
|
-
end
|
49
|
-
|
48
|
+
end
|
49
|
+
|
50
50
|
def set_size
|
51
51
|
model.data_file_size = file.size
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
def read_dimensions
|
55
55
|
if model.image? && model.has_dimensions?
|
56
56
|
magick = ::MiniMagick::Image.new(current_path)
|
57
57
|
model.width, model.height = magick[:width], magick[:height]
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -5,7 +5,7 @@ module Ckeditor
|
|
5
5
|
base.send(:include, InstanceMethods)
|
6
6
|
base.send(:extend, ClassMethods)
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
module ClassMethods
|
10
10
|
def attachment_file_types
|
11
11
|
@attachment_file_types ||= Ckeditor.attachment_file_types.map(&:to_sym).tap do |formats|
|
@@ -22,7 +22,7 @@ module Ckeditor
|
|
22
22
|
@image_file_types ||= Ckeditor.image_file_types.map(&:to_sym)
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
module InstanceMethods
|
27
27
|
delegate :url, :path, :size, :image?, :width, :height, :to => :data
|
28
28
|
|
@@ -7,18 +7,18 @@ module Ckeditor
|
|
7
7
|
base.send(:include, InstanceMethods)
|
8
8
|
base.send(:extend, ClassMethods)
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
module ClassMethods
|
12
12
|
def self.extended(base)
|
13
13
|
base.class_eval do
|
14
14
|
before_validation :extract_content_type
|
15
15
|
before_create :read_dimensions, :parameterize_filename
|
16
|
-
|
16
|
+
|
17
17
|
delegate :url, :path, :styles, :size, :content_type, :to => :data
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
module InstanceMethods
|
23
23
|
def geometry
|
24
24
|
@geometry ||= begin
|
@@ -26,7 +26,7 @@ module Ckeditor
|
|
26
26
|
::Paperclip::Geometry.from_file(file)
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
protected
|
31
31
|
|
32
32
|
def parameterize_filename
|
data/lib/ckeditor/engine.rb
CHANGED
@@ -13,7 +13,7 @@ module Ckeditor
|
|
13
13
|
ActiveSupport.on_load(:action_controller) do
|
14
14
|
ActionController::Base.send :include, Ckeditor::Helpers::Controllers
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
ActiveSupport.on_load :action_view do
|
18
18
|
ActionView::Base.send :include, Ckeditor::Helpers::ViewHelper
|
19
19
|
ActionView::Base.send :include, Ckeditor::Helpers::FormHelper
|
@@ -21,15 +21,11 @@ module Ckeditor
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
rake_tasks do
|
25
|
-
load "ckeditor/tasks.rake"
|
26
|
-
end
|
27
|
-
|
28
24
|
initializer "ckeditor.hooks" do
|
29
25
|
if Object.const_defined?("Formtastic")
|
30
26
|
require "ckeditor/hooks/formtastic"
|
31
27
|
end
|
32
|
-
|
28
|
+
|
33
29
|
if Object.const_defined?("SimpleForm")
|
34
30
|
require "ckeditor/hooks/simple_form"
|
35
31
|
end
|
@@ -37,6 +33,10 @@ module Ckeditor
|
|
37
33
|
if Object.const_defined?("CanCan")
|
38
34
|
require "ckeditor/hooks/cancan"
|
39
35
|
end
|
36
|
+
|
37
|
+
if Object.const_defined?("Pundit")
|
38
|
+
require "ckeditor/hooks/pundit"
|
39
|
+
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -2,9 +2,9 @@ module Ckeditor
|
|
2
2
|
module Helpers
|
3
3
|
module Controllers
|
4
4
|
extend ActiveSupport::Concern
|
5
|
-
|
5
|
+
|
6
6
|
protected
|
7
|
-
|
7
|
+
|
8
8
|
def ckeditor_current_user
|
9
9
|
instance_eval &Ckeditor.current_user_method
|
10
10
|
end
|
@@ -12,20 +12,20 @@ module Ckeditor
|
|
12
12
|
def ckeditor_authorize!
|
13
13
|
instance_eval &Ckeditor.authorize_with
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
def ckeditor_before_create_asset(asset)
|
17
|
-
asset.assetable = ckeditor_current_user
|
17
|
+
asset.assetable = ckeditor_current_user if ckeditor_current_user
|
18
18
|
return true
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def ckeditor_pictures_scope(options = {})
|
22
22
|
ckeditor_filebrowser_scope(options)
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def ckeditor_attachment_files_scope(options = {})
|
26
26
|
ckeditor_filebrowser_scope(options)
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def ckeditor_filebrowser_scope(options = {})
|
30
30
|
{ :order => [:id, :desc] }.merge(options)
|
31
31
|
end
|
@@ -3,28 +3,9 @@ module Ckeditor
|
|
3
3
|
module FormHelper
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
include ActionView::Helpers::TagHelper
|
7
|
-
include ActionView::Helpers::JavaScriptHelper
|
8
|
-
|
9
6
|
def cktext_area(object_name, method, options = {})
|
10
|
-
options
|
11
|
-
ck_options = (options.delete('ckeditor') || {}).stringify_keys
|
12
|
-
|
13
|
-
if ActionView::Helpers.const_defined?('Tags')
|
14
|
-
instance_tag = ActionView::Helpers::Tags::TextArea.new(object_name, method, self, options)
|
15
|
-
instance_tag.send(:add_default_name_and_id, options) if options['id'].blank?
|
16
|
-
output = instance_tag.render
|
17
|
-
else
|
18
|
-
instance_tag = ActionView::Base::InstanceTag.new(object_name, method, self, options.delete('object'))
|
19
|
-
instance_tag.send(:add_default_name_and_id, options) if options['id'].blank?
|
20
|
-
output = instance_tag.to_text_area_tag(options)
|
21
|
-
end
|
22
|
-
|
23
|
-
output_buffer = ActiveSupport::SafeBuffer.new
|
24
|
-
output_buffer << output
|
25
|
-
output_buffer << javascript_tag(Utils.js_replace(options['id'], ck_options))
|
26
|
-
output_buffer
|
7
|
+
TextArea.new(self, options).render_instance_tag(object_name, method)
|
27
8
|
end
|
28
9
|
end
|
29
10
|
end
|
30
|
-
end
|
11
|
+
end
|
@@ -2,20 +2,9 @@ module Ckeditor
|
|
2
2
|
module Helpers
|
3
3
|
module ViewHelper
|
4
4
|
extend ActiveSupport::Concern
|
5
|
-
|
5
|
+
|
6
6
|
def cktext_area_tag(name, content = nil, options = {})
|
7
|
-
|
8
|
-
options = { :language => I18n.locale.to_s }.merge(options)
|
9
|
-
input_html = { :id => element_id }.merge( options.delete(:input_html) || {} )
|
10
|
-
js_content_for_section = options.delete(:js_content_for)
|
11
|
-
|
12
|
-
output_buffer = ActiveSupport::SafeBuffer.new
|
13
|
-
output_buffer << text_area_tag(name, content, input_html)
|
14
|
-
|
15
|
-
js = Utils.js_replace(element_id, options)
|
16
|
-
|
17
|
-
output_buffer << (js_content_for_section ? content_for(js_content_for_section, js) : javascript_tag(js))
|
18
|
-
output_buffer
|
7
|
+
TextArea.new(self, options).render_tag(name, content)
|
19
8
|
end
|
20
9
|
end
|
21
10
|
end
|
@@ -19,7 +19,7 @@ module Ckeditor
|
|
19
19
|
# action as a symbol (:create, :destroy, etc.). The second argument is the actual model
|
20
20
|
# instance if it is available.
|
21
21
|
def authorize(action, model_object = nil)
|
22
|
-
@controller.
|
22
|
+
@controller.authorize!(action.to_sym, model_object) if action
|
23
23
|
end
|
24
24
|
|
25
25
|
# This method is called primarily from the view to determine whether the given user
|
@@ -43,4 +43,4 @@ module Ckeditor
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
Ckeditor::AUTHORIZATION_ADAPTERS[:cancan] = Ckeditor::Hooks::CanCanAuthorization
|
46
|
+
Ckeditor::AUTHORIZATION_ADAPTERS[:cancan] = Ckeditor::Hooks::CanCanAuthorization
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'pundit'
|
2
|
+
|
3
|
+
module Ckeditor
|
4
|
+
module Hooks
|
5
|
+
# This adapter is for the Pundit[https://github.com/elabs/pundit] authorization library.
|
6
|
+
# You can create another adapter for different authorization behavior, just be certain it
|
7
|
+
# responds to each of the public methods here.
|
8
|
+
class PunditAuthorization
|
9
|
+
|
10
|
+
include Ckeditor::Helpers::Controllers
|
11
|
+
|
12
|
+
# See the +authorize_with+ config method for where the initialization happens.
|
13
|
+
def initialize(controller)
|
14
|
+
@controller = controller
|
15
|
+
@controller.extend ControllerExtension
|
16
|
+
end
|
17
|
+
|
18
|
+
# This method is called in every controller action and should raise an exception
|
19
|
+
# when the authorization fails. The first argument is the name of the controller
|
20
|
+
# action as a symbol (:create, :destroy, etc.). The second argument is the actual model
|
21
|
+
# instance if it is available.
|
22
|
+
def authorize(action, model_object = nil)
|
23
|
+
raise Pundit::NotAuthorizedError unless authorized?(action, model_object)
|
24
|
+
end
|
25
|
+
|
26
|
+
# This method is called primarily from the view to determine whether the given user
|
27
|
+
# has access to perform the action on a given model. It should return true when authorized.
|
28
|
+
# This takes the same arguments as +authorize+. The difference is that this will
|
29
|
+
# return a boolean whereas +authorize+ will raise an exception when not authorized.
|
30
|
+
def authorized?(action, model_object = nil)
|
31
|
+
Pundit.policy(@controller.current_user_for_pundit, model_object).public_send(action + '?' ) if action
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
module ControllerExtension
|
37
|
+
def current_user_for_pundit
|
38
|
+
# use ckeditor_current_user instead of default current_user so it works with
|
39
|
+
# whatever current user method is defined with Ckeditor
|
40
|
+
ckeditor_current_user
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
Ckeditor::AUTHORIZATION_ADAPTERS[:pundit] = Ckeditor::Hooks::PunditAuthorization
|