ckeditor 3.7.3 → 4.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +38 -91
- data/app/assets/javascripts/ckeditor/config.js +1 -5
- data/app/assets/javascripts/ckeditor/{init.js → init.js.erb} +1 -1
- data/app/controllers/ckeditor/application_controller.rb +2 -8
- data/app/controllers/ckeditor/attachment_files_controller.rb +5 -0
- data/app/controllers/ckeditor/pictures_controller.rb +5 -0
- data/app/views/ckeditor/shared/_asset.html.erb +4 -4
- data/lib/ckeditor.rb +72 -7
- data/lib/ckeditor/engine.rb +6 -5
- data/lib/ckeditor/helpers/controllers.rb +7 -3
- data/lib/ckeditor/helpers/form_helper.rb +6 -10
- data/lib/ckeditor/hooks/cancan.rb +46 -0
- data/lib/ckeditor/hooks/simple_form.rb +3 -0
- data/lib/ckeditor/orm/base.rb +4 -0
- data/lib/ckeditor/utils.rb +12 -7
- data/lib/ckeditor/version.rb +2 -2
- data/lib/generators/ckeditor/install_generator.rb +2 -2
- data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -2
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +4 -4
- data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +8 -8
- data/lib/generators/ckeditor/templates/ckeditor.rb +3 -0
- data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +1 -1
- data/test/dummy/app/views/posts/_form.html.erb +3 -3
- data/test/dummy/log/test.log +2843 -0
- data/test/functional/posts_controller_test.rb +3 -3
- data/test/tmp/config/initializers/ckeditor.rb +3 -0
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +12 -0
- data/vendor/assets/javascripts/ckeditor/{LICENSE.html → LICENSE.md} +26 -89
- data/vendor/assets/javascripts/ckeditor/README.md +39 -0
- data/vendor/assets/javascripts/ckeditor/build-config.js +158 -0
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +847 -152
- data/vendor/assets/javascripts/ckeditor/config.js +10 -11
- data/vendor/assets/javascripts/ckeditor/contents.css +72 -4
- data/vendor/assets/javascripts/ckeditor/lang/af.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ar.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/bg.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/bn.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/bs.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/da.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/de.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/el.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/en.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/eo.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/es.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/et.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/eu.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/fa.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/fo.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/fr.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/gl.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/gu.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/he.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/hi.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/hr.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/hu.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/is.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/it.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ka.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/km.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ko.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ku.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/lt.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/lv.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/mk.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/mn.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ms.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/no.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/pl.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/pt.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ro.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/sk.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/sl.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/sr.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/th.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/ug.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/uk.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/vi.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +2 -3
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +2 -3
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -7
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/{lang → dialogs/lang}/_translationstatus.txt +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +6 -6
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -7
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +13 -7
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -8
- data/vendor/assets/javascripts/ckeditor/{images → plugins/fakeobjects/images}/spacer.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +24 -10
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +23 -9
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +8 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +8 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +8 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +8 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +8 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +20 -9
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +8 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +10 -6
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +10 -7
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +41 -13
- data/vendor/assets/javascripts/ckeditor/{skins/kama → plugins/image}/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +8 -6
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +36 -12
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -7
- data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +30 -11
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +10 -7
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/{lang → dialogs/lang}/_translationstatus.txt +0 -2
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ca.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/et.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fa.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -7
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +20 -9
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -8
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +84 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +10 -7
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -6
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog.css +1 -6
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog_opera.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/editor.css +1 -9
- data/vendor/assets/javascripts/ckeditor/skins/kama/editor_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/editor_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/editor_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/editor_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/readme.md +40 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_opera.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/mini.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +51 -0
- data/vendor/assets/javascripts/ckeditor/styles.js +112 -0
- metadata +113 -221
- data/app/assets/javascripts/ckeditor/plugins/attachment/dialogs/attachment.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/attachment/images/attachment.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/attachment/lang/en.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/attachment/lang/ru.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/attachment/lang/uk.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/attachment/plugin.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/embed/dialogs/embed.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/embed/images/embed.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/embed/lang/el.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/embed/lang/en.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/embed/lang/ru.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/embed/lang/uk.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/embed/plugin.js +0 -1
- data/vendor/assets/javascripts/ckeditor/CHANGES.html +0 -1548
- data/vendor/assets/javascripts/ckeditor/INSTALL.html +0 -92
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +0 -6
- data/vendor/assets/javascripts/ckeditor/ckeditor.pack +0 -211
- data/vendor/assets/javascripts/ckeditor/ckeditor_basic.js +0 -8
- data/vendor/assets/javascripts/ckeditor/ckeditor_basic_source.js +0 -20
- data/vendor/assets/javascripts/ckeditor/ckeditor_source.js +0 -35
- data/vendor/assets/javascripts/ckeditor/lang/_languages.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/_translationstatus.txt +0 -64
- data/vendor/assets/javascripts/ckeditor/lang/id.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/cs.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/cy.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/da.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/de.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/el.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/eo.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/fa.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/fi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/fr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/gu.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/it.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/mk.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/nb.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/nl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/no.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/pt-br.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/ro.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/tr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/ug.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/vi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/zh-cn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/ajax/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/_translationstatus.txt +0 -28
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/bg.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/cs.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/cy.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/da.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/de.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/el.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/eo.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/et.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/fa.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/fi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/fr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/gu.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/hr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/it.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/nb.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/nl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/no.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/pl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/pt-br.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/tr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/ug.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/uk.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/vi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/zh-cn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/_translationstatus.txt +0 -27
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/bg.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/cs.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/cy.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/da.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/de.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/el.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/eo.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/et.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/fa.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/fi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/fr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/hr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/it.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/nb.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/nl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/no.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/pl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/pt-br.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/tr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/ug.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/uk.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/vi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/zh-cn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/placeholder.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/cs.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/cy.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/de.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/el.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/eo.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/et.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/fa.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/fi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/fr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/hr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/it.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/nb.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/nl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/no.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/pt-br.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/tr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/ug.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/zh-cn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/styles/styles/default.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/_translationstatus.txt +0 -28
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/bg.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/cs.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/cy.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/da.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/de.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/el.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/eo.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/et.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/fa.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/fi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/fr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/hr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/it.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/mk.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/nb.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/nl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/no.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/pl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/pt-br.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/tr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/ug.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/uk.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/vi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/zh-cn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/uicolor.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +0 -76
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -49
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -52
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/xml/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/skin.js +0 -7
- data/vendor/assets/javascripts/ckeditor/skins/kama/templates.css +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/office2003/dialog.css +0 -10
- data/vendor/assets/javascripts/ckeditor/skins/office2003/editor.css +0 -14
- data/vendor/assets/javascripts/ckeditor/skins/office2003/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/icons_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/mini.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/sprites.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/skin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/office2003/templates.css +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/v2/dialog.css +0 -9
- data/vendor/assets/javascripts/ckeditor/skins/v2/editor.css +0 -13
- data/vendor/assets/javascripts/ckeditor/skins/v2/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/icons_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/mini.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/sprites.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/skin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/v2/templates.css +0 -6
- data/vendor/assets/javascripts/ckeditor/themes/default/theme.js +0 -8
data/README.rdoc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
= Ckeditor
|
2
2
|
|
3
|
-
CKEditor is a text editor to
|
4
|
-
the results users have when publishing it. It brings to the web common editing features found on desktop editing applications like Microsoft Word and OpenOffice.
|
3
|
+
CKEditor is a ready-for-use HTML text editor designed to simplify web content creation. It's a WYSIWYG editor that brings common word processor features directly to your web pages. Enhance your website experience with our community maintained editor. http://ckeditor.com/
|
5
4
|
|
6
5
|
== Features
|
7
6
|
|
@@ -9,20 +8,20 @@ the results users have when publishing it. It brings to the web common editing f
|
|
9
8
|
* Files browser
|
10
9
|
* HTML5 files uploader
|
11
10
|
* Hooks for formtastic and simple_form forms generators
|
12
|
-
* Extra plugins: attachment and embed.
|
13
|
-
* Assets pagination (under construction)
|
14
11
|
|
15
|
-
==
|
12
|
+
== Installation
|
16
13
|
|
17
|
-
|
14
|
+
For basic usage just include ckeditor gem:
|
18
15
|
|
19
|
-
gem "ckeditor"
|
16
|
+
gem "ckeditor"
|
20
17
|
|
21
|
-
|
18
|
+
For files uploading support you need generage models for file storage.
|
19
|
+
Currently supported next backends:
|
22
20
|
|
23
|
-
|
21
|
+
* ActiveRecord (paperclip, carrierwave, dragonfly)
|
22
|
+
* Mongoid (paperclip, carrierwave, dragonfly)
|
24
23
|
|
25
|
-
===
|
24
|
+
=== How generate models for store uploading files
|
26
25
|
|
27
26
|
==== ActiveRecord + paperclip
|
28
27
|
|
@@ -52,65 +51,41 @@ For active_record orm is used paperclip gem (it's by default).
|
|
52
51
|
|
53
52
|
rails generate ckeditor:install --orm=mongoid --backend=carrierwave
|
54
53
|
|
55
|
-
|
56
|
-
* active_record
|
57
|
-
* mongoid (Thanks Dmitry Lihachev https://github.com/lda)
|
58
|
-
* mongo_mapper (under construction)
|
59
|
-
|
60
|
-
|
54
|
+
All ckeditor models will be generated into app/models/ckeditor folder.
|
61
55
|
Autoload ckeditor models folder (application.rb):
|
62
56
|
|
63
57
|
config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
|
64
58
|
|
65
|
-
== Usage
|
66
|
-
|
67
59
|
Mount engine in your routes (config/routes.rb):
|
68
60
|
|
69
61
|
mount Ckeditor::Engine => "/ckeditor"
|
70
62
|
|
71
|
-
|
72
|
-
|
73
|
-
config.assets.precompile += Ckeditor.assets
|
63
|
+
== Usage
|
74
64
|
|
75
|
-
Include ckeditor javascripts rails 3.2:
|
65
|
+
Include ckeditor javascripts rails 3.2 (application.js):
|
76
66
|
|
77
67
|
//= require ckeditor/init
|
78
68
|
|
79
|
-
or
|
80
|
-
|
81
|
-
<%= javascript_include_tag "ckeditor/init" %>
|
82
|
-
|
83
|
-
|
84
|
-
Rails <= 3.0:
|
85
|
-
|
86
|
-
<%= javascript_include_tag :ckeditor %>
|
87
|
-
|
88
69
|
Form helpers:
|
89
70
|
|
90
|
-
|
71
|
+
<%= form_for @page do |form| -%>
|
72
|
+
...
|
73
|
+
<%= form.cktext_area :notes, :class => "someclass", :ckeditor => {:language => "uk"} %>
|
74
|
+
...
|
75
|
+
<%= form.cktext_area :content, :value => "Default value", :id => "sometext" %>
|
76
|
+
...
|
77
|
+
<%= cktext_area :page, :info, :ckeditor => {:uiColor => "#AADC6E", :toolbar => "mini"} %>
|
78
|
+
...
|
79
|
+
<% end -%>
|
80
|
+
|
91
81
|
|
92
|
-
|
93
|
-
|
94
|
-
* input_html - Options for text_area tag, others for ckeditor javascript configuration.
|
95
|
-
* language - appends automatically, by default it's I18n.locale
|
96
|
-
* available ckeditor options - http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
|
82
|
+
All ckeditor 4.0 options here http://docs.ckeditor.com/#!/api/CKEDITOR.config
|
97
83
|
|
98
84
|
In order to configure the ckeditor default options, create files:
|
99
85
|
|
100
86
|
app/assets/javascripts/ckeditor/config.js
|
101
87
|
|
102
88
|
app/assets/javascripts/ckeditor/contents.css
|
103
|
-
|
104
|
-
Here's a FormBuilder helper example:
|
105
|
-
|
106
|
-
<%= form_for @page do |form| -%>
|
107
|
-
...
|
108
|
-
<%= form.cktext_area :notes, :toolbar => 'Full', :width => 800, :height => 400 %>
|
109
|
-
...
|
110
|
-
<%= form.cktext_area :content, :input_html => { :value => "Default value" } %>
|
111
|
-
...
|
112
|
-
<%= cktext_area :page, :info %>
|
113
|
-
<% end -%>
|
114
89
|
|
115
90
|
=== AJAX
|
116
91
|
|
@@ -129,61 +104,33 @@ jQuery sample:
|
|
129
104
|
=== Formtastic integration
|
130
105
|
|
131
106
|
<%= form.input :content, :as => :ckeditor %>
|
132
|
-
<%= form.input :content, :as => :ckeditor, :input_html => { :height => 400 } %>
|
107
|
+
<%= form.input :content, :as => :ckeditor, :input_html => { :ckeditor => { :height => 400 } } %>
|
133
108
|
|
134
109
|
=== SimpleForm integration
|
135
110
|
|
136
|
-
<%= form.input :content, :as => :ckeditor, :
|
111
|
+
<%= form.input :content, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Full'} } %>
|
137
112
|
|
138
|
-
===
|
113
|
+
=== CanCan integration
|
139
114
|
|
140
|
-
|
115
|
+
To use cancan with Ckeditor, add this to an initializer.
|
141
116
|
|
142
|
-
|
143
|
-
|
144
|
-
protected
|
145
|
-
|
146
|
-
def ckeditor_filebrowser_scope(options = {})
|
147
|
-
super({ :assetable_id => current_user.id, :assetable_type => 'User' }.merge(options))
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
If you want to filter only pictures or attachment_files - redefine methods "ckeditor_pictures_scope" or "ckeditor_attachment_files_scope" respectively.
|
152
|
-
By default, both these methods call "ckeditor_filebrowser_scope" method:
|
117
|
+
# in config/initializers/ckeditor.rb
|
153
118
|
|
154
|
-
|
155
|
-
|
156
|
-
protected
|
157
|
-
|
158
|
-
def ckeditor_pictures_scope(options = {})
|
159
|
-
ckeditor_filebrowser_scope(options)
|
160
|
-
end
|
161
|
-
|
162
|
-
def ckeditor_attachment_files_scope(options = {})
|
163
|
-
ckeditor_filebrowser_scope(options)
|
164
|
-
end
|
119
|
+
Ckeditor.setup do |config|
|
120
|
+
config.authorize_with :cancan
|
165
121
|
end
|
166
122
|
|
167
|
-
|
168
|
-
|
169
|
-
class ApplicationController < ActionController::Base
|
123
|
+
At this point, all authorization will fail and no one will be able to access the filebrowser pages.
|
124
|
+
To grant access, add this to Ability#initialize
|
170
125
|
|
171
|
-
|
172
|
-
|
173
|
-
# Cancan example
|
174
|
-
def ckeditor_authenticate
|
175
|
-
authorize! action_name, @asset
|
176
|
-
end
|
177
|
-
|
178
|
-
# Set current_user as assetable
|
179
|
-
def ckeditor_before_create_asset(asset)
|
180
|
-
asset.assetable = current_user
|
181
|
-
return true
|
182
|
-
end
|
183
|
-
end
|
126
|
+
# Always performed
|
127
|
+
can :access, :ckeditor # needed to access Ckeditor filebrowser
|
184
128
|
|
129
|
+
# Performed checks for actions:
|
130
|
+
can [:read, :create, :destroy], Ckeditor::Picture
|
131
|
+
can [:read, :create, :destroy], Ckeditor::AttachmentFile
|
185
132
|
|
186
|
-
== I18n
|
133
|
+
== I18n
|
187
134
|
|
188
135
|
en:
|
189
136
|
ckeditor:
|
@@ -90,10 +90,6 @@ CKEDITOR.editorConfig = function( config )
|
|
90
90
|
}
|
91
91
|
});
|
92
92
|
|
93
|
-
/* Extra plugins */
|
94
|
-
// works only with en, ru, uk locales
|
95
|
-
config.extraPlugins = "embed,attachment";
|
96
|
-
|
97
93
|
/* Toolbars */
|
98
94
|
config.toolbar = 'Easy';
|
99
95
|
|
@@ -105,7 +101,7 @@ CKEDITOR.editorConfig = function( config )
|
|
105
101
|
['Styles','Format'], ['Subscript', 'Superscript', 'TextColor'], ['Maximize','-','About'], '/',
|
106
102
|
['Bold','Italic','Underline','Strike'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
|
107
103
|
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
|
108
|
-
['Link','Unlink','Anchor'], ['Image', '
|
104
|
+
['Link','Unlink','Anchor'], ['Image', 'Flash'],
|
109
105
|
['Table','HorizontalRule','Smiley','SpecialChar','PageBreak']
|
110
106
|
];
|
111
107
|
};
|
@@ -3,6 +3,6 @@
|
|
3
3
|
|
4
4
|
(function() {
|
5
5
|
if (typeof window['CKEDITOR_BASEPATH'] === "undefined" || window['CKEDITOR_BASEPATH'] === null) {
|
6
|
-
window['CKEDITOR_BASEPATH'] = "
|
6
|
+
window['CKEDITOR_BASEPATH'] = "<%= config.relative_url_root %>/assets/ckeditor/";
|
7
7
|
}
|
8
8
|
}).call(this);
|
@@ -1,18 +1,12 @@
|
|
1
1
|
class Ckeditor::ApplicationController < ::ApplicationController
|
2
2
|
respond_to :html, :json
|
3
3
|
|
4
|
-
before_filter :set_locale
|
5
4
|
before_filter :find_asset, :only => [:destroy]
|
6
|
-
before_filter :
|
5
|
+
before_filter :ckeditor_authorize!
|
6
|
+
before_filter :authorize_resource
|
7
7
|
|
8
8
|
protected
|
9
9
|
|
10
|
-
def set_locale
|
11
|
-
if !params[:langCode].blank? && I18n.available_locales.include?(params[:langCode].to_sym)
|
12
|
-
I18n.locale = params[:langCode]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
10
|
def respond_with_asset(asset)
|
17
11
|
file = params[:CKEditor].blank? ? params[:qqfile] : params[:upload]
|
18
12
|
asset.data = Ckeditor::Http.normalize_param(file, request)
|
@@ -20,4 +20,9 @@ class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController
|
|
20
20
|
def find_asset
|
21
21
|
@attachment = Ckeditor.attachment_file_model.get!(params[:id])
|
22
22
|
end
|
23
|
+
|
24
|
+
def authorize_resource
|
25
|
+
model = (@attachment || Ckeditor::AttachmentFile)
|
26
|
+
@authorization_adapter.try(:authorize, params[:action], model)
|
27
|
+
end
|
23
28
|
end
|
@@ -20,4 +20,9 @@ class Ckeditor::PicturesController < Ckeditor::ApplicationController
|
|
20
20
|
def find_asset
|
21
21
|
@picture = Ckeditor.picture_model.get!(params[:id])
|
22
22
|
end
|
23
|
+
|
24
|
+
def authorize_resource
|
25
|
+
model = (@picture || Ckeditor::Picture)
|
26
|
+
@authorization_adapter.try(:authorize, params[:action], model)
|
27
|
+
end
|
23
28
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<%= content_tag(:div, :id => dom_id(asset), :class => "gal-item", :"data-url" => asset.url_content) do %>
|
2
|
-
<%= link_to image_tag("/assets/ckeditor/filebrowser/images/gal_del.png",
|
3
|
-
:title => I18n.t('ckeditor.buttons.delete')),
|
4
|
-
polymorphic_path(asset, :format => :json),
|
1
|
+
<%= content_tag(:div, :id => dom_id(asset), :class => "gal-item", :"data-url" => image_path(asset.url_content)) do %>
|
2
|
+
<%= link_to image_tag("/assets/ckeditor/filebrowser/images/gal_del.png",
|
3
|
+
:title => I18n.t('ckeditor.buttons.delete')),
|
4
|
+
polymorphic_path(asset, :format => :json),
|
5
5
|
:remote => true,
|
6
6
|
:method => :delete,
|
7
7
|
:confirm => t('ckeditor.confirm_delete'),
|
data/lib/ckeditor.rb
CHANGED
@@ -2,8 +2,6 @@ require 'orm_adapter'
|
|
2
2
|
require 'pathname'
|
3
3
|
|
4
4
|
module Ckeditor
|
5
|
-
IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/pjpeg', 'image/tiff', 'image/x-png']
|
6
|
-
|
7
5
|
autoload :Utils, 'ckeditor/utils'
|
8
6
|
autoload :Http, 'ckeditor/http'
|
9
7
|
|
@@ -16,6 +14,7 @@ module Ckeditor
|
|
16
14
|
|
17
15
|
module Hooks
|
18
16
|
autoload :SimpleFormBuilder, 'ckeditor/hooks/simple_form'
|
17
|
+
autoload :CanCanAuthorization, 'ckeditor/hooks/cancan'
|
19
18
|
end
|
20
19
|
|
21
20
|
module Backend
|
@@ -23,6 +22,16 @@ module Ckeditor
|
|
23
22
|
autoload :CarrierWave, 'ckeditor/backend/carrierwave'
|
24
23
|
autoload :Dragonfly, 'ckeditor/backend/dragonfly'
|
25
24
|
end
|
25
|
+
|
26
|
+
IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/pjpeg', 'image/tiff', 'image/x-png']
|
27
|
+
|
28
|
+
DEFAULT_AUTHORIZE = Proc.new {}
|
29
|
+
|
30
|
+
AUTHORIZATION_ADAPTERS = {}
|
31
|
+
|
32
|
+
DEFAULT_CURRENT_USER = Proc.new do
|
33
|
+
request.env["warden"].try(:user) || respond_to?(:current_user) && current_user
|
34
|
+
end
|
26
35
|
|
27
36
|
# Allowed image file types for upload.
|
28
37
|
# Set to nil or [] (empty array) for all file types
|
@@ -48,19 +57,24 @@ module Ckeditor
|
|
48
57
|
|
49
58
|
# Default way to setup Ckeditor. Run rails generate ckeditor to create
|
50
59
|
# a fresh initializer with all configuration values.
|
60
|
+
#
|
61
|
+
# @example
|
62
|
+
# Ckeditor.setup do |config|
|
63
|
+
# config.parameterize_filenames = false
|
64
|
+
# config.attachment_file_types += ["xml"]
|
65
|
+
# end
|
66
|
+
#
|
51
67
|
def self.setup
|
52
68
|
yield self
|
53
69
|
end
|
54
70
|
|
55
71
|
def self.root_path
|
56
|
-
@root_path ||= Pathname.new(
|
72
|
+
@root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
|
57
73
|
end
|
58
74
|
|
75
|
+
# All css and js files from ckeditor folder
|
59
76
|
def self.assets
|
60
|
-
@@assets ||=
|
61
|
-
Utils.select_assets("vendor/assets/javascripts/ckeditor", "vendor/assets/javascripts") +
|
62
|
-
Utils.select_assets("app/assets/javascripts/ckeditor/plugins", "app/assets/javascripts")
|
63
|
-
end
|
77
|
+
@@assets ||= Utils.select_assets("ckeditor", "vendor/assets/javascripts") << "ckeditor/init.js"
|
64
78
|
end
|
65
79
|
|
66
80
|
def self.picture_model
|
@@ -70,6 +84,57 @@ module Ckeditor
|
|
70
84
|
def self.attachment_file_model
|
71
85
|
Ckeditor::AttachmentFile.to_adapter
|
72
86
|
end
|
87
|
+
|
88
|
+
# Setup authorization to be run as a before filter
|
89
|
+
# This is run inside the controller instance so you can setup any authorization you need to.
|
90
|
+
#
|
91
|
+
# By default, there is no authorization.
|
92
|
+
#
|
93
|
+
# @example Custom
|
94
|
+
# Ckeditor.setup do |config|
|
95
|
+
# config.authorize_with do
|
96
|
+
# redirect_to root_path unless warden.user.is_admin?
|
97
|
+
# end
|
98
|
+
# end
|
99
|
+
#
|
100
|
+
# To use an authorization adapter, pass the name of the adapter. For example,
|
101
|
+
# to use with CanCan[https://github.com/ryanb/cancan], pass it like this.
|
102
|
+
#
|
103
|
+
# @example CanCan
|
104
|
+
# Ckeditor.setup do |config|
|
105
|
+
# config.authorize_with :cancan
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
def self.authorize_with(*args, &block)
|
109
|
+
extension = args.shift
|
110
|
+
|
111
|
+
if extension
|
112
|
+
@authorize = Proc.new {
|
113
|
+
@authorization_adapter = Ckeditor::AUTHORIZATION_ADAPTERS[extension].new(*([self] + args).compact)
|
114
|
+
}
|
115
|
+
else
|
116
|
+
@authorize = block if block
|
117
|
+
end
|
118
|
+
|
119
|
+
@authorize || DEFAULT_AUTHORIZE
|
120
|
+
end
|
121
|
+
|
122
|
+
# Setup a different method to determine the current user or admin logged in.
|
123
|
+
# This is run inside the controller instance and made available as a helper.
|
124
|
+
#
|
125
|
+
# By default, request.env["warden"].user or current_user will be used.
|
126
|
+
#
|
127
|
+
# @example Custom
|
128
|
+
# Ckeditor.setup do |config|
|
129
|
+
# config.current_user_method do
|
130
|
+
# current_account
|
131
|
+
# end
|
132
|
+
# end
|
133
|
+
#
|
134
|
+
def self.current_user_method(&block)
|
135
|
+
@current_user = block if block
|
136
|
+
@current_user || DEFAULT_CURRENT_USER
|
137
|
+
end
|
73
138
|
end
|
74
139
|
|
75
140
|
require 'ckeditor/engine'
|
data/lib/ckeditor/engine.rb
CHANGED
@@ -5,9 +5,7 @@ module Ckeditor
|
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
isolate_namespace Ckeditor
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
initializer "ckeditor.assets_precompile", :group => :assets do |app|
|
8
|
+
initializer "ckeditor.assets_precompile", :group => :all do |app|
|
11
9
|
app.config.assets.precompile += Ckeditor.assets
|
12
10
|
end
|
13
11
|
|
@@ -24,14 +22,17 @@ module Ckeditor
|
|
24
22
|
end
|
25
23
|
|
26
24
|
initializer "ckeditor.hooks" do
|
27
|
-
|
28
|
-
if Object.const_defined?("Formtastic") && Formtastic.const_defined?("Inputs")
|
25
|
+
if Object.const_defined?("Formtastic")
|
29
26
|
require "ckeditor/hooks/formtastic"
|
30
27
|
end
|
31
28
|
|
32
29
|
if Object.const_defined?("SimpleForm")
|
33
30
|
require "ckeditor/hooks/simple_form"
|
34
31
|
end
|
32
|
+
|
33
|
+
if Object.const_defined?("CanCan")
|
34
|
+
require "ckeditor/hooks/cancan"
|
35
|
+
end
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
@@ -5,12 +5,16 @@ module Ckeditor
|
|
5
5
|
|
6
6
|
protected
|
7
7
|
|
8
|
-
def
|
9
|
-
|
8
|
+
def ckeditor_current_user
|
9
|
+
instance_eval &Ckeditor.current_user_method
|
10
|
+
end
|
11
|
+
|
12
|
+
def ckeditor_authorize!
|
13
|
+
instance_eval &Ckeditor.authorize_with
|
10
14
|
end
|
11
15
|
|
12
16
|
def ckeditor_before_create_asset(asset)
|
13
|
-
asset.assetable =
|
17
|
+
asset.assetable = ckeditor_current_user
|
14
18
|
return true
|
15
19
|
end
|
16
20
|
|