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,7 +1,6 @@
|
|
1
1
|
@init_ajaxy_pagination = ->
|
2
|
-
if typeof (window.history.pushState) == "function"
|
3
|
-
|
4
|
-
pagination_pages.on "click", (e) ->
|
2
|
+
if typeof (window.history.pushState) == "function"
|
3
|
+
$(".pagination_container .pagination a").on "click", (e) ->
|
5
4
|
navigate_to = @href.replace(/(\&(amp\;)?)?from_page\=\d+/, "")
|
6
5
|
navigate_to += "&from_page=" + $(".current").text()
|
7
6
|
navigate_to = navigate_to.replace("?&", "?").replace(/\s+/, "")
|
@@ -9,5 +8,3 @@
|
|
9
8
|
window.history.pushState path: current_state_location, "", navigate_to
|
10
9
|
$(document).paginateTo navigate_to
|
11
10
|
e.preventDefault()
|
12
|
-
$(".pagination_container").applyMinimumHeightFromChildren()
|
13
|
-
$(".pagination_frame").css "top", "0px" if $(".pagination_container").find(".pagination").length == 0
|
@@ -5,25 +5,11 @@ $(document).ready(function(){
|
|
5
5
|
init_flash_messages();
|
6
6
|
});
|
7
7
|
|
8
|
-
init_flash_messages = function(){
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}).animate({'opacity': '1'}, 550);
|
13
|
-
$('#flash_close').on('click', function(e) {
|
14
|
-
try {
|
15
|
-
$('#flash').animate({
|
16
|
-
'opacity': 0,
|
17
|
-
'visibility': 'hidden'
|
18
|
-
}, 330, function() {
|
19
|
-
$('#flash').hide();
|
20
|
-
});
|
21
|
-
} catch(ex) {
|
22
|
-
$('#flash').hide();
|
23
|
-
}
|
8
|
+
init_flash_messages = function() {
|
9
|
+
|
10
|
+
$('#flash_container').on('click', '#flash_close', function(e) {
|
11
|
+
$('#flash').hide();
|
24
12
|
e.preventDefault();
|
25
13
|
});
|
26
14
|
$('#flash.flash_message').prependTo('#records');
|
27
15
|
};
|
28
|
-
|
29
|
-
|
@@ -1,36 +1,12 @@
|
|
1
1
|
@init_interface = ->
|
2
|
-
$("body#dialog_container.dialog").addClass "iframed"
|
2
|
+
$("body#dialog_container.dialog").addClass "iframed" if parent and parent.document.location.href != document.location.href
|
3
3
|
$("input:submit:not(.button)").addClass "button"
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
if (instance = WYMeditor.INSTANCES[$((textarea.next(".wym_box").find("iframe").attr("id") or "").split("_")).last().get(0)])?
|
8
|
-
if (next = textarea.parent().next())? and next.length > 0
|
9
|
-
next.find("input, textarea").keydown($.proxy((e) ->
|
10
|
-
shiftHeld = e.shiftKey
|
11
|
-
if shiftHeld and e.keyCode == $.ui.keyCode.TAB
|
12
|
-
@_iframe.contentWindow.focus()
|
13
|
-
e.preventDefault()
|
14
|
-
, instance)).keyup (e) ->
|
15
|
-
shiftHeld = false
|
16
|
-
if (prev = textarea.parent().prev())? and prev.length > 0
|
17
|
-
prev.find("input, textarea").keydown $.proxy((e) ->
|
18
|
-
if e.keyCode == $.ui.keyCode.TAB
|
19
|
-
@_iframe.contentWindow.focus()
|
20
|
-
e.preventDefault()
|
21
|
-
, instance)
|
22
|
-
|
23
|
-
if ($menu = $("#menu")).length > 0
|
24
|
-
$menu.jcarousel
|
25
|
-
vertical: false
|
26
|
-
scroll: 1
|
27
|
-
buttonNextHTML: "<img src='<%= asset_path 'refinery/carousel-right.png' %>' alt='down' height='15' width='10' />"
|
28
|
-
buttonPrevHTML: "<img src='<%= asset_path 'refinery/carousel-left.png' %>' alt='up' height='15' width='10' />"
|
29
|
-
listTag: $menu.get(0).tagName.toLowerCase()
|
30
|
-
itemTag: $menu.children(":first").get(0).tagName.toLowerCase()
|
5
|
+
if typeof(visual_editor_init_interface_hook) != 'undefined'
|
6
|
+
visual_editor_init_interface_hook()
|
31
7
|
|
32
8
|
$("#current_locale li a").click (e) ->
|
33
|
-
$("#current_locale li a span").each (span) ->
|
9
|
+
$("#current_locale li a span.action").each (span) ->
|
34
10
|
$(this).css "display", (if $(this).css("display") == "none" then "" else "none")
|
35
11
|
|
36
12
|
$("#other_locales").animate
|
@@ -45,7 +21,7 @@
|
|
45
21
|
$("form.edit_image .form-actions").css "margin-top": margin_top if margin_top > 0
|
46
22
|
|
47
23
|
$(".form-actions .form-actions-left input:submit#submit_button").click (e) ->
|
48
|
-
$(
|
24
|
+
$(this).nextAll('#spinner').removeClass('hidden_icon').addClass('unhidden_icon')
|
49
25
|
|
50
26
|
$(".form-actions.form-actions-dialog .form-actions-left a.close_dialog").click (e) ->
|
51
27
|
titlebar_close_button = $('.ui-dialog-titlebar-close')
|
@@ -30,108 +30,3 @@ init_modal_dialogs = function(){
|
|
30
30
|
});
|
31
31
|
});
|
32
32
|
};
|
33
|
-
|
34
|
-
init_sortable_menu = function(){
|
35
|
-
var $menu = $('#menu');
|
36
|
-
|
37
|
-
if($menu.length === 0){return;}
|
38
|
-
|
39
|
-
$menu.sortable({
|
40
|
-
axis: 'x',
|
41
|
-
cursor: 'crosshair',
|
42
|
-
connectWith: '.nested',
|
43
|
-
update: function(){
|
44
|
-
$.post('/refinery/update_menu_positions', $menu.sortable('serialize', {
|
45
|
-
key: 'menu[]'
|
46
|
-
, expression: /plugin_([\w]*)$/
|
47
|
-
}));
|
48
|
-
}
|
49
|
-
}).tabs();
|
50
|
-
//Initial status disabled
|
51
|
-
$menu.sortable('disable');
|
52
|
-
|
53
|
-
$menu.find('#menu_reorder').click(function(e){
|
54
|
-
trigger_reordering(e, true);
|
55
|
-
});
|
56
|
-
|
57
|
-
$menu.find('#menu_reorder_done').click(function(e){
|
58
|
-
trigger_reordering(e, false);
|
59
|
-
});
|
60
|
-
};
|
61
|
-
|
62
|
-
trigger_reordering = function(e, enable) {
|
63
|
-
e.preventDefault();
|
64
|
-
$('#menu_reorder, #menu_reorder_done').toggle();
|
65
|
-
$('#site_bar, #content').fadeTo(500, enable ? 0.35 : 1);
|
66
|
-
|
67
|
-
if(enable) {
|
68
|
-
$menu.find('.tab a').click(function(ev){
|
69
|
-
ev.preventDefault();
|
70
|
-
});
|
71
|
-
} else {
|
72
|
-
$menu.find('.tab a').unbind('click');
|
73
|
-
}
|
74
|
-
|
75
|
-
$menu.sortable(enable ? 'enable' : 'disable');
|
76
|
-
};
|
77
|
-
|
78
|
-
init_submit_continue = function(){
|
79
|
-
$('#submit_continue_button').click(submit_and_continue);
|
80
|
-
|
81
|
-
$('form').change(function(e) {
|
82
|
-
$(this).attr('data-changes-made', true);
|
83
|
-
});
|
84
|
-
|
85
|
-
if ((continue_editing_button = $('#continue_editing')).length > 0 && continue_editing_button.attr('rel') != 'no-prompt') {
|
86
|
-
$('#editor_switch a').click(function(e) {
|
87
|
-
if ($('form[data-changes-made]').length > 0) {
|
88
|
-
if (!confirm('<%= ::I18n.t('js.admin.confirm_changes') %>')) {
|
89
|
-
e.preventDefault();
|
90
|
-
}
|
91
|
-
}
|
92
|
-
});
|
93
|
-
}
|
94
|
-
};
|
95
|
-
|
96
|
-
submit_and_continue = function(e, redirect_to) {
|
97
|
-
// ensure wymeditors are up to date.
|
98
|
-
if ($(this).hasClass('wymupdate')) {
|
99
|
-
$.each(WYMeditor.INSTANCES, function(index, wym)
|
100
|
-
{
|
101
|
-
wym.update();
|
102
|
-
});
|
103
|
-
}
|
104
|
-
|
105
|
-
$('#continue_editing').val(true);
|
106
|
-
$('#flash').fadeOut(250);
|
107
|
-
|
108
|
-
$('.fieldWithErrors').removeClass('fieldWithErrors').addClass('field');
|
109
|
-
$('#flash_container .errorExplanation').remove();
|
110
|
-
|
111
|
-
$.post($('#continue_editing').get(0).form.action, $($('#continue_editing').get(0).form).serialize(), function(data) {
|
112
|
-
if (($flash_container = $('#flash_container')).length > 0) {
|
113
|
-
$flash_container.html(data);
|
114
|
-
|
115
|
-
$('#flash').css({'width': 'auto', 'visibility': null}).fadeIn(550);
|
116
|
-
|
117
|
-
$('.errorExplanation').not($('#flash_container .errorExplanation')).remove();
|
118
|
-
|
119
|
-
if ((error_fields = $('#fieldsWithErrors').val()) != null) {
|
120
|
-
$.each(error_fields.split(','), function() {
|
121
|
-
$("#" + this).wrap("<div class='fieldWithErrors' />");
|
122
|
-
});
|
123
|
-
} else if (redirect_to) {
|
124
|
-
window.location = redirect_to;
|
125
|
-
}
|
126
|
-
|
127
|
-
$('.fieldWithErrors:first :input:first').focus();
|
128
|
-
|
129
|
-
$('#continue_editing').val(false);
|
130
|
-
|
131
|
-
init_flash_messages();
|
132
|
-
}
|
133
|
-
});
|
134
|
-
|
135
|
-
e.preventDefault();
|
136
|
-
};
|
137
|
-
|
@@ -1,36 +1,48 @@
|
|
1
1
|
/*
|
2
2
|
* jQuery UI Nested Sortable
|
3
|
-
* v 1.3.
|
4
|
-
* http://mjsarfatti.com/
|
3
|
+
* v 1.3.5 / 21 jun 2012
|
4
|
+
* http://mjsarfatti.com/code/nestedSortable
|
5
5
|
*
|
6
|
-
* Depends:
|
6
|
+
* Depends on:
|
7
7
|
* jquery.ui.sortable.js 1.8+
|
8
8
|
*
|
9
|
-
*
|
10
|
-
*
|
9
|
+
* Copyright (c) 2010-2012 Manuele J Sarfatti
|
10
|
+
* Licensed under the MIT License
|
11
|
+
* http://www.opensource.org/licenses/mit-license.php
|
11
12
|
*/
|
12
13
|
|
13
14
|
(function($) {
|
14
15
|
|
15
|
-
$.widget("
|
16
|
+
$.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, {
|
16
17
|
|
17
18
|
options: {
|
18
19
|
tabSize: 20,
|
19
|
-
disableNesting: '
|
20
|
-
errorClass: '
|
20
|
+
disableNesting: 'mjs-nestedSortable-no-nesting',
|
21
|
+
errorClass: 'mjs-nestedSortable-error',
|
22
|
+
doNotClear: false,
|
21
23
|
listType: 'ol',
|
22
24
|
maxLevels: 0,
|
23
|
-
|
25
|
+
protectRoot: false,
|
26
|
+
rootID: null,
|
27
|
+
rtl: false,
|
28
|
+
isAllowed: function(item, parent) { return true; }
|
24
29
|
},
|
25
30
|
|
26
|
-
_create: function(){
|
27
|
-
if (this.noJumpFix == false)
|
28
|
-
this.element.height(this.element.height());
|
31
|
+
_create: function() {
|
29
32
|
this.element.data('sortable', this.element.data('nestedSortable'));
|
33
|
+
|
34
|
+
if (!this.element.is(this.options.listType))
|
35
|
+
throw new Error('nestedSortable: Please check the listType option is set to your actual list type');
|
36
|
+
|
30
37
|
return $.ui.sortable.prototype._create.apply(this, arguments);
|
31
38
|
},
|
32
39
|
|
33
|
-
|
40
|
+
destroy: function() {
|
41
|
+
this.element
|
42
|
+
.removeData("nestedSortable")
|
43
|
+
.unbind(".nestedSortable");
|
44
|
+
return $.ui.sortable.prototype.destroy.apply(this, arguments);
|
45
|
+
},
|
34
46
|
|
35
47
|
_mouseDrag: function(event) {
|
36
48
|
|
@@ -42,9 +54,11 @@
|
|
42
54
|
this.lastPositionAbs = this.positionAbs;
|
43
55
|
}
|
44
56
|
|
57
|
+
var o = this.options;
|
58
|
+
|
45
59
|
//Do scrolling
|
46
60
|
if(this.options.scroll) {
|
47
|
-
var
|
61
|
+
var scrolled = false;
|
48
62
|
if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
|
49
63
|
|
50
64
|
if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
|
@@ -78,6 +92,9 @@
|
|
78
92
|
//Regenerate the absolute position used for position checks
|
79
93
|
this.positionAbs = this._convertPositionTo("absolute");
|
80
94
|
|
95
|
+
// Find the top offset before rearrangement,
|
96
|
+
var previousTopOffset = this.placeholder.offset().top;
|
97
|
+
|
81
98
|
//Set the helper position
|
82
99
|
if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
|
83
100
|
if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
|
@@ -96,9 +113,12 @@
|
|
96
113
|
//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
|
97
114
|
) {
|
98
115
|
|
116
|
+
$(itemElement).mouseenter();
|
117
|
+
|
99
118
|
this.direction = intersection == 1 ? "down" : "up";
|
100
119
|
|
101
120
|
if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
|
121
|
+
$(itemElement).mouseleave();
|
102
122
|
this._rearrange(event, item);
|
103
123
|
} else {
|
104
124
|
break;
|
@@ -112,12 +132,17 @@
|
|
112
132
|
}
|
113
133
|
}
|
114
134
|
|
115
|
-
var parentItem = (this.placeholder[0].parentNode.parentNode &&
|
116
|
-
|
117
|
-
|
135
|
+
var parentItem = (this.placeholder[0].parentNode.parentNode &&
|
136
|
+
$(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length)
|
137
|
+
? $(this.placeholder[0].parentNode.parentNode)
|
138
|
+
: null,
|
139
|
+
level = this._getLevel(this.placeholder),
|
140
|
+
childLevels = this._getChildLevels(this.helper);
|
141
|
+
|
142
|
+
// To find the previous sibling in the list, keep backtracking until we hit a valid list item.
|
118
143
|
var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;
|
119
144
|
if (previousItem != null) {
|
120
|
-
while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0]) {
|
145
|
+
while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {
|
121
146
|
if (previousItem[0].previousSibling) {
|
122
147
|
previousItem = $(previousItem[0].previousSibling);
|
123
148
|
} else {
|
@@ -127,27 +152,51 @@
|
|
127
152
|
}
|
128
153
|
}
|
129
154
|
|
130
|
-
|
155
|
+
// To find the next sibling in the list, keep stepping forward until we hit a valid list item.
|
156
|
+
var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;
|
157
|
+
if (nextItem != null) {
|
158
|
+
while (nextItem[0].nodeName.toLowerCase() != 'li' || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {
|
159
|
+
if (nextItem[0].nextSibling) {
|
160
|
+
nextItem = $(nextItem[0].nextSibling);
|
161
|
+
} else {
|
162
|
+
nextItem = null;
|
163
|
+
break;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
var newList = document.createElement(o.listType);
|
131
169
|
|
132
170
|
this.beyondMaxLevels = 0;
|
133
171
|
|
134
|
-
// If the item is moved to the left, send it to its parent level
|
135
|
-
if (parentItem != null &&
|
172
|
+
// If the item is moved to the left, send it to its parent's level unless there are siblings below it.
|
173
|
+
if (parentItem != null && nextItem == null &&
|
174
|
+
(o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||
|
175
|
+
!o.rtl && (this.positionAbs.left < parentItem.offset().left))) {
|
136
176
|
parentItem.after(this.placeholder[0]);
|
137
177
|
this._clearEmpty(parentItem[0]);
|
138
178
|
this._trigger("change", event, this._uiHash());
|
139
179
|
}
|
140
|
-
// If the item is below
|
141
|
-
else if (previousItem != null &&
|
142
|
-
|
180
|
+
// If the item is below a sibling and is moved to the right, make it a child of that sibling.
|
181
|
+
else if (previousItem != null &&
|
182
|
+
(o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||
|
183
|
+
!o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {
|
184
|
+
this._isAllowed(previousItem, level, level+childLevels+1);
|
143
185
|
if (!previousItem.children(o.listType).length) {
|
144
186
|
previousItem[0].appendChild(newList);
|
145
187
|
}
|
146
|
-
|
188
|
+
// If this item is being moved from the top, add it to the top of the list.
|
189
|
+
if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {
|
190
|
+
previousItem.children(o.listType).prepend(this.placeholder);
|
191
|
+
}
|
192
|
+
// Otherwise, add it to the bottom of the list.
|
193
|
+
else {
|
194
|
+
previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);
|
195
|
+
}
|
147
196
|
this._trigger("change", event, this._uiHash());
|
148
197
|
}
|
149
198
|
else {
|
150
|
-
this._isAllowed(parentItem, level+childLevels);
|
199
|
+
this._isAllowed(parentItem, level, level+childLevels);
|
151
200
|
}
|
152
201
|
|
153
202
|
//Post events to containers
|
@@ -168,30 +217,48 @@
|
|
168
217
|
|
169
218
|
// If the item is in a position not allowed, send it back
|
170
219
|
if (this.beyondMaxLevels) {
|
171
|
-
var parent = this.placeholder.parent().closest(this.options.items);
|
172
|
-
|
173
|
-
for (var i = this.beyondMaxLevels - 1; i > 0; i--) {
|
174
|
-
parent = parent.parent().closest(this.options.items);
|
175
|
-
}
|
176
220
|
|
177
221
|
this.placeholder.removeClass(this.options.errorClass);
|
178
|
-
|
179
|
-
|
222
|
+
|
223
|
+
if (this.domPosition.prev) {
|
224
|
+
$(this.domPosition.prev).after(this.placeholder);
|
225
|
+
} else {
|
226
|
+
$(this.domPosition.parent).prepend(this.placeholder);
|
227
|
+
}
|
228
|
+
|
229
|
+
this._trigger("revert", event, this._uiHash());
|
230
|
+
|
231
|
+
}
|
232
|
+
|
233
|
+
// Clean last empty ul/ol
|
234
|
+
for (var i = this.items.length - 1; i >= 0; i--) {
|
235
|
+
var item = this.items[i].item[0];
|
236
|
+
this._clearEmpty(item);
|
180
237
|
}
|
181
238
|
|
182
239
|
$.ui.sortable.prototype._mouseStop.apply(this, arguments);
|
183
240
|
|
184
241
|
},
|
185
242
|
|
186
|
-
serialize: function(
|
243
|
+
serialize: function(options) {
|
187
244
|
|
188
|
-
var
|
189
|
-
|
245
|
+
var o = $.extend({}, this.options, options),
|
246
|
+
items = this._getItemsAsjQuery(o && o.connected),
|
247
|
+
str = [];
|
190
248
|
|
191
249
|
$(items).each(function() {
|
192
|
-
var res = ($(o.item || this).attr(o.attribute || 'id') || '')
|
193
|
-
|
194
|
-
|
250
|
+
var res = ($(o.item || this).attr(o.attribute || 'id') || '')
|
251
|
+
.match(o.expression || (/(.+)[-=_](.+)/)),
|
252
|
+
pid = ($(o.item || this).parent(o.listType)
|
253
|
+
.parent(o.items)
|
254
|
+
.attr(o.attribute || 'id') || '')
|
255
|
+
.match(o.expression || (/(.+)[-=_](.+)/));
|
256
|
+
|
257
|
+
if (res) {
|
258
|
+
str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']')
|
259
|
+
+ '='
|
260
|
+
+ (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));
|
261
|
+
}
|
195
262
|
});
|
196
263
|
|
197
264
|
if(!str.length && o.key) {
|
@@ -202,62 +269,67 @@
|
|
202
269
|
|
203
270
|
},
|
204
271
|
|
205
|
-
toHierarchy: function(
|
272
|
+
toHierarchy: function(options) {
|
206
273
|
|
207
|
-
o =
|
208
|
-
|
209
|
-
|
274
|
+
var o = $.extend({}, this.options, options),
|
275
|
+
sDepth = o.startDepthCount || 0,
|
276
|
+
ret = [];
|
210
277
|
|
211
|
-
$(this.element).children(
|
212
|
-
var level = _recursiveItems(
|
278
|
+
$(this.element).children(o.items).each(function () {
|
279
|
+
var level = _recursiveItems(this);
|
213
280
|
ret.push(level);
|
214
281
|
});
|
215
282
|
|
216
283
|
return ret;
|
217
284
|
|
218
|
-
function _recursiveItems(
|
219
|
-
var id = ($(
|
220
|
-
if (id
|
221
|
-
var
|
222
|
-
if ($(
|
223
|
-
|
224
|
-
$(
|
225
|
-
var level = _recursiveItems(
|
226
|
-
|
285
|
+
function _recursiveItems(item) {
|
286
|
+
var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
|
287
|
+
if (id) {
|
288
|
+
var currentItem = {"id" : id[2]};
|
289
|
+
if ($(item).children(o.listType).children(o.items).length > 0) {
|
290
|
+
currentItem.children = [];
|
291
|
+
$(item).children(o.listType).children(o.items).each(function() {
|
292
|
+
var level = _recursiveItems(this);
|
293
|
+
currentItem.children.push(level);
|
227
294
|
});
|
228
295
|
}
|
229
|
-
return
|
296
|
+
return currentItem;
|
230
297
|
}
|
231
298
|
}
|
232
|
-
|
299
|
+
},
|
233
300
|
|
234
|
-
toArray: function(
|
301
|
+
toArray: function(options) {
|
235
302
|
|
236
|
-
o =
|
237
|
-
|
238
|
-
|
239
|
-
|
303
|
+
var o = $.extend({}, this.options, options),
|
304
|
+
sDepth = o.startDepthCount || 0,
|
305
|
+
ret = [],
|
306
|
+
left = 2;
|
240
307
|
|
241
|
-
ret.push({
|
308
|
+
ret.push({
|
309
|
+
"item_id": o.rootID,
|
310
|
+
"parent_id": 'none',
|
311
|
+
"depth": sDepth,
|
312
|
+
"left": '1',
|
313
|
+
"right": ($(o.items, this.element).length + 1) * 2
|
314
|
+
});
|
242
315
|
|
243
|
-
$(this.element).children(
|
316
|
+
$(this.element).children(o.items).each(function () {
|
244
317
|
left = _recursiveArray(this, sDepth + 1, left);
|
245
318
|
});
|
246
319
|
|
247
|
-
|
248
|
-
return a['left'] - b['left'];
|
249
|
-
}
|
250
|
-
ret = ret.sort(_sortByLeft);
|
320
|
+
ret = ret.sort(function(a,b){ return (a.left - b.left); });
|
251
321
|
|
252
322
|
return ret;
|
253
323
|
|
254
324
|
function _recursiveArray(item, depth, left) {
|
255
325
|
|
256
|
-
right = left + 1
|
326
|
+
var right = left + 1,
|
327
|
+
id,
|
328
|
+
pid;
|
257
329
|
|
258
|
-
if ($(item).children(o.listType).children(
|
330
|
+
if ($(item).children(o.listType).children(o.items).length > 0) {
|
259
331
|
depth ++;
|
260
|
-
$(item).children(o.listType).children(
|
332
|
+
$(item).children(o.listType).children(o.items).each(function () {
|
261
333
|
right = _recursiveArray($(this), depth, right);
|
262
334
|
});
|
263
335
|
depth --;
|
@@ -265,38 +337,31 @@
|
|
265
337
|
|
266
338
|
id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));
|
267
339
|
|
268
|
-
if (depth === sDepth + 1)
|
269
|
-
|
270
|
-
|
340
|
+
if (depth === sDepth + 1) {
|
341
|
+
pid = o.rootID;
|
342
|
+
} else {
|
343
|
+
var parentItem = ($(item).parent(o.listType)
|
344
|
+
.parent(o.items)
|
345
|
+
.attr(o.attribute || 'id'))
|
346
|
+
.match(o.expression || (/(.+)[-=_](.+)/));
|
271
347
|
pid = parentItem[2];
|
272
348
|
}
|
273
349
|
|
274
|
-
if (id
|
350
|
+
if (id) {
|
275
351
|
ret.push({"item_id": id[2], "parent_id": pid, "depth": depth, "left": left, "right": right});
|
276
352
|
}
|
277
353
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
},
|
282
|
-
|
283
|
-
_clear: function(event, noPropagation) {
|
284
|
-
|
285
|
-
$.ui.sortable.prototype._clear.apply(this, arguments);
|
286
|
-
|
287
|
-
// Clean last empty ul/ol
|
288
|
-
for (var i = this.items.length - 1; i >= 0; i--) {
|
289
|
-
var item = this.items[i].item[0];
|
290
|
-
this._clearEmpty(item);
|
354
|
+
left = right + 1;
|
355
|
+
return left;
|
291
356
|
}
|
292
|
-
return true;
|
293
357
|
|
294
358
|
},
|
295
359
|
|
296
360
|
_clearEmpty: function(item) {
|
297
361
|
|
298
|
-
|
299
|
-
|
362
|
+
var emptyList = $(item).children(this.options.listType);
|
363
|
+
if (emptyList.length && !emptyList.children().length && !this.options.doNotClear) {
|
364
|
+
emptyList.remove();
|
300
365
|
}
|
301
366
|
|
302
367
|
},
|
@@ -306,11 +371,12 @@
|
|
306
371
|
var level = 1;
|
307
372
|
|
308
373
|
if (this.options.listType) {
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
374
|
+
var list = item.closest(this.options.listType);
|
375
|
+
while (list && list.length > 0 &&
|
376
|
+
!list.is('.ui-sortable')) {
|
377
|
+
level++;
|
378
|
+
list = list.parent().closest(this.options.listType);
|
379
|
+
}
|
314
380
|
}
|
315
381
|
|
316
382
|
return level;
|
@@ -329,28 +395,35 @@
|
|
329
395
|
return depth ? result + 1 : result;
|
330
396
|
},
|
331
397
|
|
332
|
-
_isAllowed: function(parentItem, levels) {
|
333
|
-
var o = this.options
|
334
|
-
|
335
|
-
|
336
|
-
|
398
|
+
_isAllowed: function(parentItem, level, levels) {
|
399
|
+
var o = this.options,
|
400
|
+
isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false,
|
401
|
+
maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels'); // this takes into account the maxLevels set to the recipient list
|
402
|
+
|
403
|
+
// Is the root protected?
|
404
|
+
// Are we trying to nest under a no-nest?
|
405
|
+
// Are we nesting too deep?
|
406
|
+
if (!o.isAllowed(this.currentItem, parentItem) ||
|
407
|
+
parentItem && parentItem.hasClass(o.disableNesting) ||
|
408
|
+
o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {
|
337
409
|
this.placeholder.addClass(o.errorClass);
|
338
|
-
|
410
|
+
if (maxLevels < levels && maxLevels != 0) {
|
411
|
+
this.beyondMaxLevels = levels - maxLevels;
|
412
|
+
} else {
|
413
|
+
this.beyondMaxLevels = 1;
|
414
|
+
}
|
415
|
+
} else {
|
416
|
+
if (maxLevels < levels && maxLevels != 0) {
|
417
|
+
this.placeholder.addClass(o.errorClass);
|
418
|
+
this.beyondMaxLevels = levels - maxLevels;
|
339
419
|
} else {
|
340
420
|
this.placeholder.removeClass(o.errorClass);
|
341
421
|
this.beyondMaxLevels = 0;
|
342
422
|
}
|
343
|
-
} else {
|
344
|
-
this.placeholder.addClass(o.errorClass);
|
345
|
-
if (o.maxLevels < levels && o.maxLevels != 0) {
|
346
|
-
this.beyondMaxLevels = levels - o.maxLevels;
|
347
|
-
} else {
|
348
|
-
this.beyondMaxLevels = 1;
|
349
|
-
}
|
350
423
|
}
|
351
424
|
}
|
352
425
|
|
353
426
|
}));
|
354
427
|
|
355
|
-
$.
|
356
|
-
})(jQuery);
|
428
|
+
$.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options);
|
429
|
+
})(jQuery);
|