st-rich 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +289 -0
- data/Rakefile +39 -0
- data/app/assets/images/rich/document-thumb.png +0 -0
- data/app/assets/images/rich/files.png +0 -0
- data/app/assets/images/rich/images.png +0 -0
- data/app/assets/images/rich/insert-many.png +0 -0
- data/app/assets/images/rich/insert-one.png +0 -0
- data/app/assets/images/rich/loading.png +0 -0
- data/app/assets/images/rich/menu-dash.png +0 -0
- data/app/assets/images/rich/plus-red.png +0 -0
- data/app/assets/images/rich/plus.png +0 -0
- data/app/assets/images/rich/rich.png +0 -0
- data/app/assets/images/rich/view-grid.png +0 -0
- data/app/assets/images/rich/view-list.png +0 -0
- data/app/assets/images/rich/x-red.png +0 -0
- data/app/assets/javascripts/rich/application.js +12 -0
- data/app/assets/javascripts/rich/base.js.erb +5 -0
- data/app/assets/javascripts/rich/browser/extensions.js +15 -0
- data/app/assets/javascripts/rich/browser/filebrowser.js +186 -0
- data/app/assets/javascripts/rich/browser/uploader.js +68 -0
- data/app/assets/javascripts/rich/editor/ckeditor_path.js.erb +1 -0
- data/app/assets/javascripts/rich/editor/rich_editor.js.erb +14 -0
- data/app/assets/javascripts/rich/editor/rich_picker.js +45 -0
- data/app/assets/stylesheets/rich/application.css.scss +365 -0
- data/app/assets/stylesheets/rich/editor.css +20 -0
- data/app/assets/stylesheets/rich/files.css +4 -0
- data/app/assets/stylesheets/rich/mixins/reset.css.scss +58 -0
- data/app/controllers/rich/files_controller.rb +82 -0
- data/app/helpers/rich/application_helper.rb +4 -0
- data/app/helpers/rich/files_helper.rb +13 -0
- data/app/inputs/rich_input.rb +19 -0
- data/app/inputs/rich_picker_input.rb +88 -0
- data/app/models/rich/rich_file.rb +75 -0
- data/app/views/layouts/rich/application.html.erb +14 -0
- data/app/views/rails_admin/main/_form_rich_picker.html.haml +7 -0
- data/app/views/rails_admin/main/_form_rich_text.html.haml +7 -0
- data/app/views/rich/files/_file.html.erb +11 -0
- data/app/views/rich/files/destroy.js.erb +1 -0
- data/app/views/rich/files/index.html.erb +38 -0
- data/app/views/rich/files/index.js.erb +1 -0
- data/app/views/rich/files/show.html.erb +1 -0
- data/config/locales/en.yml +19 -0
- data/config/locales/fr.yml +14 -0
- data/config/locales/it.yml +19 -0
- data/config/locales/nl.yml +14 -0
- data/config/locales/ru.yml +19 -0
- data/config/locales/sv.yml +14 -0
- data/config/locales/zh-CN.yml +19 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20111002142937_create_rich_rich_images.rb +17 -0
- data/db/migrate/20111117202133_add_uri_cache_to_rich_image.rb +5 -0
- data/db/migrate/20111201095829_refactor_image_to_file.rb +12 -0
- data/lib/generators/rich/install/install_generator.rb +34 -0
- data/lib/generators/rich/install/templates/rich.js +1 -0
- data/lib/generators/rich/install/templates/rich.rb.erb +125 -0
- data/lib/rich.rb +195 -0
- data/lib/rich/authorize.rb +7 -0
- data/lib/rich/backends/carrierwave.rb +78 -0
- data/lib/rich/backends/paperclip.rb +79 -0
- data/lib/rich/backends/rich_file_uploader.rb +55 -0
- data/lib/rich/engine.rb +26 -0
- data/lib/rich/integrations/legacy_formtastic.rb +50 -0
- data/lib/rich/rails_admin/config/fields/types/rich_editor.rb +34 -0
- data/lib/rich/rails_admin/config/fields/types/rich_picker.rb +45 -0
- data/lib/rich/utils/file_size_validator.rb +68 -0
- data/lib/rich/version.rb +3 -0
- data/lib/tasks/rich_tasks.rake +24 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/admin/dashboards.rb +38 -0
- data/test/dummy/app/admin/posts.rb +11 -0
- data/test/dummy/app/assets/javascripts/active_admin.js +2 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/javascripts/posts.js +2 -0
- data/test/dummy/app/assets/javascripts/rich.js +1 -0
- data/test/dummy/app/assets/stylesheets/active_admin.css.scss +10 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/assets/stylesheets/posts.css +4 -0
- data/test/dummy/app/assets/stylesheets/rich/editor.css +20 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/posts_controller.rb +83 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/posts_helper.rb +2 -0
- data/test/dummy/app/models/admin_user.rb +9 -0
- data/test/dummy/app/models/post.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/posts/_form.html.erb +29 -0
- data/test/dummy/app/views/posts/_formtastic_form.html.erb +17 -0
- data/test/dummy/app/views/posts/edit.html.erb +6 -0
- data/test/dummy/app/views/posts/index.html.erb +27 -0
- data/test/dummy/app/views/posts/new.html.erb +5 -0
- data/test/dummy/app/views/posts/show.html.erb +20 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +48 -0
- data/test/dummy/config/boot.rb +19 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +32 -0
- data/test/dummy/config/environments/production.rb +62 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/active_admin.rb +101 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +211 -0
- data/test/dummy/config/initializers/formtastic.rb +80 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/rich.rb +29 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/devise.en.yml +58 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +13 -0
- data/test/dummy/db/migrate/20111001122048_create_posts.rb +12 -0
- data/test/dummy/db/migrate/20111003150957_create_rich_rich_images.rb +17 -0
- data/test/dummy/db/migrate/20111014123344_devise_create_admin_users.rb +31 -0
- data/test/dummy/db/migrate/20111014143348_create_admin_notes.rb +16 -0
- data/test/dummy/db/migrate/20111014143349_move_admin_notes_to_comments.rb +25 -0
- data/test/dummy/db/migrate/20111117202523_add_uri_cache_to_rich_image.rb +5 -0
- data/test/dummy/db/migrate/20111201102914_refactor_image_to_file.rb +12 -0
- data/test/dummy/db/schema.rb +58 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/admin_users.yml +11 -0
- data/test/dummy/test/fixtures/posts.yml +11 -0
- data/test/dummy/test/functional/posts_controller_test.rb +49 -0
- data/test/dummy/test/unit/admin_user_test.rb +7 -0
- data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/dummy/test/unit/post_test.rb +7 -0
- data/test/fixtures/rich/rich_images.yml +11 -0
- data/test/functional/rich/files_controller_test.rb +9 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/rich_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- data/test/unit/helpers/rich/files_helper_test.rb +6 -0
- data/test/unit/rich/rich_image_test.rb +9 -0
- data/vendor/assets/images/ckeditor/plugins/MediaEmbed/icons/mediaembed.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/MediaEmbed/images/icon.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/icons_hidpi.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/image/images/noimage.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/link/images/anchor.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/magicline/images/icon.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/maximize/icons/maximize.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/icons/hidpi/showblocks-rtl.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/icons/hidpi/showblocks.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/icons/showblocks-rtl.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/icons/showblocks.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/vendor/assets/images/ckeditor/plugins/widget/images/handle.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/icons.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/dialog_sides.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/dialog_sides.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/mini.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/noimage.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/sprites.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/sprites_ie6.png +0 -0
- data/vendor/assets/images/ckeditor/skins/BootstrapCK/images/toolbar_start.gif +0 -0
- data/vendor/assets/images/ckeditor/skins/moono/icons.png +0 -0
- data/vendor/assets/images/ckeditor/skins/moono/images/arrow.png +0 -0
- data/vendor/assets/images/ckeditor/skins/moono/images/close.png +0 -0
- data/vendor/assets/images/ckeditor/skins/moono/images/mini.png +0 -0
- data/vendor/assets/javascripts/ckeditor/build-config.js +102 -0
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +926 -0
- data/vendor/assets/javascripts/ckeditor/config.js +10 -0
- data/vendor/assets/javascripts/ckeditor/lang/af.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ar.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/bg.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/bn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/bs.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/da.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/de.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/el.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/en.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/eo.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/es.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/et.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/eu.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fa.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fo.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/fr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/gl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/gu.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/he.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/hi.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/hr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/hu.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/id.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/is.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/it.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ka.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/km.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ko.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ku.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/lt.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/lv.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/mk.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/mn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ms.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/no.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/pl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/pt.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ro.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/si.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sk.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sl.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sq.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/th.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/tt.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ug.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/uk.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/vi.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/MediaEmbed/plugin.js +65 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en-gb.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr-ca.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gl.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/id.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ko.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/si.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sq.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr-latn.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tt.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +178 -0
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +3 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +3 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +4 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/foldcode/foldcode.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +2 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +188 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +187 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed.js +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/divarea/plugin.js +36 -0
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +24 -0
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +23 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +20 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineutils/plugin.js +933 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +26 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/af.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ar.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/bg.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/bn.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/bs.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ca.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/cs.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/cy.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/da.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/de.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/el.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/en-au.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/en-ca.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/en-gb.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/en.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/eo.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/es.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/et.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/eu.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/fa.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/fi.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/fo.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/fr-ca.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/fr.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/gl.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/gu.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/he.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/hi.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/hr.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/hu.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/is.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/it.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ja.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ka.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/km.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ko.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ku.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/lt.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/lv.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/mk.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/mn.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ms.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/nb.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/nl.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/no.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/pl.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/pt-br.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/pt.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ro.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ru.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/sk.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/sl.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/sr-latn.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/sr.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/sv.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/th.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/tr.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/ug.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/uk.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/vi.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/zh-cn.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/lang/zh.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/maximize/plugin.js +301 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
- data/vendor/assets/javascripts/ckeditor/plugins/richfile/plugin.js.erb +85 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +17 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/af.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ar.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/bg.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/bn.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/bs.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ca.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/cs.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/cy.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/da.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/de.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/el.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/en-au.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/en-ca.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/en-gb.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/en.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/eo.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/es.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/et.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/eu.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/fa.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/fi.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/fo.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/fr-ca.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/fr.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/gl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/gu.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/he.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/hi.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/hr.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/hu.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/id.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/is.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/it.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ja.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ka.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/km.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ko.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ku.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/lt.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/lv.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/mk.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/mn.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ms.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/nb.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/nl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/no.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/pl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/pt-br.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/pt.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ro.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ru.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/si.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/sk.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/sl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/sq.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/sr-latn.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/sr.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/sv.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/th.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/tr.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/tt.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/ug.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/uk.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/vi.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/zh-cn.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/lang/zh.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/plugin.js +153 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ar.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/bg.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ca.js +14 -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-gb.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/es.js +13 -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 +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr-ca.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/gl.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hu.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/id.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/ja.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/km.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -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/pl.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/si.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sl.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sq.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/th.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/tt.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/uk.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/vi.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/af.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ar.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/bg.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/bn.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/bs.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ca.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/cs.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/cy.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/da.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/de.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/el.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/en-au.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/en-ca.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/en-gb.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/en.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/eo.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/es.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/et.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/eu.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/fa.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/fi.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/fo.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/fr-ca.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/fr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/gl.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/gu.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/he.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/hi.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/hr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/hu.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/is.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/it.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ja.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ka.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/km.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ko.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ku.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/lt.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/lv.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/mk.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/mn.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ms.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/nb.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/nl.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/no.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/pl.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/pt-br.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/pt.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ro.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ru.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/sk.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/sl.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/sr-latn.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/sr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/sv.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/th.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/tr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/ug.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/uk.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/vi.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/zh-cn.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/lang/zh.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylescombo/plugin.js +186 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +152 -0
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +17 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/dev/console.js +129 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/dev/contents.css +23 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/dev/widgetstyles.html +145 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/ar.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/ca.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/cs.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/cy.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/de.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/el.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/en-gb.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/en.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/eo.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/es.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/fa.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/fi.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/fr.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/gl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/he.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/hr.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/hu.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/it.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/ja.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/km.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/ko.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/nb.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/nl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/no.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/pl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/pt-br.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/pt.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/ru.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/sl.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/sv.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/tt.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/uk.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/vi.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/zh-cn.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/lang/zh.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/widget/plugin.js +3684 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +66 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +74 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc_ie.js +11 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/README.md +26 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/dialog.css +616 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/editor.css +1088 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/dialog_sides.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/dialog_sides.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/mini.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/sprites.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/sprites_ie6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/images/toolbar_start.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/skin.js +7 -0
- data/vendor/assets/javascripts/ckeditor/skins/BootstrapCK/templates.css +54 -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_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +51 -0
- data/vendor/assets/javascripts/ckeditor/styles.js +111 -0
- data/vendor/assets/javascripts/fileuploader.js +1247 -0
- data/vendor/assets/stylesheets/ckeditor/contents.css +99 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +74 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/css/codemirror.css +245 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +6 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/ambiance.css +76 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/blackboard.css +25 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/cobalt.css +18 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/eclipse.css +25 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/elegant.css +10 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/erlang-dark.css +21 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/lesser-dark.css +44 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/monokai.css +28 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/neat.css +9 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/night.css +21 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/rubyblue.css +21 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/solarized.css +207 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/twilight.css +25 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/vibrant-ink.css +27 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/codemirror/theme/xq-dark.css +46 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/templates/dialogs/templates.css +84 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/widget/dev/contents.css +23 -0
- data/vendor/assets/stylesheets/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
- data/vendor/assets/stylesheets/ckeditor/skins/BootstrapCK/dialog.css +616 -0
- data/vendor/assets/stylesheets/ckeditor/skins/BootstrapCK/editor.css +1088 -0
- data/vendor/assets/stylesheets/ckeditor/skins/BootstrapCK/templates.css +54 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie7.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie8.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_iequirks.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_opera.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_gecko.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie7.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie8.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_iequirks.css +5 -0
- metadata +955 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
CKEDITOR.dialog.add("select",function(c){function h(a,b,e,d,c){a=f(a);d=d?d.createElement("OPTION"):document.createElement("OPTION");if(a&&d&&"option"==d.getName())CKEDITOR.env.ie?(isNaN(parseInt(c,10))?a.$.options.add(d.$):a.$.options.add(d.$,c),d.$.innerHTML=0<b.length?b:"",d.$.value=e):(null!==c&&c<a.getChildCount()?a.getChild(0>c?0:c).insertBeforeMe(d):a.append(d),d.setText(0<b.length?b:""),d.setValue(e));else return!1;return d}function m(a){for(var a=f(a),b=g(a),e=a.getChildren().count()-1;0<=
|
|
6
|
+
e;e--)a.getChild(e).$.selected&&a.getChild(e).remove();i(a,b)}function n(a,b,e,d){a=f(a);if(0>b)return!1;a=a.getChild(b);a.setText(e);a.setValue(d);return a}function k(a){for(a=f(a);a.getChild(0)&&a.getChild(0).remove(););}function j(a,b,e){var a=f(a),d=g(a);if(0>d)return!1;b=d+b;b=0>b?0:b;b=b>=a.getChildCount()?a.getChildCount()-1:b;if(d==b)return!1;var d=a.getChild(d),c=d.getText(),o=d.getValue();d.remove();d=h(a,c,o,!e?null:e,b);i(a,b);return d}function g(a){return(a=f(a))?a.$.selectedIndex:-1}
|
|
7
|
+
function i(a,b){a=f(a);if(0>b)return null;var e=a.getChildren().count();a.$.selectedIndex=b>=e?e-1:b;return a}function l(a){return(a=f(a))?a.getChildren():!1}function f(a){return a&&a.domId&&a.getInputElement().$?a.getInputElement():a&&a.$?a:!1}return{title:c.lang.forms.select.title,minWidth:CKEDITOR.env.ie?460:395,minHeight:CKEDITOR.env.ie?320:300,onShow:function(){delete this.selectBox;this.setupContent("clear");var a=this.getParentEditor().getSelection().getSelectedElement();if(a&&"select"==a.getName()){this.selectBox=
|
|
8
|
+
a;this.setupContent(a.getName(),a);for(var a=l(a),b=0;b<a.count();b++)this.setupContent("option",a.getItem(b))}},onOk:function(){var a=this.getParentEditor(),b=this.selectBox,e=!b;e&&(b=a.document.createElement("select"));this.commitContent(b);if(e&&(a.insertElement(b),CKEDITOR.env.ie)){var d=a.getSelection(),c=d.createBookmarks();setTimeout(function(){d.selectBookmarks(c)},0)}},contents:[{id:"info",label:c.lang.forms.select.selectInfo,title:c.lang.forms.select.selectInfo,accessKey:"",elements:[{id:"txtName",
|
|
9
|
+
type:"text",widths:["25%","75%"],labelLayout:"horizontal",label:c.lang.common.name,"default":"",accessKey:"N",style:"width:350px",setup:function(a,b){"clear"==a?this.setValue(this["default"]||""):"select"==a&&this.setValue(b.data("cke-saved-name")||b.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"txtValue",type:"text",widths:["25%","75%"],labelLayout:"horizontal",label:c.lang.forms.select.value,
|
|
10
|
+
style:"width:350px","default":"",className:"cke_disabled",onLoad:function(){this.getInputElement().setAttribute("readOnly",!0)},setup:function(a,b){"clear"==a?this.setValue(""):"option"==a&&b.getAttribute("selected")&&this.setValue(b.$.value)}},{type:"hbox",widths:["175px","170px"],children:[{id:"txtSize",type:"text",labelLayout:"horizontal",label:c.lang.forms.select.size,"default":"",accessKey:"S",style:"width:175px",validate:function(){var a=CKEDITOR.dialog.validate.integer(c.lang.common.validateNumberFailed);
|
|
11
|
+
return""===this.getValue()||a.apply(this)},setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("size")||"");CKEDITOR.env.webkit&&this.getInputElement().setStyle("width","86px")},commit:function(a){this.getValue()?a.setAttribute("size",this.getValue()):a.removeAttribute("size")}},{type:"html",html:"<span>"+CKEDITOR.tools.htmlEncode(c.lang.forms.select.lines)+"</span>"}]},{type:"html",html:"<span>"+CKEDITOR.tools.htmlEncode(c.lang.forms.select.opAvail)+"</span>"},{type:"hbox",widths:["115px",
|
|
12
|
+
"115px","100px"],children:[{type:"vbox",children:[{id:"txtOptName",type:"text",label:c.lang.forms.select.opText,style:"width:115px",setup:function(a){"clear"==a&&this.setValue("")}},{type:"select",id:"cmbName",label:"",title:"",size:5,style:"width:115px;height:75px",items:[],onChange:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbValue"),e=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue"),d=g(this);i(b,d);e.setValue(this.getValue());a.setValue(b.getValue())},
|
|
13
|
+
setup:function(a,b){"clear"==a?k(this):"option"==a&&h(this,b.getText(),b.getText(),this.getDialog().getParentEditor().document)},commit:function(a){var b=this.getDialog(),e=l(this),d=l(b.getContentElement("info","cmbValue")),c=b.getContentElement("info","txtValue").getValue();k(a);for(var f=0;f<e.count();f++){var g=h(a,e.getItem(f).getValue(),d.getItem(f).getValue(),b.getParentEditor().document);d.getItem(f).getValue()==c&&(g.setAttribute("selected","selected"),g.selected=!0)}}}]},{type:"vbox",children:[{id:"txtOptValue",
|
|
14
|
+
type:"text",label:c.lang.forms.select.opValue,style:"width:115px",setup:function(a){"clear"==a&&this.setValue("")}},{type:"select",id:"cmbValue",label:"",size:5,style:"width:115px;height:75px",items:[],onChange:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),e=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue"),d=g(this);i(b,d);e.setValue(b.getValue());a.setValue(this.getValue())},setup:function(a,b){if("clear"==a)k(this);else if("option"==
|
|
15
|
+
a){var e=b.getValue();h(this,e,e,this.getDialog().getParentEditor().document);"selected"==b.getAttribute("selected")&&this.getDialog().getContentElement("info","txtValue").setValue(e)}}}]},{type:"vbox",padding:5,children:[{type:"button",id:"btnAdd",style:"",label:c.lang.forms.select.btnAdd,title:c.lang.forms.select.btnAdd,style:"width:100%;",onClick:function(){var a=this.getDialog();a.getParentEditor();var b=a.getContentElement("info","txtOptName"),e=a.getContentElement("info","txtOptValue"),d=a.getContentElement("info",
|
|
16
|
+
"cmbName"),c=a.getContentElement("info","cmbValue");h(d,b.getValue(),b.getValue(),a.getParentEditor().document);h(c,e.getValue(),e.getValue(),a.getParentEditor().document);b.setValue("");e.setValue("")}},{type:"button",id:"btnModify",label:c.lang.forms.select.btnModify,title:c.lang.forms.select.btnModify,style:"width:100%;",onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","txtOptName"),e=a.getContentElement("info","txtOptValue"),d=a.getContentElement("info","cmbName"),a=a.getContentElement("info",
|
|
17
|
+
"cmbValue"),c=g(d);0<=c&&(n(d,c,b.getValue(),b.getValue()),n(a,c,e.getValue(),e.getValue()))}},{type:"button",id:"btnUp",style:"width:100%;",label:c.lang.forms.select.btnUp,title:c.lang.forms.select.btnUp,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");j(b,-1,a.getParentEditor().document);j(c,-1,a.getParentEditor().document)}},{type:"button",id:"btnDown",style:"width:100%;",label:c.lang.forms.select.btnDown,title:c.lang.forms.select.btnDown,
|
|
18
|
+
onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue");j(b,1,a.getParentEditor().document);j(c,1,a.getParentEditor().document)}}]}]},{type:"hbox",widths:["40%","20%","40%"],children:[{type:"button",id:"btnSetValue",label:c.lang.forms.select.btnSetValue,title:c.lang.forms.select.btnSetValue,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbValue");a.getContentElement("info","txtValue").setValue(b.getValue())}},
|
|
19
|
+
{type:"button",id:"btnDelete",label:c.lang.forms.select.btnDelete,title:c.lang.forms.select.btnDelete,onClick:function(){var a=this.getDialog(),b=a.getContentElement("info","cmbName"),c=a.getContentElement("info","cmbValue"),d=a.getContentElement("info","txtOptName"),a=a.getContentElement("info","txtOptValue");m(b);m(c);d.setValue("");a.setValue("")}},{id:"chkMulti",type:"checkbox",label:c.lang.forms.select.chkMulti,"default":"",accessKey:"M",value:"checked",setup:function(a,b){"select"==a&&this.setValue(b.getAttribute("multiple"));
|
|
20
|
+
CKEDITOR.env.webkit&&this.getElement().getParent().setStyle("vertical-align","middle")},commit:function(a){this.getValue()?a.setAttribute("multiple",this.getValue()):a.removeAttribute("multiple")}}]}]}]}});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
CKEDITOR.dialog.add("textarea",function(b){return{title:b.lang.forms.textarea.title,minWidth:350,minHeight:220,onShow:function(){delete this.textarea;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"textarea"==a.getName()&&(this.textarea=a,this.setupContent(a))},onOk:function(){var a,b=this.textarea,c=!b;c&&(a=this.getParentEditor(),b=a.document.createElement("textarea"));this.commitContent(b);c&&a.insertElement(b)},contents:[{id:"info",label:b.lang.forms.textarea.title,title:b.lang.forms.textarea.title,
|
|
6
|
+
elements:[{id:"_cke_saved_name",type:"text",label:b.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{type:"hbox",widths:["50%","50%"],children:[{id:"cols",type:"text",label:b.lang.forms.textarea.cols,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),
|
|
7
|
+
setup:function(a){this.setValue(a.hasAttribute("cols")&&a.getAttribute("cols")||"")},commit:function(a){this.getValue()?a.setAttribute("cols",this.getValue()):a.removeAttribute("cols")}},{id:"rows",type:"text",label:b.lang.forms.textarea.rows,"default":"",accessKey:"R",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),setup:function(a){this.setValue(a.hasAttribute("rows")&&a.getAttribute("rows")||"")},commit:function(a){this.getValue()?a.setAttribute("rows",
|
|
8
|
+
this.getValue()):a.removeAttribute("rows")}}]},{id:"value",type:"textarea",label:b.lang.forms.textfield.value,"default":"",setup:function(a){this.setValue(a.$.defaultValue)},commit:function(a){a.$.value=a.$.defaultValue=this.getValue()}}]}]}});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
CKEDITOR.dialog.add("textfield",function(b){function e(a){var a=a.element,c=this.getValue();c?a.setAttribute(this.id,c):a.removeAttribute(this.id)}function f(a){this.setValue(a.hasAttribute(this.id)&&a.getAttribute(this.id)||"")}var g={email:1,password:1,search:1,tel:1,text:1,url:1};return{title:b.lang.forms.textfield.title,minWidth:350,minHeight:150,onShow:function(){delete this.textField;var a=this.getParentEditor().getSelection().getSelectedElement();if(a&&"input"==a.getName()&&(g[a.getAttribute("type")]||
|
|
6
|
+
!a.getAttribute("type")))this.textField=a,this.setupContent(a)},onOk:function(){var a=this.getParentEditor(),c=this.textField,b=!c;b&&(c=a.document.createElement("input"),c.setAttribute("type","text"));c={element:c};b&&a.insertElement(c.element);this.commitContent(c);b||a.getSelection().selectElement(c.element)},onLoad:function(){this.foreach(function(a){if(a.getValue&&(a.setup||(a.setup=f),!a.commit))a.commit=e})},contents:[{id:"info",label:b.lang.forms.textfield.title,title:b.lang.forms.textfield.title,
|
|
7
|
+
elements:[{type:"hbox",widths:["50%","50%"],children:[{id:"_cke_saved_name",type:"text",label:b.lang.forms.textfield.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:b.lang.forms.textfield.value,"default":"",accessKey:"V",commit:function(a){if(CKEDITOR.env.ie&&
|
|
8
|
+
!this.getValue()){var c=a.element,d=new CKEDITOR.dom.element("input",b.document);c.copyAttributes(d,{value:1});d.replace(c);a.element=d}else e.call(this,a)}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"size",type:"text",label:b.lang.forms.textfield.charWidth,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)},{id:"maxLength",type:"text",label:b.lang.forms.textfield.maxChars,"default":"",accessKey:"M",style:"width:50px",
|
|
9
|
+
validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed)}],onLoad:function(){CKEDITOR.env.ie7Compat&&this.getElement().setStyle("zoom","100%")}},{id:"type",type:"select",label:b.lang.forms.textfield.type,"default":"text",accessKey:"M",items:[[b.lang.forms.textfield.typeEmail,"email"],[b.lang.forms.textfield.typePass,"password"],[b.lang.forms.textfield.typeSearch,"search"],[b.lang.forms.textfield.typeTel,"tel"],[b.lang.forms.textfield.typeText,"text"],[b.lang.forms.textfield.typeUrl,
|
|
10
|
+
"url"]],setup:function(a){this.setValue(a.getAttribute("type"))},commit:function(a){var c=a.element;if(CKEDITOR.env.ie){var d=c.getAttribute("type"),e=this.getValue();d!=e&&(d=CKEDITOR.dom.element.createFromHtml('<input type="'+e+'"></input>',b.document),c.copyAttributes(d,{type:1}),d.replace(c),a.element=d)}else c.setAttribute("type",this.getValue())}}]}]}});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
(function(){function c(b){var c=this instanceof CKEDITOR.ui.dialog.checkbox;b.hasAttribute(this.id)&&(b=b.getAttribute(this.id),c?this.setValue(e[this.id]["true"]==b.toLowerCase()):this.setValue(b))}function d(b){var c=""===this.getValue(),a=this instanceof CKEDITOR.ui.dialog.checkbox,d=this.getValue();c?b.removeAttribute(this.att||this.id):a?b.setAttribute(this.id,e[this.id][d]):b.setAttribute(this.att||this.id,d)}var e={scrolling:{"true":"yes","false":"no"},frameborder:{"true":"1","false":"0"}};
|
|
6
|
+
CKEDITOR.dialog.add("iframe",function(b){var f=b.lang.iframe,a=b.lang.common,e=b.plugins.dialogadvtab;return{title:f.title,minWidth:350,minHeight:260,onShow:function(){this.fakeImage=this.iframeNode=null;var a=this.getSelectedElement();a&&(a.data("cke-real-element-type")&&"iframe"==a.data("cke-real-element-type"))&&(this.fakeImage=a,this.iframeNode=a=b.restoreRealElement(a),this.setupContent(a))},onOk:function(){var a;a=this.fakeImage?this.iframeNode:new CKEDITOR.dom.element("iframe");var c={},d=
|
|
7
|
+
{};this.commitContent(a,c,d);a=b.createFakeElement(a,"cke_iframe","iframe",!0);a.setAttributes(d);a.setStyles(c);this.fakeImage?(a.replace(this.fakeImage),b.getSelection().selectElement(a)):b.insertElement(a)},contents:[{id:"info",label:a.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{id:"src",type:"text",label:a.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(f.noUrl),setup:c,commit:d}]},{type:"hbox",children:[{id:"width",type:"text",style:"width:100%",labelLayout:"vertical",
|
|
8
|
+
label:a.width,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.width)),setup:c,commit:d},{id:"height",type:"text",style:"width:100%",labelLayout:"vertical",label:a.height,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.height)),setup:c,commit:d},{id:"align",type:"select","default":"",items:[[a.notSet,""],[a.alignLeft,"left"],[a.alignRight,"right"],[a.alignTop,"top"],[a.alignMiddle,"middle"],[a.alignBottom,"bottom"]],style:"width:100%",
|
|
9
|
+
labelLayout:"vertical",label:a.align,setup:function(a,b){c.apply(this,arguments);if(b){var d=b.getAttribute("align");this.setValue(d&&d.toLowerCase()||"")}},commit:function(a,b,c){d.apply(this,arguments);this.getValue()&&(c.align=this.getValue())}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"scrolling",type:"checkbox",label:f.scrolling,setup:c,commit:d},{id:"frameborder",type:"checkbox",label:f.border,setup:c,commit:d}]},{type:"hbox",widths:["50%","50%"],children:[{id:"name",type:"text",label:a.name,
|
|
10
|
+
setup:c,commit:d},{id:"title",type:"text",label:a.advisoryTitle,setup:c,commit:d}]},{id:"longdesc",type:"text",label:a.longDescr,setup:c,commit:d}]},e&&e.createAdvancedTab(b,{id:1,classes:1,styles:1})]}})})();
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.md or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
(function(){var r=function(c,j){function r(){var a=arguments,b=this.getContentElement("advanced","txtdlgGenStyle");b&&b.commit.apply(b,a);this.foreach(function(b){b.commit&&"txtdlgGenStyle"!=b.id&&b.commit.apply(b,a)})}function i(a){if(!s){s=1;var b=this.getDialog(),d=b.imageElement;if(d){this.commit(f,d);for(var a=[].concat(a),e=a.length,c,g=0;g<e;g++)(c=b.getContentElement.apply(b,a[g].split(":")))&&c.setup(f,d)}s=0}}var f=1,k=/^\s*(\d+)((px)|\%)?\s*$/i,v=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,o=/^\d+px$/,
|
|
6
|
+
w=function(){var a=this.getValue(),b=this.getDialog(),d=a.match(k);d&&("%"==d[2]&&l(b,!1),a=d[1]);b.lockRatio&&(d=b.originalElement,"true"==d.getCustomData("isReady")&&("txtHeight"==this.id?(a&&"0"!=a&&(a=Math.round(d.$.width*(a/d.$.height))),isNaN(a)||b.setValueOf("info","txtWidth",a)):(a&&"0"!=a&&(a=Math.round(d.$.height*(a/d.$.width))),isNaN(a)||b.setValueOf("info","txtHeight",a))));g(b)},g=function(a){if(!a.originalElement||!a.preview)return 1;a.commitContent(4,a.preview);return 0},s,l=function(a,
|
|
7
|
+
b){if(!a.getContentElement("info","ratioLock"))return null;var d=a.originalElement;if(!d)return null;if("check"==b){if(!a.userlockRatio&&"true"==d.getCustomData("isReady")){var e=a.getValueOf("info","txtWidth"),c=a.getValueOf("info","txtHeight"),d=1E3*d.$.width/d.$.height,f=1E3*e/c;a.lockRatio=!1;!e&&!c?a.lockRatio=!0:!isNaN(d)&&!isNaN(f)&&Math.round(d)==Math.round(f)&&(a.lockRatio=!0)}}else void 0!=b?a.lockRatio=b:(a.userlockRatio=1,a.lockRatio=!a.lockRatio);e=CKEDITOR.document.getById(p);a.lockRatio?
|
|
8
|
+
e.removeClass("cke_btn_unlocked"):e.addClass("cke_btn_unlocked");e.setAttribute("aria-checked",a.lockRatio);CKEDITOR.env.hc&&e.getChild(0).setHtml(a.lockRatio?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢");return a.lockRatio},x=function(a){var b=a.originalElement;if("true"==b.getCustomData("isReady")){var d=a.getContentElement("info","txtWidth"),e=a.getContentElement("info","txtHeight");d&&d.setValue(b.$.width);e&&e.setValue(b.$.height)}g(a)},y=function(a,b){function d(a,b){var d=a.match(k);return d?
|
|
9
|
+
("%"==d[2]&&(d[1]+="%",l(e,!1)),d[1]):b}if(a==f){var e=this.getDialog(),c="",g="txtWidth"==this.id?"width":"height",h=b.getAttribute(g);h&&(c=d(h,c));c=d(b.getStyle(g),c);this.setValue(c)}},t,q=function(){var a=this.originalElement;a.setCustomData("isReady","true");a.removeListener("load",q);a.removeListener("error",h);a.removeListener("abort",h);CKEDITOR.document.getById(m).setStyle("display","none");this.dontResetSize||x(this);this.firstLoad&&CKEDITOR.tools.setTimeout(function(){l(this,"check")},
|
|
10
|
+
0,this);this.dontResetSize=this.firstLoad=!1},h=function(){var a=this.originalElement;a.removeListener("load",q);a.removeListener("error",h);a.removeListener("abort",h);a=CKEDITOR.getUrl(CKEDITOR.plugins.get("image").path+"images/noimage.png");this.preview&&this.preview.setAttribute("src",a);CKEDITOR.document.getById(m).setStyle("display","none");l(this,!1)},n=function(a){return CKEDITOR.tools.getNextId()+"_"+a},p=n("btnLockSizes"),u=n("btnResetSize"),m=n("ImagePreviewLoader"),A=n("previewLink"),
|
|
11
|
+
z=n("previewImage");return{title:c.lang.image["image"==j?"title":"titleButton"],minWidth:420,minHeight:360,onShow:function(){this.linkEditMode=this.imageEditMode=this.linkElement=this.imageElement=!1;this.lockRatio=!0;this.userlockRatio=0;this.dontResetSize=!1;this.firstLoad=!0;this.addLink=!1;var a=this.getParentEditor(),b=a.getSelection(),d=(b=b&&b.getSelectedElement())&&a.elementPath(b).contains("a",1);CKEDITOR.document.getById(m).setStyle("display","none");t=new CKEDITOR.dom.element("img",a.document);
|
|
12
|
+
this.preview=CKEDITOR.document.getById(z);this.originalElement=a.document.createElement("img");this.originalElement.setAttribute("alt","");this.originalElement.setCustomData("isReady","false");if(d){this.linkElement=d;this.linkEditMode=!0;var c=d.getChildren();if(1==c.count()){var g=c.getItem(0).getName();if("img"==g||"input"==g)this.imageElement=c.getItem(0),"img"==this.imageElement.getName()?this.imageEditMode="img":"input"==this.imageElement.getName()&&(this.imageEditMode="input")}"image"==j&&
|
|
13
|
+
this.setupContent(2,d)}if(this.customImageElement)this.imageEditMode="img",this.imageElement=this.customImageElement,delete this.customImageElement;else if(b&&"img"==b.getName()&&!b.data("cke-realelement")||b&&"input"==b.getName()&&"image"==b.getAttribute("type"))this.imageEditMode=b.getName(),this.imageElement=b;this.imageEditMode?(this.cleanImageElement=this.imageElement,this.imageElement=this.cleanImageElement.clone(!0,!0),this.setupContent(f,this.imageElement)):this.imageElement=a.document.createElement("img");
|
|
14
|
+
l(this,!0);CKEDITOR.tools.trim(this.getValueOf("info","txtUrl"))||(this.preview.removeAttribute("src"),this.preview.setStyle("display","none"))},onOk:function(){if(this.imageEditMode){var a=this.imageEditMode;"image"==j&&"input"==a&&confirm(c.lang.image.button2Img)?(this.imageElement=c.document.createElement("img"),this.imageElement.setAttribute("alt",""),c.insertElement(this.imageElement)):"image"!=j&&"img"==a&&confirm(c.lang.image.img2Button)?(this.imageElement=c.document.createElement("input"),
|
|
15
|
+
this.imageElement.setAttributes({type:"image",alt:""}),c.insertElement(this.imageElement)):(this.imageElement=this.cleanImageElement,delete this.cleanImageElement)}else"image"==j?this.imageElement=c.document.createElement("img"):(this.imageElement=c.document.createElement("input"),this.imageElement.setAttribute("type","image")),this.imageElement.setAttribute("alt","");this.linkEditMode||(this.linkElement=c.document.createElement("a"));this.commitContent(f,this.imageElement);this.commitContent(2,this.linkElement);
|
|
16
|
+
this.imageElement.getAttribute("style")||this.imageElement.removeAttribute("style");this.imageEditMode?!this.linkEditMode&&this.addLink?(c.insertElement(this.linkElement),this.imageElement.appendTo(this.linkElement)):this.linkEditMode&&!this.addLink&&(c.getSelection().selectElement(this.linkElement),c.insertElement(this.imageElement)):this.addLink?this.linkEditMode?c.insertElement(this.imageElement):(c.insertElement(this.linkElement),this.linkElement.append(this.imageElement,!1)):c.insertElement(this.imageElement)},
|
|
17
|
+
onLoad:function(){"image"!=j&&this.hidePage("Link");var a=this._.element.getDocument();this.getContentElement("info","ratioLock")&&(this.addFocusable(a.getById(u),5),this.addFocusable(a.getById(p),5));this.commitContent=r},onHide:function(){this.preview&&this.commitContent(8,this.preview);this.originalElement&&(this.originalElement.removeListener("load",q),this.originalElement.removeListener("error",h),this.originalElement.removeListener("abort",h),this.originalElement.remove(),this.originalElement=
|
|
18
|
+
!1);delete this.imageElement},contents:[{id:"info",label:c.lang.image.infoTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",children:[{id:"txtUrl",type:"text",label:c.lang.common.url,required:!0,onChange:function(){var a=this.getDialog(),b=this.getValue();if(0<b.length){var a=this.getDialog(),d=a.originalElement;a.preview.removeStyle("display");d.setCustomData("isReady","false");var c=CKEDITOR.document.getById(m);c&&c.setStyle("display",
|
|
19
|
+
"");d.on("load",q,a);d.on("error",h,a);d.on("abort",h,a);d.setAttribute("src",b);t.setAttribute("src",b);a.preview.setAttribute("src",t.$.src);g(a)}else a.preview&&(a.preview.removeAttribute("src"),a.preview.setStyle("display","none"))},setup:function(a,b){if(a==f){var d=b.data("cke-saved-src")||b.getAttribute("src");this.getDialog().dontResetSize=!0;this.setValue(d);this.setInitValue()}},commit:function(a,b){a==f&&(this.getValue()||this.isChanged())?(b.data("cke-saved-src",this.getValue()),b.setAttribute("src",
|
|
20
|
+
this.getValue())):8==a&&(b.setAttribute("src",""),b.removeAttribute("src"))},validate:CKEDITOR.dialog.validate.notEmpty(c.lang.image.urlMissing)},{type:"button",id:"browse",style:"display:inline-block;margin-top:10px;",align:"center",label:c.lang.common.browseServer,hidden:!0,filebrowser:"info:txtUrl"}]}]},{id:"txtAlt",type:"text",label:c.lang.image.alt,accessKey:"T","default":"",onChange:function(){g(this.getDialog())},setup:function(a,b){a==f&&this.setValue(b.getAttribute("alt"))},commit:function(a,
|
|
21
|
+
b){a==f?(this.getValue()||this.isChanged())&&b.setAttribute("alt",this.getValue()):4==a?b.setAttribute("alt",this.getValue()):8==a&&b.removeAttribute("alt")}},{type:"hbox",children:[{id:"basic",type:"vbox",children:[{type:"hbox",requiredContent:"img{width,height}",widths:["50%","50%"],children:[{type:"vbox",padding:1,children:[{type:"text",width:"45px",id:"txtWidth",label:c.lang.common.width,onKeyUp:w,onChange:function(){i.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(v);
|
|
22
|
+
(a=!!(a&&0!==parseInt(a[1],10)))||alert(c.lang.common.invalidWidth);return a},setup:y,commit:function(a,b,d){var c=this.getValue();a==f?(c?b.setStyle("width",CKEDITOR.tools.cssLength(c)):b.removeStyle("width"),!d&&b.removeAttribute("width")):4==a?c.match(k)?b.setStyle("width",CKEDITOR.tools.cssLength(c)):(a=this.getDialog().originalElement,"true"==a.getCustomData("isReady")&&b.setStyle("width",a.$.width+"px")):8==a&&(b.removeAttribute("width"),b.removeStyle("width"))}},{type:"text",id:"txtHeight",
|
|
23
|
+
width:"45px",label:c.lang.common.height,onKeyUp:w,onChange:function(){i.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(v);(a=!!(a&&0!==parseInt(a[1],10)))||alert(c.lang.common.invalidHeight);return a},setup:y,commit:function(a,b,d){var c=this.getValue();a==f?(c?b.setStyle("height",CKEDITOR.tools.cssLength(c)):b.removeStyle("height"),!d&&b.removeAttribute("height")):4==a?c.match(k)?b.setStyle("height",CKEDITOR.tools.cssLength(c)):(a=this.getDialog().originalElement,
|
|
24
|
+
"true"==a.getCustomData("isReady")&&b.setStyle("height",a.$.height+"px")):8==a&&(b.removeAttribute("height"),b.removeStyle("height"))}}]},{id:"ratioLock",type:"html",style:"margin-top:30px;width:40px;height:40px;",onLoad:function(){var a=CKEDITOR.document.getById(u),b=CKEDITOR.document.getById(p);a&&(a.on("click",function(a){x(this);a.data&&a.data.preventDefault()},this.getDialog()),a.on("mouseover",function(){this.addClass("cke_btn_over")},a),a.on("mouseout",function(){this.removeClass("cke_btn_over")},
|
|
25
|
+
a));b&&(b.on("click",function(a){l(this);var b=this.originalElement,c=this.getValueOf("info","txtWidth");if(b.getCustomData("isReady")=="true"&&c){b=b.$.height/b.$.width*c;if(!isNaN(b)){this.setValueOf("info","txtHeight",Math.round(b));g(this)}}a.data&&a.data.preventDefault()},this.getDialog()),b.on("mouseover",function(){this.addClass("cke_btn_over")},b),b.on("mouseout",function(){this.removeClass("cke_btn_over")},b))},html:'<div><a href="javascript:void(0)" tabindex="-1" title="'+c.lang.image.lockRatio+
|
|
26
|
+
'" class="cke_btn_locked" id="'+p+'" role="checkbox"><span class="cke_icon"></span><span class="cke_label">'+c.lang.image.lockRatio+'</span></a><a href="javascript:void(0)" tabindex="-1" title="'+c.lang.image.resetSize+'" class="cke_btn_reset" id="'+u+'" role="button"><span class="cke_label">'+c.lang.image.resetSize+"</span></a></div>"}]},{type:"vbox",padding:1,children:[{type:"text",id:"txtBorder",requiredContent:"img{border-width}",width:"60px",label:c.lang.image.border,"default":"",onKeyUp:function(){g(this.getDialog())},
|
|
27
|
+
onChange:function(){i.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(c.lang.image.validateBorder),setup:function(a,b){if(a==f){var d;d=(d=(d=b.getStyle("border-width"))&&d.match(/^(\d+px)(?: \1 \1 \1)?$/))&&parseInt(d[1],10);isNaN(parseInt(d,10))&&(d=b.getAttribute("border"));this.setValue(d)}},commit:function(a,b,d){var c=parseInt(this.getValue(),10);a==f||4==a?(isNaN(c)?!c&&this.isChanged()&&b.removeStyle("border"):(b.setStyle("border-width",CKEDITOR.tools.cssLength(c)),
|
|
28
|
+
b.setStyle("border-style","solid")),!d&&a==f&&b.removeAttribute("border")):8==a&&(b.removeAttribute("border"),b.removeStyle("border-width"),b.removeStyle("border-style"),b.removeStyle("border-color"))}},{type:"text",id:"txtHSpace",requiredContent:"img{margin-left,margin-right}",width:"60px",label:c.lang.image.hSpace,"default":"",onKeyUp:function(){g(this.getDialog())},onChange:function(){i.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(c.lang.image.validateHSpace),
|
|
29
|
+
setup:function(a,b){if(a==f){var d,c;d=b.getStyle("margin-left");c=b.getStyle("margin-right");d=d&&d.match(o);c=c&&c.match(o);d=parseInt(d,10);c=parseInt(c,10);d=d==c&&d;isNaN(parseInt(d,10))&&(d=b.getAttribute("hspace"));this.setValue(d)}},commit:function(a,b,c){var e=parseInt(this.getValue(),10);a==f||4==a?(isNaN(e)?!e&&this.isChanged()&&(b.removeStyle("margin-left"),b.removeStyle("margin-right")):(b.setStyle("margin-left",CKEDITOR.tools.cssLength(e)),b.setStyle("margin-right",CKEDITOR.tools.cssLength(e))),
|
|
30
|
+
!c&&a==f&&b.removeAttribute("hspace")):8==a&&(b.removeAttribute("hspace"),b.removeStyle("margin-left"),b.removeStyle("margin-right"))}},{type:"text",id:"txtVSpace",requiredContent:"img{margin-top,margin-bottom}",width:"60px",label:c.lang.image.vSpace,"default":"",onKeyUp:function(){g(this.getDialog())},onChange:function(){i.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(c.lang.image.validateVSpace),setup:function(a,b){if(a==f){var c,e;c=b.getStyle("margin-top");e=
|
|
31
|
+
b.getStyle("margin-bottom");c=c&&c.match(o);e=e&&e.match(o);c=parseInt(c,10);e=parseInt(e,10);c=c==e&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("vspace"));this.setValue(c)}},commit:function(a,b,c){var e=parseInt(this.getValue(),10);a==f||4==a?(isNaN(e)?!e&&this.isChanged()&&(b.removeStyle("margin-top"),b.removeStyle("margin-bottom")):(b.setStyle("margin-top",CKEDITOR.tools.cssLength(e)),b.setStyle("margin-bottom",CKEDITOR.tools.cssLength(e))),!c&&a==f&&b.removeAttribute("vspace")):8==a&&(b.removeAttribute("vspace"),
|
|
32
|
+
b.removeStyle("margin-top"),b.removeStyle("margin-bottom"))}},{id:"cmbAlign",requiredContent:"img{float}",type:"select",widths:["35%","65%"],style:"width:90px",label:c.lang.common.align,"default":"",items:[[c.lang.common.notSet,""],[c.lang.common.alignLeft,"left"],[c.lang.common.alignRight,"right"]],onChange:function(){g(this.getDialog());i.call(this,"advanced:txtdlgGenStyle")},setup:function(a,b){if(a==f){var c=b.getStyle("float");switch(c){case "inherit":case "none":c=""}!c&&(c=(b.getAttribute("align")||
|
|
33
|
+
"").toLowerCase());this.setValue(c)}},commit:function(a,b,c){var e=this.getValue();if(a==f||4==a){if(e?b.setStyle("float",e):b.removeStyle("float"),!c&&a==f)switch(e=(b.getAttribute("align")||"").toLowerCase(),e){case "left":case "right":b.removeAttribute("align")}}else 8==a&&b.removeStyle("float")}}]}]},{type:"vbox",height:"250px",children:[{type:"html",id:"htmlPreview",style:"width:95%;",html:"<div>"+CKEDITOR.tools.htmlEncode(c.lang.common.preview)+'<br><div id="'+m+'" class="ImagePreviewLoader" style="display:none"><div class="loading"> </div></div><div class="ImagePreviewBox"><table><tr><td><a href="javascript:void(0)" target="_blank" onclick="return false;" id="'+
|
|
34
|
+
A+'"><img id="'+z+'" alt="" /></a>'+(c.config.image_previewText||"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.")+
|
|
35
|
+
"</td></tr></table></div></div>"}]}]}]},{id:"Link",requiredContent:"a[href]",label:c.lang.image.linkTab,padding:0,elements:[{id:"txtUrl",type:"text",label:c.lang.common.url,style:"width: 100%","default":"",setup:function(a,b){if(2==a){var c=b.data("cke-saved-href");c||(c=b.getAttribute("href"));this.setValue(c)}},commit:function(a,b){if(2==a&&(this.getValue()||this.isChanged())){var d=decodeURI(this.getValue());b.data("cke-saved-href",d);b.setAttribute("href",d);if(this.getValue()||!c.config.image_removeLinkByEmptyURL)this.getDialog().addLink=
|
|
36
|
+
!0}}},{type:"button",id:"browse",filebrowser:{action:"Browse",target:"Link:txtUrl",url:c.config.filebrowserImageBrowseLinkUrl},style:"float:right",hidden:!0,label:c.lang.common.browseServer},{id:"cmbTarget",type:"select",requiredContent:"a[target]",label:c.lang.common.target,"default":"",items:[[c.lang.common.notSet,""],[c.lang.common.targetNew,"_blank"],[c.lang.common.targetTop,"_top"],[c.lang.common.targetSelf,"_self"],[c.lang.common.targetParent,"_parent"]],setup:function(a,b){2==a&&this.setValue(b.getAttribute("target")||
|
|
37
|
+
"")},commit:function(a,b){2==a&&(this.getValue()||this.isChanged())&&b.setAttribute("target",this.getValue())}}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:c.lang.image.upload,elements:[{type:"file",id:"upload",label:c.lang.image.btnUpload,style:"height:40px",size:38},{type:"fileButton",id:"uploadButton",filebrowser:"info:txtUrl",label:c.lang.image.btnUpload,"for":["Upload","upload"]}]},{id:"advanced",label:c.lang.common.advancedTab,elements:[{type:"hbox",widths:["50%","25%","25%"],
|
|
38
|
+
children:[{type:"text",id:"linkId",requiredContent:"img[id]",label:c.lang.common.id,setup:function(a,b){a==f&&this.setValue(b.getAttribute("id"))},commit:function(a,b){a==f&&(this.getValue()||this.isChanged())&&b.setAttribute("id",this.getValue())}},{id:"cmbLangDir",type:"select",requiredContent:"img[dir]",style:"width : 100px;",label:c.lang.common.langDir,"default":"",items:[[c.lang.common.notSet,""],[c.lang.common.langDirLtr,"ltr"],[c.lang.common.langDirRtl,"rtl"]],setup:function(a,b){a==f&&this.setValue(b.getAttribute("dir"))},
|
|
39
|
+
commit:function(a,b){a==f&&(this.getValue()||this.isChanged())&&b.setAttribute("dir",this.getValue())}},{type:"text",id:"txtLangCode",requiredContent:"img[lang]",label:c.lang.common.langCode,"default":"",setup:function(a,b){a==f&&this.setValue(b.getAttribute("lang"))},commit:function(a,b){a==f&&(this.getValue()||this.isChanged())&&b.setAttribute("lang",this.getValue())}}]},{type:"text",id:"txtGenLongDescr",requiredContent:"img[longdesc]",label:c.lang.common.longDescr,setup:function(a,b){a==f&&this.setValue(b.getAttribute("longDesc"))},
|
|
40
|
+
commit:function(a,b){a==f&&(this.getValue()||this.isChanged())&&b.setAttribute("longDesc",this.getValue())}},{type:"hbox",widths:["50%","50%"],children:[{type:"text",id:"txtGenClass",requiredContent:"img(cke-xyz)",label:c.lang.common.cssClass,"default":"",setup:function(a,b){a==f&&this.setValue(b.getAttribute("class"))},commit:function(a,b){a==f&&(this.getValue()||this.isChanged())&&b.setAttribute("class",this.getValue())}},{type:"text",id:"txtGenTitle",requiredContent:"img[title]",label:c.lang.common.advisoryTitle,
|
|
41
|
+
"default":"",onChange:function(){g(this.getDialog())},setup:function(a,b){a==f&&this.setValue(b.getAttribute("title"))},commit:function(a,b){a==f?(this.getValue()||this.isChanged())&&b.setAttribute("title",this.getValue()):4==a?b.setAttribute("title",this.getValue()):8==a&&b.removeAttribute("title")}}]},{type:"text",id:"txtdlgGenStyle",requiredContent:"img{cke-xyz}",label:c.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(c.lang.common.invalidInlineStyle),"default":"",setup:function(a,
|
|
42
|
+
b){if(a==f){var c=b.getAttribute("style");!c&&b.$.style.cssText&&(c=b.$.style.cssText);this.setValue(c);var e=b.$.style.height,c=b.$.style.width,e=(e?e:"").match(k),c=(c?c:"").match(k);this.attributesInStyle={height:!!e,width:!!c}}},onChange:function(){i.call(this,"info:cmbFloat info:cmbAlign info:txtVSpace info:txtHSpace info:txtBorder info:txtWidth info:txtHeight".split(" "));g(this)},commit:function(a,b){a==f&&(this.getValue()||this.isChanged())&&b.setAttribute("style",this.getValue())}}]}]}};
|
|
43
|
+
CKEDITOR.dialog.add("image",function(c){return r(c,"image")});CKEDITOR.dialog.add("imagebutton",function(c){return r(c,"imagebutton")})})();
|
|
@@ -0,0 +1,933 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @fileOverview A set of utilities to find and make horizontal spaces in edited contents.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
( function() {
|
|
13
|
+
|
|
14
|
+
CKEDITOR.plugins.add( 'lineutils' );
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Determines a position relative to an element in DOM (before).
|
|
18
|
+
*
|
|
19
|
+
* @readonly
|
|
20
|
+
* @property {Number} [=0]
|
|
21
|
+
* @member CKEDITOR
|
|
22
|
+
*/
|
|
23
|
+
CKEDITOR.LINEUTILS_BEFORE = 1;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Determines a position relative to an element in DOM (after).
|
|
27
|
+
*
|
|
28
|
+
* @readonly
|
|
29
|
+
* @property {Number} [=2]
|
|
30
|
+
* @member CKEDITOR
|
|
31
|
+
*/
|
|
32
|
+
CKEDITOR.LINEUTILS_AFTER = 2;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Determines a position relative to an element in DOM (inside).
|
|
36
|
+
*
|
|
37
|
+
* @readonly
|
|
38
|
+
* @property {Number} [=4]
|
|
39
|
+
* @member CKEDITOR
|
|
40
|
+
*/
|
|
41
|
+
CKEDITOR.LINEUTILS_INSIDE = 4;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An utility that traverses DOM tree and discovers elements
|
|
45
|
+
* (relations) matching user-defined lookups.
|
|
46
|
+
*
|
|
47
|
+
* @private
|
|
48
|
+
* @class CKEDITOR.plugins.lineutils.finder
|
|
49
|
+
* @constructor Creates a Finder class instance.
|
|
50
|
+
* @param {CKEDITOR.editor} editor Editor instance that Finder belongs to.
|
|
51
|
+
* @param {Object} def Finder's definition.
|
|
52
|
+
* @since 4.3
|
|
53
|
+
*/
|
|
54
|
+
function Finder( editor, def ) {
|
|
55
|
+
CKEDITOR.tools.extend( this, {
|
|
56
|
+
editor: editor,
|
|
57
|
+
editable: editor.editable(),
|
|
58
|
+
doc: editor.document,
|
|
59
|
+
win: editor.window
|
|
60
|
+
}, def, true );
|
|
61
|
+
|
|
62
|
+
this.frame = this.win.getFrame();
|
|
63
|
+
this.inline = this.editable.isInline();
|
|
64
|
+
this.target = this[ this.inline ? 'editable' : 'doc' ];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
Finder.prototype = {
|
|
68
|
+
/**
|
|
69
|
+
* Initializes searching for elements with every mousemove event fired.
|
|
70
|
+
* To stop searching use {@link #stop}.
|
|
71
|
+
*
|
|
72
|
+
* @param {Function} [callback] Function executed on every iteration.
|
|
73
|
+
*/
|
|
74
|
+
start: function( callback ) {
|
|
75
|
+
var that = this,
|
|
76
|
+
editor = this.editor,
|
|
77
|
+
doc = this.doc,
|
|
78
|
+
el, x, y;
|
|
79
|
+
|
|
80
|
+
var moveBuffer = CKEDITOR.tools.eventsBuffer( 50, function() {
|
|
81
|
+
if ( editor.readOnly || editor.mode != 'wysiwyg' )
|
|
82
|
+
return;
|
|
83
|
+
|
|
84
|
+
that.relations = {};
|
|
85
|
+
|
|
86
|
+
el = new CKEDITOR.dom.element( doc.$.elementFromPoint( x, y ) );
|
|
87
|
+
|
|
88
|
+
that.traverseSearch( el );
|
|
89
|
+
|
|
90
|
+
if ( !isNaN( x + y ) )
|
|
91
|
+
that.pixelSearch( el, x, y );
|
|
92
|
+
|
|
93
|
+
callback && callback( that.relations, x, y );
|
|
94
|
+
} );
|
|
95
|
+
|
|
96
|
+
// Searching starting from element from point on mousemove.
|
|
97
|
+
this.listener = this.editable.attachListener( this.target, 'mousemove', function( evt ) {
|
|
98
|
+
x = evt.data.$.clientX;
|
|
99
|
+
y = evt.data.$.clientY;
|
|
100
|
+
|
|
101
|
+
moveBuffer.input();
|
|
102
|
+
} );
|
|
103
|
+
|
|
104
|
+
this.editable.attachListener( this.inline ? this.editable : this.frame, 'mouseout', function( evt ) {
|
|
105
|
+
moveBuffer.reset();
|
|
106
|
+
} );
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Stops observing mouse events attached by {@link #start}.
|
|
111
|
+
*/
|
|
112
|
+
stop: function() {
|
|
113
|
+
if ( this.listener )
|
|
114
|
+
this.listener.removeListener();
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Returns a range representing the relation, according to its element
|
|
119
|
+
* and type.
|
|
120
|
+
*
|
|
121
|
+
* @param {Object} location Location containing unique identifier and type.
|
|
122
|
+
* @returns {CKEDITOR.dom.range} Range representing the relation.
|
|
123
|
+
*/
|
|
124
|
+
getRange: ( function() {
|
|
125
|
+
var where = {};
|
|
126
|
+
|
|
127
|
+
where[ CKEDITOR.LINEUTILS_BEFORE ] = CKEDITOR.POSITION_BEFORE_START;
|
|
128
|
+
where[ CKEDITOR.LINEUTILS_AFTER ] = CKEDITOR.POSITION_AFTER_END;
|
|
129
|
+
where[ CKEDITOR.LINEUTILS_INSIDE ] = CKEDITOR.POSITION_AFTER_START;
|
|
130
|
+
|
|
131
|
+
return function( location ) {
|
|
132
|
+
var range = this.editor.createRange();
|
|
133
|
+
|
|
134
|
+
range.moveToPosition( this.relations[ location.uid ].element, where[ location.type ] );
|
|
135
|
+
|
|
136
|
+
return range;
|
|
137
|
+
};
|
|
138
|
+
} )(),
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Stores given relation in {@link #relations} object. Processes the relation
|
|
142
|
+
* to normalize and avoid duplicates.
|
|
143
|
+
*
|
|
144
|
+
* @param {CKEDITOR.dom.element} el Element of the relation.
|
|
145
|
+
* @param {Number} type Relation, one of `CKEDITOR.LINEUTILS_AFTER`, `CKEDITOR.LINEUTILS_BEFORE`, `CKEDITOR.LINEUTILS_INSIDE`.
|
|
146
|
+
*/
|
|
147
|
+
store: ( function() {
|
|
148
|
+
function merge( el, type, relations ) {
|
|
149
|
+
var uid = el.getUniqueId();
|
|
150
|
+
|
|
151
|
+
if ( uid in relations )
|
|
152
|
+
relations[ uid ].type |= type;
|
|
153
|
+
else
|
|
154
|
+
relations[ uid ] = { element: el, type: type };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return function( el, type ) {
|
|
158
|
+
var alt;
|
|
159
|
+
|
|
160
|
+
// Normalization to avoid duplicates:
|
|
161
|
+
// CKEDITOR.LINEUTILS_AFTER becomes CKEDITOR.LINEUTILS_BEFORE of el.getNext().
|
|
162
|
+
if ( is( type, CKEDITOR.LINEUTILS_AFTER ) && isStatic( alt = el.getNext() ) && alt.isVisible() ) {
|
|
163
|
+
merge( alt, CKEDITOR.LINEUTILS_BEFORE, this.relations );
|
|
164
|
+
type ^= CKEDITOR.LINEUTILS_AFTER;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Normalization to avoid duplicates:
|
|
168
|
+
// CKEDITOR.LINEUTILS_INSIDE becomes CKEDITOR.LINEUTILS_BEFORE of el.getFirst().
|
|
169
|
+
if ( is( type, CKEDITOR.LINEUTILS_INSIDE ) && isStatic( alt = el.getFirst() ) && alt.isVisible() ) {
|
|
170
|
+
merge( alt, CKEDITOR.LINEUTILS_BEFORE, this.relations );
|
|
171
|
+
type ^= CKEDITOR.LINEUTILS_INSIDE;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
merge( el, type, this.relations );
|
|
175
|
+
};
|
|
176
|
+
} )(),
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Traverses DOM tree towards root, checking all ancestors
|
|
180
|
+
* with lookup rules, avoiding duplicates. Stores positive relations
|
|
181
|
+
* in {@link #relations} object.
|
|
182
|
+
*
|
|
183
|
+
* @param {CKEDITOR.dom.element} el Element which is the starting point.
|
|
184
|
+
*/
|
|
185
|
+
traverseSearch: function( el ) {
|
|
186
|
+
var l, type, uid;
|
|
187
|
+
|
|
188
|
+
// Go down DOM towards root (or limit).
|
|
189
|
+
do {
|
|
190
|
+
uid = el.$[ 'data-cke-expando' ];
|
|
191
|
+
|
|
192
|
+
// This element was already visited and checked.
|
|
193
|
+
if ( uid && uid in this.relations )
|
|
194
|
+
continue;
|
|
195
|
+
|
|
196
|
+
if ( el.equals( this.editable ) )
|
|
197
|
+
return;
|
|
198
|
+
|
|
199
|
+
if ( isStatic( el ) ) {
|
|
200
|
+
// Collect all addresses yielded by lookups for that element.
|
|
201
|
+
for ( l in this.lookups ) {
|
|
202
|
+
|
|
203
|
+
if ( ( type = this.lookups[ l ]( el ) ) )
|
|
204
|
+
this.store( el, type );
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
} while ( !isLimit( el ) && ( el = el.getParent() ) )
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Iterates vertically pixel-by-pixel within given element starting
|
|
212
|
+
* from given coordinates, searching for elements in the neighbourhood.
|
|
213
|
+
* Once an element is found it is processed by {@link #traverseSearch}.
|
|
214
|
+
*
|
|
215
|
+
* @param {CKEDITOR.dom.element} el Element which is the starting point.
|
|
216
|
+
* @param {Number} [x] Horizontal mouse coordinate relative to the viewport.
|
|
217
|
+
* @param {Number} [y] Vertical mouse coordinate relative to the viewport.
|
|
218
|
+
*/
|
|
219
|
+
pixelSearch: ( function() {
|
|
220
|
+
var contains = CKEDITOR.env.ie || CKEDITOR.env.webkit ?
|
|
221
|
+
function( el, found ) {
|
|
222
|
+
return el.contains( found );
|
|
223
|
+
}
|
|
224
|
+
:
|
|
225
|
+
function( el, found ) {
|
|
226
|
+
return !!( el.compareDocumentPosition( found ) & 16 );
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// Iterates pixel-by-pixel from starting coordinates, moving by defined
|
|
230
|
+
// step and getting elementFromPoint in every iteration. Iteration stops when:
|
|
231
|
+
// * A valid element is found.
|
|
232
|
+
// * Condition function returns false (i.e. reached boundaries of viewport).
|
|
233
|
+
// * No element is found (i.e. coordinates out of viewport).
|
|
234
|
+
// * Element found is ascendant of starting element.
|
|
235
|
+
//
|
|
236
|
+
// @param {Object} doc Native DOM document.
|
|
237
|
+
// @param {Object} el Native DOM element.
|
|
238
|
+
// @param {Number} xStart Horizontal starting coordinate to use.
|
|
239
|
+
// @param {Number} yStart Vertical starting coordinate to use.
|
|
240
|
+
// @param {Number} step Step of the algorithm.
|
|
241
|
+
// @param {Function} condition A condition relative to current vertical coordinate.
|
|
242
|
+
function iterate( el, xStart, yStart, step, condition ) {
|
|
243
|
+
var y = yStart,
|
|
244
|
+
tryouts = 0,
|
|
245
|
+
found, uid;
|
|
246
|
+
|
|
247
|
+
while ( condition( y ) ) {
|
|
248
|
+
y += step;
|
|
249
|
+
|
|
250
|
+
// If we try and we try, and still nothing's found, let's end
|
|
251
|
+
// that party.
|
|
252
|
+
if ( ++tryouts == 25 )
|
|
253
|
+
return;
|
|
254
|
+
|
|
255
|
+
found = this.doc.$.elementFromPoint( xStart, y );
|
|
256
|
+
|
|
257
|
+
// Nothing found. This is crazy... but...
|
|
258
|
+
// It might be that a line, which is in different document,
|
|
259
|
+
// covers that pixel (elementFromPoint is doc-sensitive).
|
|
260
|
+
// Better let's have another try.
|
|
261
|
+
if ( !found )
|
|
262
|
+
continue;
|
|
263
|
+
|
|
264
|
+
// Still in the same element.
|
|
265
|
+
else if ( found == el ) {
|
|
266
|
+
tryouts = 0;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Reached the edge of an element and found an ancestor or...
|
|
271
|
+
// A line, that covers that pixel. Better let's have another try.
|
|
272
|
+
else if ( !contains( el, found ) )
|
|
273
|
+
continue;
|
|
274
|
+
|
|
275
|
+
tryouts = 0;
|
|
276
|
+
|
|
277
|
+
// Found a valid element. Stop iterating.
|
|
278
|
+
if ( isStatic( ( found = new CKEDITOR.dom.element( found ) ) ) )
|
|
279
|
+
return found;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return function( el, x, y ) {
|
|
284
|
+
var paneHeight = this.win.getViewPaneSize().height,
|
|
285
|
+
|
|
286
|
+
// Try to find an element iterating *up* from the starting point.
|
|
287
|
+
neg = iterate.call( this, el.$, x, y, -1, function( y ) {
|
|
288
|
+
return y > 0;
|
|
289
|
+
} ),
|
|
290
|
+
|
|
291
|
+
// Try to find an element iterating *down* from the starting point.
|
|
292
|
+
pos = iterate.call( this, el.$, x, y, 1, function( y ) {
|
|
293
|
+
return y < paneHeight;
|
|
294
|
+
} );
|
|
295
|
+
|
|
296
|
+
if ( neg ) {
|
|
297
|
+
this.traverseSearch( neg );
|
|
298
|
+
|
|
299
|
+
// Iterate towards DOM root until neg is a direct child of el.
|
|
300
|
+
while ( !neg.getParent().equals( el ) )
|
|
301
|
+
neg = neg.getParent();
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if ( pos ) {
|
|
305
|
+
this.traverseSearch( pos );
|
|
306
|
+
|
|
307
|
+
// Iterate towards DOM root until pos is a direct child of el.
|
|
308
|
+
while ( !pos.getParent().equals( el ) )
|
|
309
|
+
pos = pos.getParent();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Iterate forwards starting from neg and backwards from
|
|
313
|
+
// pos to harvest all children of el between those elements.
|
|
314
|
+
// Stop when neg and pos meet each other or there's none of them.
|
|
315
|
+
// TODO (?) reduce number of hops forwards/backwards.
|
|
316
|
+
while ( neg || pos ) {
|
|
317
|
+
if ( neg )
|
|
318
|
+
neg = neg.getNext( isStatic );
|
|
319
|
+
|
|
320
|
+
if ( !neg || neg.equals( pos ) )
|
|
321
|
+
break;
|
|
322
|
+
|
|
323
|
+
this.traverseSearch( neg );
|
|
324
|
+
|
|
325
|
+
if ( pos )
|
|
326
|
+
pos = pos.getPrevious( isStatic );
|
|
327
|
+
|
|
328
|
+
if ( !pos || pos.equals( neg ) )
|
|
329
|
+
break;
|
|
330
|
+
|
|
331
|
+
this.traverseSearch( pos );
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
} )(),
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Unline {@link #traverseSearch}, it collects **all** elements from editable's DOM tree
|
|
338
|
+
* and runs lookups for every one of them, collecting relations.
|
|
339
|
+
*
|
|
340
|
+
* @returns {Object} {@link #relations}.
|
|
341
|
+
*/
|
|
342
|
+
greedySearch: function() {
|
|
343
|
+
this.relations = {};
|
|
344
|
+
|
|
345
|
+
var all = this.editable.getElementsByTag( '*' ),
|
|
346
|
+
i = 0,
|
|
347
|
+
el, type, l;
|
|
348
|
+
|
|
349
|
+
while ( ( el = all.getItem( i++ ) ) ) {
|
|
350
|
+
// Don't consider editable, as it might be inline,
|
|
351
|
+
// and i.e. checking it's siblings is pointless.
|
|
352
|
+
if ( el.equals( this.editable ) )
|
|
353
|
+
continue;
|
|
354
|
+
|
|
355
|
+
// Don't visit non-editable internals, for example widget's
|
|
356
|
+
// guts (above wrapper, below nested). Still check editable limits,
|
|
357
|
+
// as they are siblings with editable contents.
|
|
358
|
+
if ( !el.hasAttribute( 'contenteditable' ) && el.isReadOnly() )
|
|
359
|
+
continue;
|
|
360
|
+
|
|
361
|
+
if ( isStatic( el ) && el.isVisible() ) {
|
|
362
|
+
// Collect all addresses yielded by lookups for that element.
|
|
363
|
+
for ( l in this.lookups ) {
|
|
364
|
+
if ( ( type = this.lookups[ l ]( el ) ) )
|
|
365
|
+
this.store( el, type );
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return this.relations;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Relations express elements in DOM that match user-defined {@link #lookups}.
|
|
375
|
+
* Every relation has its own `type` that determines whether
|
|
376
|
+
* it refers to the space before, after or inside of `element`.
|
|
377
|
+
* This object stores relations found by {@link #traverseSearch} or {@link #greedySearch}, structured
|
|
378
|
+
* in the following way:
|
|
379
|
+
*
|
|
380
|
+
* relations: {
|
|
381
|
+
* // Unique identifier of the element.
|
|
382
|
+
* Number: {
|
|
383
|
+
* // Element of this relation.
|
|
384
|
+
* element: {@link CKEDITOR.dom.element}
|
|
385
|
+
* // Conjunction of CKEDITOR.LINEUTILS_BEFORE, CKEDITOR.LINEUTILS_AFTER and CKEDITOR.LINEUTILS_INSIDE.
|
|
386
|
+
* type: Number
|
|
387
|
+
* },
|
|
388
|
+
* ...
|
|
389
|
+
* }
|
|
390
|
+
*
|
|
391
|
+
* @property {Object} relations
|
|
392
|
+
* @readonly
|
|
393
|
+
*/
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* A set of user-defined functions used by Finder to check if an element
|
|
397
|
+
* is a valid relation, belonging to {@link #relations}.
|
|
398
|
+
* When the criterion is met, lookup returns a logical conjunction of `CKEDITOR.LINEUTILS_BEFORE`,
|
|
399
|
+
* `CKEDITOR.LINEUTILS_AFTER` or `CKEDITOR.LINEUTILS_INSIDE`.
|
|
400
|
+
*
|
|
401
|
+
* Lookups are passed along with Finder's definition.
|
|
402
|
+
*
|
|
403
|
+
* lookups: {
|
|
404
|
+
* 'some lookup': function( el ) {
|
|
405
|
+
* if ( someCondition )
|
|
406
|
+
* return CKEDITOR.LINEUTILS_BEFORE;
|
|
407
|
+
* },
|
|
408
|
+
* ...
|
|
409
|
+
* }
|
|
410
|
+
*
|
|
411
|
+
* @property {Object} lookups
|
|
412
|
+
*/
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* An utility that analyses relations found by
|
|
418
|
+
* CKEDITOR.plugins.lineutils.finder and locates them
|
|
419
|
+
* in the viewport as horizontal lines of specific coordinates.
|
|
420
|
+
*
|
|
421
|
+
* @private
|
|
422
|
+
* @class CKEDITOR.plugins.lineutils.locator
|
|
423
|
+
* @constructor Creates a Locator class instance.
|
|
424
|
+
* @param {CKEDITOR.editor} editor Editor instance that Locator belongs to.
|
|
425
|
+
* @since 4.3
|
|
426
|
+
*/
|
|
427
|
+
function Locator( editor, def ) {
|
|
428
|
+
CKEDITOR.tools.extend( this, def, {
|
|
429
|
+
editor: editor
|
|
430
|
+
}, true );
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
Locator.prototype = {
|
|
434
|
+
/**
|
|
435
|
+
* Localizes Y coordinate for all types of every single relation and stores
|
|
436
|
+
* them in the object.
|
|
437
|
+
*
|
|
438
|
+
* @param {Object} relations {@link CKEDITOR.plugins.lineutils.finder#relations}.
|
|
439
|
+
* @returns {Object} {@link #locations}.
|
|
440
|
+
*/
|
|
441
|
+
locate: ( function() {
|
|
442
|
+
var rel, uid;
|
|
443
|
+
|
|
444
|
+
function locateSibling( rel, type ) {
|
|
445
|
+
var sib = rel.element[ type === CKEDITOR.LINEUTILS_BEFORE ? 'getPrevious' : 'getNext' ]();
|
|
446
|
+
|
|
447
|
+
// Return the middle point between siblings.
|
|
448
|
+
if ( sib && isStatic( sib ) ) {
|
|
449
|
+
rel.siblingRect = sib.getClientRect();
|
|
450
|
+
|
|
451
|
+
if ( type == CKEDITOR.LINEUTILS_BEFORE )
|
|
452
|
+
return ( rel.siblingRect.bottom + rel.elementRect.top ) / 2;
|
|
453
|
+
else
|
|
454
|
+
return ( rel.elementRect.bottom + rel.siblingRect.top ) / 2;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// If there's no sibling, use the edge of an element.
|
|
458
|
+
else {
|
|
459
|
+
if ( type == CKEDITOR.LINEUTILS_BEFORE )
|
|
460
|
+
return rel.elementRect.top;
|
|
461
|
+
else
|
|
462
|
+
return rel.elementRect.bottom;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
return function( relations ) {
|
|
467
|
+
this.locations = {};
|
|
468
|
+
|
|
469
|
+
for ( uid in relations ) {
|
|
470
|
+
rel = relations[ uid ];
|
|
471
|
+
rel.elementRect = rel.element.getClientRect();
|
|
472
|
+
|
|
473
|
+
if ( is( rel.type, CKEDITOR.LINEUTILS_BEFORE ) )
|
|
474
|
+
this.store( uid, CKEDITOR.LINEUTILS_BEFORE, locateSibling( rel, CKEDITOR.LINEUTILS_BEFORE ) );
|
|
475
|
+
|
|
476
|
+
if ( is( rel.type, CKEDITOR.LINEUTILS_AFTER ) )
|
|
477
|
+
this.store( uid, CKEDITOR.LINEUTILS_AFTER, locateSibling( rel, CKEDITOR.LINEUTILS_AFTER ) );
|
|
478
|
+
|
|
479
|
+
// The middle point of the element.
|
|
480
|
+
if ( is( rel.type, CKEDITOR.LINEUTILS_INSIDE ) )
|
|
481
|
+
this.store( uid, CKEDITOR.LINEUTILS_INSIDE, ( rel.elementRect.top + rel.elementRect.bottom ) / 2 );
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return this.locations;
|
|
485
|
+
};
|
|
486
|
+
} )(),
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Calculates distances from every location to given vertical coordinate
|
|
490
|
+
* and sorts locations according to that distance.
|
|
491
|
+
*
|
|
492
|
+
* @param {Number} y The vertical coordinate used for sorting, used as a reference.
|
|
493
|
+
* @param {Number} [howMany] Determines the number "closest locations" to be returned.
|
|
494
|
+
* @returns {Array} Sorted, array representation of {@link #locations}.
|
|
495
|
+
*/
|
|
496
|
+
sort: ( function() {
|
|
497
|
+
var locations, sorted,
|
|
498
|
+
dist, uid, type, i;
|
|
499
|
+
|
|
500
|
+
function distance( y ) {
|
|
501
|
+
return Math.abs( y - locations[ uid ][ type ] );
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
return function( y, howMany ) {
|
|
505
|
+
locations = this.locations;
|
|
506
|
+
sorted = [];
|
|
507
|
+
|
|
508
|
+
for ( uid in locations ) {
|
|
509
|
+
for ( type in locations[ uid ] ) {
|
|
510
|
+
dist = distance( y );
|
|
511
|
+
|
|
512
|
+
// An array is empty.
|
|
513
|
+
if ( !sorted.length )
|
|
514
|
+
sorted.push( { uid: +uid, type: type, dist: dist } );
|
|
515
|
+
else {
|
|
516
|
+
// Sort the array on fly when it's populated.
|
|
517
|
+
for ( i = 0; i < sorted.length; i++ ) {
|
|
518
|
+
if ( dist < sorted[ i ].dist ) {
|
|
519
|
+
sorted.splice( i, 0, { uid: +uid, type: type, dist: dist } );
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// Nothing was inserted, so the distance is bigger than
|
|
525
|
+
// any of already calculated: push to the end.
|
|
526
|
+
if ( i == sorted.length )
|
|
527
|
+
sorted.push( { uid: +uid, type: type, dist: dist } );
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
if ( typeof howMany != 'undefined' )
|
|
533
|
+
return sorted.slice( 0, howMany );
|
|
534
|
+
else
|
|
535
|
+
return sorted;
|
|
536
|
+
};
|
|
537
|
+
} )(),
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Stores the location in a collection.
|
|
541
|
+
*
|
|
542
|
+
* @param {Number} uid Unique identifier of the relation.
|
|
543
|
+
* @param {Number} type One of `CKEDITOR.LINEUTILS_BEFORE`, `CKEDITOR.LINEUTILS_AFTER` and `CKEDITOR.LINEUTILS_INSIDE`.
|
|
544
|
+
* @param {Number} y Vertical position of the relation.
|
|
545
|
+
*/
|
|
546
|
+
store: function( uid, type, y ) {
|
|
547
|
+
if ( !this.locations[ uid ] )
|
|
548
|
+
this.locations[ uid ] = {};
|
|
549
|
+
|
|
550
|
+
this.locations[ uid ][ type ] = y;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* @readonly
|
|
555
|
+
* @property {Object} locations
|
|
556
|
+
*/
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
var tipCss = {
|
|
560
|
+
display: 'block',
|
|
561
|
+
width: '0px',
|
|
562
|
+
height: '0px',
|
|
563
|
+
'border-color': 'transparent',
|
|
564
|
+
'border-style': 'solid',
|
|
565
|
+
position: 'absolute',
|
|
566
|
+
top: '-6px'
|
|
567
|
+
},
|
|
568
|
+
|
|
569
|
+
lineStyle = {
|
|
570
|
+
height: '0px',
|
|
571
|
+
'border-top': '1px dashed red',
|
|
572
|
+
position: 'absolute',
|
|
573
|
+
'z-index': 9999
|
|
574
|
+
},
|
|
575
|
+
|
|
576
|
+
lineTpl =
|
|
577
|
+
'<div data-cke-lineutils-line="1" class="cke_reset_all" style="{lineStyle}">' +
|
|
578
|
+
'<span style="{tipLeftStyle}"> </span>' +
|
|
579
|
+
'<span style="{tipRightStyle}"> </span>' +
|
|
580
|
+
'</div>';
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* An utility that draws horizontal lines in DOM according to locations
|
|
584
|
+
* returned by CKEDITOR.plugins.lineutils.locator.
|
|
585
|
+
*
|
|
586
|
+
* @private
|
|
587
|
+
* @class CKEDITOR.plugins.lineutils.liner
|
|
588
|
+
* @constructor Creates a Liner class instance.
|
|
589
|
+
* @param {CKEDITOR.editor} editor Editor instance that Liner belongs to.
|
|
590
|
+
* @param {Object} def Liner's definition.
|
|
591
|
+
* @since 4.3
|
|
592
|
+
*/
|
|
593
|
+
function Liner( editor, def ) {
|
|
594
|
+
var editable = editor.editable();
|
|
595
|
+
|
|
596
|
+
CKEDITOR.tools.extend( this, {
|
|
597
|
+
editor: editor,
|
|
598
|
+
editable: editable,
|
|
599
|
+
doc: editor.document,
|
|
600
|
+
win: editor.window,
|
|
601
|
+
container: CKEDITOR.document.getBody(),
|
|
602
|
+
winTop: CKEDITOR.document.getWindow()
|
|
603
|
+
}, def, true );
|
|
604
|
+
|
|
605
|
+
this.hidden = {};
|
|
606
|
+
this.visible = {};
|
|
607
|
+
|
|
608
|
+
this.inline = editable.isInline();
|
|
609
|
+
|
|
610
|
+
if ( !this.inline )
|
|
611
|
+
this.frame = this.win.getFrame();
|
|
612
|
+
|
|
613
|
+
this.queryViewport();
|
|
614
|
+
|
|
615
|
+
// Callbacks must be wrapped. Otherwise they're not attached
|
|
616
|
+
// to global DOM objects (i.e. topmost window) for every editor
|
|
617
|
+
// because they're treated as duplicates. They belong to the
|
|
618
|
+
// same prototype shared among Liner instances.
|
|
619
|
+
var queryViewport = CKEDITOR.tools.bind( this.queryViewport, this ),
|
|
620
|
+
hideVisible = CKEDITOR.tools.bind( this.hideVisible, this ),
|
|
621
|
+
removeAll = CKEDITOR.tools.bind( this.removeAll, this );
|
|
622
|
+
|
|
623
|
+
editable.attachListener( this.winTop, 'resize', queryViewport );
|
|
624
|
+
editable.attachListener( this.winTop, 'scroll', queryViewport );
|
|
625
|
+
|
|
626
|
+
editable.attachListener( this.winTop, 'resize', hideVisible );
|
|
627
|
+
editable.attachListener( this.win, 'scroll', hideVisible );
|
|
628
|
+
|
|
629
|
+
editable.attachListener( this.inline ? editable : this.frame, 'mouseout', function( evt ) {
|
|
630
|
+
var x = evt.data.$.clientX,
|
|
631
|
+
y = evt.data.$.clientY;
|
|
632
|
+
|
|
633
|
+
this.queryViewport();
|
|
634
|
+
|
|
635
|
+
// Check if mouse is out of the element (iframe/editable).
|
|
636
|
+
if ( x <= this.rect.left || x >= this.rect.right || y <= this.rect.top || y >= this.rect.bottom )
|
|
637
|
+
this.hideVisible();
|
|
638
|
+
|
|
639
|
+
// Check if mouse is out of the top-window vieport.
|
|
640
|
+
if ( x <= 0 || x >= this.winTopPane.width || y <= 0 || y >= this.winTopPane.height )
|
|
641
|
+
this.hideVisible();
|
|
642
|
+
}, this );
|
|
643
|
+
|
|
644
|
+
editable.attachListener( editor, 'resize', queryViewport );
|
|
645
|
+
editable.attachListener( editor, 'mode', removeAll );
|
|
646
|
+
editor.on( 'destroy', removeAll );
|
|
647
|
+
|
|
648
|
+
this.lineTpl = new CKEDITOR.template( lineTpl ).output( {
|
|
649
|
+
lineStyle: CKEDITOR.tools.writeCssText(
|
|
650
|
+
CKEDITOR.tools.extend( {}, lineStyle, this.lineStyle, true )
|
|
651
|
+
),
|
|
652
|
+
tipLeftStyle: CKEDITOR.tools.writeCssText(
|
|
653
|
+
CKEDITOR.tools.extend( {}, tipCss, {
|
|
654
|
+
left: '0px',
|
|
655
|
+
'border-left-color': 'red',
|
|
656
|
+
'border-width': '6px 0 6px 6px'
|
|
657
|
+
}, this.tipCss, this.tipLeftStyle, true )
|
|
658
|
+
),
|
|
659
|
+
tipRightStyle: CKEDITOR.tools.writeCssText(
|
|
660
|
+
CKEDITOR.tools.extend( {}, tipCss, {
|
|
661
|
+
right: '0px',
|
|
662
|
+
'border-right-color': 'red',
|
|
663
|
+
'border-width': '6px 6px 6px 0'
|
|
664
|
+
}, this.tipCss, this.tipRightStyle, true )
|
|
665
|
+
)
|
|
666
|
+
} );
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
Liner.prototype = {
|
|
670
|
+
/**
|
|
671
|
+
* Permanently removes all lines (both hidden and visible) from DOM.
|
|
672
|
+
*/
|
|
673
|
+
removeAll: function() {
|
|
674
|
+
var l;
|
|
675
|
+
|
|
676
|
+
for ( l in this.hidden ) {
|
|
677
|
+
this.hidden[ l ].remove();
|
|
678
|
+
delete this.hidden[ l ];
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
for ( l in this.visible ) {
|
|
682
|
+
this.visible[ l ].remove();
|
|
683
|
+
delete this.visible[ l ];
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Hides a given line.
|
|
689
|
+
*
|
|
690
|
+
* @param {CKEDITOR.dom.element} line The line to be hidden.
|
|
691
|
+
*/
|
|
692
|
+
hideLine: function( line ) {
|
|
693
|
+
var uid = line.getUniqueId();
|
|
694
|
+
|
|
695
|
+
line.hide();
|
|
696
|
+
|
|
697
|
+
this.hidden[ uid ] = line;
|
|
698
|
+
delete this.visible[ uid ];
|
|
699
|
+
},
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Shows a given line.
|
|
703
|
+
*
|
|
704
|
+
* @param {CKEDITOR.dom.element} line The line to be shown.
|
|
705
|
+
*/
|
|
706
|
+
showLine: function( line ) {
|
|
707
|
+
var uid = line.getUniqueId();
|
|
708
|
+
|
|
709
|
+
line.show();
|
|
710
|
+
|
|
711
|
+
this.visible[ uid ] = line;
|
|
712
|
+
delete this.hidden[ uid ];
|
|
713
|
+
},
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Hides all visible lines.
|
|
717
|
+
*/
|
|
718
|
+
hideVisible: function() {
|
|
719
|
+
for ( var l in this.visible )
|
|
720
|
+
this.hideLine( this.visible[ l ] );
|
|
721
|
+
},
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Shows a line at given location.
|
|
725
|
+
*
|
|
726
|
+
* @param {Object} location Location object containing unique identifier of the relation
|
|
727
|
+
* and its type. Usually returned by {@link CKEDITOR.plugins.lineutils.locator#sort}.
|
|
728
|
+
* @param {Function} [callback] A callback to be called once the line is shown.
|
|
729
|
+
*/
|
|
730
|
+
placeLine: function( location, callback ) {
|
|
731
|
+
var styles, line, l;
|
|
732
|
+
|
|
733
|
+
// No style means that line would be out of viewport.
|
|
734
|
+
if ( !( styles = this.getStyle( location.uid, location.type ) ) )
|
|
735
|
+
return;
|
|
736
|
+
|
|
737
|
+
// Search for any visible line of a different hash first.
|
|
738
|
+
// It's faster to re-position visible line than to show it.
|
|
739
|
+
for ( l in this.visible ) {
|
|
740
|
+
if ( this.visible[ l ].getCustomData( 'hash' ) !== this.hash ) {
|
|
741
|
+
line = this.visible[ l ];
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Search for any hidden line of a different hash.
|
|
747
|
+
if ( !line ) {
|
|
748
|
+
for ( l in this.hidden ) {
|
|
749
|
+
if ( this.hidden[ l ].getCustomData( 'hash' ) !== this.hash ) {
|
|
750
|
+
this.showLine( ( line = this.hidden[ l ] ) );
|
|
751
|
+
break;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// If no line available, add the new one.
|
|
757
|
+
if ( !line )
|
|
758
|
+
this.showLine( ( line = this.addLine() ) );
|
|
759
|
+
|
|
760
|
+
// Mark the line with current hash.
|
|
761
|
+
line.setCustomData( 'hash', this.hash );
|
|
762
|
+
|
|
763
|
+
// Mark the line as visible.
|
|
764
|
+
this.visible[ line.getUniqueId() ] = line;
|
|
765
|
+
|
|
766
|
+
line.setStyles( styles );
|
|
767
|
+
|
|
768
|
+
callback && callback( line );
|
|
769
|
+
},
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Creates style set to be used by the line, representing a particular
|
|
773
|
+
* relation (location).
|
|
774
|
+
*
|
|
775
|
+
* @param {Number} uid Unique identifier of the relation.
|
|
776
|
+
* @param {Number} type Type of the relation.
|
|
777
|
+
* @returns {Object} An object containing styles.
|
|
778
|
+
*/
|
|
779
|
+
getStyle: function( uid, type ) {
|
|
780
|
+
var rel = this.relations[ uid ],
|
|
781
|
+
loc = this.locations[ uid ][ type ],
|
|
782
|
+
styles = {},
|
|
783
|
+
hdiff;
|
|
784
|
+
|
|
785
|
+
// Line should be between two elements.
|
|
786
|
+
if ( rel.siblingRect )
|
|
787
|
+
styles.width = Math.max( rel.siblingRect.width, rel.elementRect.width );
|
|
788
|
+
// Line is relative to a single element.
|
|
789
|
+
else
|
|
790
|
+
styles.width = rel.elementRect.width;
|
|
791
|
+
|
|
792
|
+
// Let's calculate the vertical position of the line.
|
|
793
|
+
if ( this.inline )
|
|
794
|
+
styles.top = loc + this.winTopScroll.y;
|
|
795
|
+
else
|
|
796
|
+
styles.top = this.rect.top + this.winTopScroll.y + loc;
|
|
797
|
+
|
|
798
|
+
// Check if line would be vertically out of the viewport.
|
|
799
|
+
if ( styles.top - this.winTopScroll.y < this.rect.top || styles.top - this.winTopScroll.y > this.rect.bottom )
|
|
800
|
+
return false;
|
|
801
|
+
|
|
802
|
+
// Now let's calculate the horizontal alignment (left and width).
|
|
803
|
+
if ( this.inline )
|
|
804
|
+
styles.left = rel.elementRect.left;
|
|
805
|
+
else {
|
|
806
|
+
if ( rel.elementRect.left > 0 )
|
|
807
|
+
styles.left = this.rect.left + rel.elementRect.left;
|
|
808
|
+
|
|
809
|
+
// H-scroll case. Left edge of element may be out of viewport.
|
|
810
|
+
else {
|
|
811
|
+
styles.width += rel.elementRect.left;
|
|
812
|
+
styles.left = this.rect.left;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// H-scroll case. Right edge of element may be out of viewport.
|
|
816
|
+
if ( ( hdiff = styles.left + styles.width - ( this.rect.left + this.winPane.width ) ) > 0 )
|
|
817
|
+
styles.width -= hdiff;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// Finally include horizontal scroll of the global window.
|
|
821
|
+
styles.left += this.winTopScroll.x;
|
|
822
|
+
|
|
823
|
+
// Append 'px' to style values.
|
|
824
|
+
for ( var style in styles )
|
|
825
|
+
styles[ style ] = CKEDITOR.tools.cssLength( styles[ style ] );
|
|
826
|
+
|
|
827
|
+
return styles;
|
|
828
|
+
},
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Adds a new line to DOM.
|
|
832
|
+
*
|
|
833
|
+
* @returns {CKEDITOR.dom.element} A brand-new line.
|
|
834
|
+
*/
|
|
835
|
+
addLine: function() {
|
|
836
|
+
var line = CKEDITOR.dom.element.createFromHtml( this.lineTpl );
|
|
837
|
+
|
|
838
|
+
line.appendTo( this.container );
|
|
839
|
+
|
|
840
|
+
return line;
|
|
841
|
+
},
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Assigns an unique hash to the instance that is later utilized
|
|
845
|
+
* to tell unwanted lines from new ones. This method **must** be called
|
|
846
|
+
* before a new set of relations is to be visualized so {@link #cleanup}
|
|
847
|
+
* eventually hides obsolete lines. This is because lines
|
|
848
|
+
* are re-used between {@link #placeLine} calls and the number of
|
|
849
|
+
* necessary ones may vary according to the number of relations.
|
|
850
|
+
*
|
|
851
|
+
* @param {Object} relations {@link CKEDITOR.plugins.lineutils.finder#relations}.
|
|
852
|
+
* @param {Object} locations {@link CKEDITOR.plugins.lineutils.locator#locations}.
|
|
853
|
+
*/
|
|
854
|
+
prepare: function( relations, locations ) {
|
|
855
|
+
this.relations = relations;
|
|
856
|
+
this.locations = locations;
|
|
857
|
+
this.hash = Math.random();
|
|
858
|
+
},
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Hides all visible lines that don't belong to current hash
|
|
862
|
+
* and no-longer represent relations (locations).
|
|
863
|
+
*
|
|
864
|
+
* See also: {@link #prepare}.
|
|
865
|
+
*/
|
|
866
|
+
cleanup: function() {
|
|
867
|
+
var line;
|
|
868
|
+
|
|
869
|
+
for ( var l in this.visible ) {
|
|
870
|
+
line = this.visible[ l ];
|
|
871
|
+
|
|
872
|
+
if ( line.getCustomData( 'hash' ) !== this.hash )
|
|
873
|
+
this.hideLine( line );
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Queries dimensions of the viewport, editable, frame etc.
|
|
879
|
+
* that are used for correct positioning of the line.
|
|
880
|
+
*/
|
|
881
|
+
queryViewport: function() {
|
|
882
|
+
this.winPane = this.win.getViewPaneSize();
|
|
883
|
+
this.winTopScroll = this.winTop.getScrollPosition();
|
|
884
|
+
this.winTopPane = this.winTop.getViewPaneSize();
|
|
885
|
+
|
|
886
|
+
if ( this.inline )
|
|
887
|
+
this.rect = this.editable.getClientRect();
|
|
888
|
+
else
|
|
889
|
+
this.rect = this.frame.getClientRect();
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
function is( type, flag ) {
|
|
894
|
+
return type & flag;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
var floats = { left: 1, right: 1, center: 1 },
|
|
898
|
+
positions = { absolute: 1, fixed: 1 };
|
|
899
|
+
|
|
900
|
+
function isElement( node ) {
|
|
901
|
+
return node && node.type == CKEDITOR.NODE_ELEMENT;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
function isFloated( el ) {
|
|
905
|
+
return !!( floats[ el.getComputedStyle( 'float' ) ] || floats[ el.getAttribute( 'align' ) ] );
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
function isPositioned( el ) {
|
|
909
|
+
return !!positions[ el.getComputedStyle( 'position' ) ];
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
function isLimit( node ) {
|
|
913
|
+
return isElement( node ) && node.getAttribute( 'contenteditable' ) == 'true';
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
function isStatic( node ) {
|
|
917
|
+
return isElement( node ) && !isFloated( node ) && !isPositioned( node );
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Global namespace holding definitions and global helpers for the lineutils plugin.
|
|
922
|
+
*
|
|
923
|
+
* @private
|
|
924
|
+
* @class
|
|
925
|
+
* @singleton
|
|
926
|
+
* @since 4.3
|
|
927
|
+
*/
|
|
928
|
+
CKEDITOR.plugins.lineutils = {
|
|
929
|
+
finder: Finder,
|
|
930
|
+
locator: Locator,
|
|
931
|
+
liner: Liner
|
|
932
|
+
};
|
|
933
|
+
} )();
|