atrium 0.0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -1
- data/.rspec +2 -0
- data/.rvmrc +1 -1
- data/CONTRIBUTING.md +73 -0
- data/Gemfile +27 -2
- data/Gemfile.lock +122 -246
- data/Guardfile +40 -10
- data/LICENSE +14 -0
- data/README.mkd +23 -39
- data/ROADMAP.mkd +41 -9
- data/Rakefile +39 -4
- data/app/assets/images/atrium/remove.png +0 -0
- data/app/assets/images/atrium/white-arrow.png +0 -0
- data/app/assets/javascripts/{atrium/atrium.js → atrium.js} +8 -153
- data/app/assets/stylesheets/{atrium/atrium.css → atrium.css} +110 -37
- data/app/assets/stylesheets/atrium/collections.css +4 -0
- data/app/assets/stylesheets/atrium/descriptions.css +4 -0
- data/app/assets/stylesheets/atrium/exhibits.css +4 -0
- data/app/assets/stylesheets/atrium/reset.css +69 -0
- data/app/assets/stylesheets/atrium/showcases.css +4 -0
- data/app/assets/stylesheets/atrium/theme.css +248 -0
- data/app/controllers/atrium/application_controller.rb +12 -0
- data/app/controllers/atrium/browse_levels_controller.rb +22 -0
- data/app/controllers/atrium/collections_controller.rb +42 -138
- data/app/controllers/atrium/descriptions_controller.rb +27 -146
- data/app/controllers/atrium/exhibits_controller.rb +51 -77
- data/app/controllers/atrium/order_controller.rb +74 -0
- data/app/controllers/atrium/showcases_controller.rb +96 -117
- data/app/helpers/atrium/application_helper.rb +8 -0
- data/app/helpers/atrium/collections_helper.rb +44 -0
- data/app/helpers/atrium/descriptions_helper.rb +4 -0
- data/app/helpers/atrium/exhibits_helper.rb +4 -0
- data/app/helpers/atrium/showcases_helper.rb +34 -0
- data/app/models/atrium/browse_level.rb +21 -11
- data/app/models/atrium/collection.rb +70 -36
- data/app/models/atrium/configuration.rb +66 -0
- data/app/models/atrium/description.rb +39 -88
- data/app/models/atrium/essay.rb +4 -5
- data/app/models/atrium/exhibit.rb +28 -19
- data/app/models/atrium/is_showcased_mixin.rb +34 -0
- data/app/models/atrium/query_param_mixin.rb +105 -0
- data/app/models/atrium/search/facet.rb +14 -25
- data/app/models/atrium/search/facet_selection.rb +10 -12
- data/app/models/atrium/showcase.rb +105 -95
- data/app/models/atrium/showcase/facet_selection.rb +18 -18
- data/app/models/atrium/showcase/featured_selection.rb +15 -0
- data/app/services/browse_level_evaluation_service.rb +131 -0
- data/app/services/current_filter_query_params_extraction_service.rb +91 -0
- data/app/services/navigation_tree.rb +13 -0
- data/app/services/params_adaptor_for_filter.rb +18 -0
- data/app/views/atrium/collections/_form.html.erb +149 -72
- data/app/views/atrium/collections/_head.html.erb +3 -0
- data/app/views/atrium/collections/edit.html.erb +1 -4
- data/app/views/atrium/collections/index.html.erb +14 -0
- data/app/views/atrium/collections/new.html.erb +2 -5
- data/app/views/atrium/collections/show.html.erb +11 -29
- data/app/views/atrium/descriptions/_form.html.erb +47 -49
- data/app/views/atrium/descriptions/edit.html.erb +1 -2
- data/app/views/atrium/descriptions/index.html.erb +2 -8
- data/app/views/atrium/descriptions/new.html.erb +2 -1
- data/app/views/atrium/descriptions/show.html.erb +2 -20
- data/app/views/atrium/exhibits/_exhibit.html.erb +1 -0
- data/app/views/atrium/exhibits/_form.html.erb +143 -96
- data/app/views/atrium/exhibits/edit.html.erb +1 -8
- data/app/views/atrium/exhibits/index.html.erb +2 -0
- data/app/views/atrium/exhibits/new.html.erb +0 -5
- data/app/views/atrium/exhibits/show.html.erb +2 -34
- data/app/views/atrium/showcases/_configure_menu.html.erb +55 -0
- data/app/views/atrium/showcases/_form.html.erb +40 -0
- data/app/views/atrium/showcases/edit.html.erb +3 -0
- data/app/views/atrium/showcases/index.html.erb +32 -0
- data/app/views/atrium/showcases/new.html.erb +3 -0
- data/app/views/atrium/showcases/show.html.erb +2 -1
- data/app/views/layouts/atrium.html.erb +16 -24
- data/app/views/layouts/atrium/application.html.erb +49 -0
- data/app/views/layouts/atrium/themes/default.html.erb +15 -0
- data/app/views/shared/_list_searchs.html.erb +4 -0
- data/app/views/shared/_navigation.html.erb +19 -0
- data/atrium.gemspec +31 -64
- data/config/routes.rb +40 -10
- data/{lib/generators/atrium/templates/migrations/create_atrium_collections.rb → db/migrate/20120730170406_create_atrium_collections.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcases.rb → db/migrate/20120731134846_create_atrium_showcases.rb} +3 -4
- data/{lib/generators/atrium/templates/migrations/create_atrium_exhibits.rb → db/migrate/20120731134856_create_atrium_exhibits.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_descriptions.rb → db/migrate/20120731134904_create_atrium_descriptions.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_essays.rb → db/migrate/20120731135534_create_atrium_essays.rb} +3 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_search_facets.rb → db/migrate/20120731135721_create_atrium_search_facets.rb} +1 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcase_facet_selections.rb → db/migrate/20120731140621_create_atrium_showcase_facet_selections.rb} +6 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_browse_levels.rb → db/migrate/20120801145241_create_atrium_browse_levels.rb} +1 -1
- data/db/migrate/20120820183808_create_selected_items.rb +16 -0
- data/db/migrate/20120823135716_update_atrium_collection_indices.rb +13 -0
- data/db/migrate/20120823143315_add_lookup_indices_as_required.rb +11 -0
- data/lib/atrium.rb +40 -36
- data/lib/atrium/engine.rb +4 -8
- data/lib/atrium/exceptions.rb +10 -0
- data/lib/atrium/version.rb +2 -2
- data/lib/generators/atrium/install/USAGE +8 -0
- data/lib/generators/atrium/install/install_generator.rb +86 -0
- data/lib/generators/atrium/install/templates/atrium_initializer.rb +21 -0
- data/lib/generators/atrium/install/templates/controllers/atrium_base_controller.rb +18 -0
- data/lib/generators/atrium/install/templates/controllers/collections_controller.rb +40 -0
- data/lib/generators/atrium/install/templates/controllers/descriptions_controller.rb +36 -0
- data/lib/generators/atrium/install/templates/controllers/exhibits_controller.rb +47 -0
- data/lib/generators/atrium/install/templates/controllers/selected_items_controller.rb +26 -0
- data/lib/generators/atrium/install/templates/helpers/application_helper.rb +42 -0
- data/lib/generators/atrium/install/templates/helpers/collections_helper.rb +15 -0
- data/lib/generators/atrium/install/templates/helpers/navigation_helper.rb +62 -0
- data/lib/generators/atrium/install/templates/helpers/solr_helper.rb +138 -0
- data/lib/generators/atrium/install/templates/models/selected_item.rb +7 -0
- data/lib/generators/atrium/install/templates/views/collections/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/collections/_exhibits.html.erb +3 -0
- data/lib/generators/atrium/install/templates/views/collections/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/collections/browse.html.erb +16 -0
- data/lib/generators/atrium/install/templates/views/collections/show.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/descriptions/show.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/exhibits/show.html.erb +28 -0
- data/lib/generators/atrium/install/templates/views/folder/_selected_items_form.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/folder/index.html.erb +45 -0
- data/lib/generators/atrium/install/templates/views/shared/_document_list.html.erb +14 -0
- data/lib/generators/atrium/install/templates/views/shared/_featured_sources.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_list_descriptions.html.erb +25 -0
- data/lib/generators/atrium/install/templates/views/shared/_masthead.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_navigation_browse_level.html.erb +34 -0
- data/lib/generators/atrium/install/templates/views/shared/_showcases.html.erb +12 -0
- data/lib/generators/atrium/install/templates/views/shared/_side_bar_navigation.html.erb +20 -0
- data/lib/generators/atrium/service/USAGE +9 -0
- data/lib/generators/atrium/service/service_generator.rb +16 -0
- data/lib/generators/atrium/service/templates/service.rb.erb +2 -0
- data/lib/generators/atrium/service/templates/service_spec.rb.erb +4 -0
- data/lib/generators/atrium/theme/USAGE +8 -0
- data/lib/generators/atrium/theme/templates/theme.html.erb +14 -0
- data/lib/generators/atrium/theme/theme_generator.rb +11 -0
- data/lib/tasks/atrium_tasks.rake +4 -0
- data/script/rails +10 -0
- data/spec/atrium_spec.rb +10 -0
- data/spec/controllers/atrium/application_controller_spec.rb +7 -0
- data/spec/controllers/atrium/collections_controller_spec.rb +125 -0
- data/spec/controllers/atrium/descriptions_controller_spec.rb +142 -0
- data/spec/controllers/atrium/exhibits_controller_spec.rb +102 -0
- data/spec/controllers/atrium/order_controller_spec.rb +100 -0
- data/spec/controllers/atrium/showcases_controller_spec.rb +217 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/collection.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/db/schema.rb +124 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/test/fixtures/collections.yml +11 -0
- data/spec/dummy/test/unit/collection_test.rb +7 -0
- data/spec/factories/atrium_collections.rb +8 -0
- data/spec/factories/atrium_exhibits.rb +9 -0
- data/spec/factories/atrium_search_facets.rb +8 -0
- data/spec/factories/atrium_showcases.rb +25 -0
- data/spec/helpers/atrium/collections_helper_spec.rb +57 -0
- data/spec/helpers/atrium/showcases_helper_spec.rb +56 -0
- data/spec/models/atrium/browse_level_spec.rb +56 -0
- data/spec/models/atrium/collection_spec.rb +76 -0
- data/spec/models/atrium/configuration_spec.rb +114 -0
- data/spec/models/atrium/description_spec.rb +56 -0
- data/spec/models/atrium/essay_spec.rb +16 -0
- data/spec/models/atrium/exhibit_spec.rb +90 -0
- data/spec/models/atrium/search/facet_selection_spec.rb +23 -0
- data/{test_support/spec → spec}/models/atrium/search/facet_spec.rb +2 -4
- data/{test_support/spec → spec}/models/atrium/showcase/facet_selection_spec.rb +5 -5
- data/spec/models/atrium/showcase/featured_selection_spec.rb +18 -0
- data/spec/models/atrium/showcase_spec.rb +97 -0
- data/spec/services/browse_level_evaluation_service_spec.rb +33 -0
- data/spec/services/current_filter_query_params_extraction_service_spec.rb +34 -0
- data/spec/services/navigation_tree_spec.rb +18 -0
- data/spec/services/params_adaptor_for_filter_spec.rb +8 -0
- data/spec/spec_helper.rb +39 -0
- data/spec/support/accept_nested_attributes_for.rb +39 -0
- data/{test_support/spec → spec}/support/be_accessible_matcher.rb +0 -0
- data/{test_support/spec → spec}/support/be_routed_mixin.rb +0 -0
- data/spec/support/controller_hacks.rb +35 -0
- data/spec/support/routes.rb +5 -0
- data/spec/support/shared_examples/is_showcased_mixin.rb +20 -0
- data/spec/support/shared_examples/query_param_mixin.rb +179 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/images}/chosen-sprite.png +0 -0
- data/{app → vendor}/assets/javascripts/chosen.jquery.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor.warning.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/config.js.coffee +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.generateId.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.jeditable.ckeditor.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/application_link.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/dialogs/linkItem.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/plugin.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/ui_toolbar_pencil.png +0 -0
- data/vendor/assets/javascripts/jquery-ui-1.8.23.custom.min.js +41 -0
- data/vendor/assets/javascripts/jquery-ui-build.txt +8 -0
- data/{app → vendor}/assets/javascripts/jquery.jeditable.js +0 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/stylesheets}/chosen.css +4 -4
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/jquery-ui-1.8.23.custom.css +334 -0
- metadata +431 -949
- data/GETTING_STARTED.textile +0 -102
- data/app/assets/images/atrium/ajax-loader.gif +0 -0
- data/app/assets/images/atrium/lightbox-ico-loading.gif +0 -0
- data/app/assets/images/atrium/logo.png +0 -0
- data/app/assets/javascripts/jquery.colorbox.js +0 -864
- data/app/assets/stylesheets/colorbox.css +0 -42
- data/app/assets/stylesheets/controls.png +0 -0
- data/app/assets/stylesheets/loading.gif +0 -0
- data/app/controllers/atrium/base_controller.rb +0 -25
- data/app/controllers/atrium/collection_exhibit_order_controller.rb +0 -21
- data/app/controllers/atrium/customization_controller.rb +0 -41
- data/app/controllers/atrium/exhibit_facet_order_controller.rb +0 -19
- data/app/helpers/atrium/base_helper.rb +0 -6
- data/app/models/ability.rb +0 -14
- data/app/models/atrium/showcase/item.rb +0 -19
- data/app/models/role_mapper.rb +0 -23
- data/app/views/_user_util_links.html.erb +0 -25
- data/app/views/atrium/collections/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/collections/_browse_index.html.erb +0 -20
- data/app/views/atrium/collections/_collection_items_index.html.erb +0 -10
- data/app/views/atrium/collections/_document.html.erb +0 -24
- data/app/views/atrium/collections/_document_list.html.erb +0 -6
- data/app/views/atrium/collections/_edit_navigation.html.erb +0 -20
- data/app/views/atrium/collections/_folder_control.html.erb +0 -12
- data/app/views/atrium/collections/_listing.html.erb +0 -18
- data/app/views/atrium/collections/_navigation.html.erb +0 -50
- data/app/views/atrium/collections/_results_pagination.html.erb +0 -9
- data/app/views/atrium/collections/_sort_and_per_page.html.erb +0 -23
- data/app/views/atrium/exhibits/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/exhibits/_folder_control.html.erb +0 -12
- data/app/views/atrium/exhibits/_navigation.html.erb +0 -30
- data/app/views/atrium/showcases/_showcase_navigation.html.erb +0 -23
- data/app/views/catalog/_collection_home_text.html.erb +0 -6
- data/app/views/catalog/_constraints.html.erb +0 -9
- data/app/views/catalog/_default_collection_text.html.erb +0 -18
- data/app/views/catalog/_default_home_text.html.erb +0 -6
- data/app/views/catalog/_home_text.html.erb +0 -6
- data/app/views/catalog/_index_partials/_description.html.erb +0 -8
- data/app/views/catalog/_search_form.html.erb +0 -66
- data/app/views/catalog/_show_partials/_description.html.erb +0 -15
- data/app/views/catalog/browse_show.html.erb +0 -18
- data/app/views/catalog/index.html.erb +0 -41
- data/app/views/catalog/list_description.html.erb +0 -24
- data/app/views/catalog/list_item.html.erb +0 -3
- data/app/views/layouts/atrium_themes/default.html.erb +0 -4
- data/app/views/layouts/item_listing.html.erb +0 -36
- data/app/views/listing/_document.html.erb +0 -27
- data/app/views/listing/_document_list.html.erb +0 -3
- data/app/views/listing/_item_search.html.erb +0 -27
- data/app/views/shared/_banner.html.erb +0 -5
- data/app/views/shared/_collection_complete_list.html.erb +0 -33
- data/app/views/shared/_collection_search_form.html.erb +0 -12
- data/app/views/shared/_collection_title_header.html.erb +0 -3
- data/app/views/shared/_featured_sources.html.erb +0 -23
- data/app/views/shared/_list_descriptions.html.erb +0 -39
- data/app/views/shared/_navigation_browse_levels.html.erb +0 -34
- data/app/views/shared/_showcase_configure_menu.html.erb +0 -22
- data/app/views/shared/_top_navigation.html.erb +0 -9
- data/init.rb +0 -3
- data/lib/application_controller.rb +0 -24
- data/lib/atrium/application_helper.rb +0 -24
- data/lib/atrium/atrium_helper_behavior.rb +0 -159
- data/lib/atrium/catalog.rb +0 -203
- data/lib/atrium/collections_helper.rb +0 -172
- data/lib/atrium/controller.rb +0 -10
- data/lib/atrium/descriptions_helper.rb +0 -27
- data/lib/atrium/layout_helper.rb +0 -13
- data/lib/atrium/routes.rb +0 -100
- data/lib/atrium/solr_helper.rb +0 -440
- data/lib/generators/atrium/assets_generator.rb +0 -44
- data/lib/generators/atrium/atrium_generator.rb +0 -149
- data/lib/generators/atrium/cucumber_support_generator.rb +0 -29
- data/lib/generators/atrium/templates/config/role_map_cucumber.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_development.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_production.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_test.yml +0 -2
- data/lib/generators/atrium/templates/config/solr.yml +0 -10
- data/lib/generators/atrium/templates/db/seeds.rb +0 -87
- data/lib/generators/atrium/templates/migrations/create_atrium_showcase_items.rb +0 -17
- data/lib/generators/atrium/templates/themes/example.html.erb +0 -21
- data/lib/railties/all_tests.rake +0 -23
- data/lib/railties/atrium_cucumber.rake +0 -121
- data/lib/railties/index.rake +0 -37
- data/tasks/atrium.rake +0 -268
- data/tasks/atrium_rspec.rake +0 -91
- data/test_support/etc/Gemfile +0 -33
- data/test_support/etc/bundle_config +0 -3
- data/test_support/etc/rvmrc +0 -32
- data/test_support/features/atrium_collections.feature +0 -162
- data/test_support/features/atrium_exhibits.feature +0 -164
- data/test_support/features/step_definitions/atrium_collection_steps.rb +0 -102
- data/test_support/features/step_definitions/atrium_exhibit_steps.rb +0 -53
- data/test_support/features/step_definitions/bookmarks_steps.rb +0 -6
- data/test_support/features/step_definitions/error_steps.rb +0 -5
- data/test_support/features/step_definitions/folder_steps.rb +0 -27
- data/test_support/features/step_definitions/general_steps.rb +0 -50
- data/test_support/features/step_definitions/record_view_steps.rb +0 -12
- data/test_support/features/step_definitions/saved_searches_steps.rb +0 -22
- data/test_support/features/step_definitions/search_facets_steps.rb +0 -29
- data/test_support/features/step_definitions/search_history_steps.rb +0 -9
- data/test_support/features/step_definitions/search_result_steps.rb +0 -114
- data/test_support/features/step_definitions/search_steps.rb +0 -103
- data/test_support/features/step_definitions/user_steps.rb +0 -5
- data/test_support/features/step_definitions/web_steps.rb +0 -213
- data/test_support/features/support/env.rb +0 -67
- data/test_support/features/support/paths.rb +0 -76
- data/test_support/features/support/selectors.rb +0 -40
- data/test_support/fixtures/atrium_exhibits.yml +0 -3
- data/test_support/spec/controllers/atrium/base_controller_spec.rb +0 -13
- data/test_support/spec/controllers/atrium/collection_exhibit_order_controller_spec.rb +0 -29
- data/test_support/spec/controllers/atrium/collections_controller_spec.rb +0 -185
- data/test_support/spec/controllers/atrium/customization_controller_spec.rb +0 -38
- data/test_support/spec/controllers/atrium/descriptions_controller_spec.rb +0 -150
- data/test_support/spec/controllers/atrium/exhibit_facet_order_controller_spec.rb +0 -36
- data/test_support/spec/controllers/atrium/exhibits_controller_spec.rb +0 -192
- data/test_support/spec/controllers/atrium/showcases_controller_spec.rb +0 -219
- data/test_support/spec/helpers/atrium_collections_helper_spec.rb +0 -147
- data/test_support/spec/helpers/atrium_description_helper_spec.rb +0 -47
- data/test_support/spec/helpers/atrium_solr_helper_spec.rb +0 -522
- data/test_support/spec/models/atrium/browse_level_spec.rb +0 -31
- data/test_support/spec/models/atrium/collection_spec.rb +0 -30
- data/test_support/spec/models/atrium/description_spec.rb +0 -67
- data/test_support/spec/models/atrium/essay_spec.rb +0 -12
- data/test_support/spec/models/atrium/exhibit_spec.rb +0 -76
- data/test_support/spec/models/atrium/search/facet_selection_spec.rb +0 -24
- data/test_support/spec/models/atrium/search_facet_spec.rb +0 -54
- data/test_support/spec/models/atrium/showcase/item_spec.rb +0 -12
- data/test_support/spec/models/atrium/showcase_facet_selection_spec.rb +0 -65
- data/test_support/spec/models/atrium/showcase_spec.rb +0 -134
- data/test_support/spec/rcov.opts +0 -3
- data/test_support/spec/routing/atrium/collections_routing_spec.rb +0 -33
- data/test_support/spec/spec.opts +0 -4
- data/test_support/spec/spec_helper.rb +0 -47
- data/test_support/tmp/step_definitions/catalog_index_steps.rb +0 -14
- data/test_support/tmp/step_definitions/edit_document_steps.rb +0 -67
- data/test_support/tmp/step_definitions/hydra_metadata_steps.rb +0 -3
- data/test_support/tmp/step_definitions/hydra_steps.rb +0 -8
- data/test_support/tmp/step_definitions/search_steps.rb +0 -86
- data/test_support/tmp/step_definitions/searching_steps.rb +0 -22
- data/test_support/tmp/step_definitions/select_steps.rb +0 -8
- data/test_support/tmp/step_definitions/show_document_steps.rb +0 -73
- data/test_support/tmp/step_definitions/user_steps.rb +0 -15
- data/test_support/tmp/step_definitions/web_steps.rb +0 -273
- data/test_support/tmp/support/env.rb +0 -54
- data/test_support/tmp/support/paths.rb +0 -57
data/GETTING_STARTED.textile
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
h1. Atrium
|
2
|
-
|
3
|
-
Atrium is a Ruby-on-Rails 3 gem containing the core code for a web application to build collection based of blacklight which build faceted search and discovery layer on top of solr
|
4
|
-
|
5
|
-
h2. Before You Begin
|
6
|
-
|
7
|
-
*!!! This is a WORK IN PROGRESS !!!*
|
8
|
-
|
9
|
-
h2. Installation/Setup
|
10
|
-
|
11
|
-
h3. Installation Prerequisites
|
12
|
-
|
13
|
-
|
14
|
-
Ruby 1.8.7 is required by Atrium release 4.0; RVM is strongly suggested.
|
15
|
-
|
16
|
-
h3. Install Rails
|
17
|
-
|
18
|
-
Currently Atrium is compatible with Rails 3.2
|
19
|
-
|
20
|
-
<pre>
|
21
|
-
gem install 'rails' --version '~>3.2.2'
|
22
|
-
</pre>
|
23
|
-
|
24
|
-
h3. Generate a new rails application:
|
25
|
-
|
26
|
-
<pre>
|
27
|
-
rails new my_atrium_app
|
28
|
-
cd my_atrium_app
|
29
|
-
</pre>
|
30
|
-
|
31
|
-
h3. Install Dependencies
|
32
|
-
|
33
|
-
First, add them to the "Gemfile":http://gembundler.com/gemfile.html of your application. You may already have a Gemfile in the new rails application you just generated; in that case, be sure to add blacklight devise and the development/test group per below:
|
34
|
-
|
35
|
-
<pre>
|
36
|
-
source 'http://rubygems.org'
|
37
|
-
|
38
|
-
gem 'rails', '~> 3.2'
|
39
|
-
gem 'blacklight', '~> 3.3'
|
40
|
-
gem 'atrium', :path => '../../'
|
41
|
-
|
42
|
-
gem 'cancan'
|
43
|
-
gem 'jquery-rails'
|
44
|
-
gem 'json'
|
45
|
-
|
46
|
-
group :assets do
|
47
|
-
gem 'coffee-rails', '~> 3.2.1'
|
48
|
-
gem 'sass-rails', '~> 3.2.3'
|
49
|
-
gem 'therubyracer', :platforms => :ruby
|
50
|
-
gem 'uglifier', '>= 1.0.3'
|
51
|
-
end
|
52
|
-
|
53
|
-
# For testing
|
54
|
-
group :development, :test do
|
55
|
-
gem 'bcrypt-ruby'
|
56
|
-
gem 'capybara'
|
57
|
-
gem 'cucumber-rails'
|
58
|
-
gem 'database_cleaner'
|
59
|
-
gem 'factory_girl', '~> 1.1'
|
60
|
-
gem 'mocha'
|
61
|
-
gem 'rspec'
|
62
|
-
gem 'rspec-rails', '>=2.5.0'
|
63
|
-
gem 'ruby-debug'
|
64
|
-
gem 'sqlite3'
|
65
|
-
end
|
66
|
-
gem "devise"
|
67
|
-
gem "compass-rails", "~> 1.0.0", :group => :assets
|
68
|
-
gem "compass-susy-plugin", "~> 0.9.0", :group => :assets
|
69
|
-
|
70
|
-
</pre>
|
71
|
-
|
72
|
-
To install all of the dependencies, run:
|
73
|
-
|
74
|
-
<pre>
|
75
|
-
bundle install
|
76
|
-
</pre>
|
77
|
-
|
78
|
-
On some systems, you will have to install system libraries that various gems rely on. For example, in order to install the curl gem on ubuntu you have to first install libcurl4-openssl-dev and then re-run bundler.
|
79
|
-
|
80
|
-
h3. Run the generators and migrations:
|
81
|
-
|
82
|
-
Run the Atrium generator
|
83
|
-
|
84
|
-
<pre>rails g atrium -df</pre>
|
85
|
-
|
86
|
-
Run the database migrations
|
87
|
-
|
88
|
-
<pre>
|
89
|
-
rake db:migrate
|
90
|
-
rake db:test:prepare
|
91
|
-
</pre>
|
92
|
-
|
93
|
-
h3. You're done.
|
94
|
-
|
95
|
-
Congratulations. You've set up the code to create atrium application.
|
96
|
-
|
97
|
-
h2. Modifying and Testing the Atrium Gem
|
98
|
-
|
99
|
-
|
100
|
-
h2. Acknowledgements
|
101
|
-
|
102
|
-
h3. Design & Strategic Contributions
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,864 +0,0 @@
|
|
1
|
-
// ColorBox v1.3.17.2 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
|
2
|
-
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
|
3
|
-
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
4
|
-
|
5
|
-
(function ($, document, window) {
|
6
|
-
var
|
7
|
-
// ColorBox Default Settings.
|
8
|
-
// See http://colorpowered.com/colorbox for details.
|
9
|
-
defaults = {
|
10
|
-
transition: "elastic",
|
11
|
-
speed: 300,
|
12
|
-
width: false,
|
13
|
-
initialWidth: "600",
|
14
|
-
innerWidth: false,
|
15
|
-
maxWidth: false,
|
16
|
-
height: false,
|
17
|
-
initialHeight: "450",
|
18
|
-
innerHeight: false,
|
19
|
-
maxHeight: false,
|
20
|
-
scalePhotos: true,
|
21
|
-
scrolling: true,
|
22
|
-
inline: false,
|
23
|
-
html: false,
|
24
|
-
iframe: false,
|
25
|
-
fastIframe: true,
|
26
|
-
photo: false,
|
27
|
-
href: false,
|
28
|
-
title: false,
|
29
|
-
rel: false,
|
30
|
-
opacity: 0.9,
|
31
|
-
preloading: true,
|
32
|
-
current: "image {current} of {total}",
|
33
|
-
previous: "previous",
|
34
|
-
next: "next",
|
35
|
-
close: "close",
|
36
|
-
open: false,
|
37
|
-
returnFocus: true,
|
38
|
-
loop: true,
|
39
|
-
slideshow: false,
|
40
|
-
slideshowAuto: true,
|
41
|
-
slideshowSpeed: 2500,
|
42
|
-
slideshowStart: "start slideshow",
|
43
|
-
slideshowStop: "stop slideshow",
|
44
|
-
onOpen: false,
|
45
|
-
onLoad: false,
|
46
|
-
onComplete: false,
|
47
|
-
onCleanup: false,
|
48
|
-
onClosed: false,
|
49
|
-
overlayClose: true,
|
50
|
-
escKey: true,
|
51
|
-
arrowKey: true,
|
52
|
-
top: false,
|
53
|
-
bottom: false,
|
54
|
-
left: false,
|
55
|
-
right: false,
|
56
|
-
fixed: false,
|
57
|
-
data: false
|
58
|
-
},
|
59
|
-
|
60
|
-
// Abstracting the HTML and event identifiers for easy rebranding
|
61
|
-
colorbox = 'colorbox',
|
62
|
-
prefix = 'cbox',
|
63
|
-
boxElement = prefix + 'Element',
|
64
|
-
|
65
|
-
// Events
|
66
|
-
event_open = prefix + '_open',
|
67
|
-
event_load = prefix + '_load',
|
68
|
-
event_complete = prefix + '_complete',
|
69
|
-
event_cleanup = prefix + '_cleanup',
|
70
|
-
event_closed = prefix + '_closed',
|
71
|
-
event_purge = prefix + '_purge',
|
72
|
-
|
73
|
-
// Special Handling for IE
|
74
|
-
isIE = $.browser.msie && !$.support.opacity, // Detects IE6,7,8. IE9 supports opacity. Feature detection alone gave a false positive on at least one phone browser and on some development versions of Chrome, hence the user-agent test.
|
75
|
-
isIE6 = isIE && $.browser.version < 7,
|
76
|
-
event_ie6 = prefix + '_IE6',
|
77
|
-
|
78
|
-
// Cached jQuery Object Variables
|
79
|
-
$overlay,
|
80
|
-
$box,
|
81
|
-
$wrap,
|
82
|
-
$content,
|
83
|
-
$topBorder,
|
84
|
-
$leftBorder,
|
85
|
-
$rightBorder,
|
86
|
-
$bottomBorder,
|
87
|
-
$related,
|
88
|
-
$window,
|
89
|
-
$loaded,
|
90
|
-
$loadingBay,
|
91
|
-
$loadingOverlay,
|
92
|
-
$title,
|
93
|
-
$current,
|
94
|
-
$slideshow,
|
95
|
-
$next,
|
96
|
-
$prev,
|
97
|
-
$close,
|
98
|
-
$groupControls,
|
99
|
-
|
100
|
-
// Variables for cached values or use across multiple functions
|
101
|
-
settings,
|
102
|
-
interfaceHeight,
|
103
|
-
interfaceWidth,
|
104
|
-
loadedHeight,
|
105
|
-
loadedWidth,
|
106
|
-
element,
|
107
|
-
index,
|
108
|
-
photo,
|
109
|
-
open,
|
110
|
-
active,
|
111
|
-
closing,
|
112
|
-
handler,
|
113
|
-
loadingTimer,
|
114
|
-
publicMethod;
|
115
|
-
|
116
|
-
// ****************
|
117
|
-
// HELPER FUNCTIONS
|
118
|
-
// ****************
|
119
|
-
|
120
|
-
// jQuery object generator to reduce code size
|
121
|
-
function $div(id, cssText, div) {
|
122
|
-
div = document.createElement('div');
|
123
|
-
if (id) {
|
124
|
-
div.id = prefix + id;
|
125
|
-
}
|
126
|
-
div.style.cssText = cssText || '';
|
127
|
-
return $(div);
|
128
|
-
}
|
129
|
-
|
130
|
-
// Convert '%' and 'px' values to integers
|
131
|
-
function setSize(size, dimension) {
|
132
|
-
return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10));
|
133
|
-
}
|
134
|
-
|
135
|
-
// Checks an href to see if it is a photo.
|
136
|
-
// There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
|
137
|
-
function isImage(url) {
|
138
|
-
return settings.photo || /\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(url);
|
139
|
-
}
|
140
|
-
|
141
|
-
// Assigns function results to their respective settings. This allows functions to be used as values.
|
142
|
-
function makeSettings(i) {
|
143
|
-
settings = $.extend({}, $.data(element, colorbox));
|
144
|
-
|
145
|
-
for (i in settings) {
|
146
|
-
if ($.isFunction(settings[i]) && i.substring(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
|
147
|
-
settings[i] = settings[i].call(element);
|
148
|
-
}
|
149
|
-
}
|
150
|
-
|
151
|
-
settings.rel = settings.rel || element.rel || 'nofollow';
|
152
|
-
settings.href = settings.href || $(element).attr('href');
|
153
|
-
settings.title = settings.title || element.title;
|
154
|
-
|
155
|
-
if (typeof settings.href === "string") {
|
156
|
-
settings.href = $.trim(settings.href);
|
157
|
-
}
|
158
|
-
}
|
159
|
-
|
160
|
-
function trigger(event, callback) {
|
161
|
-
if (callback) {
|
162
|
-
callback.call(element);
|
163
|
-
}
|
164
|
-
$.event.trigger(event);
|
165
|
-
}
|
166
|
-
|
167
|
-
// Slideshow functionality
|
168
|
-
function slideshow() {
|
169
|
-
var
|
170
|
-
timeOut,
|
171
|
-
className = prefix + "Slideshow_",
|
172
|
-
click = "click." + prefix,
|
173
|
-
start,
|
174
|
-
stop,
|
175
|
-
clear;
|
176
|
-
|
177
|
-
if (settings.slideshow && $related[1]) {
|
178
|
-
start = function () {
|
179
|
-
$slideshow
|
180
|
-
.text(settings.slideshowStop)
|
181
|
-
.unbind(click)
|
182
|
-
.bind(event_complete, function () {
|
183
|
-
if (index < $related.length - 1 || settings.loop) {
|
184
|
-
timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
|
185
|
-
}
|
186
|
-
})
|
187
|
-
.bind(event_load, function () {
|
188
|
-
clearTimeout(timeOut);
|
189
|
-
})
|
190
|
-
.one(click + ' ' + event_cleanup, stop);
|
191
|
-
$box.removeClass(className + "off").addClass(className + "on");
|
192
|
-
timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
|
193
|
-
};
|
194
|
-
|
195
|
-
stop = function () {
|
196
|
-
clearTimeout(timeOut);
|
197
|
-
$slideshow
|
198
|
-
.text(settings.slideshowStart)
|
199
|
-
.unbind([event_complete, event_load, event_cleanup, click].join(' '))
|
200
|
-
.one(click, start);
|
201
|
-
$box.removeClass(className + "on").addClass(className + "off");
|
202
|
-
};
|
203
|
-
|
204
|
-
if (settings.slideshowAuto) {
|
205
|
-
start();
|
206
|
-
} else {
|
207
|
-
stop();
|
208
|
-
}
|
209
|
-
} else {
|
210
|
-
$box.removeClass(className + "off " + className + "on");
|
211
|
-
}
|
212
|
-
}
|
213
|
-
|
214
|
-
function launch(target) {
|
215
|
-
if (!closing) {
|
216
|
-
|
217
|
-
element = target;
|
218
|
-
|
219
|
-
makeSettings();
|
220
|
-
|
221
|
-
$related = $(element);
|
222
|
-
|
223
|
-
index = 0;
|
224
|
-
|
225
|
-
if (settings.rel !== 'nofollow') {
|
226
|
-
$related = $('.' + boxElement).filter(function () {
|
227
|
-
var relRelated = $.data(this, colorbox).rel || this.rel;
|
228
|
-
return (relRelated === settings.rel);
|
229
|
-
});
|
230
|
-
index = $related.index(element);
|
231
|
-
|
232
|
-
// Check direct calls to ColorBox.
|
233
|
-
if (index === -1) {
|
234
|
-
$related = $related.add(element);
|
235
|
-
index = $related.length - 1;
|
236
|
-
}
|
237
|
-
}
|
238
|
-
|
239
|
-
if (!open) {
|
240
|
-
open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
|
241
|
-
|
242
|
-
$box.show();
|
243
|
-
|
244
|
-
if (settings.returnFocus) {
|
245
|
-
try {
|
246
|
-
element.blur();
|
247
|
-
$(element).one(event_closed, function () {
|
248
|
-
try {
|
249
|
-
this.focus();
|
250
|
-
} catch (e) {
|
251
|
-
// do nothing
|
252
|
-
}
|
253
|
-
});
|
254
|
-
} catch (e) {
|
255
|
-
// do nothing
|
256
|
-
}
|
257
|
-
}
|
258
|
-
|
259
|
-
// +settings.opacity avoids a problem in IE when using non-zero-prefixed-string-values, like '.5'
|
260
|
-
$overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
|
261
|
-
|
262
|
-
// Opens inital empty ColorBox prior to content being loaded.
|
263
|
-
settings.w = setSize(settings.initialWidth, 'x');
|
264
|
-
settings.h = setSize(settings.initialHeight, 'y');
|
265
|
-
publicMethod.position();
|
266
|
-
|
267
|
-
if (isIE6) {
|
268
|
-
$window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
|
269
|
-
$overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
|
270
|
-
}).trigger('resize.' + event_ie6);
|
271
|
-
}
|
272
|
-
|
273
|
-
trigger(event_open, settings.onOpen);
|
274
|
-
|
275
|
-
$groupControls.add($title).hide();
|
276
|
-
|
277
|
-
$close.html(settings.close).show();
|
278
|
-
}
|
279
|
-
|
280
|
-
publicMethod.load(true);
|
281
|
-
}
|
282
|
-
}
|
283
|
-
|
284
|
-
// ****************
|
285
|
-
// PUBLIC FUNCTIONS
|
286
|
-
// Usage format: $.fn.colorbox.close();
|
287
|
-
// Usage from within an iframe: parent.$.fn.colorbox.close();
|
288
|
-
// ****************
|
289
|
-
|
290
|
-
publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
|
291
|
-
var $this = this;
|
292
|
-
|
293
|
-
options = options || {};
|
294
|
-
|
295
|
-
if (!$this[0]) {
|
296
|
-
if ($this.selector) { // if a selector was given and it didn't match any elements, go ahead and exit.
|
297
|
-
return $this;
|
298
|
-
}
|
299
|
-
// if no selector was given (ie. $.colorbox()), create a temporary element to work with
|
300
|
-
$this = $('<a/>');
|
301
|
-
options.open = true; // assume an immediate open
|
302
|
-
}
|
303
|
-
|
304
|
-
if (callback) {
|
305
|
-
options.onComplete = callback;
|
306
|
-
}
|
307
|
-
|
308
|
-
$this.each(function () {
|
309
|
-
$.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
|
310
|
-
$(this).addClass(boxElement);
|
311
|
-
});
|
312
|
-
|
313
|
-
if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
|
314
|
-
launch($this[0]);
|
315
|
-
}
|
316
|
-
|
317
|
-
return $this;
|
318
|
-
};
|
319
|
-
|
320
|
-
// Initialize ColorBox: store common calculations, preload the interface graphics, append the html.
|
321
|
-
// This preps ColorBox for a speedy open when clicked, and minimizes the burdon on the browser by only
|
322
|
-
// having to run once, instead of each time colorbox is opened.
|
323
|
-
publicMethod.init = function () {
|
324
|
-
// Create & Append jQuery Objects
|
325
|
-
$window = $(window);
|
326
|
-
$box = $div().attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''});
|
327
|
-
$overlay = $div("Overlay", isIE6 ? 'position:absolute' : '').hide();
|
328
|
-
|
329
|
-
$wrap = $div("Wrapper");
|
330
|
-
$content = $div("Content").append(
|
331
|
-
$loaded = $div("LoadedContent", 'width:0; height:0; overflow:hidden'),
|
332
|
-
$loadingOverlay = $div("LoadingOverlay").add($div("LoadingGraphic")),
|
333
|
-
$title = $div("Title"),
|
334
|
-
$current = $div("Current"),
|
335
|
-
$next = $div("Next"),
|
336
|
-
$prev = $div("Previous"),
|
337
|
-
$slideshow = $div("Slideshow").bind(event_open, slideshow),
|
338
|
-
$close = $div("Close")
|
339
|
-
);
|
340
|
-
$wrap.append( // The 3x3 Grid that makes up ColorBox
|
341
|
-
$div().append(
|
342
|
-
$div("TopLeft"),
|
343
|
-
$topBorder = $div("TopCenter"),
|
344
|
-
$div("TopRight")
|
345
|
-
),
|
346
|
-
$div(false, 'clear:left').append(
|
347
|
-
$leftBorder = $div("MiddleLeft"),
|
348
|
-
$content,
|
349
|
-
$rightBorder = $div("MiddleRight")
|
350
|
-
),
|
351
|
-
$div(false, 'clear:left').append(
|
352
|
-
$div("BottomLeft"),
|
353
|
-
$bottomBorder = $div("BottomCenter"),
|
354
|
-
$div("BottomRight")
|
355
|
-
)
|
356
|
-
).children().children().css({'float': 'left'});
|
357
|
-
|
358
|
-
$loadingBay = $div(false, 'position:absolute; width:9999px; visibility:hidden; display:none');
|
359
|
-
|
360
|
-
$('body').prepend($overlay, $box.append($wrap, $loadingBay));
|
361
|
-
|
362
|
-
$content.children()
|
363
|
-
.hover(function () {
|
364
|
-
$(this).addClass('hover');
|
365
|
-
}, function () {
|
366
|
-
$(this).removeClass('hover');
|
367
|
-
}).addClass('hover');
|
368
|
-
|
369
|
-
// Cache values needed for size calculations
|
370
|
-
interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
|
371
|
-
interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
|
372
|
-
loadedHeight = $loaded.outerHeight(true);
|
373
|
-
loadedWidth = $loaded.outerWidth(true);
|
374
|
-
|
375
|
-
// Setting padding to remove the need to do size conversions during the animation step.
|
376
|
-
$box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth}).hide();
|
377
|
-
|
378
|
-
// Setup button events.
|
379
|
-
// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
|
380
|
-
$next.click(function () {
|
381
|
-
publicMethod.next();
|
382
|
-
});
|
383
|
-
$prev.click(function () {
|
384
|
-
publicMethod.prev();
|
385
|
-
});
|
386
|
-
$close.click(function () {
|
387
|
-
publicMethod.close();
|
388
|
-
});
|
389
|
-
|
390
|
-
$groupControls = $next.add($prev).add($current).add($slideshow);
|
391
|
-
|
392
|
-
// Adding the 'hover' class allowed the browser to load the hover-state
|
393
|
-
// background graphics in case the images were not part of a sprite. The class can now can be removed.
|
394
|
-
$content.children().removeClass('hover');
|
395
|
-
|
396
|
-
$overlay.click(function () {
|
397
|
-
if (settings.overlayClose) {
|
398
|
-
publicMethod.close();
|
399
|
-
}
|
400
|
-
});
|
401
|
-
|
402
|
-
// Set Navigation Key Bindings
|
403
|
-
$(document).bind('keydown.' + prefix, function (e) {
|
404
|
-
var key = e.keyCode;
|
405
|
-
if (open && settings.escKey && key === 27) {
|
406
|
-
e.preventDefault();
|
407
|
-
publicMethod.close();
|
408
|
-
}
|
409
|
-
if (open && settings.arrowKey && $related[1]) {
|
410
|
-
if (key === 37) {
|
411
|
-
e.preventDefault();
|
412
|
-
$prev.click();
|
413
|
-
} else if (key === 39) {
|
414
|
-
e.preventDefault();
|
415
|
-
$next.click();
|
416
|
-
}
|
417
|
-
}
|
418
|
-
});
|
419
|
-
};
|
420
|
-
|
421
|
-
publicMethod.remove = function () {
|
422
|
-
$box.add($overlay).remove();
|
423
|
-
$('.' + boxElement).removeData(colorbox).removeClass(boxElement);
|
424
|
-
};
|
425
|
-
|
426
|
-
publicMethod.position = function (speed, loadedCallback) {
|
427
|
-
var top = 0, left = 0;
|
428
|
-
|
429
|
-
$window.unbind('resize.' + prefix);
|
430
|
-
|
431
|
-
// remove the modal so that it doesn't influence the document width/height
|
432
|
-
$box.hide();
|
433
|
-
|
434
|
-
if (settings.fixed && !isIE6) {
|
435
|
-
$box.css({position: 'fixed'});
|
436
|
-
} else {
|
437
|
-
top = $window.scrollTop();
|
438
|
-
left = $window.scrollLeft();
|
439
|
-
$box.css({position: 'absolute'});
|
440
|
-
}
|
441
|
-
|
442
|
-
// keeps the top and left positions within the browser's viewport.
|
443
|
-
if (settings.right !== false) {
|
444
|
-
left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
|
445
|
-
} else if (settings.left !== false) {
|
446
|
-
left += setSize(settings.left, 'x');
|
447
|
-
} else {
|
448
|
-
left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
|
449
|
-
}
|
450
|
-
|
451
|
-
if (settings.bottom !== false) {
|
452
|
-
top += Math.max(document.documentElement.clientHeight - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
|
453
|
-
} else if (settings.top !== false) {
|
454
|
-
top += setSize(settings.top, 'y');
|
455
|
-
} else {
|
456
|
-
top += Math.round(Math.max(document.documentElement.clientHeight - settings.h - loadedHeight - interfaceHeight, 0) / 2);
|
457
|
-
}
|
458
|
-
|
459
|
-
$box.show();
|
460
|
-
|
461
|
-
// setting the speed to 0 to reduce the delay between same-sized content.
|
462
|
-
speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;
|
463
|
-
|
464
|
-
// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
|
465
|
-
// but it has to be shrank down around the size of div#colorbox when it's done. If not,
|
466
|
-
// it can invoke an obscure IE bug when using iframes.
|
467
|
-
$wrap[0].style.width = $wrap[0].style.height = "9999px";
|
468
|
-
|
469
|
-
function modalDimensions(that) {
|
470
|
-
// loading overlay height has to be explicitly set for IE6.
|
471
|
-
$topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;
|
472
|
-
$loadingOverlay[0].style.height = $loadingOverlay[1].style.height = $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;
|
473
|
-
}
|
474
|
-
|
475
|
-
$box.dequeue().animate({width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: top, left: left}, {
|
476
|
-
duration: speed,
|
477
|
-
complete: function () {
|
478
|
-
modalDimensions(this);
|
479
|
-
|
480
|
-
active = false;
|
481
|
-
|
482
|
-
// shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
|
483
|
-
$wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
|
484
|
-
$wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
|
485
|
-
|
486
|
-
if (loadedCallback) {
|
487
|
-
loadedCallback();
|
488
|
-
}
|
489
|
-
|
490
|
-
setTimeout(function(){ // small delay before binding onresize due to an IE8 bug.
|
491
|
-
$window.bind('resize.' + prefix, publicMethod.position);
|
492
|
-
}, 1);
|
493
|
-
},
|
494
|
-
step: function () {
|
495
|
-
modalDimensions(this);
|
496
|
-
}
|
497
|
-
});
|
498
|
-
};
|
499
|
-
|
500
|
-
publicMethod.resize = function (options) {
|
501
|
-
if (open) {
|
502
|
-
options = options || {};
|
503
|
-
|
504
|
-
if (options.width) {
|
505
|
-
settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
|
506
|
-
}
|
507
|
-
if (options.innerWidth) {
|
508
|
-
settings.w = setSize(options.innerWidth, 'x');
|
509
|
-
}
|
510
|
-
$loaded.css({width: settings.w});
|
511
|
-
|
512
|
-
if (options.height) {
|
513
|
-
settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
|
514
|
-
}
|
515
|
-
if (options.innerHeight) {
|
516
|
-
settings.h = setSize(options.innerHeight, 'y');
|
517
|
-
}
|
518
|
-
if (!options.innerHeight && !options.height) {
|
519
|
-
var $child = $loaded.wrapInner("<div style='overflow:auto'></div>").children(); // temporary wrapper to get an accurate estimate of just how high the total content should be.
|
520
|
-
settings.h = $child.height();
|
521
|
-
$child.replaceWith($child.children()); // ditch the temporary wrapper div used in height calculation
|
522
|
-
}
|
523
|
-
$loaded.css({height: settings.h});
|
524
|
-
|
525
|
-
publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
|
526
|
-
}
|
527
|
-
};
|
528
|
-
|
529
|
-
publicMethod.prep = function (object) {
|
530
|
-
if (!open) {
|
531
|
-
return;
|
532
|
-
}
|
533
|
-
|
534
|
-
var callback, speed = settings.transition === "none" ? 0 : settings.speed;
|
535
|
-
|
536
|
-
$loaded.remove();
|
537
|
-
$loaded = $div('LoadedContent').append(object);
|
538
|
-
|
539
|
-
function getWidth() {
|
540
|
-
settings.w = settings.w || $loaded.width();
|
541
|
-
settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
|
542
|
-
return settings.w;
|
543
|
-
}
|
544
|
-
function getHeight() {
|
545
|
-
settings.h = settings.h || $loaded.height();
|
546
|
-
settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
|
547
|
-
return settings.h;
|
548
|
-
}
|
549
|
-
|
550
|
-
$loaded.hide()
|
551
|
-
.appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
|
552
|
-
.css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
|
553
|
-
.css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
|
554
|
-
.prependTo($content);
|
555
|
-
|
556
|
-
$loadingBay.hide();
|
557
|
-
|
558
|
-
// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
|
559
|
-
//$(photo).css({'float': 'none', marginLeft: 'auto', marginRight: 'auto'});
|
560
|
-
|
561
|
-
$(photo).css({'float': 'none'});
|
562
|
-
|
563
|
-
// Hides SELECT elements in IE6 because they would otherwise sit on top of the overlay.
|
564
|
-
if (isIE6) {
|
565
|
-
$('select').not($box.find('select')).filter(function () {
|
566
|
-
return this.style.visibility !== 'hidden';
|
567
|
-
}).css({'visibility': 'hidden'}).one(event_cleanup, function () {
|
568
|
-
this.style.visibility = 'inherit';
|
569
|
-
});
|
570
|
-
}
|
571
|
-
|
572
|
-
callback = function () {
|
573
|
-
var prev, prevSrc, next, nextSrc, total = $related.length, iframe, complete;
|
574
|
-
|
575
|
-
if (!open) {
|
576
|
-
return;
|
577
|
-
}
|
578
|
-
|
579
|
-
function removeFilter() {
|
580
|
-
if (isIE) {
|
581
|
-
$box[0].style.removeAttribute('filter');
|
582
|
-
}
|
583
|
-
}
|
584
|
-
|
585
|
-
complete = function () {
|
586
|
-
clearTimeout(loadingTimer);
|
587
|
-
$loadingOverlay.hide();
|
588
|
-
trigger(event_complete, settings.onComplete);
|
589
|
-
};
|
590
|
-
|
591
|
-
if (isIE) {
|
592
|
-
//This fadeIn helps the bicubic resampling to kick-in.
|
593
|
-
if (photo) {
|
594
|
-
$loaded.fadeIn(100);
|
595
|
-
}
|
596
|
-
}
|
597
|
-
|
598
|
-
$title.html(settings.title).add($loaded).show();
|
599
|
-
|
600
|
-
if (total > 1) { // handle grouping
|
601
|
-
if (typeof settings.current === "string") {
|
602
|
-
$current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
|
603
|
-
}
|
604
|
-
|
605
|
-
$next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
|
606
|
-
$prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
|
607
|
-
|
608
|
-
prev = index ? $related[index - 1] : $related[total - 1];
|
609
|
-
next = index < total - 1 ? $related[index + 1] : $related[0];
|
610
|
-
|
611
|
-
if (settings.slideshow) {
|
612
|
-
$slideshow.show();
|
613
|
-
}
|
614
|
-
|
615
|
-
// Preloads images within a rel group
|
616
|
-
if (settings.preloading) {
|
617
|
-
nextSrc = $.data(next, colorbox).href || next.href;
|
618
|
-
prevSrc = $.data(prev, colorbox).href || prev.href;
|
619
|
-
|
620
|
-
nextSrc = $.isFunction(nextSrc) ? nextSrc.call(next) : nextSrc;
|
621
|
-
prevSrc = $.isFunction(prevSrc) ? prevSrc.call(prev) : prevSrc;
|
622
|
-
|
623
|
-
if (isImage(nextSrc)) {
|
624
|
-
$('<img/>')[0].src = nextSrc;
|
625
|
-
}
|
626
|
-
|
627
|
-
if (isImage(prevSrc)) {
|
628
|
-
$('<img/>')[0].src = prevSrc;
|
629
|
-
}
|
630
|
-
}
|
631
|
-
} else {
|
632
|
-
$groupControls.hide();
|
633
|
-
}
|
634
|
-
|
635
|
-
if (settings.iframe) {
|
636
|
-
iframe = $('<iframe/>').addClass(prefix + 'Iframe')[0];
|
637
|
-
|
638
|
-
if (settings.fastIframe) {
|
639
|
-
complete();
|
640
|
-
} else {
|
641
|
-
$(iframe).one('load', complete);
|
642
|
-
}
|
643
|
-
iframe.name = prefix + (+new Date());
|
644
|
-
iframe.src = settings.href;
|
645
|
-
|
646
|
-
if (!settings.scrolling) {
|
647
|
-
iframe.scrolling = "no";
|
648
|
-
}
|
649
|
-
|
650
|
-
if (isIE) {
|
651
|
-
iframe.frameBorder = 0;
|
652
|
-
iframe.allowTransparency = "true";
|
653
|
-
}
|
654
|
-
|
655
|
-
$(iframe).appendTo($loaded).one(event_purge, function () {
|
656
|
-
iframe.src = "//about:blank";
|
657
|
-
});
|
658
|
-
} else {
|
659
|
-
complete();
|
660
|
-
}
|
661
|
-
|
662
|
-
if (settings.transition === 'fade') {
|
663
|
-
$box.fadeTo(speed, 1, removeFilter);
|
664
|
-
} else {
|
665
|
-
removeFilter();
|
666
|
-
}
|
667
|
-
};
|
668
|
-
|
669
|
-
if (settings.transition === 'fade') {
|
670
|
-
$box.fadeTo(speed, 0, function () {
|
671
|
-
publicMethod.position(0, callback);
|
672
|
-
});
|
673
|
-
} else {
|
674
|
-
publicMethod.position(speed, callback);
|
675
|
-
}
|
676
|
-
};
|
677
|
-
|
678
|
-
publicMethod.load = function (launched) {
|
679
|
-
var href, setResize, prep = publicMethod.prep;
|
680
|
-
|
681
|
-
active = true;
|
682
|
-
|
683
|
-
photo = false;
|
684
|
-
|
685
|
-
element = $related[index];
|
686
|
-
|
687
|
-
if (!launched) {
|
688
|
-
makeSettings();
|
689
|
-
}
|
690
|
-
|
691
|
-
trigger(event_purge);
|
692
|
-
|
693
|
-
trigger(event_load, settings.onLoad);
|
694
|
-
|
695
|
-
settings.h = settings.height ?
|
696
|
-
setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
|
697
|
-
settings.innerHeight && setSize(settings.innerHeight, 'y');
|
698
|
-
|
699
|
-
settings.w = settings.width ?
|
700
|
-
setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
|
701
|
-
settings.innerWidth && setSize(settings.innerWidth, 'x');
|
702
|
-
|
703
|
-
// Sets the minimum dimensions for use in image scaling
|
704
|
-
settings.mw = settings.w;
|
705
|
-
settings.mh = settings.h;
|
706
|
-
|
707
|
-
// Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
|
708
|
-
// If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
|
709
|
-
if (settings.maxWidth) {
|
710
|
-
settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
|
711
|
-
settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
|
712
|
-
}
|
713
|
-
if (settings.maxHeight) {
|
714
|
-
settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
|
715
|
-
settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
|
716
|
-
}
|
717
|
-
|
718
|
-
href = settings.href;
|
719
|
-
|
720
|
-
loadingTimer = setTimeout(function () {
|
721
|
-
$loadingOverlay.show();
|
722
|
-
}, 100);
|
723
|
-
|
724
|
-
if (settings.inline) {
|
725
|
-
// Inserts an empty placeholder where inline content is being pulled from.
|
726
|
-
// An event is bound to put inline content back when ColorBox closes or loads new content.
|
727
|
-
$div().hide().insertBefore($(href)[0]).one(event_purge, function () {
|
728
|
-
$(this).replaceWith($loaded.children());
|
729
|
-
});
|
730
|
-
prep($(href));
|
731
|
-
} else if (settings.iframe) {
|
732
|
-
// IFrame element won't be added to the DOM until it is ready to be displayed,
|
733
|
-
// to avoid problems with DOM-ready JS that might be trying to run in that iframe.
|
734
|
-
prep(" ");
|
735
|
-
} else if (settings.html) {
|
736
|
-
prep(settings.html);
|
737
|
-
} else if (isImage(href)) {
|
738
|
-
$(photo = new Image())
|
739
|
-
.addClass(prefix + 'Photo')
|
740
|
-
.error(function () {
|
741
|
-
settings.title = false;
|
742
|
-
prep($div('Error').text('This image could not be loaded'));
|
743
|
-
})
|
744
|
-
.load(function () {
|
745
|
-
var percent;
|
746
|
-
photo.onload = null; //stops animated gifs from firing the onload repeatedly.
|
747
|
-
|
748
|
-
if (settings.scalePhotos) {
|
749
|
-
setResize = function () {
|
750
|
-
photo.height -= photo.height * percent;
|
751
|
-
photo.width -= photo.width * percent;
|
752
|
-
};
|
753
|
-
if (settings.mw && photo.width > settings.mw) {
|
754
|
-
percent = (photo.width - settings.mw) / photo.width;
|
755
|
-
setResize();
|
756
|
-
}
|
757
|
-
if (settings.mh && photo.height > settings.mh) {
|
758
|
-
percent = (photo.height - settings.mh) / photo.height;
|
759
|
-
setResize();
|
760
|
-
}
|
761
|
-
}
|
762
|
-
|
763
|
-
if (settings.h) {
|
764
|
-
photo.style.marginTop = Math.max(settings.h - photo.height, 0) / 2 + 'px';
|
765
|
-
}
|
766
|
-
|
767
|
-
if ($related[1] && (index < $related.length - 1 || settings.loop)) {
|
768
|
-
photo.style.cursor = 'pointer';
|
769
|
-
photo.onclick = function () {
|
770
|
-
publicMethod.next();
|
771
|
-
};
|
772
|
-
}
|
773
|
-
|
774
|
-
if (isIE) {
|
775
|
-
photo.style.msInterpolationMode = 'bicubic';
|
776
|
-
}
|
777
|
-
|
778
|
-
setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
|
779
|
-
prep(photo);
|
780
|
-
}, 1);
|
781
|
-
});
|
782
|
-
|
783
|
-
setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
|
784
|
-
photo.src = href;
|
785
|
-
}, 1);
|
786
|
-
} else if (href) {
|
787
|
-
$loadingBay.load(href, settings.data, function (data, status, xhr) {
|
788
|
-
prep(status === 'error' ? $div('Error').text('Request unsuccessful: ' + xhr.statusText) : $(this).contents());
|
789
|
-
});
|
790
|
-
}
|
791
|
-
};
|
792
|
-
|
793
|
-
// Navigates to the next page/image in a set.
|
794
|
-
publicMethod.next = function () {
|
795
|
-
if (!active && $related[1] && (index < $related.length - 1 || settings.loop)) {
|
796
|
-
index = index < $related.length - 1 ? index + 1 : 0;
|
797
|
-
publicMethod.load();
|
798
|
-
}
|
799
|
-
};
|
800
|
-
|
801
|
-
publicMethod.prev = function () {
|
802
|
-
if (!active && $related[1] && (index || settings.loop)) {
|
803
|
-
index = index ? index - 1 : $related.length - 1;
|
804
|
-
publicMethod.load();
|
805
|
-
}
|
806
|
-
};
|
807
|
-
|
808
|
-
// Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
|
809
|
-
publicMethod.close = function () {
|
810
|
-
if (open && !closing) {
|
811
|
-
|
812
|
-
closing = true;
|
813
|
-
|
814
|
-
open = false;
|
815
|
-
|
816
|
-
trigger(event_cleanup, settings.onCleanup);
|
817
|
-
|
818
|
-
$window.unbind('.' + prefix + ' .' + event_ie6);
|
819
|
-
|
820
|
-
$overlay.fadeTo(200, 0);
|
821
|
-
|
822
|
-
$box.stop().fadeTo(300, 0, function () {
|
823
|
-
|
824
|
-
$box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
|
825
|
-
|
826
|
-
trigger(event_purge);
|
827
|
-
|
828
|
-
$loaded.remove();
|
829
|
-
|
830
|
-
setTimeout(function () {
|
831
|
-
closing = false;
|
832
|
-
trigger(event_closed, settings.onClosed);
|
833
|
-
}, 1);
|
834
|
-
});
|
835
|
-
}
|
836
|
-
};
|
837
|
-
|
838
|
-
// A method for fetching the current element ColorBox is referencing.
|
839
|
-
// returns a jQuery object.
|
840
|
-
publicMethod.element = function () {
|
841
|
-
return $(element);
|
842
|
-
};
|
843
|
-
|
844
|
-
publicMethod.settings = defaults;
|
845
|
-
|
846
|
-
// Bind the live event before DOM-ready for maximum performance in IE6 & 7.
|
847
|
-
handler = function (e) {
|
848
|
-
// checks to see if it was a non-left mouse-click and for clicks modified with ctrl, shift, or alt.
|
849
|
-
if (!((e.button !== 0 && typeof e.button !== 'undefined') || e.ctrlKey || e.shiftKey || e.altKey)) {
|
850
|
-
e.preventDefault();
|
851
|
-
launch(this);
|
852
|
-
}
|
853
|
-
};
|
854
|
-
|
855
|
-
if ($.fn.delegate) {
|
856
|
-
$(document).delegate('.' + boxElement, 'click', handler);
|
857
|
-
} else {
|
858
|
-
$('.' + boxElement).live('click', handler);
|
859
|
-
}
|
860
|
-
|
861
|
-
// Initializes ColorBox when the DOM has loaded
|
862
|
-
$(publicMethod.init);
|
863
|
-
|
864
|
-
}(jQuery, document, this));
|