enju_leaf 1.3.6 → 2.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/app/assets/javascripts/enju_leaf/application.js +12 -0
- data/app/assets/javascripts/{autocomplete_agent.js → enju_leaf/autocomplete_agent.js} +0 -0
- data/app/assets/javascripts/{menu.js → enju_leaf/menu.js} +0 -0
- data/app/assets/javascripts/enju_leaf/mobile.js +5 -0
- data/app/assets/javascripts/{portlets.js → enju_leaf/portlets.js} +0 -0
- data/app/assets/javascripts/{select_locale.js → enju_leaf/select_locale.js} +0 -0
- data/app/assets/stylesheets/{enju_leaf.css → enju_leaf/application.scss} +6 -6
- data/app/assets/stylesheets/{enju.css → enju_leaf/enju.css} +0 -0
- data/app/assets/stylesheets/{enju_mobile.css → enju_leaf/enju_mobile.css} +0 -0
- data/app/assets/stylesheets/{enju_print.css → enju_leaf/enju_print.css} +0 -0
- data/app/assets/stylesheets/{mobile.css → enju_leaf/mobile.css} +1 -1
- data/app/assets/stylesheets/{pagination.css → enju_leaf/pagination.css} +0 -0
- data/app/assets/stylesheets/{portlets.css → enju_leaf/portlets.css} +0 -0
- data/app/assets/stylesheets/{print.css → enju_leaf/print.css} +1 -1
- data/app/assets/stylesheets/{scaffold_modified.css → enju_leaf/scaffold_modified.css} +0 -0
- data/app/views/devise/registrations/edit.html.erb +1 -1
- data/app/views/layouts/application.html.erb +4 -4
- data/app/views/page/_include.html.erb +1 -1
- data/app/views/page/_index.html+phone.erb +1 -1
- data/app/views/page/_menu.html.erb +1 -1
- data/app/views/page/_mobile.html+phone.erb +2 -2
- data/app/views/page/about.en.html.erb +4 -4
- data/app/views/page/about.ja.html.erb +4 -4
- data/app/views/page/advanced_search.html.erb +5 -5
- data/app/views/page/configuration.html.erb +0 -2
- data/app/views/page/opensearch.xml.builder +2 -2
- data/config/initializers/mime_types.rb +2 -0
- data/config/locales/en.yml +0 -4
- data/config/locales/ja.yml +0 -4
- data/lib/enju_leaf/engine.rb +1 -1
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +5 -2
- data/lib/generators/enju_leaf/setup/setup_generator.rb +22 -17
- data/lib/generators/enju_leaf/setup/templates/Procfile +2 -2
- data/lib/generators/enju_leaf/setup/templates/config/schedule.rb +2 -2
- data/lib/generators/enju_leaf/setup/templates/db/seeds.rb +0 -4
- data/lib/tasks/enju_leaf_tasks.rake +2 -5
- data/spec/acceptance/profile.rb +9 -0
- data/spec/controllers/page_controller_spec.rb +1 -1
- data/spec/dummy/app/assets/javascripts/application.js +3 -0
- data/spec/dummy/app/assets/stylesheets/application.css +1 -0
- data/spec/dummy/app/controllers/application_controller.rb +0 -1
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/setup +1 -3
- data/spec/dummy/bin/update +4 -2
- data/spec/dummy/bin/yarn +3 -3
- data/spec/dummy/config/application.rb +3 -2
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/config/environments/development.rb +9 -2
- data/spec/dummy/config/environments/production.rb +7 -4
- data/spec/dummy/config/environments/test.rb +7 -1
- data/spec/dummy/config/initializers/assets.rb +1 -2
- data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy/config/locales/en.yml +30 -2
- data/spec/dummy/config/puma.rb +34 -0
- data/spec/dummy/config/routes.rb +2 -58
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/config.ru +3 -2
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
- data/spec/dummy/db/migrate/127_create_use_restrictions.rb +3 -7
- data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +3 -7
- data/spec/dummy/db/migrate/149_create_message_templates.rb +3 -8
- data/spec/dummy/db/migrate/154_create_messages.rb +6 -14
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +4 -4
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +6 -5
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -0
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -1
- data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
- data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +2 -4
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +1 -1
- data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +1 -1
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -1
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -0
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -0
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -0
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +1 -1
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +1 -1
- data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +4 -5
- data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +4 -9
- data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +4 -9
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160319144230_create_issn_records.rb +11 -0
- data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +11 -0
- data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
- data/spec/dummy/db/migrate/20170114174536_add_profile_id_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
- data/spec/dummy/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
- data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
- data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20181030072731_add_not_null_to_position_on_carrier_type.rb +14 -0
- data/spec/dummy/db/migrate/20190102034126_create_doi_records.rb +13 -0
- data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +27 -0
- data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
- data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
- data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
- data/spec/dummy/db/schema.rb +265 -135
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/node_modules/jquery/AUTHORS.txt +278 -0
- data/spec/dummy/node_modules/jquery/LICENSE.txt +36 -0
- data/spec/dummy/node_modules/jquery/README.md +65 -0
- data/spec/dummy/node_modules/jquery/bower.json +14 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.js +9814 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.min.js +4 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.min.map +1 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/spec/dummy/node_modules/jquery/package.json +84 -0
- data/spec/dummy/node_modules/jquery/src/ajax/jsonp.js +100 -0
- data/spec/dummy/node_modules/jquery/src/ajax/load.js +83 -0
- data/spec/dummy/node_modules/jquery/src/ajax/parseJSON.js +13 -0
- data/spec/dummy/node_modules/jquery/src/ajax/parseXML.js +27 -0
- data/spec/dummy/node_modules/jquery/src/ajax/script.js +68 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/location.js +3 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/rquery.js +3 -0
- data/spec/dummy/node_modules/jquery/src/ajax/xhr.js +167 -0
- data/spec/dummy/node_modules/jquery/src/ajax.js +845 -0
- data/spec/dummy/node_modules/jquery/src/attributes/attr.js +142 -0
- data/spec/dummy/node_modules/jquery/src/attributes/classes.js +177 -0
- data/spec/dummy/node_modules/jquery/src/attributes/prop.js +125 -0
- data/spec/dummy/node_modules/jquery/src/attributes/support.js +36 -0
- data/spec/dummy/node_modules/jquery/src/attributes/val.js +177 -0
- data/spec/dummy/node_modules/jquery/src/attributes.js +11 -0
- data/spec/dummy/node_modules/jquery/src/callbacks.js +232 -0
- data/spec/dummy/node_modules/jquery/src/core/access.js +65 -0
- data/spec/dummy/node_modules/jquery/src/core/init.js +134 -0
- data/spec/dummy/node_modules/jquery/src/core/parseHTML.js +41 -0
- data/spec/dummy/node_modules/jquery/src/core/ready.js +103 -0
- data/spec/dummy/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
- data/spec/dummy/node_modules/jquery/src/core.js +494 -0
- data/spec/dummy/node_modules/jquery/src/css/addGetHookIf.js +24 -0
- data/spec/dummy/node_modules/jquery/src/css/adjustCSS.js +65 -0
- data/spec/dummy/node_modules/jquery/src/css/curCSS.js +60 -0
- data/spec/dummy/node_modules/jquery/src/css/defaultDisplay.js +72 -0
- data/spec/dummy/node_modules/jquery/src/css/hiddenVisibleSelectors.js +18 -0
- data/spec/dummy/node_modules/jquery/src/css/showHide.js +48 -0
- data/spec/dummy/node_modules/jquery/src/css/support.js +121 -0
- data/spec/dummy/node_modules/jquery/src/css/var/cssExpand.js +3 -0
- data/spec/dummy/node_modules/jquery/src/css/var/getStyles.js +15 -0
- data/spec/dummy/node_modules/jquery/src/css/var/isHidden.js +16 -0
- data/spec/dummy/node_modules/jquery/src/css/var/rmargin.js +3 -0
- data/spec/dummy/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
- data/spec/dummy/node_modules/jquery/src/css/var/swap.js +24 -0
- data/spec/dummy/node_modules/jquery/src/css.js +502 -0
- data/spec/dummy/node_modules/jquery/src/data/Data.js +200 -0
- data/spec/dummy/node_modules/jquery/src/data/var/acceptData.js +18 -0
- data/spec/dummy/node_modules/jquery/src/data/var/dataPriv.js +5 -0
- data/spec/dummy/node_modules/jquery/src/data/var/dataUser.js +5 -0
- data/spec/dummy/node_modules/jquery/src/data.js +187 -0
- data/spec/dummy/node_modules/jquery/src/deferred.js +158 -0
- data/spec/dummy/node_modules/jquery/src/deprecated.js +32 -0
- data/spec/dummy/node_modules/jquery/src/dimensions.js +54 -0
- data/spec/dummy/node_modules/jquery/src/effects/Tween.js +121 -0
- data/spec/dummy/node_modules/jquery/src/effects/animatedSelector.js +13 -0
- data/spec/dummy/node_modules/jquery/src/effects.js +629 -0
- data/spec/dummy/node_modules/jquery/src/event/ajax.js +20 -0
- data/spec/dummy/node_modules/jquery/src/event/alias.js +27 -0
- data/spec/dummy/node_modules/jquery/src/event/focusin.js +53 -0
- data/spec/dummy/node_modules/jquery/src/event/support.js +9 -0
- data/spec/dummy/node_modules/jquery/src/event/trigger.js +183 -0
- data/spec/dummy/node_modules/jquery/src/event.js +711 -0
- data/spec/dummy/node_modules/jquery/src/exports/amd.js +24 -0
- data/spec/dummy/node_modules/jquery/src/exports/global.js +26 -0
- data/spec/dummy/node_modules/jquery/src/intro.js +44 -0
- data/spec/dummy/node_modules/jquery/src/jquery.js +37 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/_evalUrl.js +20 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/buildFragment.js +102 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/getAll.js +21 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/setGlobalEval.js +20 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/support.js +33 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/wrapMap.js +27 -0
- data/spec/dummy/node_modules/jquery/src/manipulation.js +481 -0
- data/spec/dummy/node_modules/jquery/src/offset.js +218 -0
- data/spec/dummy/node_modules/jquery/src/outro.js +2 -0
- data/spec/dummy/node_modules/jquery/src/queue/delay.js +22 -0
- data/spec/dummy/node_modules/jquery/src/queue.js +143 -0
- data/spec/dummy/node_modules/jquery/src/selector-native.js +211 -0
- data/spec/dummy/node_modules/jquery/src/selector-sizzle.js +14 -0
- data/spec/dummy/node_modules/jquery/src/selector.js +1 -0
- data/spec/dummy/node_modules/jquery/src/serialize.js +125 -0
- data/spec/dummy/node_modules/jquery/src/traversing/findFilter.js +100 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/dir.js +20 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/siblings.js +15 -0
- data/spec/dummy/node_modules/jquery/src/traversing.js +175 -0
- data/spec/dummy/node_modules/jquery/src/var/arr.js +3 -0
- data/spec/dummy/node_modules/jquery/src/var/class2type.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/concat.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/document.js +3 -0
- data/spec/dummy/node_modules/jquery/src/var/documentElement.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/hasOwn.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/indexOf.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/pnum.js +3 -0
- data/spec/dummy/node_modules/jquery/src/var/push.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/rcssNum.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/rnotwhite.js +3 -0
- data/spec/dummy/node_modules/jquery/src/var/slice.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/support.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/toString.js +5 -0
- data/spec/dummy/node_modules/jquery/src/wrap.js +79 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20141214-44379-1fdvvdb.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20141225-67268-nerc4o.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20150123-14447-1lf8lc5.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141214-44379-1exy9mg.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58343-ztcmne.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58490-hnqvxg.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58609-5iyax7.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58776-1e9gg8b.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-58951-zfxzc6.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59095-l3yd2t.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59220-1mgboh1.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59533-1ie807t.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59716-m8uy9h.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59834-1fcv3ir.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-59932-14y6v8m.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60422-ksg8ww.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60507-j2u5ra.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60619-2j2h65.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60822-1xdqwcc.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-60925-4d4ce1.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-61046-y4nspn.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-62053-1qsuqzd.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-62204-3quf6j.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141217-62472-w05wkf.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67112-1viizrs.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67232-11tcrfq.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67342-1bajplt.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141218-67475-gmnmq4.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-74670-mxvkc6.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-74954-1m11avl.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75054-1ac0xmz.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75135-1r3z1p.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75289-18xm9sx.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75372-1ab1rn4.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75612-14gavh8.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75709-xgjjja.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75832-uej6ye.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-75905-13kbauv.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76001-13yt1kv.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76158-1pitds8.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76526-q0rb2j.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-76848-ya95k2.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-88475-165899e.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-89902-paupo2.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-90001-1eg9w1e.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141220-90157-bcu8m7.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141221-7985-u6s6l1.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141224-44711-1amcibm.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141224-44828-ap6n8d.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-48701-14hbzl1.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-49875-1pc6esj.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-64608-1wo1bpq.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-64763-daej3l.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65000-1a7srlh.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65196-ggad1c.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65273-tt5ev2.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65424-1d17hts.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65662-1gqvlj3.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65725-1qpz2tm.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65807-t7cfln.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-65962-161pm01.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-66069-h9ftv6.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-66327-hsz0j4.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20141225-67268-hqxt6v.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150119-54567-1exwx4r.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150120-80886-1whqn2s.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150120-81115-hlvwc4.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150121-86495-navftm.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150121-86986-894a3i.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150122-4492-vaml86.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20150123-14447-gy0ver.txt +8 -0
- data/spec/dummy/yarn.lock +8 -0
- data/spec/factories/agent.rb +1 -1
- data/spec/factories/library.rb +1 -1
- data/spec/factories/profile.rb +3 -3
- data/spec/factories/user.rb +25 -31
- data/spec/fixtures/carrier_types.yml +23 -24
- data/spec/fixtures/content_types.yml +78 -22
- data/spec/fixtures/libraries.yml +28 -31
- data/spec/fixtures/library_groups.yml +33 -16
- data/spec/fixtures/manifestations.yml +32 -27
- data/spec/fixtures/roles.yml +11 -12
- data/spec/fixtures/shelves.yml +14 -15
- data/spec/fixtures/user_groups.yml +9 -16
- data/spec/fixtures/user_has_roles.yml +2 -1
- data/spec/rails_helper.rb +11 -1
- data/spec/system/page_spec.rb +35 -0
- data/spec/views/page/configuration.html.erb_spec.rb +1 -1
- metadata +724 -338
- data/app/assets/javascripts/enju_leaf.js +0 -12
- data/app/assets/javascripts/mobile.js +0 -4
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -25
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
- data/vendor/assets/javascripts/jquery.colorbox.js +0 -1105
- data/vendor/assets/javascripts/jquery.powertip.js +0 -1395
- data/vendor/assets/stylesheets/colorbox.css +0 -70
- data/vendor/assets/stylesheets/jquery.powertip.css +0 -105
@@ -0,0 +1,845 @@
|
|
1
|
+
define( [
|
2
|
+
"./core",
|
3
|
+
"./var/document",
|
4
|
+
"./var/rnotwhite",
|
5
|
+
"./ajax/var/location",
|
6
|
+
"./ajax/var/nonce",
|
7
|
+
"./ajax/var/rquery",
|
8
|
+
|
9
|
+
"./core/init",
|
10
|
+
"./ajax/parseJSON",
|
11
|
+
"./ajax/parseXML",
|
12
|
+
"./event/trigger",
|
13
|
+
"./deferred"
|
14
|
+
], function( jQuery, document, rnotwhite, location, nonce, rquery ) {
|
15
|
+
|
16
|
+
var
|
17
|
+
rhash = /#.*$/,
|
18
|
+
rts = /([?&])_=[^&]*/,
|
19
|
+
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
|
20
|
+
|
21
|
+
// #7653, #8125, #8152: local protocol detection
|
22
|
+
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
|
23
|
+
rnoContent = /^(?:GET|HEAD)$/,
|
24
|
+
rprotocol = /^\/\//,
|
25
|
+
|
26
|
+
/* Prefilters
|
27
|
+
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
|
28
|
+
* 2) These are called:
|
29
|
+
* - BEFORE asking for a transport
|
30
|
+
* - AFTER param serialization (s.data is a string if s.processData is true)
|
31
|
+
* 3) key is the dataType
|
32
|
+
* 4) the catchall symbol "*" can be used
|
33
|
+
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
|
34
|
+
*/
|
35
|
+
prefilters = {},
|
36
|
+
|
37
|
+
/* Transports bindings
|
38
|
+
* 1) key is the dataType
|
39
|
+
* 2) the catchall symbol "*" can be used
|
40
|
+
* 3) selection will start with transport dataType and THEN go to "*" if needed
|
41
|
+
*/
|
42
|
+
transports = {},
|
43
|
+
|
44
|
+
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
45
|
+
allTypes = "*/".concat( "*" ),
|
46
|
+
|
47
|
+
// Anchor tag for parsing the document origin
|
48
|
+
originAnchor = document.createElement( "a" );
|
49
|
+
originAnchor.href = location.href;
|
50
|
+
|
51
|
+
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
52
|
+
function addToPrefiltersOrTransports( structure ) {
|
53
|
+
|
54
|
+
// dataTypeExpression is optional and defaults to "*"
|
55
|
+
return function( dataTypeExpression, func ) {
|
56
|
+
|
57
|
+
if ( typeof dataTypeExpression !== "string" ) {
|
58
|
+
func = dataTypeExpression;
|
59
|
+
dataTypeExpression = "*";
|
60
|
+
}
|
61
|
+
|
62
|
+
var dataType,
|
63
|
+
i = 0,
|
64
|
+
dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
|
65
|
+
|
66
|
+
if ( jQuery.isFunction( func ) ) {
|
67
|
+
|
68
|
+
// For each dataType in the dataTypeExpression
|
69
|
+
while ( ( dataType = dataTypes[ i++ ] ) ) {
|
70
|
+
|
71
|
+
// Prepend if requested
|
72
|
+
if ( dataType[ 0 ] === "+" ) {
|
73
|
+
dataType = dataType.slice( 1 ) || "*";
|
74
|
+
( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
|
75
|
+
|
76
|
+
// Otherwise append
|
77
|
+
} else {
|
78
|
+
( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
};
|
83
|
+
}
|
84
|
+
|
85
|
+
// Base inspection function for prefilters and transports
|
86
|
+
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
|
87
|
+
|
88
|
+
var inspected = {},
|
89
|
+
seekingTransport = ( structure === transports );
|
90
|
+
|
91
|
+
function inspect( dataType ) {
|
92
|
+
var selected;
|
93
|
+
inspected[ dataType ] = true;
|
94
|
+
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
|
95
|
+
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
|
96
|
+
if ( typeof dataTypeOrTransport === "string" &&
|
97
|
+
!seekingTransport && !inspected[ dataTypeOrTransport ] ) {
|
98
|
+
|
99
|
+
options.dataTypes.unshift( dataTypeOrTransport );
|
100
|
+
inspect( dataTypeOrTransport );
|
101
|
+
return false;
|
102
|
+
} else if ( seekingTransport ) {
|
103
|
+
return !( selected = dataTypeOrTransport );
|
104
|
+
}
|
105
|
+
} );
|
106
|
+
return selected;
|
107
|
+
}
|
108
|
+
|
109
|
+
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
|
110
|
+
}
|
111
|
+
|
112
|
+
// A special extend for ajax options
|
113
|
+
// that takes "flat" options (not to be deep extended)
|
114
|
+
// Fixes #9887
|
115
|
+
function ajaxExtend( target, src ) {
|
116
|
+
var key, deep,
|
117
|
+
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
118
|
+
|
119
|
+
for ( key in src ) {
|
120
|
+
if ( src[ key ] !== undefined ) {
|
121
|
+
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
|
122
|
+
}
|
123
|
+
}
|
124
|
+
if ( deep ) {
|
125
|
+
jQuery.extend( true, target, deep );
|
126
|
+
}
|
127
|
+
|
128
|
+
return target;
|
129
|
+
}
|
130
|
+
|
131
|
+
/* Handles responses to an ajax request:
|
132
|
+
* - finds the right dataType (mediates between content-type and expected dataType)
|
133
|
+
* - returns the corresponding response
|
134
|
+
*/
|
135
|
+
function ajaxHandleResponses( s, jqXHR, responses ) {
|
136
|
+
|
137
|
+
var ct, type, finalDataType, firstDataType,
|
138
|
+
contents = s.contents,
|
139
|
+
dataTypes = s.dataTypes;
|
140
|
+
|
141
|
+
// Remove auto dataType and get content-type in the process
|
142
|
+
while ( dataTypes[ 0 ] === "*" ) {
|
143
|
+
dataTypes.shift();
|
144
|
+
if ( ct === undefined ) {
|
145
|
+
ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
// Check if we're dealing with a known content-type
|
150
|
+
if ( ct ) {
|
151
|
+
for ( type in contents ) {
|
152
|
+
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
153
|
+
dataTypes.unshift( type );
|
154
|
+
break;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
// Check to see if we have a response for the expected dataType
|
160
|
+
if ( dataTypes[ 0 ] in responses ) {
|
161
|
+
finalDataType = dataTypes[ 0 ];
|
162
|
+
} else {
|
163
|
+
|
164
|
+
// Try convertible dataTypes
|
165
|
+
for ( type in responses ) {
|
166
|
+
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
|
167
|
+
finalDataType = type;
|
168
|
+
break;
|
169
|
+
}
|
170
|
+
if ( !firstDataType ) {
|
171
|
+
firstDataType = type;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
// Or just use first one
|
176
|
+
finalDataType = finalDataType || firstDataType;
|
177
|
+
}
|
178
|
+
|
179
|
+
// If we found a dataType
|
180
|
+
// We add the dataType to the list if needed
|
181
|
+
// and return the corresponding response
|
182
|
+
if ( finalDataType ) {
|
183
|
+
if ( finalDataType !== dataTypes[ 0 ] ) {
|
184
|
+
dataTypes.unshift( finalDataType );
|
185
|
+
}
|
186
|
+
return responses[ finalDataType ];
|
187
|
+
}
|
188
|
+
}
|
189
|
+
|
190
|
+
/* Chain conversions given the request and the original response
|
191
|
+
* Also sets the responseXXX fields on the jqXHR instance
|
192
|
+
*/
|
193
|
+
function ajaxConvert( s, response, jqXHR, isSuccess ) {
|
194
|
+
var conv2, current, conv, tmp, prev,
|
195
|
+
converters = {},
|
196
|
+
|
197
|
+
// Work with a copy of dataTypes in case we need to modify it for conversion
|
198
|
+
dataTypes = s.dataTypes.slice();
|
199
|
+
|
200
|
+
// Create converters map with lowercased keys
|
201
|
+
if ( dataTypes[ 1 ] ) {
|
202
|
+
for ( conv in s.converters ) {
|
203
|
+
converters[ conv.toLowerCase() ] = s.converters[ conv ];
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
current = dataTypes.shift();
|
208
|
+
|
209
|
+
// Convert to each sequential dataType
|
210
|
+
while ( current ) {
|
211
|
+
|
212
|
+
if ( s.responseFields[ current ] ) {
|
213
|
+
jqXHR[ s.responseFields[ current ] ] = response;
|
214
|
+
}
|
215
|
+
|
216
|
+
// Apply the dataFilter if provided
|
217
|
+
if ( !prev && isSuccess && s.dataFilter ) {
|
218
|
+
response = s.dataFilter( response, s.dataType );
|
219
|
+
}
|
220
|
+
|
221
|
+
prev = current;
|
222
|
+
current = dataTypes.shift();
|
223
|
+
|
224
|
+
if ( current ) {
|
225
|
+
|
226
|
+
// There's only work to do if current dataType is non-auto
|
227
|
+
if ( current === "*" ) {
|
228
|
+
|
229
|
+
current = prev;
|
230
|
+
|
231
|
+
// Convert response if prev dataType is non-auto and differs from current
|
232
|
+
} else if ( prev !== "*" && prev !== current ) {
|
233
|
+
|
234
|
+
// Seek a direct converter
|
235
|
+
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
|
236
|
+
|
237
|
+
// If none found, seek a pair
|
238
|
+
if ( !conv ) {
|
239
|
+
for ( conv2 in converters ) {
|
240
|
+
|
241
|
+
// If conv2 outputs current
|
242
|
+
tmp = conv2.split( " " );
|
243
|
+
if ( tmp[ 1 ] === current ) {
|
244
|
+
|
245
|
+
// If prev can be converted to accepted input
|
246
|
+
conv = converters[ prev + " " + tmp[ 0 ] ] ||
|
247
|
+
converters[ "* " + tmp[ 0 ] ];
|
248
|
+
if ( conv ) {
|
249
|
+
|
250
|
+
// Condense equivalence converters
|
251
|
+
if ( conv === true ) {
|
252
|
+
conv = converters[ conv2 ];
|
253
|
+
|
254
|
+
// Otherwise, insert the intermediate dataType
|
255
|
+
} else if ( converters[ conv2 ] !== true ) {
|
256
|
+
current = tmp[ 0 ];
|
257
|
+
dataTypes.unshift( tmp[ 1 ] );
|
258
|
+
}
|
259
|
+
break;
|
260
|
+
}
|
261
|
+
}
|
262
|
+
}
|
263
|
+
}
|
264
|
+
|
265
|
+
// Apply converter (if not an equivalence)
|
266
|
+
if ( conv !== true ) {
|
267
|
+
|
268
|
+
// Unless errors are allowed to bubble, catch and return them
|
269
|
+
if ( conv && s.throws ) {
|
270
|
+
response = conv( response );
|
271
|
+
} else {
|
272
|
+
try {
|
273
|
+
response = conv( response );
|
274
|
+
} catch ( e ) {
|
275
|
+
return {
|
276
|
+
state: "parsererror",
|
277
|
+
error: conv ? e : "No conversion from " + prev + " to " + current
|
278
|
+
};
|
279
|
+
}
|
280
|
+
}
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
}
|
285
|
+
|
286
|
+
return { state: "success", data: response };
|
287
|
+
}
|
288
|
+
|
289
|
+
jQuery.extend( {
|
290
|
+
|
291
|
+
// Counter for holding the number of active queries
|
292
|
+
active: 0,
|
293
|
+
|
294
|
+
// Last-Modified header cache for next request
|
295
|
+
lastModified: {},
|
296
|
+
etag: {},
|
297
|
+
|
298
|
+
ajaxSettings: {
|
299
|
+
url: location.href,
|
300
|
+
type: "GET",
|
301
|
+
isLocal: rlocalProtocol.test( location.protocol ),
|
302
|
+
global: true,
|
303
|
+
processData: true,
|
304
|
+
async: true,
|
305
|
+
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
|
306
|
+
/*
|
307
|
+
timeout: 0,
|
308
|
+
data: null,
|
309
|
+
dataType: null,
|
310
|
+
username: null,
|
311
|
+
password: null,
|
312
|
+
cache: null,
|
313
|
+
throws: false,
|
314
|
+
traditional: false,
|
315
|
+
headers: {},
|
316
|
+
*/
|
317
|
+
|
318
|
+
accepts: {
|
319
|
+
"*": allTypes,
|
320
|
+
text: "text/plain",
|
321
|
+
html: "text/html",
|
322
|
+
xml: "application/xml, text/xml",
|
323
|
+
json: "application/json, text/javascript"
|
324
|
+
},
|
325
|
+
|
326
|
+
contents: {
|
327
|
+
xml: /\bxml\b/,
|
328
|
+
html: /\bhtml/,
|
329
|
+
json: /\bjson\b/
|
330
|
+
},
|
331
|
+
|
332
|
+
responseFields: {
|
333
|
+
xml: "responseXML",
|
334
|
+
text: "responseText",
|
335
|
+
json: "responseJSON"
|
336
|
+
},
|
337
|
+
|
338
|
+
// Data converters
|
339
|
+
// Keys separate source (or catchall "*") and destination types with a single space
|
340
|
+
converters: {
|
341
|
+
|
342
|
+
// Convert anything to text
|
343
|
+
"* text": String,
|
344
|
+
|
345
|
+
// Text to html (true = no transformation)
|
346
|
+
"text html": true,
|
347
|
+
|
348
|
+
// Evaluate text as a json expression
|
349
|
+
"text json": jQuery.parseJSON,
|
350
|
+
|
351
|
+
// Parse text as xml
|
352
|
+
"text xml": jQuery.parseXML
|
353
|
+
},
|
354
|
+
|
355
|
+
// For options that shouldn't be deep extended:
|
356
|
+
// you can add your own custom options here if
|
357
|
+
// and when you create one that shouldn't be
|
358
|
+
// deep extended (see ajaxExtend)
|
359
|
+
flatOptions: {
|
360
|
+
url: true,
|
361
|
+
context: true
|
362
|
+
}
|
363
|
+
},
|
364
|
+
|
365
|
+
// Creates a full fledged settings object into target
|
366
|
+
// with both ajaxSettings and settings fields.
|
367
|
+
// If target is omitted, writes into ajaxSettings.
|
368
|
+
ajaxSetup: function( target, settings ) {
|
369
|
+
return settings ?
|
370
|
+
|
371
|
+
// Building a settings object
|
372
|
+
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
|
373
|
+
|
374
|
+
// Extending ajaxSettings
|
375
|
+
ajaxExtend( jQuery.ajaxSettings, target );
|
376
|
+
},
|
377
|
+
|
378
|
+
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
|
379
|
+
ajaxTransport: addToPrefiltersOrTransports( transports ),
|
380
|
+
|
381
|
+
// Main method
|
382
|
+
ajax: function( url, options ) {
|
383
|
+
|
384
|
+
// If url is an object, simulate pre-1.5 signature
|
385
|
+
if ( typeof url === "object" ) {
|
386
|
+
options = url;
|
387
|
+
url = undefined;
|
388
|
+
}
|
389
|
+
|
390
|
+
// Force options to be an object
|
391
|
+
options = options || {};
|
392
|
+
|
393
|
+
var transport,
|
394
|
+
|
395
|
+
// URL without anti-cache param
|
396
|
+
cacheURL,
|
397
|
+
|
398
|
+
// Response headers
|
399
|
+
responseHeadersString,
|
400
|
+
responseHeaders,
|
401
|
+
|
402
|
+
// timeout handle
|
403
|
+
timeoutTimer,
|
404
|
+
|
405
|
+
// Url cleanup var
|
406
|
+
urlAnchor,
|
407
|
+
|
408
|
+
// To know if global events are to be dispatched
|
409
|
+
fireGlobals,
|
410
|
+
|
411
|
+
// Loop variable
|
412
|
+
i,
|
413
|
+
|
414
|
+
// Create the final options object
|
415
|
+
s = jQuery.ajaxSetup( {}, options ),
|
416
|
+
|
417
|
+
// Callbacks context
|
418
|
+
callbackContext = s.context || s,
|
419
|
+
|
420
|
+
// Context for global events is callbackContext if it is a DOM node or jQuery collection
|
421
|
+
globalEventContext = s.context &&
|
422
|
+
( callbackContext.nodeType || callbackContext.jquery ) ?
|
423
|
+
jQuery( callbackContext ) :
|
424
|
+
jQuery.event,
|
425
|
+
|
426
|
+
// Deferreds
|
427
|
+
deferred = jQuery.Deferred(),
|
428
|
+
completeDeferred = jQuery.Callbacks( "once memory" ),
|
429
|
+
|
430
|
+
// Status-dependent callbacks
|
431
|
+
statusCode = s.statusCode || {},
|
432
|
+
|
433
|
+
// Headers (they are sent all at once)
|
434
|
+
requestHeaders = {},
|
435
|
+
requestHeadersNames = {},
|
436
|
+
|
437
|
+
// The jqXHR state
|
438
|
+
state = 0,
|
439
|
+
|
440
|
+
// Default abort message
|
441
|
+
strAbort = "canceled",
|
442
|
+
|
443
|
+
// Fake xhr
|
444
|
+
jqXHR = {
|
445
|
+
readyState: 0,
|
446
|
+
|
447
|
+
// Builds headers hashtable if needed
|
448
|
+
getResponseHeader: function( key ) {
|
449
|
+
var match;
|
450
|
+
if ( state === 2 ) {
|
451
|
+
if ( !responseHeaders ) {
|
452
|
+
responseHeaders = {};
|
453
|
+
while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
454
|
+
responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
|
455
|
+
}
|
456
|
+
}
|
457
|
+
match = responseHeaders[ key.toLowerCase() ];
|
458
|
+
}
|
459
|
+
return match == null ? null : match;
|
460
|
+
},
|
461
|
+
|
462
|
+
// Raw string
|
463
|
+
getAllResponseHeaders: function() {
|
464
|
+
return state === 2 ? responseHeadersString : null;
|
465
|
+
},
|
466
|
+
|
467
|
+
// Caches the header
|
468
|
+
setRequestHeader: function( name, value ) {
|
469
|
+
var lname = name.toLowerCase();
|
470
|
+
if ( !state ) {
|
471
|
+
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
|
472
|
+
requestHeaders[ name ] = value;
|
473
|
+
}
|
474
|
+
return this;
|
475
|
+
},
|
476
|
+
|
477
|
+
// Overrides response content-type header
|
478
|
+
overrideMimeType: function( type ) {
|
479
|
+
if ( !state ) {
|
480
|
+
s.mimeType = type;
|
481
|
+
}
|
482
|
+
return this;
|
483
|
+
},
|
484
|
+
|
485
|
+
// Status-dependent callbacks
|
486
|
+
statusCode: function( map ) {
|
487
|
+
var code;
|
488
|
+
if ( map ) {
|
489
|
+
if ( state < 2 ) {
|
490
|
+
for ( code in map ) {
|
491
|
+
|
492
|
+
// Lazy-add the new callback in a way that preserves old ones
|
493
|
+
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
|
494
|
+
}
|
495
|
+
} else {
|
496
|
+
|
497
|
+
// Execute the appropriate callbacks
|
498
|
+
jqXHR.always( map[ jqXHR.status ] );
|
499
|
+
}
|
500
|
+
}
|
501
|
+
return this;
|
502
|
+
},
|
503
|
+
|
504
|
+
// Cancel the request
|
505
|
+
abort: function( statusText ) {
|
506
|
+
var finalText = statusText || strAbort;
|
507
|
+
if ( transport ) {
|
508
|
+
transport.abort( finalText );
|
509
|
+
}
|
510
|
+
done( 0, finalText );
|
511
|
+
return this;
|
512
|
+
}
|
513
|
+
};
|
514
|
+
|
515
|
+
// Attach deferreds
|
516
|
+
deferred.promise( jqXHR ).complete = completeDeferred.add;
|
517
|
+
jqXHR.success = jqXHR.done;
|
518
|
+
jqXHR.error = jqXHR.fail;
|
519
|
+
|
520
|
+
// Remove hash character (#7531: and string promotion)
|
521
|
+
// Add protocol if not provided (prefilters might expect it)
|
522
|
+
// Handle falsy url in the settings object (#10093: consistency with old signature)
|
523
|
+
// We also use the url parameter if available
|
524
|
+
s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" )
|
525
|
+
.replace( rprotocol, location.protocol + "//" );
|
526
|
+
|
527
|
+
// Alias method option to type as per ticket #12004
|
528
|
+
s.type = options.method || options.type || s.method || s.type;
|
529
|
+
|
530
|
+
// Extract dataTypes list
|
531
|
+
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
|
532
|
+
|
533
|
+
// A cross-domain request is in order when the origin doesn't match the current origin.
|
534
|
+
if ( s.crossDomain == null ) {
|
535
|
+
urlAnchor = document.createElement( "a" );
|
536
|
+
|
537
|
+
// Support: IE8-11+
|
538
|
+
// IE throws exception if url is malformed, e.g. http://example.com:80x/
|
539
|
+
try {
|
540
|
+
urlAnchor.href = s.url;
|
541
|
+
|
542
|
+
// Support: IE8-11+
|
543
|
+
// Anchor's host property isn't correctly set when s.url is relative
|
544
|
+
urlAnchor.href = urlAnchor.href;
|
545
|
+
s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
|
546
|
+
urlAnchor.protocol + "//" + urlAnchor.host;
|
547
|
+
} catch ( e ) {
|
548
|
+
|
549
|
+
// If there is an error parsing the URL, assume it is crossDomain,
|
550
|
+
// it can be rejected by the transport if it is invalid
|
551
|
+
s.crossDomain = true;
|
552
|
+
}
|
553
|
+
}
|
554
|
+
|
555
|
+
// Convert data if not already a string
|
556
|
+
if ( s.data && s.processData && typeof s.data !== "string" ) {
|
557
|
+
s.data = jQuery.param( s.data, s.traditional );
|
558
|
+
}
|
559
|
+
|
560
|
+
// Apply prefilters
|
561
|
+
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
562
|
+
|
563
|
+
// If request was aborted inside a prefilter, stop there
|
564
|
+
if ( state === 2 ) {
|
565
|
+
return jqXHR;
|
566
|
+
}
|
567
|
+
|
568
|
+
// We can fire global events as of now if asked to
|
569
|
+
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
|
570
|
+
fireGlobals = jQuery.event && s.global;
|
571
|
+
|
572
|
+
// Watch for a new set of requests
|
573
|
+
if ( fireGlobals && jQuery.active++ === 0 ) {
|
574
|
+
jQuery.event.trigger( "ajaxStart" );
|
575
|
+
}
|
576
|
+
|
577
|
+
// Uppercase the type
|
578
|
+
s.type = s.type.toUpperCase();
|
579
|
+
|
580
|
+
// Determine if request has content
|
581
|
+
s.hasContent = !rnoContent.test( s.type );
|
582
|
+
|
583
|
+
// Save the URL in case we're toying with the If-Modified-Since
|
584
|
+
// and/or If-None-Match header later on
|
585
|
+
cacheURL = s.url;
|
586
|
+
|
587
|
+
// More options handling for requests with no content
|
588
|
+
if ( !s.hasContent ) {
|
589
|
+
|
590
|
+
// If data is available, append data to url
|
591
|
+
if ( s.data ) {
|
592
|
+
cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
|
593
|
+
|
594
|
+
// #9682: remove data so that it's not used in an eventual retry
|
595
|
+
delete s.data;
|
596
|
+
}
|
597
|
+
|
598
|
+
// Add anti-cache in url if needed
|
599
|
+
if ( s.cache === false ) {
|
600
|
+
s.url = rts.test( cacheURL ) ?
|
601
|
+
|
602
|
+
// If there is already a '_' parameter, set its value
|
603
|
+
cacheURL.replace( rts, "$1_=" + nonce++ ) :
|
604
|
+
|
605
|
+
// Otherwise add one to the end
|
606
|
+
cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
|
607
|
+
}
|
608
|
+
}
|
609
|
+
|
610
|
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
611
|
+
if ( s.ifModified ) {
|
612
|
+
if ( jQuery.lastModified[ cacheURL ] ) {
|
613
|
+
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
|
614
|
+
}
|
615
|
+
if ( jQuery.etag[ cacheURL ] ) {
|
616
|
+
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
|
617
|
+
}
|
618
|
+
}
|
619
|
+
|
620
|
+
// Set the correct header, if data is being sent
|
621
|
+
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
622
|
+
jqXHR.setRequestHeader( "Content-Type", s.contentType );
|
623
|
+
}
|
624
|
+
|
625
|
+
// Set the Accepts header for the server, depending on the dataType
|
626
|
+
jqXHR.setRequestHeader(
|
627
|
+
"Accept",
|
628
|
+
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
|
629
|
+
s.accepts[ s.dataTypes[ 0 ] ] +
|
630
|
+
( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
|
631
|
+
s.accepts[ "*" ]
|
632
|
+
);
|
633
|
+
|
634
|
+
// Check for headers option
|
635
|
+
for ( i in s.headers ) {
|
636
|
+
jqXHR.setRequestHeader( i, s.headers[ i ] );
|
637
|
+
}
|
638
|
+
|
639
|
+
// Allow custom headers/mimetypes and early abort
|
640
|
+
if ( s.beforeSend &&
|
641
|
+
( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
642
|
+
|
643
|
+
// Abort if not done already and return
|
644
|
+
return jqXHR.abort();
|
645
|
+
}
|
646
|
+
|
647
|
+
// Aborting is no longer a cancellation
|
648
|
+
strAbort = "abort";
|
649
|
+
|
650
|
+
// Install callbacks on deferreds
|
651
|
+
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
652
|
+
jqXHR[ i ]( s[ i ] );
|
653
|
+
}
|
654
|
+
|
655
|
+
// Get transport
|
656
|
+
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
657
|
+
|
658
|
+
// If no transport, we auto-abort
|
659
|
+
if ( !transport ) {
|
660
|
+
done( -1, "No Transport" );
|
661
|
+
} else {
|
662
|
+
jqXHR.readyState = 1;
|
663
|
+
|
664
|
+
// Send global event
|
665
|
+
if ( fireGlobals ) {
|
666
|
+
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
667
|
+
}
|
668
|
+
|
669
|
+
// If request was aborted inside ajaxSend, stop there
|
670
|
+
if ( state === 2 ) {
|
671
|
+
return jqXHR;
|
672
|
+
}
|
673
|
+
|
674
|
+
// Timeout
|
675
|
+
if ( s.async && s.timeout > 0 ) {
|
676
|
+
timeoutTimer = window.setTimeout( function() {
|
677
|
+
jqXHR.abort( "timeout" );
|
678
|
+
}, s.timeout );
|
679
|
+
}
|
680
|
+
|
681
|
+
try {
|
682
|
+
state = 1;
|
683
|
+
transport.send( requestHeaders, done );
|
684
|
+
} catch ( e ) {
|
685
|
+
|
686
|
+
// Propagate exception as error if not done
|
687
|
+
if ( state < 2 ) {
|
688
|
+
done( -1, e );
|
689
|
+
|
690
|
+
// Simply rethrow otherwise
|
691
|
+
} else {
|
692
|
+
throw e;
|
693
|
+
}
|
694
|
+
}
|
695
|
+
}
|
696
|
+
|
697
|
+
// Callback for when everything is done
|
698
|
+
function done( status, nativeStatusText, responses, headers ) {
|
699
|
+
var isSuccess, success, error, response, modified,
|
700
|
+
statusText = nativeStatusText;
|
701
|
+
|
702
|
+
// Called once
|
703
|
+
if ( state === 2 ) {
|
704
|
+
return;
|
705
|
+
}
|
706
|
+
|
707
|
+
// State is "done" now
|
708
|
+
state = 2;
|
709
|
+
|
710
|
+
// Clear timeout if it exists
|
711
|
+
if ( timeoutTimer ) {
|
712
|
+
window.clearTimeout( timeoutTimer );
|
713
|
+
}
|
714
|
+
|
715
|
+
// Dereference transport for early garbage collection
|
716
|
+
// (no matter how long the jqXHR object will be used)
|
717
|
+
transport = undefined;
|
718
|
+
|
719
|
+
// Cache response headers
|
720
|
+
responseHeadersString = headers || "";
|
721
|
+
|
722
|
+
// Set readyState
|
723
|
+
jqXHR.readyState = status > 0 ? 4 : 0;
|
724
|
+
|
725
|
+
// Determine if successful
|
726
|
+
isSuccess = status >= 200 && status < 300 || status === 304;
|
727
|
+
|
728
|
+
// Get response data
|
729
|
+
if ( responses ) {
|
730
|
+
response = ajaxHandleResponses( s, jqXHR, responses );
|
731
|
+
}
|
732
|
+
|
733
|
+
// Convert no matter what (that way responseXXX fields are always set)
|
734
|
+
response = ajaxConvert( s, response, jqXHR, isSuccess );
|
735
|
+
|
736
|
+
// If successful, handle type chaining
|
737
|
+
if ( isSuccess ) {
|
738
|
+
|
739
|
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
740
|
+
if ( s.ifModified ) {
|
741
|
+
modified = jqXHR.getResponseHeader( "Last-Modified" );
|
742
|
+
if ( modified ) {
|
743
|
+
jQuery.lastModified[ cacheURL ] = modified;
|
744
|
+
}
|
745
|
+
modified = jqXHR.getResponseHeader( "etag" );
|
746
|
+
if ( modified ) {
|
747
|
+
jQuery.etag[ cacheURL ] = modified;
|
748
|
+
}
|
749
|
+
}
|
750
|
+
|
751
|
+
// if no content
|
752
|
+
if ( status === 204 || s.type === "HEAD" ) {
|
753
|
+
statusText = "nocontent";
|
754
|
+
|
755
|
+
// if not modified
|
756
|
+
} else if ( status === 304 ) {
|
757
|
+
statusText = "notmodified";
|
758
|
+
|
759
|
+
// If we have data, let's convert it
|
760
|
+
} else {
|
761
|
+
statusText = response.state;
|
762
|
+
success = response.data;
|
763
|
+
error = response.error;
|
764
|
+
isSuccess = !error;
|
765
|
+
}
|
766
|
+
} else {
|
767
|
+
|
768
|
+
// Extract error from statusText and normalize for non-aborts
|
769
|
+
error = statusText;
|
770
|
+
if ( status || !statusText ) {
|
771
|
+
statusText = "error";
|
772
|
+
if ( status < 0 ) {
|
773
|
+
status = 0;
|
774
|
+
}
|
775
|
+
}
|
776
|
+
}
|
777
|
+
|
778
|
+
// Set data for the fake xhr object
|
779
|
+
jqXHR.status = status;
|
780
|
+
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
|
781
|
+
|
782
|
+
// Success/Error
|
783
|
+
if ( isSuccess ) {
|
784
|
+
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
785
|
+
} else {
|
786
|
+
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
787
|
+
}
|
788
|
+
|
789
|
+
// Status-dependent callbacks
|
790
|
+
jqXHR.statusCode( statusCode );
|
791
|
+
statusCode = undefined;
|
792
|
+
|
793
|
+
if ( fireGlobals ) {
|
794
|
+
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
|
795
|
+
[ jqXHR, s, isSuccess ? success : error ] );
|
796
|
+
}
|
797
|
+
|
798
|
+
// Complete
|
799
|
+
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
800
|
+
|
801
|
+
if ( fireGlobals ) {
|
802
|
+
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
803
|
+
|
804
|
+
// Handle the global AJAX counter
|
805
|
+
if ( !( --jQuery.active ) ) {
|
806
|
+
jQuery.event.trigger( "ajaxStop" );
|
807
|
+
}
|
808
|
+
}
|
809
|
+
}
|
810
|
+
|
811
|
+
return jqXHR;
|
812
|
+
},
|
813
|
+
|
814
|
+
getJSON: function( url, data, callback ) {
|
815
|
+
return jQuery.get( url, data, callback, "json" );
|
816
|
+
},
|
817
|
+
|
818
|
+
getScript: function( url, callback ) {
|
819
|
+
return jQuery.get( url, undefined, callback, "script" );
|
820
|
+
}
|
821
|
+
} );
|
822
|
+
|
823
|
+
jQuery.each( [ "get", "post" ], function( i, method ) {
|
824
|
+
jQuery[ method ] = function( url, data, callback, type ) {
|
825
|
+
|
826
|
+
// Shift arguments if data argument was omitted
|
827
|
+
if ( jQuery.isFunction( data ) ) {
|
828
|
+
type = type || callback;
|
829
|
+
callback = data;
|
830
|
+
data = undefined;
|
831
|
+
}
|
832
|
+
|
833
|
+
// The url can be an options object (which then must have .url)
|
834
|
+
return jQuery.ajax( jQuery.extend( {
|
835
|
+
url: url,
|
836
|
+
type: method,
|
837
|
+
dataType: type,
|
838
|
+
data: data,
|
839
|
+
success: callback
|
840
|
+
}, jQuery.isPlainObject( url ) && url ) );
|
841
|
+
};
|
842
|
+
} );
|
843
|
+
|
844
|
+
return jQuery;
|
845
|
+
} );
|