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/http.rb
CHANGED
@@ -36,7 +36,7 @@ module Ckeditor
|
|
36
36
|
@tempfile.size
|
37
37
|
end
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
# Usage (paperclip example)
|
41
41
|
# @asset.data = QqFile.new(params[:qqfile], request)
|
42
42
|
class QqFile < ::Tempfile
|
@@ -44,26 +44,27 @@ module Ckeditor
|
|
44
44
|
def initialize(filename, request, tmpdir = Dir::tmpdir)
|
45
45
|
@original_filename = filename
|
46
46
|
@request = request
|
47
|
-
|
47
|
+
|
48
48
|
super Digest::SHA1.hexdigest(filename), tmpdir
|
49
|
+
binmode
|
49
50
|
fetch
|
50
51
|
end
|
51
|
-
|
52
|
+
|
52
53
|
def fetch
|
53
54
|
self.write(body)
|
54
55
|
self.rewind
|
55
56
|
self
|
56
57
|
end
|
57
|
-
|
58
|
+
|
58
59
|
def original_filename
|
59
60
|
@original_filename
|
60
61
|
end
|
61
|
-
|
62
|
+
|
62
63
|
def content_type
|
63
64
|
types = MIME::Types.type_for(original_filename)
|
64
65
|
types.empty? ? @request.content_type : types.first.to_s
|
65
66
|
end
|
66
|
-
|
67
|
+
|
67
68
|
def body
|
68
69
|
if @request.raw_post.respond_to?(:force_encoding)
|
69
70
|
@request.raw_post.force_encoding("UTF-8")
|
@@ -72,7 +73,7 @@ module Ckeditor
|
|
72
73
|
end
|
73
74
|
end
|
74
75
|
end
|
75
|
-
|
76
|
+
|
76
77
|
# Convert nested Hash to HashWithIndifferentAccess and replace
|
77
78
|
# file upload hash with UploadedFile objects
|
78
79
|
def self.normalize_param(*args)
|
@@ -8,13 +8,13 @@ module Ckeditor
|
|
8
8
|
base.send(:include, Base::AssetBase::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
|
15
15
|
self.table_name = "ckeditor_assets"
|
16
|
-
|
17
|
-
belongs_to :assetable, :polymorphic => true
|
16
|
+
|
17
|
+
belongs_to :assetable, :polymorphic => true
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
data/lib/ckeditor/orm/base.rb
CHANGED
@@ -10,11 +10,11 @@ module Ckeditor
|
|
10
10
|
def size
|
11
11
|
data_file_size
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def has_dimensions?
|
15
15
|
respond_to?(:width) && respond_to?(:height)
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def image?
|
19
19
|
Ckeditor::IMAGE_TYPES.include?(data_content_type)
|
20
20
|
end
|
@@ -30,7 +30,7 @@ module Ckeditor
|
|
30
30
|
def url_thumb
|
31
31
|
url(:thumb)
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def as_json_methods
|
35
35
|
[:url_content, :url_thumb, :size, :filename, :format_created_at]
|
36
36
|
end
|
@@ -41,9 +41,7 @@ module Ckeditor
|
|
41
41
|
:root => "asset"
|
42
42
|
}.merge(options || {})
|
43
43
|
|
44
|
-
|
45
|
-
ret['asset']['id'] = ret['asset']['id'].to_s
|
46
|
-
ret
|
44
|
+
super options
|
47
45
|
end
|
48
46
|
end
|
49
47
|
end
|
data/lib/ckeditor/orm/mongoid.rb
CHANGED
@@ -12,12 +12,12 @@ module Ckeditor
|
|
12
12
|
base.send(:include, InstanceMethods)
|
13
13
|
base.send(:extend, ClassMethods)
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
module InstanceMethods
|
17
17
|
def type
|
18
18
|
_type
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def as_json_methods
|
22
22
|
[:id, :type] + super
|
23
23
|
end
|
@@ -30,8 +30,8 @@ module Ckeditor
|
|
30
30
|
field :data_file_size, :type => Integer
|
31
31
|
field :width, :type => Integer
|
32
32
|
field :height, :type => Integer
|
33
|
-
|
34
|
-
belongs_to :assetable, :polymorphic => true
|
33
|
+
|
34
|
+
belongs_to :assetable, :polymorphic => true
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Ckeditor
|
2
|
+
# Simple paginate relation
|
3
|
+
class Paginatable
|
4
|
+
attr_reader :limit_value, :offset_value
|
5
|
+
|
6
|
+
def initialize(scope, options = {})
|
7
|
+
@scope = scope
|
8
|
+
@limit_value = (options[:limit] || Ckeditor.default_per_page).to_i
|
9
|
+
end
|
10
|
+
|
11
|
+
def page(num = 1)
|
12
|
+
@offset_value = limit_value * ([num.to_i, 1].max - 1)
|
13
|
+
self
|
14
|
+
end
|
15
|
+
|
16
|
+
def scoped
|
17
|
+
@scope.limit(limit_value).offset(offset_value)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Next page number in the collection
|
21
|
+
def next_page
|
22
|
+
current_page + 1 unless last_page?
|
23
|
+
end
|
24
|
+
|
25
|
+
# Previous page number in the collection
|
26
|
+
def prev_page
|
27
|
+
current_page - 1 unless first_page?
|
28
|
+
end
|
29
|
+
|
30
|
+
# First page of the collection?
|
31
|
+
def first_page?
|
32
|
+
current_page == 1
|
33
|
+
end
|
34
|
+
|
35
|
+
# Last page of the collection?
|
36
|
+
def last_page?
|
37
|
+
current_page >= total_pages
|
38
|
+
end
|
39
|
+
|
40
|
+
# Total number of pages
|
41
|
+
def total_pages
|
42
|
+
(total_count.to_f / limit_value).ceil
|
43
|
+
end
|
44
|
+
|
45
|
+
# total item numbers of scope
|
46
|
+
def total_count
|
47
|
+
@total_count ||= @scope.count
|
48
|
+
end
|
49
|
+
|
50
|
+
# Current page number
|
51
|
+
def current_page
|
52
|
+
offset = (offset_value < 0 ? 0 : offset_value)
|
53
|
+
(offset / limit_value) + 1
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'active_support'
|
2
|
+
require 'action_view/helpers/tag_helper'
|
3
|
+
require 'action_view/helpers/form_tag_helper'
|
4
|
+
|
5
|
+
module Ckeditor
|
6
|
+
class TextArea
|
7
|
+
include ActionView::Helpers::TagHelper
|
8
|
+
include ActionView::Helpers::FormTagHelper
|
9
|
+
include ActionView::Helpers::JavaScriptHelper
|
10
|
+
|
11
|
+
attr_reader :template, :options, :ck_options
|
12
|
+
|
13
|
+
def initialize(template, options)
|
14
|
+
@template = template
|
15
|
+
@options = options.stringify_keys
|
16
|
+
@ck_options = (@options.delete('ckeditor') || {}).stringify_keys
|
17
|
+
end
|
18
|
+
|
19
|
+
def render_instance_tag(object_name, method)
|
20
|
+
tag = build_tag(object_name, method)
|
21
|
+
tag.send(:add_default_name_and_id, options) if options['id'].blank?
|
22
|
+
|
23
|
+
render tag.respond_to?(:to_text_area_tag) ? tag.to_text_area_tag(options) : tag.render
|
24
|
+
end
|
25
|
+
|
26
|
+
def render_tag(name, content)
|
27
|
+
options['id'] = sanitize_to_id(options['id'] || name)
|
28
|
+
|
29
|
+
render text_area_tag(name, content, options)
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
|
34
|
+
def render(input)
|
35
|
+
output_buffer << input
|
36
|
+
output_buffer << javascript_tag(Utils.js_replace(options['id'], ck_options))
|
37
|
+
output_buffer
|
38
|
+
end
|
39
|
+
|
40
|
+
def output_buffer
|
41
|
+
@output_buffer ||= ActiveSupport::SafeBuffer.new
|
42
|
+
end
|
43
|
+
|
44
|
+
def build_tag(object_name, method)
|
45
|
+
if defined?(ActionView::Base::Tags::TextArea)
|
46
|
+
ActionView::Base::Tags::TextArea.new(object_name, method, template, options.symbolize_keys)
|
47
|
+
else
|
48
|
+
ActionView::Base::InstanceTag.new(object_name, method, template, options.delete('object'))
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/lib/ckeditor/utils.rb
CHANGED
@@ -3,30 +3,20 @@ require 'active_support/json/encoding'
|
|
3
3
|
|
4
4
|
module Ckeditor
|
5
5
|
module Utils
|
6
|
-
class JavascriptCode < String
|
7
|
-
def to_json(options = nil)
|
8
|
-
self
|
9
|
-
end
|
10
|
-
|
11
|
-
def as_json(options = nil)
|
12
|
-
ActiveSupport::JSON::Variable.new(to_s).freeze
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
6
|
class << self
|
17
7
|
def escape_single_quotes(str)
|
18
8
|
str.gsub('\\','\0\0').gsub('</','<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" }
|
19
9
|
end
|
20
|
-
|
10
|
+
|
21
11
|
def parameterize_filename(filename)
|
22
12
|
return filename unless Ckeditor.parameterize_filenames
|
23
13
|
|
24
14
|
extension = File.extname(filename)
|
25
15
|
basename = filename.gsub(/#{extension}$/, "")
|
26
|
-
|
16
|
+
|
27
17
|
[basename.parameterize('_'), extension].join.downcase
|
28
18
|
end
|
29
|
-
|
19
|
+
|
30
20
|
def js_replace(dom_id, options = nil)
|
31
21
|
js = ["if (typeof CKEDITOR != 'undefined') {"]
|
32
22
|
|
@@ -40,47 +30,75 @@ module Ckeditor
|
|
40
30
|
js << "}"
|
41
31
|
js.join(" ").html_safe
|
42
32
|
end
|
43
|
-
|
33
|
+
|
44
34
|
def js_fileuploader(uploader_type, options = {})
|
45
35
|
options = { :multiple => true, :element => "fileupload" }.merge(options)
|
46
|
-
|
36
|
+
|
47
37
|
case uploader_type.to_s.downcase
|
48
38
|
when "image" then
|
49
|
-
options[:action] =
|
39
|
+
options[:action] = "EDITOR.config.filebrowserImageUploadUrl"
|
50
40
|
options[:allowedExtensions] = Ckeditor.image_file_types
|
51
41
|
when "flash" then
|
52
|
-
options[:action] =
|
42
|
+
options[:action] = "EDITOR.config.filebrowserFlashUploadUrl"
|
53
43
|
options[:allowedExtensions] = ["swf"]
|
54
44
|
else
|
55
|
-
options[:action] =
|
45
|
+
options[:action] = "EDITOR.config.filebrowserUploadUrl"
|
56
46
|
options[:allowedExtensions] = Ckeditor.attachment_file_types
|
57
47
|
end
|
58
|
-
|
59
|
-
js_options = ActiveSupport::JSON.encode(options)
|
60
|
-
|
48
|
+
|
49
|
+
js_options = ActiveSupport::JSON.encode(options).gsub /"EDITOR.config.filebrowser(.*)UploadUrl"/, 'EDITOR.config.filebrowser\1UploadUrl'
|
50
|
+
|
61
51
|
"(function() { new qq.FileUploaderInput(#{js_options}); }).call(this);".html_safe
|
62
52
|
end
|
63
|
-
|
53
|
+
|
64
54
|
def filethumb(filename)
|
65
55
|
extname = filename.blank? ? "unknown" : File.extname(filename).gsub(/^\./, '')
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
56
|
+
image = "#{extname}.gif"
|
57
|
+
source = Ckeditor.root_path.join("app/assets/javascripts/ckeditor/filebrowser/images/thumbs")
|
58
|
+
|
59
|
+
unless File.exists?(File.join(source, image))
|
60
|
+
image = "unknown.gif"
|
61
|
+
end
|
62
|
+
|
63
|
+
File.join(Ckeditor.relative_path, "filebrowser/images/thumbs", image)
|
74
64
|
end
|
75
65
|
|
76
66
|
def select_assets(path, relative_path)
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
67
|
+
relative_folder = Ckeditor.root_path.join relative_path
|
68
|
+
folder = relative_folder.join path
|
69
|
+
extensions = '*.{js,css,png,gif,jpg,scss}'
|
70
|
+
|
71
|
+
# Files at root
|
72
|
+
files = Dir[folder.join(extensions)]
|
73
|
+
|
74
|
+
# Plugins
|
75
|
+
if Ckeditor.assets_plugins.nil?
|
76
|
+
files += Dir[folder.join('plugins', '**', extensions)]
|
77
|
+
else
|
78
|
+
Ckeditor.assets_plugins.each do |plugin|
|
79
|
+
files += Dir[folder.join('plugins', plugin, '**', extensions)]
|
80
|
+
end
|
83
81
|
end
|
82
|
+
|
83
|
+
# Other folders
|
84
|
+
Dir[folder.join('*/')].each do |subfolder|
|
85
|
+
path = Pathname.new(subfolder)
|
86
|
+
unless path.basename.to_s == 'plugins'
|
87
|
+
files += Dir[path.join('**', extensions)]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
paths = files.map { |file| Pathname.new(file) }
|
92
|
+
|
93
|
+
# Filter languages
|
94
|
+
if Ckeditor.assets_languages.present?
|
95
|
+
paths.select! do |path|
|
96
|
+
path.dirname.basename.to_s != 'lang' ||
|
97
|
+
Ckeditor.assets_languages.include?(path.basename.to_s.split('.')[0])
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
paths.map { |path| path.relative_path_from(relative_folder).to_s.gsub('.scss', '') }.select { |path| path != 'ckeditor/ckeditor.js' }
|
84
102
|
end
|
85
103
|
end
|
86
104
|
end
|
data/lib/ckeditor/version.rb
CHANGED
@@ -7,14 +7,14 @@ module Ckeditor
|
|
7
7
|
include Rails::Generators::Migration
|
8
8
|
|
9
9
|
desc "Generates migration for Asset (Picture, AttachmentFile) models"
|
10
|
-
|
10
|
+
|
11
11
|
# ORM configuration
|
12
12
|
class_option :orm, :type => :string, :default => "active_record",
|
13
13
|
:desc => "Backend processor for upload support"
|
14
|
-
|
14
|
+
|
15
15
|
class_option :backend, :type => :string, :default => 'paperclip',
|
16
16
|
:desc => "paperclip (default), carrierwave, or dragonfly"
|
17
|
-
|
17
|
+
|
18
18
|
def self.source_root
|
19
19
|
@source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
20
20
|
end
|
@@ -31,7 +31,7 @@ module Ckeditor
|
|
31
31
|
template File.join("base", "dragonfly", "initializer.rb"), "config/initializers/ckeditor_dragonfly.rb"
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
def mount_engine
|
36
36
|
route "mount Ckeditor::Engine => '/ckeditor'"
|
37
37
|
end
|
@@ -41,11 +41,11 @@ module Ckeditor
|
|
41
41
|
template "#{generator_dir}/ckeditor/#{filename}.rb",
|
42
42
|
File.join('app/models', ckeditor_dir, "#{filename}.rb")
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
if backend == "carrierwave"
|
46
46
|
template "#{uploaders_dir}/uploaders/ckeditor_attachment_file_uploader.rb",
|
47
47
|
File.join("app/uploaders", "ckeditor_attachment_file_uploader.rb")
|
48
|
-
|
48
|
+
|
49
49
|
template "#{uploaders_dir}/uploaders/ckeditor_picture_uploader.rb",
|
50
50
|
File.join("app/uploaders", "ckeditor_picture_uploader.rb")
|
51
51
|
end
|
@@ -56,7 +56,7 @@ module Ckeditor
|
|
56
56
|
migration_template "#{generator_dir}/migration.rb", File.join('db/migrate', "create_ckeditor_assets.rb")
|
57
57
|
end
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
protected
|
61
61
|
|
62
62
|
def ckeditor_dir
|
@@ -66,15 +66,15 @@ module Ckeditor
|
|
66
66
|
def generator_dir
|
67
67
|
@generator_dir ||= [orm, backend].join('/')
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def uploaders_dir
|
71
71
|
@uploaders_dir ||= ['base', 'carrierwave'].join('/')
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
def orm
|
75
75
|
(options[:orm] || "active_record").to_s
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
def backend
|
79
79
|
(options[:backend] || "paperclip").to_s
|
80
80
|
end
|