refinerycms-core 2.1.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/refinery/add.png +0 -0
- data/app/assets/images/refinery/admin_bg.png +0 -0
- data/app/assets/images/refinery/ajax-loader.gif +0 -0
- data/app/assets/images/refinery/branch-end.gif +0 -0
- data/app/assets/images/refinery/branch.gif +0 -0
- data/app/assets/images/refinery/cross.png +0 -0
- data/app/assets/images/refinery/dialogLoadingAnimation.gif +0 -0
- data/app/assets/images/refinery/header_background.png +0 -0
- data/app/assets/images/refinery/hover-gradient.jpg +0 -0
- data/app/assets/images/refinery/icons/accept.png +0 -0
- data/app/assets/images/refinery/icons/add.png +0 -0
- data/app/assets/images/refinery/icons/ajax-loader.gif +0 -0
- data/app/assets/images/refinery/icons/application_edit.png +0 -0
- data/app/assets/images/refinery/icons/application_go.png +0 -0
- data/app/assets/images/refinery/icons/arrow_left.png +0 -0
- data/app/assets/images/refinery/icons/arrow_left_right.png +0 -0
- data/app/assets/images/refinery/icons/arrow_switch.png +0 -0
- data/app/assets/images/refinery/icons/arrow_up.png +0 -0
- data/app/assets/images/refinery/icons/arrow_up_down.png +0 -0
- data/app/assets/images/refinery/icons/bin.png +0 -0
- data/app/assets/images/refinery/icons/bin_closed.png +0 -0
- data/app/assets/images/refinery/icons/cancel.png +0 -0
- data/app/assets/images/refinery/icons/cog_add.png +0 -0
- data/app/assets/images/refinery/icons/cog_edit.png +0 -0
- data/app/assets/images/refinery/icons/cross.png +0 -0
- data/app/assets/images/refinery/icons/delete.png +0 -0
- data/app/assets/images/refinery/icons/doc.png +0 -0
- data/app/assets/images/refinery/icons/down.gif +0 -0
- data/app/assets/images/refinery/icons/edit.png +0 -0
- data/app/assets/images/refinery/icons/email.png +0 -0
- data/app/assets/images/refinery/icons/email_edit.png +0 -0
- data/app/assets/images/refinery/icons/email_go.png +0 -0
- data/app/assets/images/refinery/icons/email_open.png +0 -0
- data/app/assets/images/refinery/icons/eye.png +0 -0
- data/app/assets/images/refinery/icons/folder.png +0 -0
- data/app/assets/images/refinery/icons/folder_open.png +0 -0
- data/app/assets/images/refinery/icons/folder_page_white.png +0 -0
- data/app/assets/images/refinery/icons/image_add.png +0 -0
- data/app/assets/images/refinery/icons/image_edit.png +0 -0
- data/app/assets/images/refinery/icons/img.png +0 -0
- data/app/assets/images/refinery/icons/information.png +0 -0
- data/app/assets/images/refinery/icons/layout_add.png +0 -0
- data/app/assets/images/refinery/icons/layout_edit.png +0 -0
- data/app/assets/images/refinery/icons/locale-blue.svg +15 -0
- data/app/assets/images/refinery/icons/locale.svg +11 -0
- data/app/assets/images/refinery/icons/music.png +0 -0
- data/app/assets/images/refinery/icons/page.png +0 -0
- data/app/assets/images/refinery/icons/page_add.png +0 -0
- data/app/assets/images/refinery/icons/page_edit.png +0 -0
- data/app/assets/images/refinery/icons/page_white_edit.png +0 -0
- data/app/assets/images/refinery/icons/page_white_gear.png +0 -0
- data/app/assets/images/refinery/icons/page_white_put.png +0 -0
- data/app/assets/images/refinery/icons/pdf.png +0 -0
- data/app/assets/images/refinery/icons/ppt.png +0 -0
- data/app/assets/images/refinery/icons/star.png +0 -0
- data/app/assets/images/refinery/icons/tick.png +0 -0
- data/app/assets/images/refinery/icons/up.gif +0 -0
- data/app/assets/images/refinery/icons/user_add.png +0 -0
- data/app/assets/images/refinery/icons/user_comment.png +0 -0
- data/app/assets/images/refinery/icons/user_edit.png +0 -0
- data/app/assets/images/refinery/icons/xls.png +0 -0
- data/app/assets/images/refinery/icons/zip.png +0 -0
- data/app/assets/images/refinery/icons/zoom.png +0 -0
- data/app/assets/images/refinery/logo-large.png +0 -0
- data/app/assets/images/refinery/logo-medium.png +0 -0
- data/app/assets/images/refinery/logo-site-bar.png +0 -0
- data/app/assets/images/refinery/logo-small-medium.png +0 -0
- data/app/assets/images/refinery/logo-small.png +0 -0
- data/app/assets/images/refinery/logo-tiny.png +0 -0
- data/app/assets/images/refinery/logo.png +0 -0
- data/app/assets/images/refinery/nav-3-background.gif +0 -0
- data/app/assets/images/refinery/nav_inactive_background.png +0 -0
- data/app/assets/images/refinery/orange_button.png +0 -0
- data/app/assets/images/refinery/page_bg.png +0 -0
- data/app/assets/images/refinery/text_field_background.png +0 -0
- data/app/assets/images/refinery/tooltip-nib.gif +0 -0
- data/app/assets/images/refinery/tooltip-nib.png +0 -0
- data/app/assets/javascripts/admin.js +7 -6
- data/app/assets/javascripts/refinery/admin.js.erb +99 -60
- data/app/assets/javascripts/refinery/ajaxy_pagination.js.coffee +2 -5
- data/app/assets/javascripts/refinery/application.js +8 -0
- data/app/assets/javascripts/refinery/core.js +4 -18
- data/app/assets/javascripts/refinery/interface.js.coffee.erb +5 -29
- data/app/assets/javascripts/refinery/modal_dialogs.js.erb +0 -105
- data/app/assets/javascripts/refinery/nestedsortables.js +183 -110
- data/app/assets/javascripts/refinery/refinery.js.erb +3 -9
- data/app/assets/javascripts/refinery/serializelist.js +1 -1
- data/app/assets/javascripts/refinery/site_bar.js +0 -5
- data/app/assets/javascripts/refinery/sortable_list.js +10 -11
- data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +1 -1
- data/app/assets/stylesheets/application.scss +2 -0
- data/app/assets/stylesheets/refinery/_colours.scss +18 -0
- data/app/assets/stylesheets/refinery/_icons.scss +85 -0
- data/app/assets/stylesheets/refinery/{layout.css.scss → _layout.scss} +306 -338
- data/app/assets/stylesheets/refinery/_mixins.scss +84 -0
- data/app/assets/stylesheets/refinery/{submenu.css.scss → _submenu.scss} +2 -2
- data/app/assets/stylesheets/refinery/{tooltips.css.scss → _tooltips.scss} +0 -0
- data/app/assets/stylesheets/refinery/_ui.scss +252 -0
- data/app/assets/stylesheets/refinery/{formatting.css.scss → formatting.scss} +0 -0
- data/app/assets/stylesheets/refinery/refinery.scss +10 -0
- data/app/assets/stylesheets/refinery/site_bar.scss +126 -0
- data/app/assets/stylesheets/refinery/{theme.css.scss → theme.scss} +0 -0
- data/app/controllers/refinery/admin/core_controller.rb +2 -7
- data/app/controllers/refinery/admin/dialogs_controller.rb +4 -3
- data/app/controllers/refinery/admin_controller.rb +0 -1
- data/app/controllers/refinery/fast_controller.rb +0 -4
- data/app/helpers/refinery/admin/visual_editor_helper.rb +13 -0
- data/app/helpers/refinery/admin_helper.rb +4 -0
- data/app/helpers/refinery/custom_assets_helper.rb +2 -2
- data/app/helpers/refinery/image_helper.rb +9 -8
- data/app/helpers/refinery/meta_helper.rb +1 -1
- data/app/helpers/refinery/site_bar_helper.rb +16 -2
- data/app/helpers/refinery/tag_helper.rb +38 -5
- data/app/models/refinery/core/base_model.rb +3 -1
- data/app/views/layouts/refinery/admin.html.erb +12 -10
- data/app/views/layouts/refinery/admin_dialog.html.erb +1 -4
- data/app/views/refinery/_content_page.html.erb +1 -1
- data/app/views/refinery/_google_analytics.html.erb +8 -9
- data/app/views/refinery/_head.html.erb +1 -1
- data/app/views/refinery/_javascripts.html.erb +0 -15
- data/app/views/refinery/_message.html.erb +1 -1
- data/app/views/refinery/_site_bar.html.erb +9 -6
- data/app/views/refinery/admin/_error_messages.html.erb +4 -4
- data/app/views/refinery/admin/_form_actions.html.erb +1 -0
- data/app/views/refinery/admin/_form_advanced_options_menu.html.erb +3 -4
- data/app/views/refinery/admin/_head.html.erb +3 -0
- data/app/views/refinery/admin/_image_picker.html.erb +4 -5
- data/app/views/refinery/admin/_javascripts.html.erb +4 -9
- data/app/views/refinery/admin/_locale_picker.html.erb +9 -2
- data/app/views/refinery/admin/_make_sortable.html.erb +8 -6
- data/app/views/refinery/admin/_menu.html.erb +2 -15
- data/app/views/refinery/admin/_menu_item.html.erb +3 -0
- data/app/views/refinery/admin/_resource_picker.html.erb +12 -22
- data/app/views/refinery/admin/_search.html.erb +1 -1
- data/app/views/refinery/admin/_tabbed_fields.html.erb +2 -2
- data/app/views/refinery/admin/_wysiwyg.html.erb +1 -1
- data/{lib/generators/refinery/cms/templates/app/decorators/controllers/refinery/.gitkeep → app/views/refinery/admin/dialog_success.html.erb} +0 -0
- data/app/views/refinery/admin/dialogs/show.html.erb +1 -19
- data/config/initializers/assets.rb +6 -0
- data/config/locales/ca.yml +84 -0
- data/config/locales/cs.yml +12 -5
- data/config/locales/en.yml +6 -2
- data/config/locales/fr.yml +15 -11
- data/config/locales/hu.yml +3 -1
- data/config/locales/it.yml +5 -1
- data/config/locales/ja.yml +2 -2
- data/config/locales/pt.yml +5 -3
- data/config/locales/ru.yml +7 -0
- data/config/locales/sl.yml +0 -3
- data/config/locales/tr.yml +43 -41
- data/config/routes.rb +1 -4
- data/lib/generators/refinery/cms/cms_generator.rb +68 -26
- data/lib/generators/refinery/cms/templates/app/decorators/{models/refinery/.gitkeep → controllers/refinery/.keep} +0 -0
- data/lib/generators/refinery/{form/templates/.gitkeep → cms/templates/app/decorators/models/refinery/.keep} +0 -0
- data/lib/generators/refinery/cms/templates/config/database.yml.mysql +3 -3
- data/lib/generators/refinery/cms/templates/config/database.yml.postgresql +3 -3
- data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +18 -5
- data/lib/generators/refinery/dummy/dummy_generator.rb +3 -1
- data/lib/generators/refinery/dummy/templates/rails/application.js +3 -0
- data/lib/generators/refinery/dummy/templates/rails/application.rb.erb +0 -2
- data/lib/generators/refinery/dummy/templates/rails/blank.png +0 -0
- data/lib/generators/refinery/dummy/templates/rails/routes.rb +1 -1
- data/lib/generators/refinery/engine/engine_generator.rb +3 -2
- data/lib/generators/refinery/engine/templates/Gemfile +9 -4
- data/lib/generators/refinery/engine/templates/Rakefile +3 -4
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +11 -2
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +2 -2
- data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/singular_name.rb.erb +5 -5
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_actions.html.erb +7 -12
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_form.html.erb +8 -8
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +3 -3
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +6 -11
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +1 -1
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/plural_name/show.html.erb +4 -4
- data/lib/generators/refinery/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb +2 -9
- data/lib/generators/refinery/engine/templates/db/seeds.rb.erb +13 -19
- data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb +0 -4
- data/lib/generators/refinery/engine/templates/readme.md +3 -3
- data/lib/generators/refinery/engine/templates/refinerycms-extension_plural_name.gemspec +1 -0
- data/lib/generators/refinery/engine/templates/spec/features/refinery/namespace/admin/plural_name_spec.rb.erb +25 -28
- data/lib/generators/refinery/engine/templates/spec/models/refinery/namespace/singular_name_spec.rb.erb +1 -1
- data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +1 -1
- data/lib/refinery.rb +7 -9
- data/lib/refinery/admin/base_controller.rb +42 -32
- data/lib/refinery/application_controller.rb +25 -17
- data/lib/refinery/cli.rb +54 -19
- data/lib/refinery/core.rb +5 -0
- data/lib/refinery/core/authorisation_adapter.rb +11 -0
- data/lib/refinery/core/authorisation_manager.rb +14 -0
- data/lib/refinery/core/configuration.rb +25 -4
- data/lib/refinery/core/default_route.rb +16 -0
- data/lib/refinery/core/engine.rb +44 -25
- data/lib/refinery/core/nil_user.rb +42 -0
- data/lib/refinery/crud.rb +40 -29
- data/lib/refinery/extension_generation.rb +11 -22
- data/lib/refinery/generators/generated_attribute.rb +54 -0
- data/lib/refinery/generators/named_base.rb +16 -0
- data/lib/refinery/menu.rb +3 -2
- data/lib/refinery/menu_item.rb +1 -1
- data/lib/refinery/plugin.rb +27 -43
- data/lib/refinery/plugins.rb +22 -26
- data/lib/refinery/users_manager.rb +8 -0
- data/lib/refinery/version.rb +7 -3
- data/lib/tasks/refinery.rake +7 -0
- data/license.md +1 -1
- data/refinerycms-core.gemspec +11 -8
- data/spec/controllers/refinery/admin/dummy_controller_spec.rb +23 -11
- data/spec/controllers/refinery/sitemap_controller_spec.rb +2 -2
- data/spec/features/refinery/admin/custom_assets_spec.rb +12 -10
- data/spec/features/refinery/admin/dialogs_spec.rb +5 -5
- data/spec/features/refinery/admin/xhr_paging_spec.rb +24 -38
- data/spec/features/refinery/application_layout_spec.rb +3 -3
- data/spec/features/refinery/core_spec.rb +1 -1
- data/spec/features/refinery/site_bar_spec.rb +44 -23
- data/spec/helpers/refinery/admin_helper_spec.rb +15 -0
- data/spec/helpers/refinery/custom_assets_helper_spec.rb +15 -23
- data/spec/helpers/refinery/html_truncation_helper_spec.rb +10 -5
- data/spec/helpers/refinery/meta_helper_spec.rb +3 -3
- data/spec/helpers/refinery/pagination_helper_spec.rb +7 -7
- data/spec/helpers/refinery/tag_helper_spec.rb +4 -4
- data/spec/helpers/refinery/translation_helper_spec.rb +3 -3
- data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +30 -25
- data/spec/lib/generators/refinery/core/core_generator_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +7 -8
- data/spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb +15 -15
- data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +9 -9
- data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb +1 -1
- data/spec/lib/refinery/application_controller_spec.rb +16 -16
- data/spec/lib/refinery/authorisation_manager_spec.rb +10 -0
- data/spec/lib/refinery/cli_spec.rb +83 -21
- data/spec/lib/refinery/core/configuration_spec.rb +5 -5
- data/spec/lib/refinery/core/nil_user_spec.rb +39 -0
- data/spec/lib/refinery/core_spec.rb +39 -30
- data/spec/lib/refinery/crud_spec.rb +70 -59
- data/spec/lib/refinery/menu_spec.rb +4 -4
- data/spec/lib/refinery/plugin_spec.rb +56 -45
- data/spec/lib/refinery/plugins_spec.rb +39 -87
- data/spec/lib/refinery/users_manager_spec.rb +9 -0
- data/spec/support/refinery.rb +3 -8
- data/vendor/assets/fonts/font-awesome/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.svg +565 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/stylesheets/_font-awesome-compass.scss +5 -0
- data/vendor/assets/stylesheets/_font-awesome-sprockets.scss +5 -0
- data/vendor/assets/stylesheets/_font-awesome.scss +17 -0
- data/vendor/assets/stylesheets/font-awesome/_animated.scss +34 -0
- data/vendor/assets/stylesheets/font-awesome/_bordered-pulled.scss +16 -0
- data/vendor/assets/stylesheets/font-awesome/_core.scss +12 -0
- data/vendor/assets/stylesheets/font-awesome/_extras.scss +44 -0
- data/vendor/assets/stylesheets/font-awesome/_fixed-width.scss +6 -0
- data/vendor/assets/stylesheets/font-awesome/_icons.scss +596 -0
- data/vendor/assets/stylesheets/font-awesome/_larger.scss +13 -0
- data/vendor/assets/stylesheets/font-awesome/_list.scss +19 -0
- data/vendor/assets/stylesheets/font-awesome/_mixins.scss +26 -0
- data/vendor/assets/stylesheets/font-awesome/_path.scss +14 -0
- data/vendor/assets/stylesheets/font-awesome/_rotated-flipped.scss +20 -0
- data/vendor/assets/stylesheets/font-awesome/_stacked.scss +20 -0
- data/vendor/assets/stylesheets/font-awesome/_variables.scss +606 -0
- metadata +144 -441
- data/app/assets/images/refinery/carousel-left.png +0 -0
- data/app/assets/images/refinery/carousel-right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/arrow_redo.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/arrow_undo.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/eye.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/article.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/aside.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/blockquote.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/command.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/details.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/figcaption.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/figure.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/footer.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/header.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/hgroup.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/mark.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/meter.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/nav.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/p.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/pre.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/progress.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/readme.md +0 -1
- data/app/assets/images/wymeditor/skins/refinery/html5/rp.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/rt.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/ruby.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/section.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/summary.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/time.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-blockquote.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-p.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-pre.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/link_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/link_break.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/page_code.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/page_paste.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/photo_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/style.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/table_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_center.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_justify.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_left.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_bold.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_indent.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_indent_remove.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_italic.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_list_bullets.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_list_numbers.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_paragraph.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_strikethrough.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_subscript.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_superscript.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_underline.png +0 -0
- data/app/assets/images/wymeditor/skins/wymeditor_icon.png +0 -0
- data/app/assets/javascripts/refinery/boot_wym.js.erb +0 -285
- data/app/assets/javascripts/refinery/sortable_menu.js.coffee.erb +0 -20
- data/app/assets/javascripts/refinery/wymeditor.js +0 -37
- data/app/assets/javascripts/wymeditor/GPL-license.txt +0 -278
- data/app/assets/javascripts/wymeditor/MIT-license.txt +0 -20
- data/app/assets/javascripts/wymeditor/README +0 -35
- data/app/assets/javascripts/wymeditor/browsers/ie.js.erb +0 -224
- data/app/assets/javascripts/wymeditor/browsers/mozilla.js.erb +0 -292
- data/app/assets/javascripts/wymeditor/browsers/opera.js.erb +0 -123
- data/app/assets/javascripts/wymeditor/browsers/webkit.js.erb +0 -283
- data/app/assets/javascripts/wymeditor/classes.js.erb +0 -1575
- data/app/assets/javascripts/wymeditor/functions.js.erb +0 -222
- data/app/assets/javascripts/wymeditor/lang/bg.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/ca.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/cs.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/da.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/de.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/en.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/es.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/fa.js +0 -46
- data/app/assets/javascripts/wymeditor/lang/fi.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/fr.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/he.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/hu.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/it.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/ja.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/lv.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/nb.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/nl.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/nn.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/pl.js +0 -56
- data/app/assets/javascripts/wymeditor/lang/pt-BR.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/pt.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/rs.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/ru.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/sk.js +0 -56
- data/app/assets/javascripts/wymeditor/lang/sl.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/sv.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/tr.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/vi.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/zh-CN.js +0 -47
- data/app/assets/javascripts/wymeditor/prototypes.js.erb +0 -1103
- data/app/assets/javascripts/wymeditor/setup.js.erb +0 -622
- data/app/assets/javascripts/wymeditor/skins/refinery/skin.js +0 -45
- data/app/assets/javascripts/wymeditor/validators.js.erb +0 -777
- data/app/assets/stylesheets/refinery/refinery.css +0 -15
- data/app/assets/stylesheets/refinery/site_bar.css.scss +0 -92
- data/app/assets/stylesheets/refinery/ui.css.scss +0 -103
- data/app/assets/stylesheets/wymeditor/skins/refinery/skin.css.scss +0 -530
- data/app/assets/stylesheets/wymeditor/skins/refinery/wymiframe.css.scss +0 -156
- data/app/helpers/refinery/admin/core_helper.rb +0 -6
- data/app/helpers/refinery/admin/dialogs_helper.rb +0 -6
- data/app/helpers/refinery/fast_helper.rb +0 -4
- data/app/helpers/refinery/sitemap_helper.rb +0 -4
- data/app/views/refinery/wymiframe.html.erb +0 -14
- data/lib/generators/refinery/form/USAGE +0 -20
- data/lib/generators/refinery/form/form_generator.rb +0 -25
- data/lib/generators/refinery/form/templates/.gitignore +0 -2
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +0 -54
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb.erb +0 -45
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +0 -53
- data/lib/generators/refinery/form/templates/app/mailers/refinery/namespace/mailer.rb.erb +0 -22
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb +0 -34
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/singular_name.rb.erb +0 -49
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +0 -23
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +0 -25
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_submenu.html.erb +0 -29
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +0 -4
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/show.html.erb +0 -52
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/spam.html.erb +0 -27
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_confirmation_email_form.html.erb +0 -51
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_notification_recipients_form.html.erb +0 -21
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/edit.html.erb +0 -5
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/confirmation.html.erb +0 -1
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/notification.html.erb +0 -17
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb +0 -43
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/thank_you.html.erb +0 -1
- data/lib/generators/refinery/form/templates/config/locales/cs.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/da.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/de.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/en.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/es.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/fr.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/it.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/lv.yml +0 -77
- data/lib/generators/refinery/form/templates/config/locales/nb.yml +0 -75
- data/lib/generators/refinery/form/templates/config/locales/nl.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/pt-BR.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/ru.yml +0 -77
- data/lib/generators/refinery/form/templates/config/locales/sk.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/sl.yml +0 -67
- data/lib/generators/refinery/form/templates/config/locales/tr.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/zh-CN.yml +0 -78
- data/lib/generators/refinery/form/templates/config/routes.rb.erb +0 -26
- data/lib/generators/refinery/form/templates/db/migrate/1_create_plural_name.rb.erb +0 -39
- data/lib/generators/refinery/form/templates/db/seeds.rb.erb +0 -31
- data/lib/generators/refinery/form/templates/lib/generators/refinery/plural_name_generator.rb.erb +0 -20
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name.rb.erb +0 -18
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb +0 -27
- data/lib/generators/refinery/form/templates/lib/refinerycms-plural_name.rb.erb +0 -1
- data/lib/generators/refinery/form/templates/refinerycms-plural_name.gemspec +0 -16
- data/lib/generators/refinery/form/templates/script/rails +0 -10
- data/lib/refinery/activity.rb +0 -113
- data/lib/refinery/ext/action_view/helpers/form_builder.rb +0 -9
- data/lib/refinery/ext/action_view/helpers/form_helper.rb +0 -20
- data/lib/refinery/ext/action_view/helpers/form_tag_helper.rb +0 -10
- data/spec/controllers/refinery/admin/refinery_core_controller_spec.rb +0 -19
- data/spec/controllers/refinery/fast_controller_spec.rb +0 -12
- data/spec/lib/generators/refinery/form/form_generator_spec.rb +0 -99
- data/spec/lib/refinery/activity_spec.rb +0 -46
- data/spec/support/background_selenium_firefox_driver.rb +0 -14
- data/vendor/assets/javascripts/jquery/jquery.jcarousel.js +0 -900
@@ -1,292 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* WYMeditor : what you see is What You Mean web-based editor
|
3
|
-
* Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
|
4
|
-
* Dual licensed under the MIT (MIT-license.txt)
|
5
|
-
* and GPL (GPL-license.txt) licenses.
|
6
|
-
*
|
7
|
-
* For further information visit:
|
8
|
-
* http://www.wymeditor.org/
|
9
|
-
*
|
10
|
-
* File Name:
|
11
|
-
* jquery.wymeditor.mozilla.js
|
12
|
-
* Gecko specific class and functions.
|
13
|
-
* See the documentation for more info.
|
14
|
-
*
|
15
|
-
* File Authors:
|
16
|
-
* Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
|
17
|
-
* Volker Mische (vmx a-t gmx dotde)
|
18
|
-
* Bermi Ferrer (wymeditor a-t bermi dotorg)
|
19
|
-
* Frédéric Palluel-Lafleur (fpalluel a-t gmail dotcom)
|
20
|
-
*/
|
21
|
-
|
22
|
-
WYMeditor.WymClassMozilla = function(wym) {
|
23
|
-
|
24
|
-
this._wym = wym;
|
25
|
-
this._class = "class";
|
26
|
-
this._newLine = "\n";
|
27
|
-
};
|
28
|
-
|
29
|
-
WYMeditor.WymClassMozilla.prototype.initIframe = function(iframe) {
|
30
|
-
|
31
|
-
var wym = this;
|
32
|
-
|
33
|
-
this._iframe = iframe;
|
34
|
-
this._doc = iframe.contentDocument;
|
35
|
-
|
36
|
-
//add css rules from options
|
37
|
-
|
38
|
-
var styles = this._doc.styleSheets[0];
|
39
|
-
var aCss = eval(this._options.editorStyles);
|
40
|
-
|
41
|
-
this.addCssRules(this._doc, aCss);
|
42
|
-
|
43
|
-
this._doc.title = this._wym._index;
|
44
|
-
|
45
|
-
//set the text direction
|
46
|
-
$('html', this._doc).attr('dir', this._options.direction);
|
47
|
-
|
48
|
-
//add error class to body if the containing iframe has an error class
|
49
|
-
$('.fieldWithErrors iframe').contents().find('body').addClass('fieldWithErrors');
|
50
|
-
|
51
|
-
//init html value
|
52
|
-
this.html(this._wym._html);
|
53
|
-
|
54
|
-
//init designMode
|
55
|
-
this.enableDesignMode();
|
56
|
-
|
57
|
-
//pre-bind functions
|
58
|
-
if($.isFunction(this._options.preBind)) this._options.preBind(this);
|
59
|
-
|
60
|
-
//bind external events
|
61
|
-
this._wym.bindEvents();
|
62
|
-
|
63
|
-
//bind editor keydown events
|
64
|
-
$(this._doc).bind("keydown", this.keydown);
|
65
|
-
|
66
|
-
//bind editor keyup events
|
67
|
-
$(this._doc).bind("keyup", this.keyup);
|
68
|
-
|
69
|
-
//bind editor paste events
|
70
|
-
$(this._doc).bind("paste", this.intercept_paste);
|
71
|
-
|
72
|
-
//bind editor focus events (used to reset designmode - Gecko bug)
|
73
|
-
$(this._doc).bind("focus", function (){
|
74
|
-
// Fix scope
|
75
|
-
wym.enableDesignMode.call(wym);
|
76
|
-
});
|
77
|
-
|
78
|
-
//post-init functions
|
79
|
-
if($.isFunction(this._options.postInit)) this._options.postInit(this);
|
80
|
-
|
81
|
-
//add event listeners to doc elements, e.g. images
|
82
|
-
this.listen();
|
83
|
-
};
|
84
|
-
|
85
|
-
/* @name html
|
86
|
-
* @description Get/Set the html value
|
87
|
-
*/
|
88
|
-
WYMeditor.WymClassMozilla.prototype.html = function(html) {
|
89
|
-
|
90
|
-
if(typeof html === 'string') {
|
91
|
-
|
92
|
-
//disable designMode
|
93
|
-
try { this._doc.designMode = "off"; } catch(e) { };
|
94
|
-
|
95
|
-
//replace em by i and strong by bold
|
96
|
-
//(designMode issue)
|
97
|
-
html = html.replace(/<em(\b[^>]*)>/gi, "<i$1>")
|
98
|
-
.replace(/<\/em>/gi, "</i>")
|
99
|
-
.replace(/<strong(\b[^>]*)>/gi, "<b$1>")
|
100
|
-
.replace(/<\/strong>/gi, "</b>");
|
101
|
-
|
102
|
-
//update the html body
|
103
|
-
$(this._doc.body).html(html);
|
104
|
-
|
105
|
-
//re-init designMode
|
106
|
-
this.enableDesignMode();
|
107
|
-
}
|
108
|
-
else {
|
109
|
-
return($(this._doc.body).html());
|
110
|
-
}
|
111
|
-
};
|
112
|
-
|
113
|
-
WYMeditor.WymClassMozilla.prototype._exec = function(cmd,param) {
|
114
|
-
|
115
|
-
if(!this.selected()) return(false);
|
116
|
-
|
117
|
-
switch(cmd) {
|
118
|
-
|
119
|
-
case WYMeditor.INDENT: case WYMeditor.OUTDENT:
|
120
|
-
var focusNode = this.selected();
|
121
|
-
var sel = this._iframe.contentWindow.getSelection();
|
122
|
-
var anchorNode = sel.anchorNode;
|
123
|
-
if(anchorNode.nodeName == "#text") {
|
124
|
-
anchorNode = anchorNode.parentNode;
|
125
|
-
}
|
126
|
-
|
127
|
-
focusNode = this.findUp(focusNode, WYMeditor.BLOCKS);
|
128
|
-
anchorNode = this.findUp(anchorNode, WYMeditor.BLOCKS);
|
129
|
-
|
130
|
-
if(focusNode && focusNode == anchorNode && focusNode.tagName.toLowerCase() == WYMeditor.LI) {
|
131
|
-
var ancestor = focusNode.parentNode.parentNode;
|
132
|
-
|
133
|
-
if(focusNode.parentNode.childNodes.length > 1 || $.inArray(ancestor.tagName.toLowerCase(), [WYMeditor.OL, WYMeditor.UL]) > -1) {
|
134
|
-
this._doc.execCommand(cmd,'',null);
|
135
|
-
}
|
136
|
-
}
|
137
|
-
break;
|
138
|
-
|
139
|
-
default:
|
140
|
-
if(param) this._doc.execCommand(cmd,'',param);
|
141
|
-
else this._doc.execCommand(cmd,'',null);
|
142
|
-
}
|
143
|
-
|
144
|
-
//set to P if parent = BODY
|
145
|
-
var container = this.selected();
|
146
|
-
if(container.tagName.toLowerCase() == WYMeditor.BODY) {
|
147
|
-
this._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P);
|
148
|
-
}
|
149
|
-
};
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
/* @name selected
|
154
|
-
* @description Returns the selected container
|
155
|
-
*/
|
156
|
-
WYMeditor.WymClassMozilla.prototype.selected = function(upgrade_text_nodes) {
|
157
|
-
|
158
|
-
if (upgrade_text_nodes == null || upgrade_text_nodes.toString() != "true") { upgrade_text_nodes = false; }
|
159
|
-
var sel = this._iframe.contentWindow.getSelection();
|
160
|
-
var node = sel.focusNode;
|
161
|
-
if(node) {
|
162
|
-
if(node.nodeName == "#text"){
|
163
|
-
if (upgrade_text_nodes && sel.toString().length > 0) {
|
164
|
-
actual_node = null;
|
165
|
-
parent_node = sel.focusNode.parentNode;
|
166
|
-
if (parent_node != null) {
|
167
|
-
for (i=0;i<parent_node.childNodes.length;i++){
|
168
|
-
child_node = parent_node.childNodes[i];
|
169
|
-
if (child_node.nodeName != "#text" && child_node.innerHTML == sel.toString()){
|
170
|
-
actual_node = child_node;
|
171
|
-
}
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
if (actual_node == null) {
|
176
|
-
return this.switchTo(sel, 'span');
|
177
|
-
} else {
|
178
|
-
return actual_node;
|
179
|
-
}
|
180
|
-
}
|
181
|
-
else {
|
182
|
-
return node.parentNode;
|
183
|
-
}
|
184
|
-
}
|
185
|
-
else {
|
186
|
-
return(node);
|
187
|
-
}
|
188
|
-
}
|
189
|
-
else {
|
190
|
-
return(null);
|
191
|
-
}
|
192
|
-
};
|
193
|
-
|
194
|
-
WYMeditor.WymClassMozilla.prototype.addCssRule = function(styles, oCss) {
|
195
|
-
styles.insertRule(oCss.name + " {" + oCss.css + "}", styles.cssRules.length);
|
196
|
-
};
|
197
|
-
|
198
|
-
|
199
|
-
//keydown handler, mainly used for keyboard shortcuts
|
200
|
-
WYMeditor.WymClassMozilla.prototype.keydown = function(e) {
|
201
|
-
|
202
|
-
//'this' is the doc
|
203
|
-
var wym = WYMeditor.INSTANCES[this.title];
|
204
|
-
|
205
|
-
if(e.ctrlKey){
|
206
|
-
if(e.keyCode == 66){
|
207
|
-
//CTRL+b => STRONG
|
208
|
-
wym._exec(WYMeditor.BOLD);
|
209
|
-
return false;
|
210
|
-
}
|
211
|
-
if(e.keyCode == 73){
|
212
|
-
//CTRL+i => EMPHASIS
|
213
|
-
wym._exec(WYMeditor.ITALIC);
|
214
|
-
return false;
|
215
|
-
}
|
216
|
-
}
|
217
|
-
else if(e.keyCode == 13) {
|
218
|
-
if(!e.shiftKey){
|
219
|
-
//fix PRE bug #73
|
220
|
-
container = wym.selected();
|
221
|
-
if(container && container.tagName.toLowerCase() == WYMeditor.PRE) {
|
222
|
-
e.preventDefault();
|
223
|
-
wym.insert('<p></p>');
|
224
|
-
}
|
225
|
-
}
|
226
|
-
}
|
227
|
-
};
|
228
|
-
|
229
|
-
//keyup handler, mainly used for cleanups
|
230
|
-
WYMeditor.WymClassMozilla.prototype.keyup = function(e) {
|
231
|
-
|
232
|
-
//'this' is the doc
|
233
|
-
if ((wym = WYMeditor.INSTANCES[this.title]) != null)
|
234
|
-
{
|
235
|
-
wym._selected_image = null;
|
236
|
-
$(wym._iframe).contents().find('.selected_by_wym').removeClass('selected_by_wym');
|
237
|
-
var container = null;
|
238
|
-
|
239
|
-
if(e.keyCode == 13 && !e.shiftKey) {
|
240
|
-
//RETURN key - cleanup <br><br> between paragraphs
|
241
|
-
$(wym._doc.body).children(WYMeditor.BR).remove();
|
242
|
-
|
243
|
-
//fix PRE bug #73
|
244
|
-
if((container = wym.selected()) && container.tagName.toLowerCase() == WYMeditor.PRE) {
|
245
|
-
wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); //create P after PRE
|
246
|
-
}
|
247
|
-
}
|
248
|
-
else if(($.inArray(e.keyCode, [8, 17, 46, 224]) == -1) && !e.metaKey && !e.ctrlKey) {
|
249
|
-
//NOT BACKSPACE, NOT DELETE, NOT CTRL, NOT COMMAND
|
250
|
-
//text nodes replaced by P
|
251
|
-
wym.format_block();
|
252
|
-
}
|
253
|
-
}
|
254
|
-
};
|
255
|
-
|
256
|
-
WYMeditor.WymClassMozilla.prototype.enableDesignMode = function() {
|
257
|
-
if(this._doc.designMode == "off") {
|
258
|
-
try {
|
259
|
-
this._doc.designMode = "on";
|
260
|
-
this._doc.execCommand("styleWithCSS", '', false);
|
261
|
-
}
|
262
|
-
catch(e) { }
|
263
|
-
}
|
264
|
-
};
|
265
|
-
|
266
|
-
WYMeditor.WymClassMozilla.prototype.openBlockTag = function(tag, attributes)
|
267
|
-
{
|
268
|
-
var attributes = this.validator.getValidTagAttributes(tag, attributes);
|
269
|
-
|
270
|
-
// Handle Mozilla styled spans
|
271
|
-
if (tag === 'span' && attributes.style) {
|
272
|
-
var new_tag = this.getTagForStyle(attributes.style);
|
273
|
-
if (new_tag) {
|
274
|
-
tag = new_tag;
|
275
|
-
this._tag_stack.pop();
|
276
|
-
this._tag_stack.push(tag);
|
277
|
-
attributes.style = '';
|
278
|
-
}
|
279
|
-
}
|
280
|
-
|
281
|
-
this.output += this.helper.tag(tag, attributes, true);
|
282
|
-
};
|
283
|
-
|
284
|
-
|
285
|
-
WYMeditor.WymClassMozilla.prototype.getTagForStyle = function(style) {
|
286
|
-
|
287
|
-
if(/bold/.test(style)) return 'strong';
|
288
|
-
if(/italic/.test(style)) return 'em';
|
289
|
-
if(/sub/.test(style)) return 'sub';
|
290
|
-
if(/super/.test(style)) return 'super';
|
291
|
-
return false;
|
292
|
-
};
|
@@ -1,123 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* WYMeditor : what you see is What You Mean web-based editor
|
3
|
-
* Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
|
4
|
-
* Dual licensed under the MIT (MIT-license.txt)
|
5
|
-
* and GPL (GPL-license.txt) licenses.
|
6
|
-
*
|
7
|
-
* For further information visit:
|
8
|
-
* http://www.wymeditor.org/
|
9
|
-
*
|
10
|
-
* File Name:
|
11
|
-
* jquery.wymeditor.opera.js
|
12
|
-
* Opera specific class and functions.
|
13
|
-
* See the documentation for more info.
|
14
|
-
*
|
15
|
-
* File Authors:
|
16
|
-
* Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
|
17
|
-
*/
|
18
|
-
|
19
|
-
WYMeditor.WymClassOpera = function(wym) {
|
20
|
-
|
21
|
-
this._wym = wym;
|
22
|
-
this._class = "class";
|
23
|
-
this._newLine = "\r\n";
|
24
|
-
};
|
25
|
-
|
26
|
-
WYMeditor.WymClassOpera.prototype.initIframe = function(iframe) {
|
27
|
-
|
28
|
-
this._iframe = iframe;
|
29
|
-
this._doc = iframe.contentWindow.document;
|
30
|
-
|
31
|
-
//add css rules from options
|
32
|
-
var styles = this._doc.styleSheets[0];
|
33
|
-
var aCss = eval(this._options.editorStyles);
|
34
|
-
|
35
|
-
this.addCssRules(this._doc, aCss);
|
36
|
-
|
37
|
-
this._doc.title = this._wym._index;
|
38
|
-
|
39
|
-
//set the text direction
|
40
|
-
$('html', this._doc).attr('dir', this._options.direction);
|
41
|
-
|
42
|
-
//init designMode
|
43
|
-
this._doc.designMode = "on";
|
44
|
-
|
45
|
-
//init html value
|
46
|
-
this.html(this._wym._html);
|
47
|
-
|
48
|
-
//pre-bind functions
|
49
|
-
if($.isFunction(this._options.preBind)) this._options.preBind(this);
|
50
|
-
|
51
|
-
//bind external events
|
52
|
-
this._wym.bindEvents();
|
53
|
-
|
54
|
-
//bind editor keydown events
|
55
|
-
$(this._doc).bind("keydown", this.keydown);
|
56
|
-
|
57
|
-
//bind editor events
|
58
|
-
$(this._doc).bind("keyup", this.keyup);
|
59
|
-
|
60
|
-
// bind paste events for when this is supported.
|
61
|
-
$(this._doc).bind("paste", this.intercept_paste);
|
62
|
-
|
63
|
-
//post-init functions
|
64
|
-
if($.isFunction(this._options.postInit)) this._options.postInit(this);
|
65
|
-
|
66
|
-
//add event listeners to doc elements, e.g. images
|
67
|
-
this.listen();
|
68
|
-
};
|
69
|
-
|
70
|
-
WYMeditor.WymClassOpera.prototype._exec = function(cmd,param) {
|
71
|
-
if(param) this._doc.execCommand(cmd,false,param);
|
72
|
-
else this._doc.execCommand(cmd);
|
73
|
-
};
|
74
|
-
|
75
|
-
WYMeditor.WymClassOpera.prototype.selected = function() {
|
76
|
-
var sel=this._iframe.contentWindow.getSelection();
|
77
|
-
var node=sel.focusNode;
|
78
|
-
if(node) {
|
79
|
-
if(node.nodeName=="#text") {
|
80
|
-
return(node.parentNode);
|
81
|
-
}
|
82
|
-
else {
|
83
|
-
return(node);
|
84
|
-
}
|
85
|
-
} else {
|
86
|
-
return(null);
|
87
|
-
}
|
88
|
-
};
|
89
|
-
|
90
|
-
WYMeditor.WymClassOpera.prototype.addCssRule = function(styles, oCss) {
|
91
|
-
styles.insertRule(oCss.name + " {" + oCss.css + "}", styles.cssRules.length);
|
92
|
-
};
|
93
|
-
|
94
|
-
//keydown handler
|
95
|
-
WYMeditor.WymClassOpera.prototype.keydown = function(e) {
|
96
|
-
|
97
|
-
//'this' is the doc
|
98
|
-
var wym = WYMeditor.INSTANCES[this.title];
|
99
|
-
var sel = wym._iframe.contentWindow.getSelection();
|
100
|
-
startNode = sel.getRangeAt(0).startContainer;
|
101
|
-
|
102
|
-
//Get a P instead of no container
|
103
|
-
if(!$(startNode).parentsOrSelf(WYMeditor.MAIN_CONTAINERS.join(","))[0]
|
104
|
-
&& !$(startNode).parentsOrSelf('li')
|
105
|
-
&& e.keyCode != WYMeditor.KEY.ENTER
|
106
|
-
&& e.keyCode != WYMeditor.KEY.LEFT
|
107
|
-
&& e.keyCode != WYMeditor.KEY.UP
|
108
|
-
&& e.keyCode != WYMeditor.KEY.RIGHT
|
109
|
-
&& e.keyCode != WYMeditor.KEY.DOWN
|
110
|
-
&& e.keyCode != WYMeditor.KEY.BACKSPACE
|
111
|
-
&& e.keyCode != WYMeditor.KEY.DELETE)
|
112
|
-
wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P);
|
113
|
-
|
114
|
-
};
|
115
|
-
|
116
|
-
//keyup handler
|
117
|
-
WYMeditor.WymClassOpera.prototype.keyup = function(e) {
|
118
|
-
|
119
|
-
//'this' is the doc
|
120
|
-
var wym = WYMeditor.INSTANCES[this.title];
|
121
|
-
wym._selected_image = null;
|
122
|
-
$(wym._iframe).contents().find('.selected_by_wym').removeClass('selected_by_wym');
|
123
|
-
};
|
@@ -1,283 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* WYMeditor : what you see is What You Mean web-based editor
|
3
|
-
* Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
|
4
|
-
* Dual licensed under the MIT (MIT-license.txt)
|
5
|
-
* and GPL (GPL-license.txt) licenses.
|
6
|
-
*
|
7
|
-
* For further information visit:
|
8
|
-
* http://www.wymeditor.org/
|
9
|
-
*
|
10
|
-
* File Name:
|
11
|
-
* jquery.wymeditor.safari.js
|
12
|
-
* Safari specific class and functions.
|
13
|
-
* See the documentation for more info.
|
14
|
-
*
|
15
|
-
* File Authors:
|
16
|
-
* Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
|
17
|
-
* Scott Lewis (lewiscot a-t gmail dotcom)
|
18
|
-
*/
|
19
|
-
|
20
|
-
WYMeditor.WymClassSafari = function(wym) {
|
21
|
-
|
22
|
-
this._wym = wym;
|
23
|
-
this._class = "class";
|
24
|
-
this._newLine = "\n";
|
25
|
-
};
|
26
|
-
|
27
|
-
WYMeditor.WymClassSafari.prototype.initIframe = function(iframe) {
|
28
|
-
|
29
|
-
this._iframe = iframe;
|
30
|
-
this._doc = iframe.contentDocument;
|
31
|
-
|
32
|
-
//add css rules from options
|
33
|
-
|
34
|
-
var styles = this._doc.styleSheets[0];
|
35
|
-
var aCss = eval(this._options.editorStyles);
|
36
|
-
|
37
|
-
this.addCssRules(this._doc, aCss);
|
38
|
-
|
39
|
-
this._doc.title = this._wym._index;
|
40
|
-
|
41
|
-
//set the text direction
|
42
|
-
$('html', this._doc).attr('dir', this._options.direction);
|
43
|
-
|
44
|
-
//init designMode
|
45
|
-
this._doc.designMode = "on";
|
46
|
-
|
47
|
-
//init html value
|
48
|
-
this.html(this._wym._html);
|
49
|
-
|
50
|
-
//pre-bind functions
|
51
|
-
if($.isFunction(this._options.preBind)) this._options.preBind(this);
|
52
|
-
|
53
|
-
//bind external events
|
54
|
-
this._wym.bindEvents();
|
55
|
-
|
56
|
-
//bind editor keydown events
|
57
|
-
$(this._doc).bind("keydown", this.keydown);
|
58
|
-
|
59
|
-
//bind editor keyup events
|
60
|
-
$(this._doc).bind("keyup", this.keyup);
|
61
|
-
|
62
|
-
// bind paste events
|
63
|
-
$(this._doc).bind("paste", this.intercept_paste);
|
64
|
-
|
65
|
-
//post-init functions
|
66
|
-
if($.isFunction(this._options.postInit)) this._options.postInit(this);
|
67
|
-
|
68
|
-
//add event listeners to doc elements, e.g. images
|
69
|
-
this.listen();
|
70
|
-
};
|
71
|
-
|
72
|
-
WYMeditor.WymClassSafari.prototype._exec = function(cmd,param) {
|
73
|
-
|
74
|
-
var wym = this;
|
75
|
-
if(!wym.selected()) {
|
76
|
-
return(false);
|
77
|
-
}
|
78
|
-
|
79
|
-
switch(cmd) {
|
80
|
-
|
81
|
-
case WYMeditor.INDENT: case WYMeditor.OUTDENT:
|
82
|
-
|
83
|
-
var focusNode = wym.selected();
|
84
|
-
var sel = wym._iframe.contentWindow.getSelection();
|
85
|
-
var anchorNode = sel.anchorNode;
|
86
|
-
if(anchorNode.nodeName == "#text") {
|
87
|
-
anchorNode = anchorNode.parentNode;
|
88
|
-
}
|
89
|
-
|
90
|
-
focusNode = wym.findUp(focusNode, WYMeditor.BLOCKS);
|
91
|
-
anchorNode = wym.findUp(anchorNode, WYMeditor.BLOCKS);
|
92
|
-
|
93
|
-
if(focusNode && focusNode == anchorNode
|
94
|
-
&& focusNode.tagName.toLowerCase() == WYMeditor.LI) {
|
95
|
-
|
96
|
-
var ancestor = focusNode.parentNode.parentNode;
|
97
|
-
|
98
|
-
if(focusNode.parentNode.childNodes.length > 1 || $.inArray(ancestor.tagName.toLowerCase(), [WYMeditor.OL, WYMeditor.UL]) > -1) {
|
99
|
-
wym._doc.execCommand(cmd,'',null);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
|
103
|
-
break;
|
104
|
-
|
105
|
-
case WYMeditor.INSERT_ORDEREDLIST: case WYMeditor.INSERT_UNORDEREDLIST:
|
106
|
-
|
107
|
-
this._doc.execCommand(cmd,'',null);
|
108
|
-
|
109
|
-
//Safari creates lists in e.g. paragraphs.
|
110
|
-
//Find the container, and remove it.
|
111
|
-
var focusNode = this.selected();
|
112
|
-
var container = this.findUp(focusNode, WYMeditor.MAIN_CONTAINERS);
|
113
|
-
if(container) $(container).replaceWith($(container).html());
|
114
|
-
|
115
|
-
break;
|
116
|
-
|
117
|
-
default:
|
118
|
-
if(param) this._doc.execCommand(cmd,'',param);
|
119
|
-
else this._doc.execCommand(cmd,'',null);
|
120
|
-
}
|
121
|
-
|
122
|
-
};
|
123
|
-
|
124
|
-
/* @name selected
|
125
|
-
* @description Returns the selected container
|
126
|
-
*/
|
127
|
-
WYMeditor.WymClassSafari.prototype.selected = function(upgrade_text_nodes) {
|
128
|
-
|
129
|
-
if (upgrade_text_nodes == null || upgrade_text_nodes.toString() != "true") { upgrade_text_nodes = false; }
|
130
|
-
var sel = this._iframe.contentWindow.getSelection();
|
131
|
-
var node = sel.focusNode;
|
132
|
-
if(node) {
|
133
|
-
if(node.nodeName == "#text"){
|
134
|
-
if (upgrade_text_nodes && sel.toString().length > 0) {
|
135
|
-
actual_node = null;
|
136
|
-
parent_node = sel.focusNode.parentNode;
|
137
|
-
if (parent_node != null) {
|
138
|
-
for (i=0;i<parent_node.childNodes.length;i++){
|
139
|
-
child_node = parent_node.childNodes[i];
|
140
|
-
if (child_node.textContent == sel.toString()){
|
141
|
-
actual_node = child_node.parentNode;
|
142
|
-
}
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
|
-
if (actual_node == null) {
|
147
|
-
this._selected_item = this.switchTo(sel, 'span');
|
148
|
-
return this._selected_item;
|
149
|
-
} else {
|
150
|
-
return actual_node;
|
151
|
-
}
|
152
|
-
}
|
153
|
-
else {
|
154
|
-
return node.parentNode;
|
155
|
-
}
|
156
|
-
}
|
157
|
-
else { return(node); }
|
158
|
-
}
|
159
|
-
else { return(null); }
|
160
|
-
};
|
161
|
-
|
162
|
-
/* @name toggleClass
|
163
|
-
* @description Toggles class on selected element, or one of its parents
|
164
|
-
*/
|
165
|
-
WYMeditor.WymClassSafari.prototype.toggleClass = function(sClass, jqexpr) {
|
166
|
-
|
167
|
-
var container = null;
|
168
|
-
if (this._selected_image) {
|
169
|
-
container = $(this._selected_image);
|
170
|
-
}
|
171
|
-
else {
|
172
|
-
container = $(this.selected(true) || this._selected_item);
|
173
|
-
}
|
174
|
-
|
175
|
-
if (jqexpr != null) { container = $(container.parentsOrSelf(jqexpr)); }
|
176
|
-
container.toggleClass(sClass);
|
177
|
-
if(!container.attr(WYMeditor.CLASS)) container.removeAttr(this._class);
|
178
|
-
|
179
|
-
};
|
180
|
-
|
181
|
-
WYMeditor.WymClassSafari.prototype.addCssRule = function(styles, oCss) {
|
182
|
-
|
183
|
-
styles.insertRule(oCss.name + " {" + oCss.css + "}",
|
184
|
-
styles.cssRules.length);
|
185
|
-
};
|
186
|
-
|
187
|
-
|
188
|
-
//keydown handler, mainly used for keyboard shortcuts
|
189
|
-
WYMeditor.WymClassSafari.prototype.keydown = function(e) {
|
190
|
-
|
191
|
-
//'this' is the doc
|
192
|
-
var wym = WYMeditor.INSTANCES[this.title];
|
193
|
-
|
194
|
-
if(e.ctrlKey){
|
195
|
-
if(e.keyCode == 66){
|
196
|
-
//CTRL+b => STRONG
|
197
|
-
wym._exec(WYMeditor.BOLD);
|
198
|
-
e.preventDefault();
|
199
|
-
}
|
200
|
-
if(e.keyCode == 73){
|
201
|
-
//CTRL+i => EMPHASIS
|
202
|
-
wym._exec(WYMeditor.ITALIC);
|
203
|
-
e.preventDefault();
|
204
|
-
}
|
205
|
-
} else if(e.shiftKey && e.keyCode == 13) {
|
206
|
-
wym._exec('InsertLineBreak');
|
207
|
-
e.preventDefault();
|
208
|
-
}
|
209
|
-
};
|
210
|
-
|
211
|
-
//keyup handler, mainly used for cleanups
|
212
|
-
WYMeditor.WymClassSafari.prototype.keyup = function(e) {
|
213
|
-
|
214
|
-
//'this' is the doc
|
215
|
-
var wym = WYMeditor.INSTANCES[this.title];
|
216
|
-
|
217
|
-
wym._selected_image = null;
|
218
|
-
$(wym._iframe).contents().find('.selected_by_wym').removeClass('selected_by_wym');
|
219
|
-
var container = null;
|
220
|
-
|
221
|
-
if(e.keyCode == 13 && !e.shiftKey) {
|
222
|
-
//RETURN key
|
223
|
-
//cleanup <br><br> between paragraphs
|
224
|
-
$(wym._doc.body).children(WYMeditor.BR).remove();
|
225
|
-
|
226
|
-
//fix PRE bug #73
|
227
|
-
container = wym.selected();
|
228
|
-
if(container && container.tagName.toLowerCase() == WYMeditor.PRE) {
|
229
|
-
wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); //create P after PRE
|
230
|
-
}
|
231
|
-
}
|
232
|
-
|
233
|
-
else if(($.inArray(e.keyCode, [8, 17, 46, 224]) == -1) && !e.metaKey && !e.ctrlKey)
|
234
|
-
{
|
235
|
-
//NOT BACKSPACE, NOT DELETE, NOT CTRL, NOT COMMAND
|
236
|
-
//text nodes replaced by P
|
237
|
-
|
238
|
-
container = wym.selected();
|
239
|
-
if (container && (name = container.tagName.toLowerCase())) {
|
240
|
-
//fix forbidden main containers
|
241
|
-
if($.inArray(name, ['strong', 'b', 'em', 'i', 'sub', 'sup', 'a', 'span']) > -1) {
|
242
|
-
name = container.parentNode.tagName.toLowerCase();
|
243
|
-
}
|
244
|
-
|
245
|
-
if($.inArray(name, [WYMeditor.BODY, WYMeditor.DIV]) > -1) {
|
246
|
-
wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); //fix #110 for DIV
|
247
|
-
}
|
248
|
-
}
|
249
|
-
}
|
250
|
-
};
|
251
|
-
|
252
|
-
WYMeditor.WymClassSafari.prototype.openBlockTag = function(tag, attributes)
|
253
|
-
{
|
254
|
-
var attributes = this.validator.getValidTagAttributes(tag, attributes);
|
255
|
-
|
256
|
-
// Handle Safari styled spans
|
257
|
-
if(tag == 'span' && attributes.style) {
|
258
|
-
new_tag = this.getTagForStyle(attributes.style);
|
259
|
-
if(new_tag) {
|
260
|
-
this._tag_stack.pop();
|
261
|
-
var tag = new_tag;
|
262
|
-
this._tag_stack.push(new_tag);
|
263
|
-
attributes.style = '';
|
264
|
-
|
265
|
-
//should fix #125 - also removed the xhtml() override
|
266
|
-
if(typeof attributes['class'] == 'string') {
|
267
|
-
attributes['class'] = attributes['class'].replace(/apple-style-span/gi, '');
|
268
|
-
}
|
269
|
-
|
270
|
-
}
|
271
|
-
}
|
272
|
-
|
273
|
-
this.output += this.helper.tag(tag, attributes, true);
|
274
|
-
};
|
275
|
-
|
276
|
-
WYMeditor.WymClassSafari.prototype.getTagForStyle = function(style) {
|
277
|
-
|
278
|
-
if(/bold/.test(style)) return 'strong';
|
279
|
-
if(/italic/.test(style)) return 'em';
|
280
|
-
if(/sub/.test(style)) return 'sub';
|
281
|
-
if(/super/.test(style)) return 'sup';
|
282
|
-
return false;
|
283
|
-
};
|