upstream-rails_admin 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +74 -0
- data/LICENSE.md +20 -0
- data/README.md +162 -0
- data/Rakefile +19 -0
- data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/rails_admin/bullet_black.png +0 -0
- data/app/assets/images/rails_admin/bullet_white.png +0 -0
- data/app/assets/images/rails_admin/calendar.png +0 -0
- data/app/assets/images/rails_admin/clock.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/select.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/select2.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/slider.png +0 -0
- data/app/assets/images/rails_admin/logo.png +0 -0
- data/app/assets/images/rails_admin/magnifier.png +0 -0
- data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
- data/app/assets/javascripts/rails_admin/custom/ui.js +12 -0
- data/app/assets/javascripts/rails_admin/jquery.colorpicker.js +484 -0
- data/app/assets/javascripts/rails_admin/jquery.pjax.js +543 -0
- data/app/assets/javascripts/rails_admin/jquery.ui.timepicker.js +1371 -0
- data/app/assets/javascripts/rails_admin/ra.datetimepicker.js +67 -0
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +129 -0
- data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +280 -0
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +181 -0
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +41 -0
- data/app/assets/javascripts/rails_admin/ra.remote-form.js +152 -0
- data/app/assets/javascripts/rails_admin/ra.widgets.coffee +135 -0
- data/app/assets/javascripts/rails_admin/rails_admin.js.erb +27 -0
- data/app/assets/javascripts/rails_admin/themes/cerulean/ui.js +0 -0
- data/app/assets/javascripts/rails_admin/themes/default/ui.js +12 -0
- data/app/assets/javascripts/rails_admin/ui.js.coffee +65 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.css.scss +733 -0
- data/app/assets/stylesheets/rails_admin/base/README +2 -0
- data/app/assets/stylesheets/rails_admin/base/mixins.css.scss +1 -0
- data/app/assets/stylesheets/rails_admin/base/theming.css.scss +270 -0
- data/app/assets/stylesheets/rails_admin/base/variables.css.scss +1 -0
- data/app/assets/stylesheets/rails_admin/custom/mixins.css.scss +12 -0
- data/app/assets/stylesheets/rails_admin/custom/theming.css.scss +13 -0
- data/app/assets/stylesheets/rails_admin/custom/variables.css.scss +15 -0
- data/app/assets/stylesheets/rails_admin/imports.css.scss.erb +78 -0
- data/app/assets/stylesheets/rails_admin/jquery.colorpicker.css.scss +180 -0
- data/app/assets/stylesheets/rails_admin/jquery.ui.timepicker.css.scss +69 -0
- data/app/assets/stylesheets/rails_admin/ra.calendar-additions.css.scss +25 -0
- data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.css.scss +85 -0
- data/app/assets/stylesheets/rails_admin/rails_admin.css +4 -0
- data/app/assets/stylesheets/rails_admin/themes/cerulean/mixins.css.scss +0 -0
- data/app/assets/stylesheets/rails_admin/themes/cerulean/theming.css.scss +97 -0
- data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.css.scss +168 -0
- data/app/assets/stylesheets/rails_admin/themes/default/mixins.css.scss +8 -0
- data/app/assets/stylesheets/rails_admin/themes/default/theming.css.scss +11 -0
- data/app/assets/stylesheets/rails_admin/themes/default/variables.css.scss +12 -0
- data/app/controllers/rails_admin/application_controller.rb +82 -0
- data/app/controllers/rails_admin/main_controller.rb +155 -0
- data/app/helpers/rails_admin/application_helper.rb +125 -0
- data/app/helpers/rails_admin/form_builder.rb +113 -0
- data/app/helpers/rails_admin/main_helper.rb +36 -0
- data/app/views/kaminari/twitter-bootstrap/_gap.html.haml +2 -0
- data/app/views/kaminari/twitter-bootstrap/_next_page.html.haml +4 -0
- data/app/views/kaminari/twitter-bootstrap/_page.html.haml +4 -0
- data/app/views/kaminari/twitter-bootstrap/_paginator.html.haml +10 -0
- data/app/views/kaminari/twitter-bootstrap/_prev_page.html.haml +4 -0
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +12 -0
- data/app/views/layouts/rails_admin/application.html.haml +26 -0
- data/app/views/layouts/rails_admin/pjax.html.haml +20 -0
- data/app/views/rails_admin/main/_dashboard_history.html.haml +10 -0
- data/app/views/rails_admin/main/_delete_notice.html.haml +18 -0
- data/app/views/rails_admin/main/_form_colorpicker.html.haml +1 -0
- data/app/views/rails_admin/main/_form_datetime.html.haml +1 -0
- data/app/views/rails_admin/main/_form_enumeration.html.haml +1 -0
- data/app/views/rails_admin/main/_form_field.html.haml +1 -0
- data/app/views/rails_admin/main/_form_file_upload.html.haml +13 -0
- data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +47 -0
- data/app/views/rails_admin/main/_form_filtering_select.html.haml +37 -0
- data/app/views/rails_admin/main/_form_nested_many.html.haml +14 -0
- data/app/views/rails_admin/main/_form_nested_one.html.haml +10 -0
- data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +10 -0
- data/app/views/rails_admin/main/_form_text.html.haml +15 -0
- data/app/views/rails_admin/main/_submit_buttons.html.haml +15 -0
- data/app/views/rails_admin/main/bulk_delete.html.haml +11 -0
- data/app/views/rails_admin/main/dashboard.html.haml +31 -0
- data/app/views/rails_admin/main/delete.html.haml +18 -0
- data/app/views/rails_admin/main/edit.html.haml +2 -0
- data/app/views/rails_admin/main/export.html.haml +75 -0
- data/app/views/rails_admin/main/history.html.haml +42 -0
- data/app/views/rails_admin/main/index.html.haml +140 -0
- data/app/views/rails_admin/main/new.html.haml +2 -0
- data/app/views/rails_admin/main/show.html.haml +14 -0
- data/config/initializers/active_record_extensions.rb +19 -0
- data/config/initializers/devise_patch.rb +9 -0
- data/config/initializers/haml.rb +2 -0
- data/config/initializers/mongoid_extensions.rb +5 -0
- data/config/locales/fr.yml +24 -0
- data/config/locales/rails_admin.en.yml +130 -0
- data/config/routes.rb +12 -0
- data/lib/generators/rails_admin/install_generator.rb +84 -0
- data/lib/generators/rails_admin/templates/drop.rb +18 -0
- data/lib/generators/rails_admin/templates/initializer.erb +101 -0
- data/lib/generators/rails_admin/templates/migration.rb +18 -0
- data/lib/generators/rails_admin/uninstall_generator.rb +22 -0
- data/lib/generators/rails_admin/utils.rb +30 -0
- data/lib/rails_admin.rb +34 -0
- data/lib/rails_admin/abstract_model.rb +108 -0
- data/lib/rails_admin/adapters/active_record.rb +255 -0
- data/lib/rails_admin/adapters/active_record/abstract_object.rb +32 -0
- data/lib/rails_admin/adapters/mongoid.rb +390 -0
- data/lib/rails_admin/adapters/mongoid/abstract_object.rb +48 -0
- data/lib/rails_admin/adapters/mongoid/extension.rb +48 -0
- data/lib/rails_admin/config.rb +323 -0
- data/lib/rails_admin/config/actions.rb +121 -0
- data/lib/rails_admin/config/actions/base.rb +117 -0
- data/lib/rails_admin/config/actions/bulk_delete.rb +55 -0
- data/lib/rails_admin/config/actions/dashboard.rb +46 -0
- data/lib/rails_admin/config/actions/delete.rb +53 -0
- data/lib/rails_admin/config/actions/edit.rb +60 -0
- data/lib/rails_admin/config/actions/export.rb +40 -0
- data/lib/rails_admin/config/actions/history_index.rb +38 -0
- data/lib/rails_admin/config/actions/history_show.rb +38 -0
- data/lib/rails_admin/config/actions/index.rb +85 -0
- data/lib/rails_admin/config/actions/new.rb +64 -0
- data/lib/rails_admin/config/actions/show.rb +32 -0
- data/lib/rails_admin/config/actions/show_in_app.rb +28 -0
- data/lib/rails_admin/config/configurable.rb +92 -0
- data/lib/rails_admin/config/fields.rb +88 -0
- data/lib/rails_admin/config/fields/association.rb +108 -0
- data/lib/rails_admin/config/fields/base.rb +298 -0
- data/lib/rails_admin/config/fields/factories/association.rb +32 -0
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +31 -0
- data/lib/rails_admin/config/fields/factories/devise.rb +27 -0
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +27 -0
- data/lib/rails_admin/config/fields/factories/enum.rb +11 -0
- data/lib/rails_admin/config/fields/factories/paperclip.rb +26 -0
- data/lib/rails_admin/config/fields/factories/password.rb +17 -0
- data/lib/rails_admin/config/fields/factories/serialized.rb +17 -0
- data/lib/rails_admin/config/fields/group.rb +78 -0
- data/lib/rails_admin/config/fields/types.rb +27 -0
- data/lib/rails_admin/config/fields/types/all.rb +25 -0
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +41 -0
- data/lib/rails_admin/config/fields/types/boolean.rb +31 -0
- data/lib/rails_admin/config/fields/types/bson_object_id.rb +42 -0
- data/lib/rails_admin/config/fields/types/carrierwave.rb +31 -0
- data/lib/rails_admin/config/fields/types/color.rb +37 -0
- data/lib/rails_admin/config/fields/types/date.rb +24 -0
- data/lib/rails_admin/config/fields/types/datetime.rb +163 -0
- data/lib/rails_admin/config/fields/types/decimal.rb +14 -0
- data/lib/rails_admin/config/fields/types/dragonfly.rb +41 -0
- data/lib/rails_admin/config/fields/types/enum.rb +35 -0
- data/lib/rails_admin/config/fields/types/file_upload.rb +61 -0
- data/lib/rails_admin/config/fields/types/float.rb +14 -0
- data/lib/rails_admin/config/fields/types/has_and_belongs_to_many_association.rb +14 -0
- data/lib/rails_admin/config/fields/types/has_many_association.rb +32 -0
- data/lib/rails_admin/config/fields/types/has_one_association.rb +39 -0
- data/lib/rails_admin/config/fields/types/hidden.rb +21 -0
- data/lib/rails_admin/config/fields/types/integer.rb +22 -0
- data/lib/rails_admin/config/fields/types/paperclip.rb +28 -0
- data/lib/rails_admin/config/fields/types/password.rb +39 -0
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +76 -0
- data/lib/rails_admin/config/fields/types/serialized.rb +22 -0
- data/lib/rails_admin/config/fields/types/string.rb +41 -0
- data/lib/rails_admin/config/fields/types/text.rb +36 -0
- data/lib/rails_admin/config/fields/types/time.rb +36 -0
- data/lib/rails_admin/config/fields/types/timestamp.rb +18 -0
- data/lib/rails_admin/config/groupable.rb +18 -0
- data/lib/rails_admin/config/has_fields.rb +135 -0
- data/lib/rails_admin/config/has_groups.rb +23 -0
- data/lib/rails_admin/config/hideable.rb +28 -0
- data/lib/rails_admin/config/model.rb +88 -0
- data/lib/rails_admin/config/proxyable.rb +12 -0
- data/lib/rails_admin/config/proxyable/proxy.rb +43 -0
- data/lib/rails_admin/config/sections.rb +39 -0
- data/lib/rails_admin/config/sections/base.rb +29 -0
- data/lib/rails_admin/config/sections/create.rb +11 -0
- data/lib/rails_admin/config/sections/edit.rb +11 -0
- data/lib/rails_admin/config/sections/export.rb +11 -0
- data/lib/rails_admin/config/sections/list.rb +27 -0
- data/lib/rails_admin/config/sections/modal.rb +10 -0
- data/lib/rails_admin/config/sections/nested.rb +10 -0
- data/lib/rails_admin/config/sections/show.rb +10 -0
- data/lib/rails_admin/config/sections/update.rb +10 -0
- data/lib/rails_admin/engine.rb +22 -0
- data/lib/rails_admin/extension.rb +29 -0
- data/lib/rails_admin/extensions/cancan.rb +5 -0
- data/lib/rails_admin/extensions/cancan/authorization_adapter.rb +59 -0
- data/lib/rails_admin/extensions/history.rb +5 -0
- data/lib/rails_admin/extensions/history/auditing_adapter.rb +37 -0
- data/lib/rails_admin/extensions/history/history.rb +70 -0
- data/lib/rails_admin/extensions/paper_trail.rb +5 -0
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +92 -0
- data/lib/rails_admin/i18n_support.rb +43 -0
- data/lib/rails_admin/support/core_extensions.rb +44 -0
- data/lib/rails_admin/support/csv_converter.rb +109 -0
- data/lib/rails_admin/version.rb +3 -0
- data/lib/tasks/prepare_ci_env.rake +27 -0
- data/lib/tasks/rails_admin.rake +18 -0
- data/spec/ci.sh +2 -0
- data/spec/controllers/application_controller_spec.rb +30 -0
- data/spec/controllers/main_controller_spec.rb +179 -0
- data/spec/dummy_app/Gemfile +71 -0
- data/spec/dummy_app/Gemfile.lock +205 -0
- data/spec/dummy_app/Rakefile +7 -0
- data/spec/dummy_app/app/active_record/abstract.rb +5 -0
- data/spec/dummy_app/app/active_record/ball.rb +9 -0
- data/spec/dummy_app/app/active_record/carrierwave_uploader.rb +53 -0
- data/spec/dummy_app/app/active_record/category.rb +5 -0
- data/spec/dummy_app/app/active_record/cms.rb +5 -0
- data/spec/dummy_app/app/active_record/cms/basic_page.rb +9 -0
- data/spec/dummy_app/app/active_record/cms/unscoped_page.rb +3 -0
- data/spec/dummy_app/app/active_record/comment.rb +5 -0
- data/spec/dummy_app/app/active_record/division.rb +15 -0
- data/spec/dummy_app/app/active_record/draft.rb +13 -0
- data/spec/dummy_app/app/active_record/fan.rb +7 -0
- data/spec/dummy_app/app/active_record/field_test.rb +20 -0
- data/spec/dummy_app/app/active_record/hardball.rb +2 -0
- data/spec/dummy_app/app/active_record/league.rb +12 -0
- data/spec/dummy_app/app/active_record/nested_field_test.rb +7 -0
- data/spec/dummy_app/app/active_record/player.rb +23 -0
- data/spec/dummy_app/app/active_record/team.rb +27 -0
- data/spec/dummy_app/app/active_record/user.rb +21 -0
- data/spec/dummy_app/app/assets/images/rails.png +0 -0
- data/spec/dummy_app/app/assets/javascripts/application.js +15 -0
- data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy_app/app/controllers/application_controller.rb +3 -0
- data/spec/dummy_app/app/controllers/players_controller.rb +5 -0
- data/spec/dummy_app/app/locales/models.en.yml +20 -0
- data/spec/dummy_app/app/mongoid/ball.rb +14 -0
- data/spec/dummy_app/app/mongoid/carrierwave_uploader.rb +53 -0
- data/spec/dummy_app/app/mongoid/category.rb +7 -0
- data/spec/dummy_app/app/mongoid/cms.rb +5 -0
- data/spec/dummy_app/app/mongoid/cms/basic_page.rb +12 -0
- data/spec/dummy_app/app/mongoid/cms/unscoped_page.rb +5 -0
- data/spec/dummy_app/app/mongoid/comment.rb +9 -0
- data/spec/dummy_app/app/mongoid/division.rb +14 -0
- data/spec/dummy_app/app/mongoid/draft.rb +22 -0
- data/spec/dummy_app/app/mongoid/embed.rb +6 -0
- data/spec/dummy_app/app/mongoid/fan.rb +12 -0
- data/spec/dummy_app/app/mongoid/field_test.rb +56 -0
- data/spec/dummy_app/app/mongoid/hardball.rb +2 -0
- data/spec/dummy_app/app/mongoid/league.rb +16 -0
- data/spec/dummy_app/app/mongoid/nested_field_test.rb +12 -0
- data/spec/dummy_app/app/mongoid/player.rb +37 -0
- data/spec/dummy_app/app/mongoid/team.rb +47 -0
- data/spec/dummy_app/app/mongoid/user.rb +61 -0
- data/spec/dummy_app/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy_app/app/views/players/show.html.haml +1 -0
- data/spec/dummy_app/config.ru +4 -0
- data/spec/dummy_app/config/application.rb +69 -0
- data/spec/dummy_app/config/boot.rb +9 -0
- data/spec/dummy_app/config/database.yml +25 -0
- data/spec/dummy_app/config/environment.rb +5 -0
- data/spec/dummy_app/config/environments/development.rb +37 -0
- data/spec/dummy_app/config/environments/production.rb +67 -0
- data/spec/dummy_app/config/environments/test.rb +37 -0
- data/spec/dummy_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy_app/config/initializers/devise.rb +223 -0
- data/spec/dummy_app/config/initializers/dragonfly.rb +14 -0
- data/spec/dummy_app/config/initializers/inflections.rb +15 -0
- data/spec/dummy_app/config/initializers/mime_types.rb +5 -0
- data/spec/dummy_app/config/initializers/rails_admin.rb +8 -0
- data/spec/dummy_app/config/initializers/secret_token.rb +7 -0
- data/spec/dummy_app/config/initializers/session_patch.rb +16 -0
- data/spec/dummy_app/config/initializers/session_store.rb +8 -0
- data/spec/dummy_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy_app/config/mongoid.yml +11 -0
- data/spec/dummy_app/config/routes.rb +10 -0
- data/spec/dummy_app/db/development.sqlite3 +0 -0
- data/spec/dummy_app/db/migrate/00000000000001_create_divisions_migration.rb +13 -0
- data/spec/dummy_app/db/migrate/00000000000002_create_drafts_migration.rb +19 -0
- data/spec/dummy_app/db/migrate/00000000000003_create_leagues_migration.rb +12 -0
- data/spec/dummy_app/db/migrate/00000000000004_create_players_migration.rb +20 -0
- data/spec/dummy_app/db/migrate/00000000000005_create_teams_migration.rb +22 -0
- data/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb +49 -0
- data/spec/dummy_app/db/migrate/00000000000007_create_histories_table.rb +16 -0
- data/spec/dummy_app/db/migrate/00000000000008_create_fans_migration.rb +12 -0
- data/spec/dummy_app/db/migrate/00000000000009_create_fans_teams_migration.rb +11 -0
- data/spec/dummy_app/db/migrate/00000000000010_add_revenue_to_team_migration.rb +9 -0
- data/spec/dummy_app/db/migrate/00000000000011_add_suspended_to_player_migration.rb +9 -0
- data/spec/dummy_app/db/migrate/00000000000012_add_avatar_columns_to_user.rb +16 -0
- data/spec/dummy_app/db/migrate/00000000000013_add_roles_to_user.rb +9 -0
- data/spec/dummy_app/db/migrate/00000000000014_add_color_to_team_migration.rb +9 -0
- data/spec/dummy_app/db/migrate/20101223222233_create_rel_tests.rb +15 -0
- data/spec/dummy_app/db/migrate/20110103205808_create_comments.rb +15 -0
- data/spec/dummy_app/db/migrate/20110123042530_rename_histories_to_rails_admin_histories.rb +9 -0
- data/spec/dummy_app/db/migrate/20110224184303_create_field_tests.rb +22 -0
- data/spec/dummy_app/db/migrate/20110328193014_create_cms_basic_pages.rb +14 -0
- data/spec/dummy_app/db/migrate/20110329183136_remove_league_id_from_teams.rb +9 -0
- data/spec/dummy_app/db/migrate/20110607152842_add_format_to_field_test.rb +9 -0
- data/spec/dummy_app/db/migrate/20110714095433_create_balls.rb +12 -0
- data/spec/dummy_app/db/migrate/20110831090841_add_protected_field_and_restricted_field_to_field_tests.rb +6 -0
- data/spec/dummy_app/db/migrate/20110901131551_change_division_primary_key.rb +19 -0
- data/spec/dummy_app/db/migrate/20110901142530_rename_league_id_foreign_key_on_divisions.rb +5 -0
- data/spec/dummy_app/db/migrate/20110901150912_set_primary_key_not_null_for_divisions.rb +21 -0
- data/spec/dummy_app/db/migrate/20110901154834_change_length_for_rails_admin_histories.rb +9 -0
- data/spec/dummy_app/db/migrate/20111103174459_create_unscoped_pages.rb +9 -0
- data/spec/dummy_app/db/migrate/20111108143642_add_dragonfly_and_carrierwave_to_field_tests.rb +7 -0
- data/spec/dummy_app/db/migrate/20111115041025_add_type_to_balls.rb +5 -0
- data/spec/dummy_app/db/migrate/20111123092549_create_nested_field_tests.rb +10 -0
- data/spec/dummy_app/db/migrate/20111130075338_add_dragonfly_asset_name_to_field_tests.rb +5 -0
- data/spec/dummy_app/db/migrate/20111215083258_create_foo_bars.rb +8 -0
- data/spec/dummy_app/db/migrate/20120117151733_add_custom_field_to_teams.rb +5 -0
- data/spec/dummy_app/db/migrate/20120118122004_add_categories.rb +7 -0
- data/spec/dummy_app/db/migrate/20120319041705_drop_rel_tests.rb +15 -0
- data/spec/dummy_app/db/schema.rb +188 -0
- data/spec/dummy_app/db/seeds.rb +29 -0
- data/spec/dummy_app/db/test.sqlite3 +0 -0
- data/spec/dummy_app/doc/README_FOR_APP +2 -0
- data/spec/dummy_app/log/development.log +865 -0
- data/spec/dummy_app/log/test.log +36651 -0
- data/spec/dummy_app/public/404.html +26 -0
- data/spec/dummy_app/public/422.html +26 -0
- data/spec/dummy_app/public/500.html +25 -0
- data/spec/dummy_app/public/favicon.ico +0 -0
- data/spec/dummy_app/public/robots.txt +5 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/24/10_36_27_888_Pensive_Parakeet.jpg +0 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/24/10_36_27_888_Pensive_Parakeet.jpg.meta +1 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/30/08_54_39_906_Costa_Rican_Frog.jpg +0 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/30/08_54_39_906_Costa_Rican_Frog.jpg.meta +1 -0
- data/spec/dummy_app/public/system/paperclip_assets/1/original/Boston City Flow.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/1/thumb/Boston City Flow.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/3/original/Costa Rican Frog.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/3/thumb/Costa Rican Frog.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/6/original/liste-electorale.pdf +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/6/thumb/liste-electorale.pdf +148 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/3/Boston_City_Flow.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/3/thumb_Boston_City_Flow.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/4/Costa_Rican_Frog.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/4/thumb_Costa_Rican_Frog.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/6/Pensive_Parakeet.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/6/thumb_Pensive_Parakeet.jpg +0 -0
- data/spec/dummy_app/script/rails +6 -0
- data/spec/dummy_app/tmp/cache/assets/BE5/B00/sprockets%2F47892969925432da563a88e366309859 +1833 -0
- data/spec/dummy_app/tmp/cache/assets/C1C/C90/sprockets%2F4c1f0504074864b8b21792c77391e206 +0 -0
- data/spec/dummy_app/tmp/cache/assets/C29/F50/sprockets%2F6d087f33314fd5091b1270969287268b +0 -0
- data/spec/dummy_app/tmp/cache/assets/C2C/130/sprockets%2F2d09a75917207f5a55929639226b4b48 +26 -0
- data/spec/dummy_app/tmp/cache/assets/C49/FD0/sprockets%2F07901b5391110eea9648d5c25d481327 +0 -0
- data/spec/dummy_app/tmp/cache/assets/C63/BF0/sprockets%2F600472e1a4718315162a7cb0f285a02b +547 -0
- data/spec/dummy_app/tmp/cache/assets/C66/0B0/sprockets%2F2560ef2871b489690ff209e164d86665 +635 -0
- data/spec/dummy_app/tmp/cache/assets/C68/560/sprockets%2F5996692771c33962a9a2c72790ddd754 +0 -0
- data/spec/dummy_app/tmp/cache/assets/C83/F90/sprockets%2Fa580b424c36c26dd59f660078d541755 +0 -0
- data/spec/dummy_app/tmp/cache/assets/C86/C30/sprockets%2F23ca33803f8248991f3fa8d2104e9961 +0 -0
- data/spec/dummy_app/tmp/cache/assets/C88/790/sprockets%2F538d9562b05167d03d26b0e5e9f78830 +5 -0
- data/spec/dummy_app/tmp/cache/assets/C89/3B0/sprockets%2F503f729e1bc985e17b730122c7176f97 +0 -0
- data/spec/dummy_app/tmp/cache/assets/C95/A00/sprockets%2F458c72992a558902c05a9d6d99339af2 +4 -0
- data/spec/dummy_app/tmp/cache/assets/C97/4C0/sprockets%2F97a81a953151b41a100165fb83dfa023 +133 -0
- data/spec/dummy_app/tmp/cache/assets/C9A/C90/sprockets%2F400271d29a3bb9124a286ba761c3f254 +0 -0
- data/spec/dummy_app/tmp/cache/assets/C9D/BA0/sprockets%2F1bfd091b2034980851caa077c0892c40 +490 -0
- data/spec/dummy_app/tmp/cache/assets/CA2/FA0/sprockets%2F0c3f1c8708606aa0440c866138d1e9a2 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CA7/480/sprockets%2F23a375f496616605e4144a21fb4dc83a +4 -0
- data/spec/dummy_app/tmp/cache/assets/CB1/8A0/sprockets%2F25c2eb1d72087ed5e863f217109b6069 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CB3/B50/sprockets%2F03a7c1f7144eb79946ceb8e151772127 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CC4/220/sprockets%2F8d947b008798f16134b7d576fa456ce4 +285 -0
- data/spec/dummy_app/tmp/cache/assets/CC7/F70/sprockets%2F1a1af5b2c6473f104b2f0b252a729338 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CD1/C70/sprockets%2F75b65e7751a3f030d43c1cf6827cc100 +133 -0
- data/spec/dummy_app/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CD8/430/sprockets%2Fc89f860631079a34d3c0d662aac0d256 +635 -0
- data/spec/dummy_app/tmp/cache/assets/CD8/AF0/sprockets%2Ffa2b25b3f4c05f51086482175c970ca7 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CD9/590/sprockets%2F6882cdc2e05726d5172e2b9b334ec007 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CD9/E00/sprockets%2F233f366461a5722d7dfb7a0ecd064087 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CDA/880/sprockets%2Fa1e3e4ae81b451c8b4b798061148a358 +275 -0
- data/spec/dummy_app/tmp/cache/assets/CE2/490/sprockets%2Fab26cd4524240da60a93659780f9ae78 +0 -0
- data/spec/dummy_app/tmp/cache/assets/CEC/270/sprockets%2Fb531a7fa499c7953ab753fa911a61799 +328 -0
- data/spec/dummy_app/tmp/cache/assets/CFD/D70/sprockets%2F79acf34495d5196bd47278685b4ee68b +237 -0
- data/spec/dummy_app/tmp/cache/assets/CFE/060/sprockets%2Fd97e1e070419bcfe35c7000d1a70427b +303 -0
- data/spec/dummy_app/tmp/cache/assets/D02/8B0/sprockets%2F0c493e35ea651c55155b2a383bf2d34d +0 -0
- data/spec/dummy_app/tmp/cache/assets/D04/A20/sprockets%2Fa264585296de2351212f1063ebcccd9b +1092 -0
- data/spec/dummy_app/tmp/cache/assets/D0F/EA0/sprockets%2F4a754f04f5d1c8995a01927bbd074fa4 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D11/470/sprockets%2F67d64aa5490686515e07cdb8ae05b4c6 +9 -0
- data/spec/dummy_app/tmp/cache/assets/D12/F60/sprockets%2F6ac89a4a48bf0e3bb6364925661da565 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D15/3D0/sprockets%2F7ef98ea43116410c4c50ffff444428c8 +1376 -0
- data/spec/dummy_app/tmp/cache/assets/D17/9B0/sprockets%2F3154059ed98209719dc1a7c493cb0fff +381 -0
- data/spec/dummy_app/tmp/cache/assets/D20/9E0/sprockets%2F9e5560466ce41eac747392c97eef4c51 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D24/B30/sprockets%2F69d62273002dffc74f5368f55dfb97f3 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D2D/840/sprockets%2F6f3b681ef8ba260acc705e3b262425a0 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D2F/7C0/sprockets%2F99f6619fe89012fb9908a47ebb9b92a8 +7 -0
- data/spec/dummy_app/tmp/cache/assets/D2F/D60/sprockets%2Fa0cb0b3d7d775c4707c42a58fb0d2615 +9409 -0
- data/spec/dummy_app/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D3A/260/sprockets%2F35a5b51d1927651a39e3edca8c483dd1 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D3B/F80/sprockets%2F304efb1d2d219915606f3fd96b3bf5c2 +9409 -0
- data/spec/dummy_app/tmp/cache/assets/D3C/7C0/sprockets%2F6a50cb4a5d265838f510fc8e6178bae1 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D3D/0A0/sprockets%2Fa92066280edcd6b188dc38e35361dd3b +0 -0
- data/spec/dummy_app/tmp/cache/assets/D40/9B0/sprockets%2F704cfd791b468a6fba4fb820ec128941 +237 -0
- data/spec/dummy_app/tmp/cache/assets/D40/E10/sprockets%2F97d56619e64ca8c9c514a3aa2a4b339c +0 -0
- data/spec/dummy_app/tmp/cache/assets/D42/1F0/sprockets%2Fcaf59e1c6d22bae908a06e476b752791 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D43/E30/sprockets%2Fece324b9d4dc935a92333fd0149bf773 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D47/520/sprockets%2Ff142cf9478904f9e3ebb31ecc8c50913 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D4B/390/sprockets%2Feb90dbdd2a6275f48086881f7b74ee32 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D4B/6D0/sprockets%2F760ec9c344d334cfe919a55cf7f6a165 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D53/5C0/sprockets%2Fa93098db097c86d1e33dc86dece09991 +1092 -0
- data/spec/dummy_app/tmp/cache/assets/D56/F00/sprockets%2F48f6039e6745b557cbe83957abc8df2d +303 -0
- data/spec/dummy_app/tmp/cache/assets/D58/940/sprockets%2F0c3d05522ea3be49ba23372222fdcde7 +328 -0
- data/spec/dummy_app/tmp/cache/assets/D58/950/sprockets%2F6ade11e1b9d3ac4736b05aaf039c0804 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D5C/D10/sprockets%2F3fddf4c16115fad562082a5d4f1bd520 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D5D/950/sprockets%2F9ed4c3b788618998fefb569a0a58da80 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D5F/F30/sprockets%2Fc93672decbf5fb650336d1a67001fba0 +547 -0
- data/spec/dummy_app/tmp/cache/assets/D62/4A0/sprockets%2F47b7cb361e1f2e2ce081ea52fe32f640 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D65/140/sprockets%2F5cc4a9317d68e31bb0c5b8d3f517a0e4 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D6C/170/sprockets%2Fdc1a668e0c34eb1206fc67cf526249cf +0 -0
- data/spec/dummy_app/tmp/cache/assets/D71/9B0/sprockets%2Fc98bb1ca9b745d615b0f2f0d963c44d8 +5 -0
- data/spec/dummy_app/tmp/cache/assets/D74/020/sprockets%2Fd99999af4693dfa5998fdaf5b68276e6 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D74/050/sprockets%2Fab9217b6ce5c3c8969791adc819b2a2b +0 -0
- data/spec/dummy_app/tmp/cache/assets/D7A/410/sprockets%2Fd1decdae4824f395df114687f262e78a +381 -0
- data/spec/dummy_app/tmp/cache/assets/D7C/630/sprockets%2Fff49f6b45a167453dabfa743e588dd16 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D85/CC0/sprockets%2F09f7b34bbc050700a3bcbf6c6c5c1b45 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D8F/DD0/sprockets%2F7bd51d74d575ec0bfad624acc81a6040 +0 -0
- data/spec/dummy_app/tmp/cache/assets/D93/C20/sprockets%2F2f48ab1ea8216fd918beb173c2a4f04d +0 -0
- data/spec/dummy_app/tmp/cache/assets/D9B/920/sprockets%2F4a02c68d7d2e9a072b8cdd5f715ab7c4 +26 -0
- data/spec/dummy_app/tmp/cache/assets/D9D/720/sprockets%2Fc7c311fcebe12a3cf86631a4a47f849f +490 -0
- data/spec/dummy_app/tmp/cache/assets/D9F/F20/sprockets%2F32f6c0bcea62f9ab09385db3217ee7e8 +0 -0
- data/spec/dummy_app/tmp/cache/assets/DA0/8A0/sprockets%2F9aff0ec8777da07337a51280eacd3f4e +768 -0
- data/spec/dummy_app/tmp/cache/assets/DA2/DB0/sprockets%2Fa6cfbef08a491ac3397e006bed885b38 +275 -0
- data/spec/dummy_app/tmp/cache/assets/DA4/010/sprockets%2F9663c5eebc07fdb49dd221cf84804c6b +0 -0
- data/spec/dummy_app/tmp/cache/assets/DA5/FE0/sprockets%2Fc5d487522471a6ab39cac1bf8e7e9b9b +0 -0
- data/spec/dummy_app/tmp/cache/assets/DA6/0A0/sprockets%2Fae11a6ff426fe2d094a5cde67159f94d +0 -0
- data/spec/dummy_app/tmp/cache/assets/DA9/170/sprockets%2F88a844719bb0fc081d9cfafc0e76ca96 +0 -0
- data/spec/dummy_app/tmp/cache/assets/DC2/720/sprockets%2F6a32e6f352ddd183d19dcac10cfc456b +0 -0
- data/spec/dummy_app/tmp/cache/assets/DCA/070/sprockets%2F8ec1ae13cf7ba342507cbb8f877a6dd1 +768 -0
- data/spec/dummy_app/tmp/cache/assets/DCB/120/sprockets%2Fc29be206ce74d90a4ad1f9a3d9d20f7d +0 -0
- data/spec/dummy_app/tmp/cache/assets/DD6/9B0/sprockets%2Fb92fb5cec0493bfdbe8248cd5673f71b +0 -0
- data/spec/dummy_app/tmp/cache/assets/DD7/5C0/sprockets%2Fe0912ed75a6ed23afdf293deed66871c +1376 -0
- data/spec/dummy_app/tmp/cache/assets/DD8/110/sprockets%2F8dfc7ac2667a017ee469f4cd443cfa8c +0 -0
- data/spec/dummy_app/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +21 -0
- data/spec/dummy_app/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +21 -0
- data/spec/dummy_app/tmp/cache/assets/E05/140/sprockets%2F41bf6f07f45b76cd2eef60ed2ffbb908 +0 -0
- data/spec/dummy_app/tmp/cache/assets/E09/FE0/sprockets%2Fc5df928b0e066c9e19ee3f2be8f6dbd0 +0 -0
- data/spec/dummy_app/tmp/cache/assets/E30/BF0/sprockets%2Fd35aca629e1763dd5a9deeb6caa78b6c +285 -0
- data/spec/dummy_app/tmp/cache/assets/E42/8C0/sprockets%2Faff1c93e2a43b887cbdebf8f9df9087b +0 -0
- data/spec/dummy_app/tmp/cache/assets/E61/F10/sprockets%2Fe616dbbacda8602fc9c589aefaf4c34f +1833 -0
- data/spec/dummy_app/tmp/cache/assets/E87/8F0/sprockets%2Ff90a7f08fcd06d0faf133fed3edbfa6a +0 -0
- data/spec/dummy_app/tmp/cache/sass/0591c977016a0bb372763f6f1cfb8002d44de3b2/mixins.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/0591c977016a0bb372763f6f1cfb8002d44de3b2/theming.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/0591c977016a0bb372763f6f1cfb8002d44de3b2/variables.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/10238403c134661921596d094764445b02e815fe/mixins.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/10238403c134661921596d094764445b02e815fe/theming.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/10238403c134661921596d094764445b02e815fe/variables.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/imports.css.scss.erbc +0 -0
- data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/jquery.colorpicker.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/jquery.ui.timepicker.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/ra.calendar-additions.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/ra.filtering-multiselect.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_accordion.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_alerts.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_breadcrumbs.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_button-groups.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_buttons.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_carousel.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_close.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_code.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_component-animations.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_dropdowns.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_forms.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_grid.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_hero-unit.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_labels.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_layouts.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_mixins.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_modals.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_navbar.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_navs.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_pager.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_pagination.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_popovers.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_progress-bars.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_reset.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_scaffolding.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_sprites.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_tables.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_thumbnails.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_tooltip.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_type.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_utilities.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_variables.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_wells.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/ea17b334a44bfc0f3681b2e3e4202c941da9ee82/jquery-ui-1.8.7.custom.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/fb68f840f6ad0344d3dcaecafd4b6ac4e35ca8fe/mixins.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/fb68f840f6ad0344d3dcaecafd4b6ac4e35ca8fe/theming.css.scssc +0 -0
- data/spec/dummy_app/tmp/cache/sass/fb68f840f6ad0344d3dcaecafd4b6ac4e35ca8fe/variables.css.scssc +0 -0
- data/spec/dummy_app/tmp/dragonfly/cache/body/67/c49ea211b51fee9c0ccde26af73f27446aa071 +1 -0
- data/spec/dummy_app/tmp/dragonfly/cache/body/da/39a3ee5e6b4b0d3255bfef95601890afd80709 +0 -0
- data/spec/dummy_app/tmp/dragonfly/cache/body/e7/536a0250f5395f318c24bee30dbbb0a2a28714 +24 -0
- data/spec/dummy_app/tmp/dragonfly/cache/body/f0/76846cb5891d588ad63ea7f6451e26b4f48c3d +19 -0
- data/spec/dummy_app/tmp/dragonfly/cache/meta/26/1464d915347774c08b1ddf6d305783e3acfadb +0 -0
- data/spec/dummy_app/tmp/dragonfly/cache/meta/7f/29e62b90d2b255e74d7e1a8ee8ed509c3f0406 +0 -0
- data/spec/dummy_app/tmp/dragonfly/cache/meta/c1/0f5c4fe64b3d3cffe2793ad7a8e51aeb4f3eec +0 -0
- data/spec/dummy_app/tmp/dragonfly/cache/meta/fe/97fd48b64023fee9cc7d8a12f0f1e9097058da +0 -0
- data/spec/factories.rb +71 -0
- data/spec/helpers/application_helper_spec.rb +277 -0
- data/spec/integration/authorization/cancan_spec.rb +358 -0
- data/spec/integration/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +25 -0
- data/spec/integration/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +42 -0
- data/spec/integration/basic/create/rails_admin_basic_create_spec.rb +141 -0
- data/spec/integration/basic/create/rails_admin_namespaced_model_create_spec.rb +23 -0
- data/spec/integration/basic/delete/rails_admin_basic_delete_spec.rb +27 -0
- data/spec/integration/basic/destroy/rails_admin_basic_destroy_spec.rb +56 -0
- data/spec/integration/basic/edit/rails_admin_basic_edit_spec.rb +109 -0
- data/spec/integration/basic/export/rails_admin_basic_export_spec.rb +106 -0
- data/spec/integration/basic/list/rails_admin_basic_list_spec.rb +400 -0
- data/spec/integration/basic/new/rails_admin_basic_new_spec.rb +74 -0
- data/spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb +31 -0
- data/spec/integration/basic/show/rails_admin_basic_show_spec.rb +91 -0
- data/spec/integration/basic/update/rails_admin_basic_update_spec.rb +223 -0
- data/spec/integration/config/edit/rails_admin_config_edit_spec.rb +1043 -0
- data/spec/integration/config/list/rails_admin_config_list_spec.rb +521 -0
- data/spec/integration/config/show/rails_admin_config_show_spec.rb +312 -0
- data/spec/integration/history/rails_admin_history_spec.rb +65 -0
- data/spec/integration/rails_admin_spec.rb +113 -0
- data/spec/integration/relation_spec.rb +35 -0
- data/spec/orm/active_record.rb +42 -0
- data/spec/orm/mongoid.rb +19 -0
- data/spec/spec_helper.rb +79 -0
- data/spec/unit/abstract_model_spec.rb +45 -0
- data/spec/unit/adapters/active_record/abstract_object_spec.rb +132 -0
- data/spec/unit/adapters/active_record_spec.rb +373 -0
- data/spec/unit/adapters/mongoid/abstract_object_spec.rb +31 -0
- data/spec/unit/adapters/mongoid_spec.rb +686 -0
- data/spec/unit/config/actions_spec.rb +181 -0
- data/spec/unit/config/fields/base_spec.rb +339 -0
- data/spec/unit/config/model_spec.rb +75 -0
- data/spec/unit/config/sections_spec.rb +123 -0
- data/spec/unit/config_spec.rb +278 -0
- metadata +1317 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@expires_in0:@compressedF:@value"�'{"content_type"application/javascript"
|
|
2
|
+
class"ProcessedAsset"dependency_digest"%7f6f61ce59398ccfcd0bb43dd7435d54"
|
|
3
|
+
mtime"2012-04-28T19:31:44-05:00"
|
|
4
|
+
mtime"2012-04-28T19:31:44-05:00"digest"%f45753f40f0237b53b1b80f35094cb33" path"f/Library/Ruby/Gems/1.8/gems/remotipart-1.0.2/vendor/assets/javascripts/jquery.iframe-transport.js"digest"%f45753f40f0237b53b1b80f35094cb33"required_paths["f/Library/Ruby/Gems/1.8/gems/remotipart-1.0.2/vendor/assets/javascripts/jquery.iframe-transport.js"
|
|
5
|
+
// [transport](http://api.jquery.com/extending-ajax/#Transports) so that
|
|
6
|
+
// `$.ajax()` calls support the uploading of files using standard HTML file
|
|
7
|
+
// input fields. This is done by switching the exchange from `XMLHttpRequest` to
|
|
8
|
+
// a hidden `iframe` element containing a form that is submitted.
|
|
9
|
+
|
|
10
|
+
// The [source for the plugin](http://github.com/cmlenz/jquery-iframe-transport)
|
|
11
|
+
// is available on [Github](http://github.com/) and dual licensed under the MIT
|
|
12
|
+
// or GPL Version 2 licenses.
|
|
13
|
+
|
|
14
|
+
// ## Usage
|
|
15
|
+
|
|
16
|
+
// To use this plugin, you simply add a `iframe` option with the value `true`
|
|
17
|
+
// to the Ajax settings an `$.ajax()` call, and specify the file fields to
|
|
18
|
+
// include in the submssion using the `files` option, which can be a selector,
|
|
19
|
+
// jQuery object, or a list of DOM elements containing one or more
|
|
20
|
+
// `<input type="file">` elements:
|
|
21
|
+
|
|
22
|
+
// $("#myform").submit(function() {
|
|
23
|
+
// $.ajax(this.action, {
|
|
24
|
+
// files: $(":file", this),
|
|
25
|
+
// iframe: true
|
|
26
|
+
// }).complete(function(data) {
|
|
27
|
+
// console.log(data);
|
|
28
|
+
// });
|
|
29
|
+
// });
|
|
30
|
+
|
|
31
|
+
// The plugin will construct a hidden `<iframe>` element containing a copy of
|
|
32
|
+
// the form the file field belongs to, will disable any form fields not
|
|
33
|
+
// explicitly included, submit that form, and process the response.
|
|
34
|
+
|
|
35
|
+
// If you want to include other form fields in the form submission, include them
|
|
36
|
+
// in the `data` option, and set the `processData` option to `false`:
|
|
37
|
+
|
|
38
|
+
// $("#myform").submit(function() {
|
|
39
|
+
// $.ajax(this.action, {
|
|
40
|
+
// data: $(":text", this).serializeArray(),
|
|
41
|
+
// files: $(":file", this),
|
|
42
|
+
// iframe: true,
|
|
43
|
+
// processData: false
|
|
44
|
+
// }).complete(function(data) {
|
|
45
|
+
// console.log(data);
|
|
46
|
+
// });
|
|
47
|
+
// });
|
|
48
|
+
|
|
49
|
+
// ### The Server Side
|
|
50
|
+
|
|
51
|
+
// If the response is not HTML or XML, you (unfortunately) need to apply some
|
|
52
|
+
// trickery on the server side. To send back a JSON payload, send back an HTML
|
|
53
|
+
// `<textarea>` element with a `data-type` attribute that contains the MIME
|
|
54
|
+
// type, and put the actual payload in the textarea:
|
|
55
|
+
|
|
56
|
+
// <textarea data-type="application/json">
|
|
57
|
+
// {"ok": true, "message": "Thanks so much"}
|
|
58
|
+
// </textarea>
|
|
59
|
+
|
|
60
|
+
// The iframe transport plugin will detect this and attempt to apply the same
|
|
61
|
+
// conversions that jQuery applies to regular responses. That means for the
|
|
62
|
+
// example above you should get a Javascript object as the `data` parameter of
|
|
63
|
+
// the `complete` callback, with the properties `ok: true` and
|
|
64
|
+
// `message: "Thanks so much"`.
|
|
65
|
+
|
|
66
|
+
// ### Compatibility
|
|
67
|
+
|
|
68
|
+
// This plugin has primarily been tested on Safari 5, Firefox 4, and Internet
|
|
69
|
+
// Explorer all the way back to version 6. While I haven't found any issues with
|
|
70
|
+
// it so far, I'm fairly sure it still doesn't work around all the quirks in all
|
|
71
|
+
// different browsers. But the code is still pretty simple overall, so you
|
|
72
|
+
// should be able to fix it and contribute a patch :)
|
|
73
|
+
|
|
74
|
+
// ## Annotated Source
|
|
75
|
+
|
|
76
|
+
(function($, undefined) {
|
|
77
|
+
|
|
78
|
+
// Register a prefilter that checks whether the `iframe` option is set, and
|
|
79
|
+
// switches to the iframe transport if it is `true`.
|
|
80
|
+
$.ajaxPrefilter(function(options, origOptions, jqXHR) {
|
|
81
|
+
if (options.iframe) {
|
|
82
|
+
return "iframe";
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Register an iframe transport, independent of requested data type. It will
|
|
87
|
+
// only activate when the "files" option has been set to a non-empty list of
|
|
88
|
+
// enabled file inputs.
|
|
89
|
+
$.ajaxTransport("iframe", function(options, origOptions, jqXHR) {
|
|
90
|
+
var form = null,
|
|
91
|
+
iframe = null,
|
|
92
|
+
origAction = null,
|
|
93
|
+
origTarget = null,
|
|
94
|
+
origEnctype = null,
|
|
95
|
+
addedFields = [],
|
|
96
|
+
disabledFields = [],
|
|
97
|
+
files = $(options.files).filter(":file:enabled");
|
|
98
|
+
|
|
99
|
+
// This function gets called after a successful submission or an abortion
|
|
100
|
+
// and should revert all changes made to the page to enable the
|
|
101
|
+
// submission via this transport.
|
|
102
|
+
function cleanUp() {
|
|
103
|
+
$(addedFields).each(function() {
|
|
104
|
+
this.remove();
|
|
105
|
+
});
|
|
106
|
+
$(disabledFields).each(function() {
|
|
107
|
+
this.disabled = false;
|
|
108
|
+
});
|
|
109
|
+
form.attr("action", origAction || "")
|
|
110
|
+
.attr("target", origTarget || "")
|
|
111
|
+
.attr("enctype", origEnctype || "");
|
|
112
|
+
iframe.attr("src", "javascript:false;").remove();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Remove "iframe" from the data types list so that further processing is
|
|
116
|
+
// based on the content type returned by the server, without attempting an
|
|
117
|
+
// (unsupported) conversion from "iframe" to the actual type.
|
|
118
|
+
options.dataTypes.shift();
|
|
119
|
+
|
|
120
|
+
if (files.length) {
|
|
121
|
+
// Determine the form the file fields belong to, and make sure they all
|
|
122
|
+
// actually belong to the same form.
|
|
123
|
+
files.each(function() {
|
|
124
|
+
if (form !== null && this.form !== form) {
|
|
125
|
+
jQuery.error("All file fields must belong to the same form");
|
|
126
|
+
}
|
|
127
|
+
form = this.form;
|
|
128
|
+
});
|
|
129
|
+
form = $(form);
|
|
130
|
+
|
|
131
|
+
// Store the original form attributes that we'll be replacing temporarily.
|
|
132
|
+
origAction = form.attr("action");
|
|
133
|
+
origTarget = form.attr("target");
|
|
134
|
+
origEnctype = form.attr("enctype");
|
|
135
|
+
|
|
136
|
+
// We need to disable all other inputs in the form so that they don't get
|
|
137
|
+
// included in the submitted data unexpectedly.
|
|
138
|
+
form.find(":input:not(:submit)").each(function() {
|
|
139
|
+
if (!this.disabled && (this.type != "file" || files.index(this) < 0)) {
|
|
140
|
+
this.disabled = true;
|
|
141
|
+
disabledFields.push(this);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// If there is any additional data specified via the `data` option,
|
|
146
|
+
// we add it as hidden fields to the form. This (currently) requires
|
|
147
|
+
// the `processData` option to be set to false so that the data doesn't
|
|
148
|
+
// get serialized to a string.
|
|
149
|
+
if (typeof(options.data) === "string" && options.data.length > 0) {
|
|
150
|
+
jQuery.error("data must not be serialized");
|
|
151
|
+
}
|
|
152
|
+
$.each(options.data || {}, function(name, value) {
|
|
153
|
+
if ($.isPlainObject(value)) {
|
|
154
|
+
name = value.name;
|
|
155
|
+
value = value.value;
|
|
156
|
+
}
|
|
157
|
+
addedFields.push($("<input type='hidden'>").attr("name", name)
|
|
158
|
+
.attr("value", value).appendTo(form));
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// Add a hidden `X-Requested-With` field with the value `IFrame` to the
|
|
162
|
+
// field, to help server-side code to determine that the upload happened
|
|
163
|
+
// through this transport.
|
|
164
|
+
addedFields.push($("<input type='hidden' name='X-Requested-With'>")
|
|
165
|
+
.attr("value", "IFrame").appendTo(form));
|
|
166
|
+
|
|
167
|
+
// Borrowed straight from the JQuery source
|
|
168
|
+
// Provides a way of specifying the accepted data type similar to HTTP_ACCEPTS
|
|
169
|
+
accepts = options.dataTypes[ 0 ] && options.accepts[ options.dataTypes[0] ] ?
|
|
170
|
+
options.accepts[ options.dataTypes[0] ] + ( options.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
|
|
171
|
+
options.accepts[ "*" ]
|
|
172
|
+
|
|
173
|
+
addedFields.push($("<input type='hidden' name='X-Http-Accept'>")
|
|
174
|
+
.attr("value", accepts).appendTo(form));
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
|
|
178
|
+
// The `send` function is called by jQuery when the request should be
|
|
179
|
+
// sent.
|
|
180
|
+
send: function(headers, completeCallback) {
|
|
181
|
+
iframe = $("<iframe src='javascript:false;' name='iframe-" + $.now()
|
|
182
|
+
+ "' style='display:none'></iframe>");
|
|
183
|
+
|
|
184
|
+
// The first load event gets fired after the iframe has been injected
|
|
185
|
+
// into the DOM, and is used to prepare the actual submission.
|
|
186
|
+
iframe.bind("load", function() {
|
|
187
|
+
|
|
188
|
+
// The second load event gets fired when the response to the form
|
|
189
|
+
// submission is received. The implementation detects whether the
|
|
190
|
+
// actual payload is embedded in a `<textarea>` element, and
|
|
191
|
+
// prepares the required conversions to be made in that case.
|
|
192
|
+
iframe.unbind("load").bind("load", function() {
|
|
193
|
+
|
|
194
|
+
var doc = this.contentWindow ? this.contentWindow.document :
|
|
195
|
+
(this.contentDocument ? this.contentDocument : this.document),
|
|
196
|
+
root = doc.documentElement ? doc.documentElement : doc.body,
|
|
197
|
+
textarea = root.getElementsByTagName("textarea")[0],
|
|
198
|
+
type = textarea ? textarea.getAttribute("data-type") : null;
|
|
199
|
+
|
|
200
|
+
var status = textarea ? parseInt(textarea.getAttribute("response-code")) : 200,
|
|
201
|
+
statusText = "OK",
|
|
202
|
+
responses = { text: type ? textarea.value : root ? root.innerHTML : null },
|
|
203
|
+
headers = "Content-Type: " + (type || "text/html")
|
|
204
|
+
|
|
205
|
+
completeCallback(status, statusText, responses, headers);
|
|
206
|
+
|
|
207
|
+
setTimeout(cleanUp, 50);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// Now that the load handler has been set up, reconfigure and
|
|
211
|
+
// submit the form.
|
|
212
|
+
form.attr("action", options.url)
|
|
213
|
+
.attr("target", iframe.attr("name"))
|
|
214
|
+
.attr("enctype", "multipart/form-data")
|
|
215
|
+
.get(0).submit();
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// After everything has been set up correctly, the iframe gets
|
|
219
|
+
// injected into the DOM so that the submission can be initiated.
|
|
220
|
+
iframe.insertAfter(form);
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
// The `abort` function is called by jQuery when the request should be
|
|
224
|
+
// aborted.
|
|
225
|
+
abort: function() {
|
|
226
|
+
if (iframe !== null) {
|
|
227
|
+
iframe.unbind("load").attr("src", "javascript:false;");
|
|
228
|
+
cleanUp();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
})(jQuery);
|
|
237
|
+
:@created_atf1335716315.2567511n�
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,1092 @@
|
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@expires_in0:@compressedF:@value"��{"content_type"application/javascript"
|
|
2
|
+
class"ProcessedAsset"dependency_digest"%0196b7795698446df49f49bf4c583c0d"
|
|
3
|
+
mtime"2012-04-20T18:49:51-05:00"
|
|
4
|
+
{"
|
|
5
|
+
mtime"2012-04-20T18:49:51-05:00"digest"%a5d1de85c8bf668b09833c6f9d7f193b" path"c/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.mouse.js{@"2012-04-28T19:31:29-05:00@"%33830d8b45ce2f9b31ccd9bdf5f3fc6e@"W/Library/Ruby/Gems/1.8/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery.js{@"2012-04-20T18:49:51-05:00@"%c1751dc898908a3b4c26592ef446387a@"d/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.widget.js{@"2012-04-20T18:49:51-05:00@"%40afad9738de38653841af508b418d17@"f/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.sortable.js{@"2012-04-20T18:49:51-05:00@"%7672653a2f5e4eab1758536a65296684@"b/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.core.js"digest"%64e6729b75057f64620c565816e759f9"required_paths[
|
|
6
|
+
"W/Library/Ruby/Gems/1.8/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery.js"b/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.core.js"d/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.widget.js"c/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.mouse.js"f/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.sortable.js"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/*!
|
|
11
|
+
* jQuery UI Sortable 1.8.18
|
|
12
|
+
*
|
|
13
|
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
|
14
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
15
|
+
* http://jquery.org/license
|
|
16
|
+
*
|
|
17
|
+
* http://docs.jquery.com/UI/Sortables
|
|
18
|
+
*
|
|
19
|
+
* Depends:
|
|
20
|
+
* jquery.ui.core.js
|
|
21
|
+
* jquery.ui.mouse.js
|
|
22
|
+
* jquery.ui.widget.js
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
(function( $, undefined ) {
|
|
26
|
+
|
|
27
|
+
$.widget("ui.sortable", $.ui.mouse, {
|
|
28
|
+
widgetEventPrefix: "sort",
|
|
29
|
+
ready: false,
|
|
30
|
+
options: {
|
|
31
|
+
appendTo: "parent",
|
|
32
|
+
axis: false,
|
|
33
|
+
connectWith: false,
|
|
34
|
+
containment: false,
|
|
35
|
+
cursor: 'auto',
|
|
36
|
+
cursorAt: false,
|
|
37
|
+
dropOnEmpty: true,
|
|
38
|
+
forcePlaceholderSize: false,
|
|
39
|
+
forceHelperSize: false,
|
|
40
|
+
grid: false,
|
|
41
|
+
handle: false,
|
|
42
|
+
helper: "original",
|
|
43
|
+
items: '> *',
|
|
44
|
+
opacity: false,
|
|
45
|
+
placeholder: false,
|
|
46
|
+
revert: false,
|
|
47
|
+
scroll: true,
|
|
48
|
+
scrollSensitivity: 20,
|
|
49
|
+
scrollSpeed: 20,
|
|
50
|
+
scope: "default",
|
|
51
|
+
tolerance: "intersect",
|
|
52
|
+
zIndex: 1000
|
|
53
|
+
},
|
|
54
|
+
_create: function() {
|
|
55
|
+
|
|
56
|
+
var o = this.options;
|
|
57
|
+
this.containerCache = {};
|
|
58
|
+
this.element.addClass("ui-sortable");
|
|
59
|
+
|
|
60
|
+
//Get the items
|
|
61
|
+
this.refresh();
|
|
62
|
+
|
|
63
|
+
//Let's determine if the items are being displayed horizontally
|
|
64
|
+
this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
|
|
65
|
+
|
|
66
|
+
//Let's determine the parent's offset
|
|
67
|
+
this.offset = this.element.offset();
|
|
68
|
+
|
|
69
|
+
//Initialize mouse events for interaction
|
|
70
|
+
this._mouseInit();
|
|
71
|
+
|
|
72
|
+
//We're ready to go
|
|
73
|
+
this.ready = true
|
|
74
|
+
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
destroy: function() {
|
|
78
|
+
$.Widget.prototype.destroy.call( this );
|
|
79
|
+
this.element
|
|
80
|
+
.removeClass("ui-sortable ui-sortable-disabled");
|
|
81
|
+
this._mouseDestroy();
|
|
82
|
+
|
|
83
|
+
for ( var i = this.items.length - 1; i >= 0; i-- )
|
|
84
|
+
this.items[i].item.removeData(this.widgetName + "-item");
|
|
85
|
+
|
|
86
|
+
return this;
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
_setOption: function(key, value){
|
|
90
|
+
if ( key === "disabled" ) {
|
|
91
|
+
this.options[ key ] = value;
|
|
92
|
+
|
|
93
|
+
this.widget()
|
|
94
|
+
[ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
|
|
95
|
+
} else {
|
|
96
|
+
// Don't call widget base _setOption for disable as it adds ui-state-disabled class
|
|
97
|
+
$.Widget.prototype._setOption.apply(this, arguments);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
_mouseCapture: function(event, overrideHandle) {
|
|
102
|
+
var that = this;
|
|
103
|
+
|
|
104
|
+
if (this.reverting) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if(this.options.disabled || this.options.type == 'static') return false;
|
|
109
|
+
|
|
110
|
+
//We have to refresh the items data once first
|
|
111
|
+
this._refreshItems(event);
|
|
112
|
+
|
|
113
|
+
//Find out if the clicked node (or one of its parents) is a actual item in this.items
|
|
114
|
+
var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {
|
|
115
|
+
if($.data(this, that.widgetName + '-item') == self) {
|
|
116
|
+
currentItem = $(this);
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target);
|
|
121
|
+
|
|
122
|
+
if(!currentItem) return false;
|
|
123
|
+
if(this.options.handle && !overrideHandle) {
|
|
124
|
+
var validHandle = false;
|
|
125
|
+
|
|
126
|
+
$(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
|
|
127
|
+
if(!validHandle) return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.currentItem = currentItem;
|
|
131
|
+
this._removeCurrentsFromItems();
|
|
132
|
+
return true;
|
|
133
|
+
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
_mouseStart: function(event, overrideHandle, noActivation) {
|
|
137
|
+
|
|
138
|
+
var o = this.options, self = this;
|
|
139
|
+
this.currentContainer = this;
|
|
140
|
+
|
|
141
|
+
//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
|
|
142
|
+
this.refreshPositions();
|
|
143
|
+
|
|
144
|
+
//Create and append the visible helper
|
|
145
|
+
this.helper = this._createHelper(event);
|
|
146
|
+
|
|
147
|
+
//Cache the helper size
|
|
148
|
+
this._cacheHelperProportions();
|
|
149
|
+
|
|
150
|
+
/*
|
|
151
|
+
* - Position generation -
|
|
152
|
+
* This block generates everything position related - it's the core of draggables.
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
//Cache the margins of the original element
|
|
156
|
+
this._cacheMargins();
|
|
157
|
+
|
|
158
|
+
//Get the next scrolling parent
|
|
159
|
+
this.scrollParent = this.helper.scrollParent();
|
|
160
|
+
|
|
161
|
+
//The element's absolute position on the page minus margins
|
|
162
|
+
this.offset = this.currentItem.offset();
|
|
163
|
+
this.offset = {
|
|
164
|
+
top: this.offset.top - this.margins.top,
|
|
165
|
+
left: this.offset.left - this.margins.left
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// Only after we got the offset, we can change the helper's position to absolute
|
|
169
|
+
// TODO: Still need to figure out a way to make relative sorting possible
|
|
170
|
+
this.helper.css("position", "absolute");
|
|
171
|
+
this.cssPosition = this.helper.css("position");
|
|
172
|
+
|
|
173
|
+
$.extend(this.offset, {
|
|
174
|
+
click: { //Where the click happened, relative to the element
|
|
175
|
+
left: event.pageX - this.offset.left,
|
|
176
|
+
top: event.pageY - this.offset.top
|
|
177
|
+
},
|
|
178
|
+
parent: this._getParentOffset(),
|
|
179
|
+
relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
//Generate the original position
|
|
183
|
+
this.originalPosition = this._generatePosition(event);
|
|
184
|
+
this.originalPageX = event.pageX;
|
|
185
|
+
this.originalPageY = event.pageY;
|
|
186
|
+
|
|
187
|
+
//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
|
|
188
|
+
(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
|
|
189
|
+
|
|
190
|
+
//Cache the former DOM position
|
|
191
|
+
this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
|
|
192
|
+
|
|
193
|
+
//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
|
|
194
|
+
if(this.helper[0] != this.currentItem[0]) {
|
|
195
|
+
this.currentItem.hide();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
//Create the placeholder
|
|
199
|
+
this._createPlaceholder();
|
|
200
|
+
|
|
201
|
+
//Set a containment if given in the options
|
|
202
|
+
if(o.containment)
|
|
203
|
+
this._setContainment();
|
|
204
|
+
|
|
205
|
+
if(o.cursor) { // cursor option
|
|
206
|
+
if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
|
|
207
|
+
$('body').css("cursor", o.cursor);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if(o.opacity) { // opacity option
|
|
211
|
+
if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
|
|
212
|
+
this.helper.css("opacity", o.opacity);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if(o.zIndex) { // zIndex option
|
|
216
|
+
if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
|
|
217
|
+
this.helper.css("zIndex", o.zIndex);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
//Prepare scrolling
|
|
221
|
+
if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
|
|
222
|
+
this.overflowOffset = this.scrollParent.offset();
|
|
223
|
+
|
|
224
|
+
//Call callbacks
|
|
225
|
+
this._trigger("start", event, this._uiHash());
|
|
226
|
+
|
|
227
|
+
//Recache the helper size
|
|
228
|
+
if(!this._preserveHelperProportions)
|
|
229
|
+
this._cacheHelperProportions();
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
//Post 'activate' events to possible containers
|
|
233
|
+
if(!noActivation) {
|
|
234
|
+
for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); }
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
//Prepare possible droppables
|
|
238
|
+
if($.ui.ddmanager)
|
|
239
|
+
$.ui.ddmanager.current = this;
|
|
240
|
+
|
|
241
|
+
if ($.ui.ddmanager && !o.dropBehaviour)
|
|
242
|
+
$.ui.ddmanager.prepareOffsets(this, event);
|
|
243
|
+
|
|
244
|
+
this.dragging = true;
|
|
245
|
+
|
|
246
|
+
this.helper.addClass("ui-sortable-helper");
|
|
247
|
+
this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
|
|
248
|
+
return true;
|
|
249
|
+
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
_mouseDrag: function(event) {
|
|
253
|
+
|
|
254
|
+
//Compute the helpers position
|
|
255
|
+
this.position = this._generatePosition(event);
|
|
256
|
+
this.positionAbs = this._convertPositionTo("absolute");
|
|
257
|
+
|
|
258
|
+
if (!this.lastPositionAbs) {
|
|
259
|
+
this.lastPositionAbs = this.positionAbs;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
//Do scrolling
|
|
263
|
+
if(this.options.scroll) {
|
|
264
|
+
var o = this.options, scrolled = false;
|
|
265
|
+
if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
|
|
266
|
+
|
|
267
|
+
if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
|
|
268
|
+
this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
|
|
269
|
+
else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
|
|
270
|
+
this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
|
|
271
|
+
|
|
272
|
+
if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
|
|
273
|
+
this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
|
|
274
|
+
else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
|
|
275
|
+
this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
|
|
276
|
+
|
|
277
|
+
} else {
|
|
278
|
+
|
|
279
|
+
if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
|
|
280
|
+
scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
|
|
281
|
+
else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
|
|
282
|
+
scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
|
|
283
|
+
|
|
284
|
+
if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
|
|
285
|
+
scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
|
|
286
|
+
else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
|
|
287
|
+
scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
|
|
288
|
+
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
|
|
292
|
+
$.ui.ddmanager.prepareOffsets(this, event);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
//Regenerate the absolute position used for position checks
|
|
296
|
+
this.positionAbs = this._convertPositionTo("absolute");
|
|
297
|
+
|
|
298
|
+
//Set the helper position
|
|
299
|
+
if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
|
|
300
|
+
if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
|
|
301
|
+
|
|
302
|
+
//Rearrange
|
|
303
|
+
for (var i = this.items.length - 1; i >= 0; i--) {
|
|
304
|
+
|
|
305
|
+
//Cache variables and intersection, continue if no intersection
|
|
306
|
+
var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
|
|
307
|
+
if (!intersection) continue;
|
|
308
|
+
|
|
309
|
+
if(itemElement != this.currentItem[0] //cannot intersect with itself
|
|
310
|
+
&& this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
|
|
311
|
+
&& !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
|
|
312
|
+
&& (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)
|
|
313
|
+
//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
|
|
314
|
+
) {
|
|
315
|
+
|
|
316
|
+
this.direction = intersection == 1 ? "down" : "up";
|
|
317
|
+
|
|
318
|
+
if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
|
|
319
|
+
this._rearrange(event, item);
|
|
320
|
+
} else {
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
this._trigger("change", event, this._uiHash());
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
//Post events to containers
|
|
330
|
+
this._contactContainers(event);
|
|
331
|
+
|
|
332
|
+
//Interconnect with droppables
|
|
333
|
+
if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
|
|
334
|
+
|
|
335
|
+
//Call callbacks
|
|
336
|
+
this._trigger('sort', event, this._uiHash());
|
|
337
|
+
|
|
338
|
+
this.lastPositionAbs = this.positionAbs;
|
|
339
|
+
return false;
|
|
340
|
+
|
|
341
|
+
},
|
|
342
|
+
|
|
343
|
+
_mouseStop: function(event, noPropagation) {
|
|
344
|
+
|
|
345
|
+
if(!event) return;
|
|
346
|
+
|
|
347
|
+
//If we are using droppables, inform the manager about the drop
|
|
348
|
+
if ($.ui.ddmanager && !this.options.dropBehaviour)
|
|
349
|
+
$.ui.ddmanager.drop(this, event);
|
|
350
|
+
|
|
351
|
+
if(this.options.revert) {
|
|
352
|
+
var self = this;
|
|
353
|
+
var cur = self.placeholder.offset();
|
|
354
|
+
|
|
355
|
+
self.reverting = true;
|
|
356
|
+
|
|
357
|
+
$(this.helper).animate({
|
|
358
|
+
left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
|
|
359
|
+
top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
|
|
360
|
+
}, parseInt(this.options.revert, 10) || 500, function() {
|
|
361
|
+
self._clear(event);
|
|
362
|
+
});
|
|
363
|
+
} else {
|
|
364
|
+
this._clear(event, noPropagation);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return false;
|
|
368
|
+
|
|
369
|
+
},
|
|
370
|
+
|
|
371
|
+
cancel: function() {
|
|
372
|
+
|
|
373
|
+
var self = this;
|
|
374
|
+
|
|
375
|
+
if(this.dragging) {
|
|
376
|
+
|
|
377
|
+
this._mouseUp({ target: null });
|
|
378
|
+
|
|
379
|
+
if(this.options.helper == "original")
|
|
380
|
+
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
|
|
381
|
+
else
|
|
382
|
+
this.currentItem.show();
|
|
383
|
+
|
|
384
|
+
//Post deactivating events to containers
|
|
385
|
+
for (var i = this.containers.length - 1; i >= 0; i--){
|
|
386
|
+
this.containers[i]._trigger("deactivate", null, self._uiHash(this));
|
|
387
|
+
if(this.containers[i].containerCache.over) {
|
|
388
|
+
this.containers[i]._trigger("out", null, self._uiHash(this));
|
|
389
|
+
this.containers[i].containerCache.over = 0;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
if (this.placeholder) {
|
|
396
|
+
//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
|
|
397
|
+
if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
|
|
398
|
+
if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
|
|
399
|
+
|
|
400
|
+
$.extend(this, {
|
|
401
|
+
helper: null,
|
|
402
|
+
dragging: false,
|
|
403
|
+
reverting: false,
|
|
404
|
+
_noFinalSort: null
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
if(this.domPosition.prev) {
|
|
408
|
+
$(this.domPosition.prev).after(this.currentItem);
|
|
409
|
+
} else {
|
|
410
|
+
$(this.domPosition.parent).prepend(this.currentItem);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return this;
|
|
415
|
+
|
|
416
|
+
},
|
|
417
|
+
|
|
418
|
+
serialize: function(o) {
|
|
419
|
+
|
|
420
|
+
var items = this._getItemsAsjQuery(o && o.connected);
|
|
421
|
+
var str = []; o = o || {};
|
|
422
|
+
|
|
423
|
+
$(items).each(function() {
|
|
424
|
+
var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
|
|
425
|
+
if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
if(!str.length && o.key) {
|
|
429
|
+
str.push(o.key + '=');
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return str.join('&');
|
|
433
|
+
|
|
434
|
+
},
|
|
435
|
+
|
|
436
|
+
toArray: function(o) {
|
|
437
|
+
|
|
438
|
+
var items = this._getItemsAsjQuery(o && o.connected);
|
|
439
|
+
var ret = []; o = o || {};
|
|
440
|
+
|
|
441
|
+
items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
|
|
442
|
+
return ret;
|
|
443
|
+
|
|
444
|
+
},
|
|
445
|
+
|
|
446
|
+
/* Be careful with the following core functions */
|
|
447
|
+
_intersectsWith: function(item) {
|
|
448
|
+
|
|
449
|
+
var x1 = this.positionAbs.left,
|
|
450
|
+
x2 = x1 + this.helperProportions.width,
|
|
451
|
+
y1 = this.positionAbs.top,
|
|
452
|
+
y2 = y1 + this.helperProportions.height;
|
|
453
|
+
|
|
454
|
+
var l = item.left,
|
|
455
|
+
r = l + item.width,
|
|
456
|
+
t = item.top,
|
|
457
|
+
b = t + item.height;
|
|
458
|
+
|
|
459
|
+
var dyClick = this.offset.click.top,
|
|
460
|
+
dxClick = this.offset.click.left;
|
|
461
|
+
|
|
462
|
+
var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
|
|
463
|
+
|
|
464
|
+
if( this.options.tolerance == "pointer"
|
|
465
|
+
|| this.options.forcePointerForContainers
|
|
466
|
+
|| (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
|
|
467
|
+
) {
|
|
468
|
+
return isOverElement;
|
|
469
|
+
} else {
|
|
470
|
+
|
|
471
|
+
return (l < x1 + (this.helperProportions.width / 2) // Right Half
|
|
472
|
+
&& x2 - (this.helperProportions.width / 2) < r // Left Half
|
|
473
|
+
&& t < y1 + (this.helperProportions.height / 2) // Bottom Half
|
|
474
|
+
&& y2 - (this.helperProportions.height / 2) < b ); // Top Half
|
|
475
|
+
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
|
|
479
|
+
_intersectsWithPointer: function(item) {
|
|
480
|
+
|
|
481
|
+
var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
|
|
482
|
+
isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
|
|
483
|
+
isOverElement = isOverElementHeight && isOverElementWidth,
|
|
484
|
+
verticalDirection = this._getDragVerticalDirection(),
|
|
485
|
+
horizontalDirection = this._getDragHorizontalDirection();
|
|
486
|
+
|
|
487
|
+
if (!isOverElement)
|
|
488
|
+
return false;
|
|
489
|
+
|
|
490
|
+
return this.floating ?
|
|
491
|
+
( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
|
|
492
|
+
: ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
|
|
493
|
+
|
|
494
|
+
},
|
|
495
|
+
|
|
496
|
+
_intersectsWithSides: function(item) {
|
|
497
|
+
|
|
498
|
+
var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
|
|
499
|
+
isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
|
|
500
|
+
verticalDirection = this._getDragVerticalDirection(),
|
|
501
|
+
horizontalDirection = this._getDragHorizontalDirection();
|
|
502
|
+
|
|
503
|
+
if (this.floating && horizontalDirection) {
|
|
504
|
+
return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
|
|
505
|
+
} else {
|
|
506
|
+
return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
},
|
|
510
|
+
|
|
511
|
+
_getDragVerticalDirection: function() {
|
|
512
|
+
var delta = this.positionAbs.top - this.lastPositionAbs.top;
|
|
513
|
+
return delta != 0 && (delta > 0 ? "down" : "up");
|
|
514
|
+
},
|
|
515
|
+
|
|
516
|
+
_getDragHorizontalDirection: function() {
|
|
517
|
+
var delta = this.positionAbs.left - this.lastPositionAbs.left;
|
|
518
|
+
return delta != 0 && (delta > 0 ? "right" : "left");
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
refresh: function(event) {
|
|
522
|
+
this._refreshItems(event);
|
|
523
|
+
this.refreshPositions();
|
|
524
|
+
return this;
|
|
525
|
+
},
|
|
526
|
+
|
|
527
|
+
_connectWith: function() {
|
|
528
|
+
var options = this.options;
|
|
529
|
+
return options.connectWith.constructor == String
|
|
530
|
+
? [options.connectWith]
|
|
531
|
+
: options.connectWith;
|
|
532
|
+
},
|
|
533
|
+
|
|
534
|
+
_getItemsAsjQuery: function(connected) {
|
|
535
|
+
|
|
536
|
+
var self = this;
|
|
537
|
+
var items = [];
|
|
538
|
+
var queries = [];
|
|
539
|
+
var connectWith = this._connectWith();
|
|
540
|
+
|
|
541
|
+
if(connectWith && connected) {
|
|
542
|
+
for (var i = connectWith.length - 1; i >= 0; i--){
|
|
543
|
+
var cur = $(connectWith[i]);
|
|
544
|
+
for (var j = cur.length - 1; j >= 0; j--){
|
|
545
|
+
var inst = $.data(cur[j], this.widgetName);
|
|
546
|
+
if(inst && inst != this && !inst.options.disabled) {
|
|
547
|
+
queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]);
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]);
|
|
554
|
+
|
|
555
|
+
for (var i = queries.length - 1; i >= 0; i--){
|
|
556
|
+
queries[i][0].each(function() {
|
|
557
|
+
items.push(this);
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
return $(items);
|
|
562
|
+
|
|
563
|
+
},
|
|
564
|
+
|
|
565
|
+
_removeCurrentsFromItems: function() {
|
|
566
|
+
|
|
567
|
+
var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
|
|
568
|
+
|
|
569
|
+
for (var i=0; i < this.items.length; i++) {
|
|
570
|
+
|
|
571
|
+
for (var j=0; j < list.length; j++) {
|
|
572
|
+
if(list[j] == this.items[i].item[0])
|
|
573
|
+
this.items.splice(i,1);
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
},
|
|
579
|
+
|
|
580
|
+
_refreshItems: function(event) {
|
|
581
|
+
|
|
582
|
+
this.items = [];
|
|
583
|
+
this.containers = [this];
|
|
584
|
+
var items = this.items;
|
|
585
|
+
var self = this;
|
|
586
|
+
var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
|
|
587
|
+
var connectWith = this._connectWith();
|
|
588
|
+
|
|
589
|
+
if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
|
|
590
|
+
for (var i = connectWith.length - 1; i >= 0; i--){
|
|
591
|
+
var cur = $(connectWith[i]);
|
|
592
|
+
for (var j = cur.length - 1; j >= 0; j--){
|
|
593
|
+
var inst = $.data(cur[j], this.widgetName);
|
|
594
|
+
if(inst && inst != this && !inst.options.disabled) {
|
|
595
|
+
queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
|
|
596
|
+
this.containers.push(inst);
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
for (var i = queries.length - 1; i >= 0; i--) {
|
|
603
|
+
var targetData = queries[i][1];
|
|
604
|
+
var _queries = queries[i][0];
|
|
605
|
+
|
|
606
|
+
for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
|
|
607
|
+
var item = $(_queries[j]);
|
|
608
|
+
|
|
609
|
+
item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)
|
|
610
|
+
|
|
611
|
+
items.push({
|
|
612
|
+
item: item,
|
|
613
|
+
instance: targetData,
|
|
614
|
+
width: 0, height: 0,
|
|
615
|
+
left: 0, top: 0
|
|
616
|
+
});
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
},
|
|
621
|
+
|
|
622
|
+
refreshPositions: function(fast) {
|
|
623
|
+
|
|
624
|
+
//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
|
|
625
|
+
if(this.offsetParent && this.helper) {
|
|
626
|
+
this.offset.parent = this._getParentOffset();
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
for (var i = this.items.length - 1; i >= 0; i--){
|
|
630
|
+
var item = this.items[i];
|
|
631
|
+
|
|
632
|
+
//We ignore calculating positions of all connected containers when we're not over them
|
|
633
|
+
if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
|
|
634
|
+
continue;
|
|
635
|
+
|
|
636
|
+
var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
|
|
637
|
+
|
|
638
|
+
if (!fast) {
|
|
639
|
+
item.width = t.outerWidth();
|
|
640
|
+
item.height = t.outerHeight();
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
var p = t.offset();
|
|
644
|
+
item.left = p.left;
|
|
645
|
+
item.top = p.top;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
if(this.options.custom && this.options.custom.refreshContainers) {
|
|
649
|
+
this.options.custom.refreshContainers.call(this);
|
|
650
|
+
} else {
|
|
651
|
+
for (var i = this.containers.length - 1; i >= 0; i--){
|
|
652
|
+
var p = this.containers[i].element.offset();
|
|
653
|
+
this.containers[i].containerCache.left = p.left;
|
|
654
|
+
this.containers[i].containerCache.top = p.top;
|
|
655
|
+
this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
|
|
656
|
+
this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
return this;
|
|
661
|
+
},
|
|
662
|
+
|
|
663
|
+
_createPlaceholder: function(that) {
|
|
664
|
+
|
|
665
|
+
var self = that || this, o = self.options;
|
|
666
|
+
|
|
667
|
+
if(!o.placeholder || o.placeholder.constructor == String) {
|
|
668
|
+
var className = o.placeholder;
|
|
669
|
+
o.placeholder = {
|
|
670
|
+
element: function() {
|
|
671
|
+
|
|
672
|
+
var el = $(document.createElement(self.currentItem[0].nodeName))
|
|
673
|
+
.addClass(className || self.currentItem[0].className+" ui-sortable-placeholder")
|
|
674
|
+
.removeClass("ui-sortable-helper")[0];
|
|
675
|
+
|
|
676
|
+
if(!className)
|
|
677
|
+
el.style.visibility = "hidden";
|
|
678
|
+
|
|
679
|
+
return el;
|
|
680
|
+
},
|
|
681
|
+
update: function(container, p) {
|
|
682
|
+
|
|
683
|
+
// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
|
|
684
|
+
// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
|
|
685
|
+
if(className && !o.forcePlaceholderSize) return;
|
|
686
|
+
|
|
687
|
+
//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
|
|
688
|
+
if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
|
|
689
|
+
if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
//Create the placeholder
|
|
695
|
+
self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));
|
|
696
|
+
|
|
697
|
+
//Append it after the actual current item
|
|
698
|
+
self.currentItem.after(self.placeholder);
|
|
699
|
+
|
|
700
|
+
//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
|
|
701
|
+
o.placeholder.update(self, self.placeholder);
|
|
702
|
+
|
|
703
|
+
},
|
|
704
|
+
|
|
705
|
+
_contactContainers: function(event) {
|
|
706
|
+
|
|
707
|
+
// get innermost container that intersects with item
|
|
708
|
+
var innermostContainer = null, innermostIndex = null;
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
for (var i = this.containers.length - 1; i >= 0; i--){
|
|
712
|
+
|
|
713
|
+
// never consider a container that's located within the item itself
|
|
714
|
+
if($.ui.contains(this.currentItem[0], this.containers[i].element[0]))
|
|
715
|
+
continue;
|
|
716
|
+
|
|
717
|
+
if(this._intersectsWith(this.containers[i].containerCache)) {
|
|
718
|
+
|
|
719
|
+
// if we've already found a container and it's more "inner" than this, then continue
|
|
720
|
+
if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0]))
|
|
721
|
+
continue;
|
|
722
|
+
|
|
723
|
+
innermostContainer = this.containers[i];
|
|
724
|
+
innermostIndex = i;
|
|
725
|
+
|
|
726
|
+
} else {
|
|
727
|
+
// container doesn't intersect. trigger "out" event if necessary
|
|
728
|
+
if(this.containers[i].containerCache.over) {
|
|
729
|
+
this.containers[i]._trigger("out", event, this._uiHash(this));
|
|
730
|
+
this.containers[i].containerCache.over = 0;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// if no intersecting containers found, return
|
|
737
|
+
if(!innermostContainer) return;
|
|
738
|
+
|
|
739
|
+
// move the item into the container if it's not there already
|
|
740
|
+
if(this.containers.length === 1) {
|
|
741
|
+
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
|
|
742
|
+
this.containers[innermostIndex].containerCache.over = 1;
|
|
743
|
+
} else if(this.currentContainer != this.containers[innermostIndex]) {
|
|
744
|
+
|
|
745
|
+
//When entering a new container, we will find the item with the least distance and append our item near it
|
|
746
|
+
var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top'];
|
|
747
|
+
for (var j = this.items.length - 1; j >= 0; j--) {
|
|
748
|
+
if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
|
|
749
|
+
var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top'];
|
|
750
|
+
if(Math.abs(cur - base) < dist) {
|
|
751
|
+
dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
|
|
756
|
+
return;
|
|
757
|
+
|
|
758
|
+
this.currentContainer = this.containers[innermostIndex];
|
|
759
|
+
itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
|
|
760
|
+
this._trigger("change", event, this._uiHash());
|
|
761
|
+
this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
|
|
762
|
+
|
|
763
|
+
//Update the placeholder
|
|
764
|
+
this.options.placeholder.update(this.currentContainer, this.placeholder);
|
|
765
|
+
|
|
766
|
+
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
|
|
767
|
+
this.containers[innermostIndex].containerCache.over = 1;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
},
|
|
772
|
+
|
|
773
|
+
_createHelper: function(event) {
|
|
774
|
+
|
|
775
|
+
var o = this.options;
|
|
776
|
+
var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
|
|
777
|
+
|
|
778
|
+
if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
|
|
779
|
+
$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
|
|
780
|
+
|
|
781
|
+
if(helper[0] == this.currentItem[0])
|
|
782
|
+
this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
|
|
783
|
+
|
|
784
|
+
if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
|
|
785
|
+
if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
|
|
786
|
+
|
|
787
|
+
return helper;
|
|
788
|
+
|
|
789
|
+
},
|
|
790
|
+
|
|
791
|
+
_adjustOffsetFromHelper: function(obj) {
|
|
792
|
+
if (typeof obj == 'string') {
|
|
793
|
+
obj = obj.split(' ');
|
|
794
|
+
}
|
|
795
|
+
if ($.isArray(obj)) {
|
|
796
|
+
obj = {left: +obj[0], top: +obj[1] || 0};
|
|
797
|
+
}
|
|
798
|
+
if ('left' in obj) {
|
|
799
|
+
this.offset.click.left = obj.left + this.margins.left;
|
|
800
|
+
}
|
|
801
|
+
if ('right' in obj) {
|
|
802
|
+
this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
|
|
803
|
+
}
|
|
804
|
+
if ('top' in obj) {
|
|
805
|
+
this.offset.click.top = obj.top + this.margins.top;
|
|
806
|
+
}
|
|
807
|
+
if ('bottom' in obj) {
|
|
808
|
+
this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
|
|
809
|
+
}
|
|
810
|
+
},
|
|
811
|
+
|
|
812
|
+
_getParentOffset: function() {
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
//Get the offsetParent and cache its position
|
|
816
|
+
this.offsetParent = this.helper.offsetParent();
|
|
817
|
+
var po = this.offsetParent.offset();
|
|
818
|
+
|
|
819
|
+
// This is a special case where we need to modify a offset calculated on start, since the following happened:
|
|
820
|
+
// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
|
|
821
|
+
// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
|
|
822
|
+
// the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
|
|
823
|
+
if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
|
|
824
|
+
po.left += this.scrollParent.scrollLeft();
|
|
825
|
+
po.top += this.scrollParent.scrollTop();
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
|
|
829
|
+
|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
|
|
830
|
+
po = { top: 0, left: 0 };
|
|
831
|
+
|
|
832
|
+
return {
|
|
833
|
+
top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
|
|
834
|
+
left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
},
|
|
838
|
+
|
|
839
|
+
_getRelativeOffset: function() {
|
|
840
|
+
|
|
841
|
+
if(this.cssPosition == "relative") {
|
|
842
|
+
var p = this.currentItem.position();
|
|
843
|
+
return {
|
|
844
|
+
top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
|
|
845
|
+
left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
|
|
846
|
+
};
|
|
847
|
+
} else {
|
|
848
|
+
return { top: 0, left: 0 };
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
},
|
|
852
|
+
|
|
853
|
+
_cacheMargins: function() {
|
|
854
|
+
this.margins = {
|
|
855
|
+
left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
|
|
856
|
+
top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
|
|
857
|
+
};
|
|
858
|
+
},
|
|
859
|
+
|
|
860
|
+
_cacheHelperProportions: function() {
|
|
861
|
+
this.helperProportions = {
|
|
862
|
+
width: this.helper.outerWidth(),
|
|
863
|
+
height: this.helper.outerHeight()
|
|
864
|
+
};
|
|
865
|
+
},
|
|
866
|
+
|
|
867
|
+
_setContainment: function() {
|
|
868
|
+
|
|
869
|
+
var o = this.options;
|
|
870
|
+
if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
|
|
871
|
+
if(o.containment == 'document' || o.containment == 'window') this.containment = [
|
|
872
|
+
0 - this.offset.relative.left - this.offset.parent.left,
|
|
873
|
+
0 - this.offset.relative.top - this.offset.parent.top,
|
|
874
|
+
$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
|
|
875
|
+
($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
|
|
876
|
+
];
|
|
877
|
+
|
|
878
|
+
if(!(/^(document|window|parent)$/).test(o.containment)) {
|
|
879
|
+
var ce = $(o.containment)[0];
|
|
880
|
+
var co = $(o.containment).offset();
|
|
881
|
+
var over = ($(ce).css("overflow") != 'hidden');
|
|
882
|
+
|
|
883
|
+
this.containment = [
|
|
884
|
+
co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
|
|
885
|
+
co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
|
|
886
|
+
co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
|
|
887
|
+
co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
|
|
888
|
+
];
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
},
|
|
892
|
+
|
|
893
|
+
_convertPositionTo: function(d, pos) {
|
|
894
|
+
|
|
895
|
+
if(!pos) pos = this.position;
|
|
896
|
+
var mod = d == "absolute" ? 1 : -1;
|
|
897
|
+
var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
|
|
898
|
+
|
|
899
|
+
return {
|
|
900
|
+
top: (
|
|
901
|
+
pos.top // The absolute mouse position
|
|
902
|
+
+ this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
|
|
903
|
+
+ this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
|
|
904
|
+
- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
|
|
905
|
+
),
|
|
906
|
+
left: (
|
|
907
|
+
pos.left // The absolute mouse position
|
|
908
|
+
+ this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
|
|
909
|
+
+ this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
|
|
910
|
+
- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
|
|
911
|
+
)
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
},
|
|
915
|
+
|
|
916
|
+
_generatePosition: function(event) {
|
|
917
|
+
|
|
918
|
+
var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
|
|
919
|
+
|
|
920
|
+
// This is another very weird special case that only happens for relative elements:
|
|
921
|
+
// 1. If the css position is relative
|
|
922
|
+
// 2. and the scroll parent is the document or similar to the offset parent
|
|
923
|
+
// we have to refresh the relative offset during the scroll so there are no jumps
|
|
924
|
+
if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
|
|
925
|
+
this.offset.relative = this._getRelativeOffset();
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
var pageX = event.pageX;
|
|
929
|
+
var pageY = event.pageY;
|
|
930
|
+
|
|
931
|
+
/*
|
|
932
|
+
* - Position constraining -
|
|
933
|
+
* Constrain the position to a mix of grid, containment.
|
|
934
|
+
*/
|
|
935
|
+
|
|
936
|
+
if(this.originalPosition) { //If we are not dragging yet, we won't check for options
|
|
937
|
+
|
|
938
|
+
if(this.containment) {
|
|
939
|
+
if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
|
|
940
|
+
if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
|
|
941
|
+
if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
|
|
942
|
+
if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
if(o.grid) {
|
|
946
|
+
var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
|
|
947
|
+
pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
|
|
948
|
+
|
|
949
|
+
var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
|
|
950
|
+
pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
return {
|
|
956
|
+
top: (
|
|
957
|
+
pageY // The absolute mouse position
|
|
958
|
+
- this.offset.click.top // Click offset (relative to the element)
|
|
959
|
+
- this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
|
|
960
|
+
- this.offset.parent.top // The offsetParent's offset without borders (offset + border)
|
|
961
|
+
+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
|
|
962
|
+
),
|
|
963
|
+
left: (
|
|
964
|
+
pageX // The absolute mouse position
|
|
965
|
+
- this.offset.click.left // Click offset (relative to the element)
|
|
966
|
+
- this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
|
|
967
|
+
- this.offset.parent.left // The offsetParent's offset without borders (offset + border)
|
|
968
|
+
+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
|
|
969
|
+
)
|
|
970
|
+
};
|
|
971
|
+
|
|
972
|
+
},
|
|
973
|
+
|
|
974
|
+
_rearrange: function(event, i, a, hardRefresh) {
|
|
975
|
+
|
|
976
|
+
a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));
|
|
977
|
+
|
|
978
|
+
//Various things done here to improve the performance:
|
|
979
|
+
// 1. we create a setTimeout, that calls refreshPositions
|
|
980
|
+
// 2. on the instance, we have a counter variable, that get's higher after every append
|
|
981
|
+
// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
|
|
982
|
+
// 4. this lets only the last addition to the timeout stack through
|
|
983
|
+
this.counter = this.counter ? ++this.counter : 1;
|
|
984
|
+
var self = this, counter = this.counter;
|
|
985
|
+
|
|
986
|
+
window.setTimeout(function() {
|
|
987
|
+
if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
|
|
988
|
+
},0);
|
|
989
|
+
|
|
990
|
+
},
|
|
991
|
+
|
|
992
|
+
_clear: function(event, noPropagation) {
|
|
993
|
+
|
|
994
|
+
this.reverting = false;
|
|
995
|
+
// We delay all events that have to be triggered to after the point where the placeholder has been removed and
|
|
996
|
+
// everything else normalized again
|
|
997
|
+
var delayedTriggers = [], self = this;
|
|
998
|
+
|
|
999
|
+
// We first have to update the dom position of the actual currentItem
|
|
1000
|
+
// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
|
|
1001
|
+
if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
|
|
1002
|
+
this._noFinalSort = null;
|
|
1003
|
+
|
|
1004
|
+
if(this.helper[0] == this.currentItem[0]) {
|
|
1005
|
+
for(var i in this._storedCSS) {
|
|
1006
|
+
if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
|
|
1007
|
+
}
|
|
1008
|
+
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
|
|
1009
|
+
} else {
|
|
1010
|
+
this.currentItem.show();
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
|
|
1014
|
+
if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
|
|
1015
|
+
if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
|
|
1016
|
+
if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
|
|
1017
|
+
for (var i = this.containers.length - 1; i >= 0; i--){
|
|
1018
|
+
if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
|
|
1019
|
+
delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
|
|
1020
|
+
delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
//Post events to containers
|
|
1026
|
+
for (var i = this.containers.length - 1; i >= 0; i--){
|
|
1027
|
+
if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
|
|
1028
|
+
if(this.containers[i].containerCache.over) {
|
|
1029
|
+
delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
|
|
1030
|
+
this.containers[i].containerCache.over = 0;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
//Do what was originally in plugins
|
|
1035
|
+
if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
|
|
1036
|
+
if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity
|
|
1037
|
+
if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
|
|
1038
|
+
|
|
1039
|
+
this.dragging = false;
|
|
1040
|
+
if(this.cancelHelperRemoval) {
|
|
1041
|
+
if(!noPropagation) {
|
|
1042
|
+
this._trigger("beforeStop", event, this._uiHash());
|
|
1043
|
+
for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
|
|
1044
|
+
this._trigger("stop", event, this._uiHash());
|
|
1045
|
+
}
|
|
1046
|
+
return false;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
|
|
1050
|
+
|
|
1051
|
+
//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
|
|
1052
|
+
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
|
|
1053
|
+
|
|
1054
|
+
if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
|
|
1055
|
+
|
|
1056
|
+
if(!noPropagation) {
|
|
1057
|
+
for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
|
|
1058
|
+
this._trigger("stop", event, this._uiHash());
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
this.fromOutside = false;
|
|
1062
|
+
return true;
|
|
1063
|
+
|
|
1064
|
+
},
|
|
1065
|
+
|
|
1066
|
+
_trigger: function() {
|
|
1067
|
+
if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
|
|
1068
|
+
this.cancel();
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
|
|
1072
|
+
_uiHash: function(inst) {
|
|
1073
|
+
var self = inst || this;
|
|
1074
|
+
return {
|
|
1075
|
+
helper: self.helper,
|
|
1076
|
+
placeholder: self.placeholder || $([]),
|
|
1077
|
+
position: self.position,
|
|
1078
|
+
originalPosition: self.originalPosition,
|
|
1079
|
+
offset: self.positionAbs,
|
|
1080
|
+
item: self.currentItem,
|
|
1081
|
+
sender: inst ? inst.element : null
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
$.extend($.ui.sortable, {
|
|
1088
|
+
version: "1.8.18"
|
|
1089
|
+
});
|
|
1090
|
+
|
|
1091
|
+
})(jQuery);
|
|
1092
|
+
:@created_atf1335716315.507509{
|