ckeditor 3.7.0.rc3 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -2
- data/README.rdoc +6 -2
- data/Rakefile +7 -0
- data/config/locales/pl.ckeditor.yml +8 -0
- data/lib/ckeditor.rb +12 -5
- data/lib/ckeditor/backend/dragonfly.rb +45 -0
- data/lib/ckeditor/backend/paperclip.rb +4 -1
- data/lib/ckeditor/engine.rb +3 -2
- data/lib/ckeditor/helpers/form_helper.rb +6 -4
- data/lib/ckeditor/helpers/view_helper.rb +4 -1
- data/lib/ckeditor/hooks/simple_form.rb +14 -25
- data/lib/ckeditor/utils.rb +22 -35
- data/lib/ckeditor/version.rb +2 -2
- data/lib/generators/ckeditor/install_generator.rb +5 -1
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +2 -2
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +7 -0
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +7 -0
- data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +12 -0
- data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +27 -0
- 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/base/dragonfly/initializer.rb +26 -0
- data/test/dummy/config/application.rb +21 -7
- data/test/dummy/config/boot.rb +1 -1
- data/test/dummy/config/database.yml +3 -3
- data/test/dummy/config/environments/development.rb +8 -1
- data/test/dummy/config/environments/production.rb +8 -1
- data/test/dummy/config/environments/test.rb +4 -6
- data/test/dummy/config/initializers/ckeditor.rb +8 -16
- data/test/dummy/config/initializers/inflections.rb +5 -0
- data/test/dummy/log/test.log +7368 -0
- data/test/functional/posts_controller_test.rb +41 -0
- data/test/generators/install_generator_test.rb +15 -0
- data/test/models/attachment_file_test.rb +10 -6
- data/test/models/picture_test.rb +10 -6
- data/test/models/utils_test.rb +6 -6
- data/test/support/helpers.rb +5 -5
- data/test/test_helper.rb +7 -1
- data/vendor/assets/javascripts/ckeditor/CHANGES.html +72 -2
- data/vendor/assets/javascripts/ckeditor/INSTALL.html +2 -2
- data/vendor/assets/javascripts/ckeditor/LICENSE.html +2 -2
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +1 -1
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +120 -118
- data/vendor/assets/javascripts/ckeditor/ckeditor.pack +1 -1
- data/vendor/assets/javascripts/ckeditor/ckeditor_basic.js +3 -3
- data/vendor/assets/javascripts/ckeditor/ckeditor_basic_source.js +2 -2
- data/vendor/assets/javascripts/ckeditor/ckeditor_source.js +2 -2
- data/vendor/assets/javascripts/ckeditor/config.js +36 -4
- data/vendor/assets/javascripts/ckeditor/contents.css +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/_languages.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/_translationstatus.txt +25 -23
- data/vendor/assets/javascripts/ckeditor/lang/af.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ar.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/bg.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/bn.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/bs.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/da.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/de.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/el.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/eo.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/es.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/et.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/eu.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/fa.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/fo.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/fr.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/gl.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/gu.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/he.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/hi.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/hr.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/hu.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/is.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/it.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ka.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/km.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ko.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/lt.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/lv.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/mk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/mn.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ms.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/no.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/pl.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/pt.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/ro.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/sk.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/sl.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/sr.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/th.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/ug.js +6 -0
- data/vendor/assets/javascripts/ckeditor/lang/uk.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/vi.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/_translationstatus.txt +23 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/cs.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/cy.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/da.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/de.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/el.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/eo.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/fa.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/fi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/fr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/gu.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/it.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/mk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/nb.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/nl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/no.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/tr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/ug.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/vi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/zh-cn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/ajax/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/attachment/dialogs/attachment.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/_translationstatus.txt +27 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/bg.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/cs.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/cy.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/da.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/de.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/el.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/eo.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/et.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/fa.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/fi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/fr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/gu.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/he.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/hr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/it.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/nb.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/nl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/no.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/pl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/tr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/ug.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/uk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/vi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/zh-cn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/embed/lang/el.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/embed/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +9 -9
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/_translationstatus.txt +26 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/bg.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/cs.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/cy.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/da.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/de.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/el.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/eo.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/et.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/fa.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/fi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/fr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/hr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/it.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/nb.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/nl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/no.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/pl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/tr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/ug.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/uk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/vi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/zh-cn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/_translationstatus.txt +19 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/cs.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/cy.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/de.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/eo.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/et.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/fa.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/fi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/fr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/hr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/it.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/nb.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/nl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/no.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/tr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/ug.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/zh-cn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/styles/styles/default.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/_translationstatus.txt +27 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/bg.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/cs.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/cy.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/da.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/de.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/el.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/eo.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/et.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/fa.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/fi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/fr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/hr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/it.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/mk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/nb.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/nl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/no.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/pl.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/tr.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/ug.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/uk.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/vi.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/zh-cn.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/xml/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/kama/editor.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/kama/skin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/kama/templates.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/office2003/dialog.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/office2003/editor.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/office2003/skin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/office2003/templates.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/v2/dialog.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/v2/editor.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/v2/skin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/v2/templates.css +1 -1
- data/vendor/assets/javascripts/ckeditor/themes/default/theme.js +1 -1
- metadata +130 -13
- data/test/dummy/db/migrate/20110705195648_create_ckeditor_assets.rb +0 -26
- data/test/integration/posts_test.rb +0 -41
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem "rails", "3.
|
5
|
+
gem "rails", "3.2.3"
|
6
6
|
|
7
7
|
platforms :mri_18 do
|
8
8
|
group :test do
|
@@ -24,8 +24,9 @@ platforms :ruby do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
group :active_record do
|
27
|
-
gem "paperclip"
|
27
|
+
gem "paperclip", "~> 3.0.3"
|
28
28
|
gem "carrierwave"
|
29
|
+
gem "dragonfly"
|
29
30
|
gem "mini_magick"
|
30
31
|
end
|
31
32
|
|
data/README.rdoc
CHANGED
@@ -16,7 +16,7 @@ the results users have when publishing it. It brings to the web common editing f
|
|
16
16
|
|
17
17
|
Rails 3.2:
|
18
18
|
|
19
|
-
gem "ckeditor", "3.7.0
|
19
|
+
gem "ckeditor", "3.7.0"
|
20
20
|
|
21
21
|
Rails <= 3.0:
|
22
22
|
|
@@ -64,6 +64,10 @@ Autoload ckeditor models folder (application.rb):
|
|
64
64
|
|
65
65
|
== Usage
|
66
66
|
|
67
|
+
Mount engine in your routes (config/routes.rb):
|
68
|
+
|
69
|
+
mount Ckeditor::Engine => "/ckeditor"
|
70
|
+
|
67
71
|
Include ckeditor javascripts rails 3.2:
|
68
72
|
|
69
73
|
//= require ckeditor/init
|
@@ -127,7 +131,7 @@ Jquery sample:
|
|
127
131
|
|
128
132
|
=== SimpleForm integration
|
129
133
|
|
130
|
-
<%= form.
|
134
|
+
<%= form.input :content, :as => :ckeditor, :label => false, :input_html => { :toolbar => 'Full' } %>
|
131
135
|
|
132
136
|
=== Default scope
|
133
137
|
|
data/Rakefile
CHANGED
@@ -46,6 +46,13 @@ Rake::TestTask.new("test:models") do |t|
|
|
46
46
|
t.verbose = false
|
47
47
|
end
|
48
48
|
|
49
|
+
Rake::TestTask.new("test:functional") do |t|
|
50
|
+
t.libs << 'lib'
|
51
|
+
t.libs << 'test'
|
52
|
+
t.pattern = 'test/functional/*_test.rb'
|
53
|
+
t.verbose = false
|
54
|
+
end
|
55
|
+
|
49
56
|
task :default => :test
|
50
57
|
|
51
58
|
RDoc::Task.new do |rdoc|
|
data/lib/ckeditor.rb
CHANGED
@@ -21,6 +21,7 @@ module Ckeditor
|
|
21
21
|
module Backend
|
22
22
|
autoload :Paperclip, 'ckeditor/backend/paperclip'
|
23
23
|
autoload :CarrierWave, 'ckeditor/backend/carrierwave'
|
24
|
+
autoload :Dragonfly, 'ckeditor/backend/dragonfly'
|
24
25
|
end
|
25
26
|
|
26
27
|
# Allowed image file types for upload.
|
@@ -37,6 +38,10 @@ module Ckeditor
|
|
37
38
|
mattr_accessor :relative_path
|
38
39
|
@@relative_path = '/assets/ckeditor'
|
39
40
|
|
41
|
+
# Ckeditor assets for precompilation
|
42
|
+
mattr_accessor :assets
|
43
|
+
@@assets = nil
|
44
|
+
|
40
45
|
# Default way to setup Ckeditor. Run rails generate ckeditor to create
|
41
46
|
# a fresh initializer with all configuration values.
|
42
47
|
def self.setup
|
@@ -48,12 +53,14 @@ module Ckeditor
|
|
48
53
|
end
|
49
54
|
|
50
55
|
def self.assets
|
51
|
-
|
52
|
-
|
53
|
-
|
56
|
+
@@assets ||= begin
|
57
|
+
Dir[root_path.join('vendor/assets/javascripts/ckeditor/**', '*.{js,css}')].inject([]) do |list, path|
|
58
|
+
unless path.include?("/ckeditor/filebrowser/")
|
59
|
+
list << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/javascripts'))
|
60
|
+
end
|
61
|
+
|
62
|
+
list
|
54
63
|
end
|
55
|
-
|
56
|
-
list
|
57
64
|
end
|
58
65
|
end
|
59
66
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Ckeditor
|
2
|
+
module Backend
|
3
|
+
module Dragonfly
|
4
|
+
def self.included(base)
|
5
|
+
base.send(:include, InstanceMethods)
|
6
|
+
base.send(:extend, ClassMethods)
|
7
|
+
end
|
8
|
+
|
9
|
+
module ClassMethods
|
10
|
+
def attachment_file_types
|
11
|
+
@attachment_file_types ||= Ckeditor.attachment_file_types.map(&:to_sym).tap do |formats|
|
12
|
+
# This is not ideal but Dragonfly doesn't return double
|
13
|
+
# extensions. Having said that, the other backends
|
14
|
+
# currently don't use attachment_file_types at all.
|
15
|
+
[ :bz2, :gz, :lzma, :xz ].each do |f|
|
16
|
+
formats << f if formats.include?("tar.#{f}".to_sym)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def image_file_types
|
22
|
+
@image_file_types ||= Ckeditor.image_file_types.map(&:to_sym)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module InstanceMethods
|
27
|
+
delegate :url, :path, :size, :image?, :width, :height, :to => :data
|
28
|
+
|
29
|
+
alias_attribute :data_file_name, :data_name
|
30
|
+
alias_attribute :data_content_type, :data_mime_type
|
31
|
+
alias_attribute :data_file_size, :data_size
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def url_thumb_options
|
36
|
+
if data.basename.present?
|
37
|
+
{ :basename => "thumb_#{data.basename}" }
|
38
|
+
else
|
39
|
+
{}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -21,7 +21,10 @@ module Ckeditor
|
|
21
21
|
|
22
22
|
module InstanceMethods
|
23
23
|
def geometry
|
24
|
-
@geometry ||=
|
24
|
+
@geometry ||= begin
|
25
|
+
file = data.respond_to?(:queued_for_write) ? data.queued_for_write[:original] : data.to_file
|
26
|
+
::Paperclip::Geometry.from_file(file)
|
27
|
+
end
|
25
28
|
end
|
26
29
|
|
27
30
|
protected
|
data/lib/ckeditor/engine.rb
CHANGED
@@ -24,12 +24,13 @@ module Ckeditor
|
|
24
24
|
end
|
25
25
|
|
26
26
|
initializer "ckeditor.hooks" do
|
27
|
-
|
27
|
+
# Don't load the hook for Formtastic < 2.0.0 that (it crashes), apparently, didn't define a Formtastic::Inputs.
|
28
|
+
if Object.const_defined?("Formtastic") && Formtastic.const_defined?("Inputs")
|
28
29
|
require "ckeditor/hooks/formtastic"
|
29
30
|
end
|
30
31
|
|
31
32
|
if Object.const_defined?("SimpleForm")
|
32
|
-
|
33
|
+
require "ckeditor/hooks/simple_form"
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
@@ -8,16 +8,18 @@ module Ckeditor
|
|
8
8
|
|
9
9
|
def cktext_area(object_name, method, options = {})
|
10
10
|
options = { :language => I18n.locale.to_s }.merge(options)
|
11
|
-
input_html = (options.delete(:input_html) || {})
|
12
|
-
|
11
|
+
input_html = (options.delete(:input_html) || {}).stringify_keys
|
12
|
+
js_content_for_section = options.delete(:js_content_for)
|
13
13
|
|
14
14
|
instance_tag = ActionView::Base::InstanceTag.new(object_name, method, self, options.delete(:object))
|
15
|
-
instance_tag.send(:add_default_name_and_id,
|
15
|
+
instance_tag.send(:add_default_name_and_id, input_html)
|
16
16
|
|
17
17
|
output_buffer = ActiveSupport::SafeBuffer.new
|
18
18
|
output_buffer << instance_tag.to_text_area_tag(input_html)
|
19
|
-
output_buffer << javascript_tag(Utils.js_replace(hash['id'], options))
|
20
19
|
|
20
|
+
js = Utils.js_replace(input_html['id'], options)
|
21
|
+
|
22
|
+
output_buffer << (js_content_for_section ? content_for(js_content_for_section, js) : javascript_tag(js))
|
21
23
|
output_buffer
|
22
24
|
end
|
23
25
|
end
|
@@ -7,11 +7,14 @@ module Ckeditor
|
|
7
7
|
element_id = sanitize_to_id(name)
|
8
8
|
options = { :language => I18n.locale.to_s }.merge(options)
|
9
9
|
input_html = { :id => element_id }.merge( options.delete(:input_html) || {} )
|
10
|
+
js_content_for_section = options.delete(:js_content_for)
|
10
11
|
|
11
12
|
output_buffer = ActiveSupport::SafeBuffer.new
|
12
13
|
output_buffer << text_area_tag(name, content, input_html)
|
13
|
-
output_buffer << javascript_tag(Utils.js_replace(element_id, options))
|
14
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))
|
15
18
|
output_buffer
|
16
19
|
end
|
17
20
|
end
|
@@ -1,28 +1,17 @@
|
|
1
|
-
module Ckeditor
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
def input
|
6
|
-
@builder.send(:cktext_area, attribute_name, input_html_options)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.included(base)
|
11
|
-
base.send(:include, InstanceMethods)
|
12
|
-
end
|
13
|
-
|
14
|
-
module InstanceMethods
|
15
|
-
def ckeditor(attribute_name, options={}, &block)
|
16
|
-
column = find_attribute_column(attribute_name)
|
17
|
-
input_type = default_input_type(attribute_name, column, options)
|
18
|
-
|
19
|
-
if block_given?
|
20
|
-
SimpleForm::Inputs::BlockInput.new(self, attribute_name, column, input_type, options, &block).render
|
21
|
-
else
|
22
|
-
CkeditorInput.new(self, attribute_name, column, input_type, options).render
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
1
|
+
module Ckeditor::Hooks::SimpleForm
|
2
|
+
class CkeditorInput < ::SimpleForm::Inputs::Base
|
3
|
+
def input
|
4
|
+
@builder.cktext_area(attribute_name, input_html_options)
|
26
5
|
end
|
27
6
|
end
|
28
7
|
end
|
8
|
+
::SimpleForm::FormBuilder.map_type :ckeditor, :to => Ckeditor::Hooks::SimpleForm::CkeditorInput
|
9
|
+
|
10
|
+
# TODO: remove this after a while, SimpleForm::FormBuilder#ckeditor is deprecated.
|
11
|
+
class SimpleForm::FormBuilder
|
12
|
+
def ckeditor(attribute_name, options={}, &block)
|
13
|
+
warn "[DEPRECATION] calling f.ckeditor(:#{attribute_name}, ...) is deprecated, call f.input(:#{attribute_name}, :as => :ckeditor, #{options.to_s[1..-1]}) #{Kernel.caller.first}"
|
14
|
+
options[:as] = :ckeditor
|
15
|
+
self.input(attribute_name, options, &block)
|
16
|
+
end
|
17
|
+
end
|
data/lib/ckeditor/utils.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
require 'active_support/json/encoding'
|
3
|
+
|
2
4
|
module Ckeditor
|
3
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
|
+
|
4
16
|
class << self
|
5
17
|
def escape_single_quotes(str)
|
6
18
|
str.gsub('\\','\0\0').gsub('</','<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" }
|
@@ -14,16 +26,12 @@ module Ckeditor
|
|
14
26
|
end
|
15
27
|
|
16
28
|
def js_replace(dom_id, options = {})
|
17
|
-
js_options =
|
18
|
-
js = ["if (CKEDITOR.instances['#{dom_id}']) {CKEDITOR.remove(CKEDITOR.instances['#{dom_id}']);}"]
|
19
|
-
|
20
|
-
if js_options.blank?
|
21
|
-
js << "CKEDITOR.replace('#{dom_id}');"
|
22
|
-
else
|
23
|
-
js << "CKEDITOR.replace('#{dom_id}', { #{js_options} });"
|
24
|
-
end
|
29
|
+
js_options = ActiveSupport::JSON.encode(options)
|
25
30
|
|
26
|
-
js.
|
31
|
+
js = ["if (CKEDITOR.instances['#{dom_id}']) {CKEDITOR.remove(CKEDITOR.instances['#{dom_id}']);}"]
|
32
|
+
js << "CKEDITOR.replace('#{dom_id}', #{js_options});"
|
33
|
+
|
34
|
+
"$(document).ready(function(){ #{js.join} });".html_safe
|
27
35
|
end
|
28
36
|
|
29
37
|
def js_fileuploader(uploader_type, options = {})
|
@@ -31,40 +39,19 @@ module Ckeditor
|
|
31
39
|
|
32
40
|
case uploader_type.to_s.downcase
|
33
41
|
when "image" then
|
34
|
-
options[:action] = "
|
42
|
+
options[:action] = JavascriptCode.new("EDITOR.config.filebrowserImageUploadUrl")
|
35
43
|
options[:allowedExtensions] = Ckeditor.image_file_types
|
36
44
|
when "flash" then
|
37
|
-
options[:action] = "
|
45
|
+
options[:action] = JavascriptCode.new("EDITOR.config.filebrowserFlashUploadUrl")
|
38
46
|
options[:allowedExtensions] = ["swf"]
|
39
47
|
else
|
40
|
-
options[:action] = "
|
48
|
+
options[:action] = JavascriptCode.new("EDITOR.config.filebrowserUploadUrl")
|
41
49
|
options[:allowedExtensions] = Ckeditor.attachment_file_types
|
42
50
|
end
|
43
51
|
|
44
|
-
js_options =
|
45
|
-
|
46
|
-
"$(document).ready(function(){ new qq.FileUploaderInput({ #{js_options} }); });".html_safe
|
47
|
-
end
|
48
|
-
|
49
|
-
def applay_options(options)
|
50
|
-
str = []
|
51
|
-
|
52
|
-
options.each do |key, value|
|
53
|
-
item = case value
|
54
|
-
when String then
|
55
|
-
value.split(//).first == '^' ? value.slice(1..-1) : "'#{value}'"
|
56
|
-
when Hash then
|
57
|
-
"{ #{applay_options(value)} }"
|
58
|
-
when Array then
|
59
|
-
arr = value.collect { |v| "'#{v}'" }
|
60
|
-
"[ #{arr.join(',')} ]"
|
61
|
-
else value
|
62
|
-
end
|
63
|
-
|
64
|
-
str << %Q{"#{key}": #{item}}
|
65
|
-
end
|
52
|
+
js_options = ActiveSupport::JSON.encode(options)
|
66
53
|
|
67
|
-
|
54
|
+
"$(document).ready(function(){ new qq.FileUploaderInput(#{js_options}); });".html_safe
|
68
55
|
end
|
69
56
|
|
70
57
|
def filethumb(filename)
|
data/lib/ckeditor/version.rb
CHANGED
@@ -13,7 +13,7 @@ module Ckeditor
|
|
13
13
|
:desc => "Backend processor for upload support"
|
14
14
|
|
15
15
|
class_option :backend, :type => :string, :default => 'paperclip',
|
16
|
-
:desc => "
|
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'))
|
@@ -26,6 +26,10 @@ module Ckeditor
|
|
26
26
|
# copy configuration
|
27
27
|
def copy_initializer
|
28
28
|
template "ckeditor.rb", "config/initializers/ckeditor.rb"
|
29
|
+
|
30
|
+
if backend == "dragonfly"
|
31
|
+
template File.join("base", "dragonfly", "initializer.rb"), "config/initializers/ckeditor_dragonfly.rb"
|
32
|
+
end
|
29
33
|
end
|
30
34
|
|
31
35
|
def mount_engine
|
@@ -10,8 +10,8 @@ class CreateCkeditorAssets < ActiveRecord::Migration
|
|
10
10
|
t.string :type, :limit => 30
|
11
11
|
|
12
12
|
# Uncomment it to save images dimensions, if your need it
|
13
|
-
|
14
|
-
|
13
|
+
t.integer :width
|
14
|
+
t.integer :height
|
15
15
|
|
16
16
|
t.timestamps
|
17
17
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class Ckeditor::Picture < Ckeditor::Asset
|
2
|
+
validates_property :format, :of => :data, :in => image_file_types unless image_file_types.empty?
|
3
|
+
validates_property :image?, :of => :data, :as => true, :message => :invalid
|
4
|
+
|
5
|
+
def url_content
|
6
|
+
data.thumb("800x800>").url
|
7
|
+
end
|
8
|
+
|
9
|
+
def url_thumb
|
10
|
+
data.thumb("118x100#").url(url_thumb_options)
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CreateCkeditorAssets < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :ckeditor_assets do |t|
|
4
|
+
t.string :data_uid, :null => false
|
5
|
+
t.string :data_name, :null => false
|
6
|
+
t.string :data_mime_type
|
7
|
+
t.integer :data_size
|
8
|
+
|
9
|
+
t.integer :assetable_id
|
10
|
+
t.string :assetable_type, :limit => 30
|
11
|
+
t.string :type, :limit => 30
|
12
|
+
|
13
|
+
# Uncomment these to save image dimensions, if your need them.
|
14
|
+
t.integer :data_width
|
15
|
+
t.integer :data_height
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
|
20
|
+
add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type"
|
21
|
+
add_index "ckeditor_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable"
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.down
|
25
|
+
drop_table :ckeditor_assets
|
26
|
+
end
|
27
|
+
end
|