blacklight 3.8.2 → 4.0.0.pre6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. data/Gemfile +1 -0
  2. data/README.md +1 -1
  3. data/VERSION +1 -1
  4. data/app/assets/javascripts/blacklight/blacklight.js +12 -1
  5. data/app/assets/javascripts/blacklight/bootstrap_dropdowns.js +3 -0
  6. data/app/assets/javascripts/blacklight/checkbox_submit.js +12 -5
  7. data/app/assets/javascripts/blacklight/core.js +0 -1
  8. data/app/assets/javascripts/blacklight/css_dropdowns.js +10 -0
  9. data/app/assets/javascripts/blacklight/facet_expand_contract.js +5 -5
  10. data/app/assets/javascripts/blacklight/lightbox_dialog.js +68 -13
  11. data/app/assets/javascripts/blacklight/select_submit.js +19 -10
  12. data/app/assets/javascripts/improved-modal/bootstrap-modal.js +282 -0
  13. data/app/assets/javascripts/improved-modal/bootstrap-modalmanager.js +353 -0
  14. data/app/assets/stylesheets/blacklight/_blacklight_base.css.scss +16 -5
  15. data/app/assets/stylesheets/blacklight/_bookmark.css.scss +24 -6
  16. data/app/assets/stylesheets/blacklight/_catalog.css.scss +115 -141
  17. data/app/assets/stylesheets/blacklight/_dropdown.css.scss +57 -0
  18. data/app/assets/stylesheets/blacklight/_facets.css.scss +127 -58
  19. data/app/assets/stylesheets/blacklight/_footer.css.scss +20 -0
  20. data/app/assets/stylesheets/blacklight/_header.css.scss +90 -21
  21. data/app/assets/stylesheets/blacklight/_layout.css.scss +10 -9
  22. data/app/assets/stylesheets/blacklight/_modal.css.scss +23 -0
  23. data/app/assets/stylesheets/blacklight/_print.css.scss +0 -7
  24. data/app/assets/stylesheets/blacklight/_responsive.css.scss +3 -0
  25. data/app/assets/stylesheets/blacklight/_search_history.css.scss +2 -4
  26. data/app/assets/stylesheets/blacklight/blacklight.css.scss +0 -1
  27. data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +9 -2
  28. data/app/assets/stylesheets/blacklight/responsive_partials/_catalog.css.scss +5 -0
  29. data/app/assets/stylesheets/blacklight/responsive_partials/_facets.css.scss +37 -0
  30. data/app/assets/stylesheets/blacklight/responsive_partials/_header.css.scss +30 -0
  31. data/app/assets/stylesheets/improved-modal/bootstrap-modal.css +199 -0
  32. data/app/controllers/bookmarks_controller.rb +16 -10
  33. data/app/helpers/blacklight/blacklight_helper_behavior.rb +124 -61
  34. data/app/helpers/blacklight/catalog_helper_behavior.rb +5 -3
  35. data/app/helpers/blacklight/facets_helper_behavior.rb +9 -9
  36. data/app/views/_flash_msg.html.erb +9 -4
  37. data/app/views/_user_util_links.html.erb +23 -17
  38. data/app/views/bookmarks/_tools.html.erb +7 -7
  39. data/app/views/bookmarks/index.html.erb +5 -13
  40. data/app/views/catalog/_bookmark_control.html.erb +2 -4
  41. data/app/views/catalog/_bookmark_form.html.erb +1 -1
  42. data/app/views/catalog/_citation.html.erb +21 -20
  43. data/app/views/catalog/_constraints.html.erb +8 -6
  44. data/app/views/catalog/_document_header.html.erb +6 -7
  45. data/app/views/catalog/_document_list.html.erb +1 -7
  46. data/app/views/catalog/_email_form.html.erb +42 -16
  47. data/app/views/catalog/_facet_layout.html.erb +1 -1
  48. data/app/views/catalog/_facet_limit.html.erb +1 -1
  49. data/app/views/catalog/_facet_pagination.html.erb +11 -14
  50. data/app/views/catalog/_facets.html.erb +16 -2
  51. data/app/views/catalog/_home.html.erb +2 -2
  52. data/app/views/catalog/_home_text.html.erb +5 -2
  53. data/app/views/catalog/_index_default.html.erb +2 -2
  54. data/app/views/catalog/_marc_view.html.erb +0 -1
  55. data/app/views/catalog/_paginate_compact.html.erb +5 -0
  56. data/app/views/catalog/_per_page_widget.html.erb +13 -7
  57. data/app/views/catalog/_previous_next_doc.html.erb +14 -4
  58. data/app/views/catalog/_refworks_form.html.erb +2 -2
  59. data/app/views/catalog/_results_pagination.html.erb +4 -1
  60. data/app/views/catalog/_search_form.html.erb +19 -13
  61. data/app/views/catalog/_show_default.html.erb +2 -2
  62. data/app/views/catalog/_show_more_like_this.html.erb +3 -0
  63. data/app/views/catalog/_show_sidebar.html.erb +14 -1
  64. data/app/views/catalog/_show_tools.html.erb +18 -18
  65. data/app/views/catalog/_sms_form.html.erb +35 -10
  66. data/app/views/catalog/_sort_and_per_page.html.erb +5 -3
  67. data/app/views/catalog/_sort_widget.html.erb +12 -6
  68. data/app/views/catalog/citation.html.erb +1 -1
  69. data/app/views/catalog/citation.js.erb +7 -0
  70. data/app/views/catalog/email.html.erb +5 -0
  71. data/app/views/catalog/facet.html.erb +28 -21
  72. data/app/views/catalog/index.html.erb +26 -26
  73. data/app/views/catalog/librarian_view.html.erb +7 -0
  74. data/app/views/catalog/show.html.erb +35 -29
  75. data/app/views/catalog/sms.html.erb +5 -0
  76. data/app/views/kaminari/blacklight/_first_page.html.erb +2 -2
  77. data/app/views/kaminari/blacklight/_gap.html.erb +4 -1
  78. data/app/views/kaminari/blacklight/_last_page.html.erb +2 -2
  79. data/app/views/kaminari/blacklight/_next_page.html.erb +3 -3
  80. data/app/views/kaminari/blacklight/_page.html.erb +4 -3
  81. data/app/views/kaminari/blacklight/_paginator.html.erb +5 -5
  82. data/app/views/kaminari/blacklight/_prev_page.html.erb +3 -3
  83. data/app/views/kaminari/blacklight_compact/_next_page.html.erb +9 -0
  84. data/app/views/kaminari/blacklight_compact/_paginator.html.erb +15 -0
  85. data/app/views/kaminari/blacklight_compact/_prev_page.html.erb +9 -0
  86. data/app/views/layouts/blacklight.html.erb +47 -27
  87. data/app/views/saved_searches/index.html.erb +2 -2
  88. data/app/views/search_history/index.html.erb +12 -7
  89. data/app/views/shared/_footer.html.erb +0 -0
  90. data/app/views/shared/_header_navbar.html.erb +25 -0
  91. data/blacklight.gemspec +2 -5
  92. data/config/locales/blacklight.en.yml +23 -15
  93. data/lib/blacklight.rb +2 -2
  94. data/lib/blacklight/catalog.rb +36 -14
  95. data/lib/blacklight/configuration.rb +10 -2
  96. data/lib/blacklight/mash.rb +151 -0
  97. data/lib/blacklight/solr/document.rb +73 -11
  98. data/lib/blacklight/solr/document/extensions.rb +0 -8
  99. data/lib/blacklight/solr/document/marc_export.rb +7 -2
  100. data/lib/blacklight/solr/document/more_like_this.rb +5 -0
  101. data/lib/blacklight/solr_helper.rb +43 -18
  102. data/lib/blacklight/solr_response.rb +60 -0
  103. data/lib/blacklight/solr_response/facets.rb +58 -0
  104. data/lib/blacklight/solr_response/more_like_this.rb +14 -0
  105. data/lib/blacklight/solr_response/spelling.rb +92 -0
  106. data/lib/generators/blacklight/assets_generator.rb +1 -14
  107. data/lib/generators/blacklight/blacklight_generator.rb +22 -21
  108. data/lib/generators/blacklight/jetty_generator.rb +1 -35
  109. data/{test_support → lib/generators/blacklight/templates}/alternate_controller.rb +0 -0
  110. data/lib/generators/blacklight/templates/blacklight.css.scss +4 -0
  111. data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +2 -2
  112. data/lib/generators/blacklight/templates/config/jetty.yml +6 -0
  113. data/lib/generators/blacklight/test_support_generator.rb +35 -0
  114. data/lib/railties/all_tests.rake +5 -23
  115. data/lib/railties/blacklight_cucumber.rake +2 -11
  116. data/lib/railties/blacklight_rspec.rake +2 -12
  117. data/test_support/bin/run-tests.sh +1 -1
  118. data/test_support/bin/setup-test-app.sh +123 -0
  119. data/test_support/bin/test.sh +21 -21
  120. data/test_support/features/bookmarks.feature +9 -3
  121. data/test_support/features/saved_searches.feature +3 -3
  122. data/test_support/features/search.feature +3 -3
  123. data/test_support/features/search_filters.feature +24 -26
  124. data/test_support/features/search_history.feature +9 -10
  125. data/test_support/features/search_sort.feature +4 -6
  126. data/test_support/features/step_definitions/general_steps.rb +0 -4
  127. data/test_support/features/step_definitions/search_result_steps.rb +2 -1
  128. data/test_support/features/step_definitions/search_steps.rb +32 -2
  129. data/test_support/spec/controllers/application_controller_spec.rb +8 -0
  130. data/test_support/spec/controllers/catalog_controller_spec.rb +3 -18
  131. data/test_support/spec/helpers/blacklight_helper_spec.rb +116 -20
  132. data/test_support/spec/helpers/catalog_helper_spec.rb +14 -6
  133. data/test_support/spec/helpers/facets_helper_spec.rb +1 -1
  134. data/test_support/spec/lib/blacklight_solr_document_more_like_this_spec.rb +18 -0
  135. data/test_support/spec/lib/blacklight_solr_document_spec.rb +54 -1
  136. data/test_support/spec/lib/blacklight_solr_response_spec.rb +153 -0
  137. data/test_support/spec/lib/facet_paginator_spec.rb +1 -1
  138. data/test_support/spec/lib/marc_export_spec.rb +14 -6
  139. data/test_support/spec/lib/solr_helper_spec.rb +22 -6
  140. data/test_support/spec/models/solr_docment_spec.rb +1 -4
  141. data/test_support/spec/{features → requests}/alternate_controller_spec.rb +3 -2
  142. data/test_support/spec/views/catalog/_facets.html.erb_spec.rb +20 -4
  143. data/test_support/spec/views/catalog/_show_sidebar.erb_spec.rb +25 -0
  144. metadata +53 -131
  145. data/app/assets/javascripts/blacklight/more_facets.js +0 -16
  146. data/app/assets/javascripts/jquery-1.4.2.min.js +0 -154
  147. data/app/assets/javascripts/jquery-ui-1.8.1.custom.min.js +0 -756
  148. data/app/assets/javascripts/jquery.uiExt.ajaxyDialog.js +0 -180
  149. data/app/assets/stylesheets/blacklight/_formatting.css.scss +0 -164
  150. data/app/assets/stylesheets/blacklight/grids/_susy_grid.css.scss +0 -72
  151. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
  152. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  153. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  154. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  155. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  156. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  157. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  158. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_558fd0_500x100.png +0 -0
  159. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  160. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  161. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  162. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  163. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_2e4f81_256x240.png +0 -0
  164. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  165. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  166. data/app/assets/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css +0 -486
  167. data/app/models/solr_document.rb +0 -5
  168. data/app/views/catalog/email.erb +0 -1
  169. data/app/views/catalog/sms.erb +0 -1
  170. data/doc/Atom-Responses.md +0 -90
  171. data/doc/Blacklight-3.2-Release-Notes-and-Upgrade-Guide.md +0 -191
  172. data/doc/Blacklight-3.3-release-notes-and-upgrade-guide.md +0 -37
  173. data/doc/Blacklight-3.4-release-notes-and-upgrade-guide.md +0 -27
  174. data/doc/Blacklight-3.5-release-notes-and-upgrade-guide.md +0 -44
  175. data/doc/Blacklight-3.6-release-notes-and-upgrade-guide.md +0 -25
  176. data/doc/Blacklight-3.7-release-notes-and-upgrade-guide.md +0 -78
  177. data/doc/Blacklight-3.8-release-notes-and-upgrade-guide.md +0 -11
  178. data/doc/Blacklight-Add-ons.md +0 -28
  179. data/doc/Blacklight-configuration.md +0 -301
  180. data/doc/Blacklight-on-Heroku.md +0 -135
  181. data/doc/Community-principles.md +0 -44
  182. data/doc/Configuring-and-Customizing-Blacklight.md +0 -271
  183. data/doc/Contributing-to-Blacklight.md +0 -25
  184. data/doc/Examples.md +0 -62
  185. data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -141
  186. data/doc/Home.md +0 -77
  187. data/doc/How-to-release-a-version.md +0 -37
  188. data/doc/Indexing-your-data-into-solr.md +0 -5
  189. data/doc/Integration-with-Rails-Footnotes.md +0 -20
  190. data/doc/Pagination.md +0 -38
  191. data/doc/Providing-your-own-view-templates.md +0 -109
  192. data/doc/Quickstart.md +0 -116
  193. data/doc/README.md +0 -77
  194. data/doc/README_SOLR.md +0 -245
  195. data/doc/Release-Notes-And-Upgrade-Guides.md +0 -14
  196. data/doc/Sunspot-for-indexing.md +0 -46
  197. data/doc/User-Authentication.md +0 -60
  198. data/doc/testing.md +0 -115
  199. data/lib/generators/blacklight/solr_conf_generator.rb +0 -26
  200. data/lib/generators/blacklight/templates/assets/standard.css.scss +0 -59
  201. data/lib/generators/blacklight/templates/config/blacklight_config.rb +0 -3
  202. data/lib/generators/blacklight/templates/config/compass.rb +0 -2
  203. data/lib/generators/blacklight/templates/solr_conf/schema.xml +0 -689
  204. data/lib/generators/blacklight/templates/solr_conf/solrconfig.xml +0 -1846
  205. data/lib/solrmarc.log.1 +0 -849
  206. data/test_support/spec/controllers/bookmarks_controller_spec.rb +0 -48
data/Gemfile CHANGED
@@ -6,3 +6,4 @@ gemspec
6
6
  gem 'rcov', :platform => :mri_18
7
7
  gem 'simplecov', :platform => :mri_19
8
8
  gem 'simplecov-rcov', :platform => :mri_19
9
+
data/README.md CHANGED
@@ -18,7 +18,7 @@ the University of Virginia Library and is made public under an Apache 2.0 licens
18
18
 
19
19
  ## Dependencies
20
20
 
21
- * ruby v1.8.7 or higher
21
+ * ruby v1.9.3 or higher
22
22
  * git
23
23
  * java 1.5 or higher
24
24
  * access to a command prompt on the machine to install
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.8.2
1
+ 4.0.0.pre6
@@ -8,10 +8,19 @@
8
8
  //= require blacklight/bookmark_toggle
9
9
  //= require blacklight/facet_expand_contract
10
10
  //= require blacklight/lightbox_dialog
11
- //= require blacklight/more_facets
12
11
  //= require blacklight/search_context
13
12
  //= require blacklight/select_submit
14
13
  //= require blacklight/zebra_stripe
14
+ //= require blacklight/bootstrap_dropdowns
15
+ //= require blacklight/css_dropdowns
16
+ //
17
+ //Bootstrap JS for providing collapsable tablet/mobile menu/alert boxes
18
+ //= require bootstrap-transition
19
+ //= require bootstrap-collapse
20
+ //= require bootstrap-alert
21
+ //= require bootstrap-dropdown
22
+ //= require improved-modal/bootstrap-modalmanager.js
23
+ //= require improved-modal/bootstrap-modal.js
15
24
 
16
25
  /* Blacklight has a Javascript setup meant to support local disabling,
17
26
  modification, and use of Blacklight behaviors.
@@ -51,3 +60,5 @@
51
60
  });
52
61
  };
53
62
  */
63
+
64
+ $('.no-js').removeClass('no-js')
@@ -0,0 +1,3 @@
1
+ $(document).ready(function() {
2
+ $('.dropdown-toggle').dropdown();
3
+ });
@@ -40,6 +40,7 @@
40
40
  //for both bookmarks/$doc_id. But let's take out the irrelevant parts
41
41
  //of the form to avoid any future confusion.
42
42
  form.find("input[type=submit]").remove();
43
+ form.addClass('form-inline');
43
44
 
44
45
  //View needs to set data-doc-id so we know a unique value
45
46
  //for making DOM id
@@ -53,9 +54,14 @@
53
54
  .attr("id", options.css_class + "_" + unique_id);
54
55
  var label = $('<label>')
55
56
  .addClass( options.css_class )
57
+ .addClass('checkbox')
56
58
  .attr("for", options.css_class + '_' + unique_id)
57
59
  .attr("title", form.attr("title") || "");
58
-
60
+ var span = $('<span>');
61
+
62
+ label.append(checkbox);
63
+ label.append(" ");
64
+ label.append(span);
59
65
 
60
66
  function update_state_for(state) {
61
67
  checkbox.attr("checked", state);
@@ -64,18 +70,19 @@
64
70
  //Set the Rails hidden field that fakes an HTTP verb
65
71
  //properly for current state action.
66
72
  form.find("input[name=_method]").val("delete");
67
- label.text(options.checked_label);
73
+ span.text(options.checked_label);
68
74
  } else {
69
75
  form.find("input[name=_method]").val("put");
70
- label.text(options.unchecked_label);
76
+ span.text(options.unchecked_label);
71
77
  }
72
78
  }
73
79
 
74
- form.append(checkbox).append(" ").append(label);
80
+ form.append(label);
75
81
  update_state_for(checked);
76
82
 
77
83
  checkbox.click(function() {
78
- label.text(options.progress_label).attr("disabled", "disabled");
84
+ span.text(options.progress_label);
85
+ label.attr("disabled", "disabled");
79
86
  checkbox.attr("disabled", "disabled");
80
87
 
81
88
  $.ajax({
@@ -1,2 +1 @@
1
- //= require jquery.uiExt.ajaxyDialog.js
2
1
  Blacklight = {};
@@ -0,0 +1,10 @@
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
+ $(document).ready(function() {
8
+ Blacklight.add_css_dropdown_click_support();
9
+ });
10
+ })(jQuery);
@@ -5,7 +5,7 @@ Blacklight.do_facet_expand_contract_behavior = function() {
5
5
  Blacklight.facet_expand_contract
6
6
  );
7
7
  }
8
- Blacklight.do_facet_expand_contract_behavior.selector = '#facets h3';
8
+ Blacklight.do_facet_expand_contract_behavior.selector = '#facets h5';
9
9
 
10
10
  /* Behavior that makes facet limit headings in sidebar expand/contract
11
11
  their contents. This is kind of fragile code targeted specifically
@@ -16,17 +16,17 @@ Blacklight.do_facet_expand_contract_behavior = function() {
16
16
  Blacklight.facet_expand_contract = function() {
17
17
  $(this).next("ul, div").each(function(){
18
18
  var f_content = $(this);
19
- $(f_content).prev('h3').addClass('twiddle');
19
+ $(f_content).prev('h5').addClass('twiddle');
20
20
  // find all f_content's that don't have any span descendants with a class of "selected"
21
21
  if($('span.selected', f_content).length == 0){
22
22
  // hide it
23
23
  f_content.hide();
24
24
  } else {
25
- $(this).prev('h3').addClass('twiddle-open');
25
+ $(this).prev('h5').addClass('twiddle-open');
26
26
  }
27
27
 
28
- // attach the toggle behavior to the h3 tag
29
- $('h3', f_content.parent()).click(function(){
28
+ // attach the toggle behavior to the h5 tag
29
+ $('h5', f_content.parent()).click(function(){
30
30
  // toggle the content
31
31
  $(this).toggleClass('twiddle-open');
32
32
  $(f_content).slideToggle();
@@ -1,16 +1,71 @@
1
1
  //= require blacklight/core
2
- (function($) {
3
- Blacklight.do_lightbox_dialog = function() {
4
- $("a.lightboxLink").ajaxyDialog({
5
- chainAjaxySelector: false,
6
- position: ['center', 50]
2
+ Blacklight.setup_modal = function(link_selector, form_selector, launch_modal) {
3
+ $(link_selector).click(function(e) {
4
+ link = $(this)
5
+
6
+ e.preventDefault();
7
+ if (launch_modal) {
8
+ GlobalModalManager.loading();
9
+ }
10
+
11
+ var jqxhr = $.ajax({
12
+ url: link.attr('href'),
13
+ dataType: 'script'
7
14
  });
8
- //But make the librarian link wider than 300px default.
9
- $('a.lightboxLink#librarianLink').ajaxyDialog("option", "width", 650);
10
- //And the email one too needs to be wider to fit the textarea
11
- $("a.lightboxLink#emailLink").ajaxyDialog("option", "width", 500);
12
- };
13
- $(document).ready(function() {
14
- Blacklight.do_lightbox_dialog();
15
+
16
+ jqxhr.always( function (data) {
17
+ if (data.statusText == "OK") {
18
+ $('#ajax-modal').html(data.responseText);
19
+ Blacklight.setup_modal('.modal-footer a', '#ajax-modal form.ajax_form', false);
20
+
21
+ if (launch_modal) {
22
+ $('#ajax-modal').modal();
23
+ }
24
+ Blacklight.check_close_ajax_modal();
25
+ }
26
+ });
27
+ });
28
+
29
+
30
+ $(form_selector).submit(function(e) {
31
+ var jqxhr = $.ajax({
32
+ url: $(this).attr('action'),
33
+ data: $(this).serialize(),
34
+ type: 'POST',
35
+ dataType: 'script'
36
+ });
37
+
38
+
39
+ jqxhr.always (function (data) {
40
+ if (data.statusText == "OK") {
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
+
48
+ return false;
49
+
50
+
51
+ });
52
+ };
53
+
54
+ Blacklight.check_close_ajax_modal = function() {
55
+ if ($('#ajax-modal span.ajax-close-modal').length) {
56
+ modal_flashes = $('#ajax-modal .flash_messages');
57
+
58
+ main_flashes = $('#main-flashes .flash_messages:nth-of-type(1)');
59
+ $('#ajax-modal *[data-dismiss="modal"]:nth-of-type(1)').trigger('click');
60
+ main_flashes.append(modal_flashes);
61
+ modal_flashes.fadeIn(500);
62
+
63
+
64
+
65
+ }
66
+
67
+ }
68
+
69
+ $(document).ready( function() {
70
+ Blacklight.setup_modal("a.lightboxLink,a.more_facets_link,.ajax_modal_launch", "#ajax-modal form.ajax_form", true);
15
71
  });
16
- })(jQuery);
@@ -2,17 +2,26 @@
2
2
  (function($) {
3
3
  // Used for sort-by and per-page controls, hide the submit button
4
4
  // and make the select auto-submit
5
- Blacklight.do_select_submit = function() {
6
- $(Blacklight.do_select_submit.selector).each(function() {
7
- var select = $(this);
8
- select.closest("form").find("input[type=submit]").hide();
9
- select.bind("change", function() {
10
- this.form.submit();
11
- });
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);
12
10
  });
13
- };
14
- Blacklight.do_select_submit.selector = "form.sort select, form.per_page select";
11
+
12
+ }
13
+
15
14
  $(document).ready(function() {
16
- Blacklight.do_select_submit();
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
+
17
26
  });
18
27
  })(jQuery);
@@ -0,0 +1,282 @@
1
+ /* ===========================================================
2
+ * bootstrap-modal.js
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' ? this.options.manager.call(this) : this.options.manager;
44
+ manager && manager.appendModal && manager.appendModal(this);
45
+ },
46
+
47
+ toggle: function () {
48
+ return this[!this.isShown ? 'show' : 'hide']();
49
+ },
50
+
51
+ show: function () {
52
+ var that = this,
53
+ e = $.Event('show');
54
+
55
+ this.$element.triggerHandler(e);
56
+
57
+ if (e.isDefaultPrevented()) return;
58
+
59
+ if (this.options.width){
60
+ this.$element.css('width', this.options.width);
61
+
62
+ var that = this;
63
+ this.$element.css('margin-left', function(){
64
+ if (/%/ig.test(that.options.width)){
65
+ return -(parseInt(that.options.width) / 2) + '%';
66
+ } else {
67
+ return -($(this).width() / 2) + 'px';
68
+ }
69
+ });
70
+ }
71
+
72
+
73
+ var prop = this.options.height ? 'height' : 'max-height';
74
+ var value = this.options.height || this.options.maxHeight;
75
+
76
+ if (value){
77
+ this.$element.find('.modal-body')
78
+ .css('overflow', 'auto')
79
+ .css(prop, value);
80
+ }
81
+
82
+ this.escape();
83
+
84
+ this.options.loading && this.loading();
85
+ },
86
+
87
+ hide: function (e) {
88
+ e && e.preventDefault();
89
+
90
+ var that = this;
91
+
92
+ e = $.Event('hide');
93
+
94
+ this.$element.triggerHandler(e);
95
+
96
+ if (!this.isShown || e.isDefaultPrevented()) return (this.isShown = false);
97
+
98
+ this.isShown = false;
99
+
100
+ this.escape();
101
+
102
+ this.isLoading && this.loading();
103
+
104
+ $(document).off('focusin.modal');
105
+
106
+ this.$element
107
+ .removeClass('in')
108
+ .removeClass('modal-overflow')
109
+ .attr('aria-hidden', true);
110
+
111
+ $.support.transition && this.$element.hasClass('fade') ?
112
+ this.hideWithTransition() :
113
+ this.hideModal();
114
+ },
115
+
116
+ escape: function () {
117
+ var that = this;
118
+ if (this.isShown && this.options.keyboard) {
119
+ if (!this.$element.attr('tabindex')) this.$element.attr('tabindex', -1);
120
+
121
+ this.$element.on('keyup.dismiss.modal', function ( e ) {
122
+ e.which == 27 && that.hide()
123
+ });
124
+ } else if (!this.isShown) {
125
+ this.$element.off('keyup.dismiss.modal')
126
+ }
127
+ },
128
+
129
+ hideWithTransition: function () {
130
+ var that = this
131
+ , timeout = setTimeout(function () {
132
+ that.$element.off($.support.transition.end)
133
+ that.hideModal()
134
+ }, 500);
135
+
136
+ this.$element.one($.support.transition.end, function () {
137
+ clearTimeout(timeout)
138
+ that.hideModal()
139
+ });
140
+ },
141
+
142
+ hideModal: function () {
143
+ this.$element
144
+ .hide()
145
+ .triggerHandler('hidden');
146
+
147
+
148
+ var prop = this.options.height ? 'height' : 'max-height';
149
+ var value = this.options.height || this.options.maxHeight;
150
+
151
+ if (value){
152
+ this.$element.find('.modal-body')
153
+ .css('overflow', '')
154
+ .css(prop, '');
155
+ }
156
+
157
+ },
158
+
159
+ removeLoading: function(){
160
+ this.$loading.remove();
161
+ this.$loading = null;
162
+ this.isLoading = false;
163
+ },
164
+
165
+ loading: function(callback){
166
+ callback = callback || function(){};
167
+
168
+ var animate = this.$element.hasClass('fade') ? 'fade' : '';
169
+
170
+ if (!this.isLoading) {
171
+ var doAnimate = $.support.transition && animate;
172
+
173
+ this.$loading = $('<div class="loading-mask ' + animate + '">')
174
+ .append(this.options.spinner)
175
+ .appendTo(this.$element);
176
+
177
+ if (doAnimate) this.$loading[0].offsetWidth // force reflow
178
+
179
+ this.$loading.addClass('in')
180
+
181
+ this.isLoading = true;
182
+
183
+ doAnimate ?
184
+ this.$loading.one($.support.transition.end, callback) :
185
+ callback();
186
+
187
+ } else if (this.isLoading && this.$loading) {
188
+ this.$loading.removeClass('in');
189
+
190
+ var that = this;
191
+ $.support.transition && this.$element.hasClass('fade')?
192
+ this.$loading.one($.support.transition.end, function(){ that.removeLoading() }) :
193
+ that.removeLoading();
194
+
195
+ } else if (callback) {
196
+ callback(this.isLoading);
197
+ }
198
+ },
199
+
200
+ toggleLoading: function(callback){ this.loading(callback); },
201
+
202
+ destroy: function(){
203
+ var e = $.Event('destroy');
204
+ this.$element.triggerHandler(e);
205
+ if (e.isDefaultPrevented()) return;
206
+
207
+ this.teardown();
208
+ },
209
+
210
+ teardown: function(){
211
+ var $parent = this.$parent;
212
+
213
+ if (!$parent.length){
214
+ this.$element.remove();
215
+ this.$element = null;
216
+ return;
217
+ }
218
+
219
+ if ($parent !== this.$element.parent()){
220
+ this.$element.appendTo(this.$parent);
221
+ }
222
+
223
+ this.$element.off('.modal');
224
+ this.$element.removeData('modal');
225
+ this.$element
226
+ .removeClass('in')
227
+ .attr('aria-hidden', true);
228
+ }
229
+ }
230
+
231
+
232
+ /* MODAL PLUGIN DEFINITION
233
+ * ======================= */
234
+
235
+ $.fn.modal = function (option) {
236
+ return this.each(function () {
237
+ var $this = $(this),
238
+ data = $this.data('modal'),
239
+ options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option);
240
+
241
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
242
+ if (typeof option == 'string') data[option]()
243
+ else if (options.show) data.show()
244
+ })
245
+ }
246
+
247
+ $.fn.modal.defaults = {
248
+ keyboard: true,
249
+ backdrop: true,
250
+ loading: false,
251
+ show: true,
252
+ width: null,
253
+ height: null,
254
+ maxHeight: null,
255
+ modalOverflow: false,
256
+ manager: function(){ return GlobalModalManager },
257
+ 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>'
258
+ }
259
+
260
+ $.fn.modal.Constructor = Modal
261
+
262
+
263
+ /* MODAL DATA-API
264
+ * ============== */
265
+
266
+ $(function () {
267
+ $(document).off('.modal').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
268
+ var $this = $(this),
269
+ href = $this.attr('href'),
270
+ $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))), //strip for ie7
271
+ option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data());
272
+
273
+ e.preventDefault();
274
+ $target
275
+ .modal(option)
276
+ .one('hide', function () {
277
+ $this.focus();
278
+ })
279
+ });
280
+ });
281
+
282
+ }(window.jQuery);