blacklight 4.9.0 → 5.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.travis.yml +22 -12
- data/Gemfile +3 -40
- data/LICENSE +1 -2
- data/README.md +1 -2
- data/Rakefile +0 -4
- data/VERSION +1 -1
- data/app/assets/images/blacklight/logo.png +0 -0
- data/app/assets/javascripts/blacklight/ajax_modal.js +190 -0
- data/app/assets/javascripts/blacklight/blacklight.js +7 -17
- data/app/assets/javascripts/blacklight/checkbox_submit.js +1 -1
- data/app/assets/stylesheets/blacklight/{_blacklight_base.scss → _blacklight_base.css.scss} +0 -21
- data/app/assets/stylesheets/blacklight/_bookmark.css.scss +4 -0
- data/app/assets/stylesheets/blacklight/_catalog.css.scss +192 -0
- data/app/assets/stylesheets/blacklight/_facets.css.scss +141 -0
- data/app/assets/stylesheets/blacklight/{_group.scss → _group.css.scss} +1 -1
- data/app/assets/stylesheets/blacklight/_header.css.scss +44 -0
- data/app/assets/stylesheets/blacklight/_layout.css.scss +5 -0
- data/app/assets/stylesheets/blacklight/{_modal.scss → _modal.css.scss} +7 -7
- data/app/assets/stylesheets/blacklight/_search_history.css.scss +20 -0
- data/app/assets/stylesheets/blacklight/{blacklight.scss → blacklight.css.scss} +0 -0
- data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +14 -0
- data/app/controllers/bookmarks_controller.rb +0 -4
- data/app/controllers/feedback_controller.rb +0 -4
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +45 -155
- data/app/helpers/blacklight/catalog_helper_behavior.rb +8 -41
- data/app/helpers/blacklight/facets_helper_behavior.rb +20 -43
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +2 -9
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +9 -14
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +6 -6
- data/app/views/_flash_msg.html.erb +9 -2
- data/app/views/_user_util_links.html.erb +29 -15
- data/app/views/bookmarks/_tools.html.erb +4 -7
- data/app/views/bookmarks/index.html.erb +3 -2
- data/app/views/catalog/_citation.html.erb +1 -1
- data/app/views/catalog/_constraints.html.erb +1 -1
- data/app/views/catalog/_constraints_element.html.erb +12 -8
- data/app/views/catalog/_did_you_mean.html.erb +2 -2
- data/app/views/catalog/_document_header.html.erb +3 -3
- data/app/views/catalog/_email_form.html.erb +10 -10
- data/app/views/catalog/_facet_layout.html.erb +11 -3
- data/app/views/catalog/_facet_limit.html.erb +7 -7
- data/app/views/catalog/_facet_pagination.html.erb +8 -7
- data/app/views/catalog/_facet_pivot.html.erb +3 -1
- data/app/views/catalog/_facets.html.erb +12 -9
- data/app/views/catalog/_paginate_compact.html.erb +1 -7
- data/app/views/catalog/_per_page_widget.html.erb +5 -8
- data/app/views/catalog/_previous_next_doc.html.erb +11 -9
- data/app/views/catalog/_refworks_form.html.erb +3 -4
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +16 -14
- data/app/views/catalog/_show_sidebar.html.erb +7 -9
- data/app/views/catalog/_show_tools.html.erb +13 -7
- data/app/views/catalog/_sms_form.html.erb +8 -8
- data/app/views/catalog/_sort_and_per_page.html.erb +4 -6
- data/app/views/catalog/_sort_widget.html.erb +5 -6
- data/app/views/catalog/email.html.erb +1 -1
- data/app/views/catalog/facet.html.erb +2 -8
- data/app/views/catalog/index.html.erb +11 -6
- data/app/views/catalog/show.html.erb +5 -5
- data/app/views/catalog/sms.html.erb +1 -1
- data/app/views/catalog/sms_sent.html.erb +1 -1
- data/app/views/feedback/complete.html.erb +2 -2
- data/app/views/feedback/show.html.erb +1 -1
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -1
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +25 -5
- data/app/views/layouts/blacklight.html.erb +23 -23
- data/app/views/saved_searches/index.html.erb +2 -2
- data/app/views/search_history/index.html.erb +5 -7
- data/app/views/shared/_header_navbar.html.erb +23 -23
- data/blacklight.gemspec +10 -13
- data/config/locales/blacklight.en.yml +1 -12
- data/config/locales/blacklight.fr.yml +1 -12
- data/gemfiles/rails3.gemfile +21 -0
- data/gemfiles/rails4.gemfile +20 -0
- data/lib/blacklight.rb +0 -8
- data/lib/blacklight/base.rb +0 -2
- data/lib/blacklight/catalog.rb +6 -32
- data/lib/blacklight/catalog/search_context.rb +8 -48
- data/lib/blacklight/configurable.rb +2 -1
- data/lib/blacklight/configuration.rb +1 -2
- data/lib/blacklight/configuration/facet_field.rb +0 -2
- data/lib/blacklight/engine.rb +3 -3
- data/lib/blacklight/legacy_controller_methods.rb +1 -64
- data/lib/blacklight/rails/routes.rb +17 -0
- data/lib/blacklight/routes.rb +46 -40
- data/lib/blacklight/solr.rb +1 -0
- data/lib/blacklight/solr/document.rb +21 -42
- data/lib/blacklight/solr/facet_paginator.rb +30 -54
- data/lib/blacklight/solr/request.rb +45 -0
- data/lib/blacklight/solr_helper.rb +16 -53
- data/lib/blacklight/solr_response.rb +0 -6
- data/lib/blacklight/user.rb +2 -7
- data/lib/blacklight/utils.rb +1 -9
- data/lib/generators/blacklight/assets_generator.rb +0 -14
- data/lib/generators/blacklight/blacklight_generator.rb +17 -14
- data/lib/generators/blacklight/templates/blacklight.css.scss +3 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +4 -1
- data/lib/railties/blacklight.rake +3 -1
- data/solr/sample_solr_documents.yml +641 -0
- data/spec/controllers/application_controller_spec.rb +5 -21
- data/spec/controllers/bookmarks_controller_spec.rb +11 -11
- data/spec/controllers/catalog_controller_spec.rb +122 -119
- data/spec/controllers/search_history_controller_spec.rb +8 -8
- data/spec/features/alternate_controller_spec.rb +5 -5
- data/spec/features/facets_spec.rb +9 -0
- data/spec/features/record_view_spec.rb +1 -1
- data/spec/features/search_filters_spec.rb +97 -41
- data/spec/features/search_results_spec.rb +14 -17
- data/spec/features/search_sort_spec.rb +1 -1
- data/spec/helpers/blacklight_helper_spec.rb +170 -285
- data/spec/helpers/catalog_helper_spec.rb +57 -96
- data/spec/helpers/facets_helper_spec.rb +130 -152
- data/spec/helpers/hash_as_hidden_fields_spec.rb +9 -15
- data/spec/helpers/render_constraints_helper_spec.rb +5 -5
- data/spec/helpers/search_history_constraints_helper_spec.rb +21 -21
- data/spec/lib/blacklight/routes_spec.rb +25 -0
- data/spec/lib/blacklight/solr/request_spec.rb +37 -0
- data/spec/lib/blacklight/solr_response/group_response_spec.rb +2 -2
- data/spec/lib/blacklight_configurable_spec.rb +16 -16
- data/spec/lib/blacklight_configuration_spec.rb +132 -132
- data/spec/lib/blacklight_email_spec.rb +4 -4
- data/spec/lib/blacklight_sms_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_dublin_core_spec.rb +6 -6
- data/spec/lib/blacklight_solr_document_more_like_this_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_spec.rb +36 -36
- data/spec/lib/blacklight_solr_response_spec.rb +43 -48
- data/spec/lib/blacklight_spec.rb +6 -14
- data/spec/lib/blacklight_user_spec.rb +5 -9
- data/spec/lib/facet_paginator_spec.rb +59 -51
- data/spec/lib/search_fields_spec.rb +13 -13
- data/spec/lib/solr_helper_spec.rb +258 -304
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
- data/spec/lib/utils_spec.rb +16 -46
- data/spec/models/bookmark_spec.rb +6 -7
- data/spec/models/record_mailer_spec.rb +16 -16
- data/spec/models/search_spec.rb +8 -8
- data/spec/models/solr_document_spec.rb +6 -77
- data/spec/routing/catalog_routing_spec.rb +16 -10
- data/spec/spec_helper.rb +7 -7
- data/spec/support/assert_difference.rb +2 -2
- data/spec/support/features.rb +0 -11
- data/spec/support/features/session_helpers.rb +3 -3
- data/spec/support/include_text.rb +2 -2
- data/spec/test_app_templates/Gemfile.extra +10 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +12 -18
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +13 -13
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facets.html.erb_spec.rb +13 -14
- data/spec/views/catalog/_index_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_search_header.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +7 -7
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +3 -3
- data/spec/views/catalog/index.atom.builder_spec.rb +29 -29
- data/spec/views/catalog/index.html.erb_spec.rb +6 -7
- data/tasks/blacklight.rake +8 -2
- metadata +84 -180
- data/app/assets/javascripts/blacklight/css_dropdowns.js +0 -10
- data/app/assets/javascripts/blacklight/facet_expand_contract.js +0 -41
- data/app/assets/javascripts/blacklight/lightbox_dialog.js +0 -70
- data/app/assets/javascripts/blacklight/select_submit.js +0 -27
- data/app/assets/javascripts/blacklight/zebra_stripe.js +0 -13
- data/app/assets/javascripts/improved-modal/bootstrap-modal.js +0 -355
- data/app/assets/javascripts/improved-modal/bootstrap-modalmanager.js +0 -370
- data/app/assets/stylesheets/blacklight/_bookmark.scss +0 -33
- data/app/assets/stylesheets/blacklight/_catalog.scss +0 -255
- data/app/assets/stylesheets/blacklight/_dropdown.scss +0 -57
- data/app/assets/stylesheets/blacklight/_facets.scss +0 -197
- data/app/assets/stylesheets/blacklight/_footer.scss +0 -0
- data/app/assets/stylesheets/blacklight/_header.scss +0 -53
- data/app/assets/stylesheets/blacklight/_layout.scss +0 -10
- data/app/assets/stylesheets/blacklight/_mixins.scss +0 -0
- data/app/assets/stylesheets/blacklight/_print.scss +0 -0
- data/app/assets/stylesheets/blacklight/_responsive.scss +0 -3
- data/app/assets/stylesheets/blacklight/_search_history.scss +0 -42
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +0 -49
- data/app/assets/stylesheets/blacklight/responsive_partials/_catalog.scss +0 -5
- data/app/assets/stylesheets/blacklight/responsive_partials/_facets.scss +0 -37
- data/app/assets/stylesheets/blacklight/responsive_partials/_header.scss +0 -30
- data/app/assets/stylesheets/improved-modal/bootstrap-modal.css +0 -217
- data/app/helpers/blacklight/html_head_helper_behavior.rb +0 -118
- data/app/helpers/html_head_helper.rb +0 -3
- data/app/views/catalog/_bookmark_form.html.erb +0 -7
- data/app/views/catalog/_marc_view.html.erb +0 -32
- data/app/views/catalog/librarian_view.html.erb +0 -10
- data/config/routes.rb +0 -17
- data/doc/Atom-Responses.md +0 -90
- data/doc/Blacklight-3.0-Release-Notes-And-Upgrade-Guide.md +0 -107
- data/doc/Blacklight-3.2-Release-Notes-and-Upgrade-Guide.md +0 -191
- data/doc/Blacklight-3.3-release-notes-and-upgrade-guide.md +0 -37
- data/doc/Blacklight-3.4-release-notes-and-upgrade-guide.md +0 -27
- data/doc/Blacklight-3.5-release-notes-and-upgrade-guide.md +0 -44
- data/doc/Blacklight-3.6-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-3.7-release-notes-and-upgrade-guide.md +0 -80
- data/doc/Blacklight-3.8-release-notes-and-upgrade-guide.md +0 -11
- data/doc/Blacklight-4.0-release-notes-and-upgrade-guide.md +0 -135
- data/doc/Blacklight-4.1-release-notes-and-upgrade-guide.md +0 -17
- data/doc/Blacklight-4.2-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-4.3-release-notes-and-upgrade-guide.md +0 -21
- data/doc/Blacklight-4.4-release-notes-and-upgrade-guide.md +0 -41
- data/doc/Blacklight-Add-ons.md +0 -28
- data/doc/Blacklight-configuration.md +0 -411
- data/doc/Blacklight-on-Heroku.md +0 -135
- data/doc/Code4Lib-2014.md +0 -48
- data/doc/Community-principles.md +0 -44
- data/doc/Configuring-and-Customizing-Blacklight.md +0 -271
- data/doc/Configuring-rails-routes.md +0 -13
- data/doc/Contributing-to-Blacklight.md +0 -25
- data/doc/Examples.md +0 -94
- data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -141
- data/doc/FAQs.md +0 -1
- data/doc/Home.md +0 -80
- data/doc/How-to-release-a-version.md +0 -29
- data/doc/Indexing-your-data-into-solr.md +0 -32
- data/doc/Integration-with-Rails-Footnotes.md +0 -20
- data/doc/Internationalization.md +0 -32
- data/doc/JSON-API.md +0 -17
- data/doc/Pagination.md +0 -51
- data/doc/Providing-your-own-view-templates.md +0 -109
- data/doc/Quickstart.md +0 -115
- data/doc/README_SOLR.md +0 -245
- data/doc/Release-Notes-And-Upgrade-Guides.md +0 -20
- data/doc/Roadmap.md +0 -43
- data/doc/Sunspot-for-indexing.md +0 -46
- data/doc/Theming.md +0 -64
- data/doc/User-Authentication.md +0 -60
- data/doc/testing.md +0 -57
- data/lib/SolrMarc.jar +0 -0
- data/lib/blacklight/mash.rb +0 -19
- data/lib/blacklight/solr/document/marc.rb +0 -71
- data/lib/blacklight/solr/document/marc_export.rb +0 -590
- data/lib/generators/blacklight/marc_generator.rb +0 -66
- data/lib/generators/blacklight/templates/blacklight.scss +0 -4
- data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/config.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/index.properties +0 -97
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/dewey.bsh +0 -47
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/format.bsh +0 -126
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/README_MAPS +0 -1
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/callnumber_map.properties +0 -407
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/composition_era_map.properties +0 -56
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/country_map.properties +0 -379
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/format_map.properties +0 -50
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/instrument_map.properties +0 -101
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/language_map.properties +0 -490
- data/lib/railties/solr_marc.rake +0 -162
- data/spec/data/test_data.utf8.mrc +0 -1
- data/spec/features/librarian_view_spec.rb +0 -13
- data/spec/helpers/html_head_helper_spec.rb +0 -164
- data/spec/lib/blacklight_solr_document_marc_spec.rb +0 -89
- data/spec/lib/marc_export_spec.rb +0 -746
- data/spec/lib/tasks/solr_marc_task_spec.rb +0 -60
- data/spec/requests/alternate_controller_spec.rb +0 -16
- data/spec/routing/routes_spec.rb +0 -20
- data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +0 -49
- data/test_support/data/test_data.utf8.mrc +0 -1
@@ -1,10 +0,0 @@
|
|
1
|
-
(function($) {
|
2
|
-
Blacklight.add_css_dropdown_click_support = function() {
|
3
|
-
$(".css-dropdown li:not(.no-menu)").on('click',function(){
|
4
|
-
$(this).toggleClass("hovering");
|
5
|
-
});
|
6
|
-
};
|
7
|
-
Blacklight.onLoad(function() {
|
8
|
-
Blacklight.add_css_dropdown_click_support();
|
9
|
-
});
|
10
|
-
})(jQuery);
|
@@ -1,41 +0,0 @@
|
|
1
|
-
//= require blacklight/core
|
2
|
-
(function($) {
|
3
|
-
Blacklight.do_facet_expand_contract_behavior = function() {
|
4
|
-
$( Blacklight.do_facet_expand_contract_behavior.selector ).each (
|
5
|
-
Blacklight.facet_expand_contract
|
6
|
-
);
|
7
|
-
}
|
8
|
-
Blacklight.do_facet_expand_contract_behavior.selector = '#facets h5';
|
9
|
-
|
10
|
-
/* Behavior that makes facet limit headings in sidebar expand/contract
|
11
|
-
their contents. This is kind of fragile code targeted specifically
|
12
|
-
at how we currently render facet HTML, which is why I put it in a function
|
13
|
-
on Blacklight instead of in a jquery plugin. Perhaps in the future this
|
14
|
-
could/should be expanded to a general purpose jquery plugin -- or
|
15
|
-
we should just use one of the existing ones for expand/contract? */
|
16
|
-
Blacklight.facet_expand_contract = function() {
|
17
|
-
$(this).next("ul, div").each(function(){
|
18
|
-
var f_content = $(this);
|
19
|
-
$(f_content).prev('h5').addClass('twiddle');
|
20
|
-
// find all f_content's that don't have any span descendants with a class of "selected"
|
21
|
-
if($('span.selected', f_content).length == 0){
|
22
|
-
// hide it
|
23
|
-
f_content.hide();
|
24
|
-
} else {
|
25
|
-
$(this).prev('h5').addClass('twiddle-open');
|
26
|
-
}
|
27
|
-
|
28
|
-
// attach the toggle behavior to the h5 tag
|
29
|
-
$('h5', f_content.parent()).click(function(){
|
30
|
-
// toggle the content
|
31
|
-
$(this).toggleClass('twiddle-open');
|
32
|
-
$(f_content).slideToggle();
|
33
|
-
});
|
34
|
-
});
|
35
|
-
};
|
36
|
-
|
37
|
-
Blacklight.onLoad(function() {
|
38
|
-
Blacklight.do_facet_expand_contract_behavior();
|
39
|
-
});
|
40
|
-
})(jQuery);
|
41
|
-
|
@@ -1,70 +0,0 @@
|
|
1
|
-
//= require blacklight/core
|
2
|
-
Blacklight.setup_modal = function(link_selector, form_selector, launch_modal) {
|
3
|
-
|
4
|
-
// Event indicating blacklight is setting up a modal link
|
5
|
-
var e = $.Event('lightbox.setup_modal');
|
6
|
-
$(link_selector).trigger(e);
|
7
|
-
if (e.isDefaultPrevented()) return;
|
8
|
-
|
9
|
-
$(link_selector).click(function(e) {
|
10
|
-
link = $(this)
|
11
|
-
|
12
|
-
e.preventDefault();
|
13
|
-
|
14
|
-
var jqxhr = $.ajax({
|
15
|
-
url: link.attr('href'),
|
16
|
-
dataType: 'script'
|
17
|
-
});
|
18
|
-
|
19
|
-
jqxhr.always( function (data) {
|
20
|
-
$('#ajax-modal').html(data.responseText);
|
21
|
-
Blacklight.setup_modal('.modal-footer a', '#ajax-modal form.ajax_form', false);
|
22
|
-
|
23
|
-
if (launch_modal) {
|
24
|
-
$('#ajax-modal').modal();
|
25
|
-
}
|
26
|
-
Blacklight.check_close_ajax_modal();
|
27
|
-
});
|
28
|
-
});
|
29
|
-
|
30
|
-
|
31
|
-
$(form_selector).submit(function(e) {
|
32
|
-
var jqxhr = $.ajax({
|
33
|
-
url: $(this).attr('action'),
|
34
|
-
data: $(this).serialize(),
|
35
|
-
type: 'POST',
|
36
|
-
dataType: 'script'
|
37
|
-
});
|
38
|
-
|
39
|
-
|
40
|
-
jqxhr.always (function (data) {
|
41
|
-
$('#ajax-modal').html(data.responseText);
|
42
|
-
Blacklight.setup_modal('#ajax-modal .ajax_reload_link', '#ajax-modal form.ajax_form', false);
|
43
|
-
Blacklight.check_close_ajax_modal();
|
44
|
-
});
|
45
|
-
|
46
|
-
|
47
|
-
return false;
|
48
|
-
|
49
|
-
|
50
|
-
});
|
51
|
-
};
|
52
|
-
|
53
|
-
Blacklight.check_close_ajax_modal = function() {
|
54
|
-
if ($('#ajax-modal span.ajax-close-modal').length) {
|
55
|
-
modal_flashes = $('#ajax-modal .flash_messages');
|
56
|
-
|
57
|
-
main_flashes = $('#main-flashes .flash_messages:nth-of-type(1)');
|
58
|
-
$('#ajax-modal *[data-dismiss="modal"]:nth-of-type(1)').trigger('click');
|
59
|
-
main_flashes.append(modal_flashes);
|
60
|
-
modal_flashes.fadeIn(500);
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}
|
65
|
-
|
66
|
-
}
|
67
|
-
|
68
|
-
Blacklight.onLoad(function() {
|
69
|
-
Blacklight.setup_modal("a.lightboxLink,a.more_facets_link,.ajax_modal_launch", "#ajax-modal form.ajax_form", true);
|
70
|
-
});
|
@@ -1,27 +0,0 @@
|
|
1
|
-
//= require blacklight/core
|
2
|
-
(function($) {
|
3
|
-
// Used for sort-by and per-page controls, hide the submit button
|
4
|
-
// and make the select auto-submit
|
5
|
-
Blacklight.update_css_dropdown = function(dropdown, prefix, suffix) {
|
6
|
-
$(dropdown).find('ul.css-dropdown ul a').click (function (e) {
|
7
|
-
selection_key = $(this).text();
|
8
|
-
|
9
|
-
$(dropdown).find('ul.css-dropdown li.btn>a').html(prefix + selection_key + suffix);
|
10
|
-
});
|
11
|
-
|
12
|
-
}
|
13
|
-
|
14
|
-
Blacklight.onLoad(function() {
|
15
|
-
$('#sort-form').hide();
|
16
|
-
$('#sort-dropdown').show();
|
17
|
-
Blacklight.update_css_dropdown('#sort-dropdown', "Sort by ", "")
|
18
|
-
|
19
|
-
|
20
|
-
$('#per_page-form').hide();
|
21
|
-
$('#per_page-dropdown').show();
|
22
|
-
Blacklight.update_css_dropdown('#per_page-dropdown', '', '')
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
});
|
27
|
-
})(jQuery);
|
@@ -1,13 +0,0 @@
|
|
1
|
-
//= require blacklight/core
|
2
|
-
(function($) {
|
3
|
-
// adds classes for zebra striping table rows
|
4
|
-
Blacklight.do_zebra_stripe = function() {
|
5
|
-
$(Blacklight.do_zebra_stripe.selector).addClass('zebra_stripe');
|
6
|
-
};
|
7
|
-
Blacklight.do_zebra_stripe.selector = "table.zebra tr:even, ul.zebra li:even";
|
8
|
-
|
9
|
-
|
10
|
-
Blacklight.onLoad(function() {
|
11
|
-
Blacklight.do_zebra_stripe();
|
12
|
-
});
|
13
|
-
})(jQuery);
|
@@ -1,355 +0,0 @@
|
|
1
|
-
/* ===========================================================
|
2
|
-
* bootstrap-modal.js v2.0
|
3
|
-
* ===========================================================
|
4
|
-
* Copyright 2012 Jordan Schroter
|
5
|
-
*
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
* you may not use this file except in compliance with the License.
|
8
|
-
* You may obtain a copy of the License at
|
9
|
-
*
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
*
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
* See the License for the specific language governing permissions and
|
16
|
-
* limitations under the License.
|
17
|
-
* ========================================================== */
|
18
|
-
|
19
|
-
|
20
|
-
!function ($) {
|
21
|
-
|
22
|
-
"use strict"; // jshint ;_;
|
23
|
-
|
24
|
-
/* MODAL CLASS DEFINITION
|
25
|
-
* ====================== */
|
26
|
-
|
27
|
-
var Modal = function (element, options) {
|
28
|
-
this.init(element, options);
|
29
|
-
}
|
30
|
-
|
31
|
-
Modal.prototype = {
|
32
|
-
|
33
|
-
constructor: Modal,
|
34
|
-
|
35
|
-
init: function (element, options) {
|
36
|
-
this.options = options;
|
37
|
-
|
38
|
-
this.$element = $(element)
|
39
|
-
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this));
|
40
|
-
|
41
|
-
this.options.remote && this.$element.find('.modal-body').load(this.options.remote);
|
42
|
-
|
43
|
-
var manager = typeof this.options.manager === 'function' ?
|
44
|
-
this.options.manager.call(this) : this.options.manager;
|
45
|
-
|
46
|
-
manager = manager.appendModal ?
|
47
|
-
manager : $(manager).modalmanager().data('modalmanager');
|
48
|
-
|
49
|
-
manager.appendModal(this);
|
50
|
-
},
|
51
|
-
|
52
|
-
toggle: function () {
|
53
|
-
return this[!this.isShown ? 'show' : 'hide']();
|
54
|
-
},
|
55
|
-
|
56
|
-
show: function () {
|
57
|
-
var that = this,
|
58
|
-
e = $.Event('show');
|
59
|
-
|
60
|
-
if (this.isShown) return;
|
61
|
-
|
62
|
-
this.$element.triggerHandler(e);
|
63
|
-
|
64
|
-
if (e.isDefaultPrevented()) return;
|
65
|
-
|
66
|
-
if (this.options.width){
|
67
|
-
this.$element.css('width', this.options.width);
|
68
|
-
|
69
|
-
var that = this;
|
70
|
-
this.$element.css('margin-left', function () {
|
71
|
-
if (/%/ig.test(that.options.width)){
|
72
|
-
return -(parseInt(that.options.width) / 2) + '%';
|
73
|
-
} else {
|
74
|
-
return -($(this).width() / 2) + 'px';
|
75
|
-
}
|
76
|
-
});
|
77
|
-
}
|
78
|
-
|
79
|
-
var prop = this.options.height ? 'height' : 'max-height';
|
80
|
-
|
81
|
-
var value = this.options.height || this.options.maxHeight;
|
82
|
-
|
83
|
-
if (value){
|
84
|
-
this.$element.find('.modal-body')
|
85
|
-
.css('overflow', 'auto')
|
86
|
-
.css(prop, value);
|
87
|
-
}
|
88
|
-
|
89
|
-
this.escape();
|
90
|
-
|
91
|
-
this.tab();
|
92
|
-
|
93
|
-
this.options.loading && this.loading();
|
94
|
-
},
|
95
|
-
|
96
|
-
hide: function (e) {
|
97
|
-
e && e.preventDefault();
|
98
|
-
|
99
|
-
e = $.Event('hide');
|
100
|
-
|
101
|
-
this.$element.triggerHandler(e);
|
102
|
-
|
103
|
-
if (!this.isShown || e.isDefaultPrevented()) return (this.isShown = false);
|
104
|
-
|
105
|
-
this.isShown = false;
|
106
|
-
|
107
|
-
this.escape();
|
108
|
-
|
109
|
-
this.tab();
|
110
|
-
|
111
|
-
this.isLoading && this.loading();
|
112
|
-
|
113
|
-
$(document).off('focusin.modal');
|
114
|
-
|
115
|
-
this.$element
|
116
|
-
.removeClass('in')
|
117
|
-
.removeClass('animated')
|
118
|
-
.removeClass(this.options.attentionAnimation)
|
119
|
-
.removeClass('modal-overflow')
|
120
|
-
.attr('aria-hidden', true);
|
121
|
-
|
122
|
-
$.support.transition && this.$element.hasClass('fade') ?
|
123
|
-
this.hideWithTransition() :
|
124
|
-
this.hideModal();
|
125
|
-
},
|
126
|
-
|
127
|
-
tab: function () {
|
128
|
-
var that = this;
|
129
|
-
|
130
|
-
if (this.isShown && this.options.consumeTab) {
|
131
|
-
this.$element.on('keydown.tabindex.modal', '[data-tabindex]', function (e) {
|
132
|
-
if (e.keyCode && e.keyCode == 9){
|
133
|
-
var $next = $(this),
|
134
|
-
$rollover = $(this);
|
135
|
-
|
136
|
-
that.$element.find('[data-tabindex]:enabled:not([readonly])').each(function (e) {
|
137
|
-
if (!e.shiftKey){
|
138
|
-
$next = $next.data('tabindex') < $(this).data('tabindex') ?
|
139
|
-
$next = $(this) :
|
140
|
-
$rollover = $(this);
|
141
|
-
} else {
|
142
|
-
$next = $next.data('tabindex') > $(this).data('tabindex') ?
|
143
|
-
$next = $(this) :
|
144
|
-
$rollover = $(this);
|
145
|
-
}
|
146
|
-
});
|
147
|
-
|
148
|
-
$next[0] !== $(this)[0] ?
|
149
|
-
$next.focus() : $rollover.focus();
|
150
|
-
|
151
|
-
e.preventDefault();
|
152
|
-
|
153
|
-
}
|
154
|
-
});
|
155
|
-
} else if (!this.isShown) {
|
156
|
-
this.$element.off('keydown.tabindex.modal');
|
157
|
-
}
|
158
|
-
},
|
159
|
-
|
160
|
-
escape: function () {
|
161
|
-
var that = this;
|
162
|
-
if (this.isShown && this.options.keyboard) {
|
163
|
-
if (!this.$element.attr('tabindex')) this.$element.attr('tabindex', -1);
|
164
|
-
|
165
|
-
this.$element.on('keyup.dismiss.modal', function (e) {
|
166
|
-
e.which == 27 && that.hide();
|
167
|
-
});
|
168
|
-
} else if (!this.isShown) {
|
169
|
-
this.$element.off('keyup.dismiss.modal')
|
170
|
-
}
|
171
|
-
},
|
172
|
-
|
173
|
-
hideWithTransition: function () {
|
174
|
-
var that = this
|
175
|
-
, timeout = setTimeout(function () {
|
176
|
-
that.$element.off($.support.transition.end)
|
177
|
-
that.hideModal()
|
178
|
-
}, 500);
|
179
|
-
|
180
|
-
this.$element.one($.support.transition.end, function () {
|
181
|
-
clearTimeout(timeout)
|
182
|
-
that.hideModal()
|
183
|
-
});
|
184
|
-
},
|
185
|
-
|
186
|
-
hideModal: function () {
|
187
|
-
this.$element
|
188
|
-
.hide()
|
189
|
-
.triggerHandler('hidden');
|
190
|
-
|
191
|
-
|
192
|
-
var prop = this.options.height ? 'height' : 'max-height';
|
193
|
-
var value = this.options.height || this.options.maxHeight;
|
194
|
-
|
195
|
-
if (value){
|
196
|
-
this.$element.find('.modal-body')
|
197
|
-
.css('overflow', '')
|
198
|
-
.css(prop, '');
|
199
|
-
}
|
200
|
-
|
201
|
-
},
|
202
|
-
|
203
|
-
removeLoading: function () {
|
204
|
-
this.$loading.remove();
|
205
|
-
this.$loading = null;
|
206
|
-
this.isLoading = false;
|
207
|
-
},
|
208
|
-
|
209
|
-
loading: function (callback) {
|
210
|
-
callback = callback || function () {};
|
211
|
-
|
212
|
-
var animate = this.$element.hasClass('fade') ? 'fade' : '';
|
213
|
-
|
214
|
-
if (!this.isLoading) {
|
215
|
-
var doAnimate = $.support.transition && animate;
|
216
|
-
|
217
|
-
this.$loading = $('<div class="loading-mask ' + animate + '">')
|
218
|
-
.append(this.options.spinner)
|
219
|
-
.appendTo(this.$element);
|
220
|
-
|
221
|
-
if (doAnimate) this.$loading[0].offsetWidth // force reflow
|
222
|
-
|
223
|
-
this.$loading.addClass('in')
|
224
|
-
|
225
|
-
this.isLoading = true;
|
226
|
-
|
227
|
-
doAnimate ?
|
228
|
-
this.$loading.one($.support.transition.end, callback) :
|
229
|
-
callback();
|
230
|
-
|
231
|
-
} else if (this.isLoading && this.$loading) {
|
232
|
-
this.$loading.removeClass('in');
|
233
|
-
|
234
|
-
var that = this;
|
235
|
-
$.support.transition && this.$element.hasClass('fade')?
|
236
|
-
this.$loading.one($.support.transition.end, function () { that.removeLoading() }) :
|
237
|
-
that.removeLoading();
|
238
|
-
|
239
|
-
} else if (callback) {
|
240
|
-
callback(this.isLoading);
|
241
|
-
}
|
242
|
-
},
|
243
|
-
|
244
|
-
focus: function () {
|
245
|
-
var $focusElem = this.$element.find(this.options.focusOn);
|
246
|
-
|
247
|
-
$focusElem = $focusElem.length ? $focusElem : this.$element;
|
248
|
-
|
249
|
-
$focusElem.focus();
|
250
|
-
},
|
251
|
-
|
252
|
-
attention: function (){
|
253
|
-
// NOTE: transitionEnd with keyframes causes odd behaviour
|
254
|
-
|
255
|
-
if (this.options.attentionAnimation){
|
256
|
-
this.$element
|
257
|
-
.removeClass('animated')
|
258
|
-
.removeClass(this.options.attentionAnimation);
|
259
|
-
|
260
|
-
var that = this;
|
261
|
-
|
262
|
-
setTimeout(function () {
|
263
|
-
that.$element
|
264
|
-
.addClass('animated')
|
265
|
-
.addClass(that.options.attentionAnimation);
|
266
|
-
}, 0);
|
267
|
-
}
|
268
|
-
|
269
|
-
|
270
|
-
this.focus();
|
271
|
-
},
|
272
|
-
|
273
|
-
|
274
|
-
destroy: function () {
|
275
|
-
var e = $.Event('destroy');
|
276
|
-
this.$element.triggerHandler(e);
|
277
|
-
if (e.isDefaultPrevented()) return;
|
278
|
-
|
279
|
-
this.teardown();
|
280
|
-
},
|
281
|
-
|
282
|
-
teardown: function () {
|
283
|
-
if (!this.$parent.length){
|
284
|
-
this.$element.remove();
|
285
|
-
this.$element = null;
|
286
|
-
return;
|
287
|
-
}
|
288
|
-
|
289
|
-
if (this.$parent !== this.$element.parent()){
|
290
|
-
this.$element.appendTo(this.$parent);
|
291
|
-
}
|
292
|
-
|
293
|
-
this.$element.off('.modal');
|
294
|
-
this.$element.removeData('modal');
|
295
|
-
this.$element
|
296
|
-
.removeClass('in')
|
297
|
-
.attr('aria-hidden', true);
|
298
|
-
}
|
299
|
-
}
|
300
|
-
|
301
|
-
|
302
|
-
/* MODAL PLUGIN DEFINITION
|
303
|
-
* ======================= */
|
304
|
-
|
305
|
-
$.fn.modal = function (option) {
|
306
|
-
return this.each(function () {
|
307
|
-
var $this = $(this),
|
308
|
-
data = $this.data('modal'),
|
309
|
-
options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option);
|
310
|
-
|
311
|
-
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
312
|
-
if (typeof option == 'string') data[option]()
|
313
|
-
else if (options.show) data.show()
|
314
|
-
})
|
315
|
-
}
|
316
|
-
|
317
|
-
$.fn.modal.defaults = {
|
318
|
-
keyboard: true,
|
319
|
-
backdrop: true,
|
320
|
-
loading: false,
|
321
|
-
show: true,
|
322
|
-
width: null,
|
323
|
-
height: null,
|
324
|
-
maxHeight: null,
|
325
|
-
modalOverflow: false,
|
326
|
-
consumeTab: true,
|
327
|
-
focusOn: null,
|
328
|
-
attentionAnimation: 'shake',
|
329
|
-
manager: 'body',
|
330
|
-
spinner: '<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="bar" style="width: 100%;"></div></div></div>'
|
331
|
-
}
|
332
|
-
|
333
|
-
$.fn.modal.Constructor = Modal
|
334
|
-
|
335
|
-
|
336
|
-
/* MODAL DATA-API
|
337
|
-
* ============== */
|
338
|
-
|
339
|
-
$(function () {
|
340
|
-
$(document).off('.modal').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
341
|
-
var $this = $(this),
|
342
|
-
href = $this.attr('href'),
|
343
|
-
$target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))), //strip for ie7
|
344
|
-
option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data());
|
345
|
-
|
346
|
-
e.preventDefault();
|
347
|
-
$target
|
348
|
-
.modal(option)
|
349
|
-
.one('hide', function () {
|
350
|
-
$this.focus();
|
351
|
-
})
|
352
|
-
});
|
353
|
-
});
|
354
|
-
|
355
|
-
}(window.jQuery);
|