blacklight-spotlight 5.3.0 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +1696 -1229
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +1718 -1232
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +1 -10
  8. data/app/assets/stylesheets/spotlight/_nestable.scss +18 -1
  9. data/app/assets/stylesheets/spotlight/_pages.scss +3 -3
  10. data/app/components/spotlight/analytics/aggregation_component.html.erb +1 -1
  11. data/app/components/spotlight/document_admin_table_component.html.erb +2 -2
  12. data/app/components/spotlight/edit_view_links_component.html.erb +1 -1
  13. data/app/components/spotlight/header_component.html.erb +1 -1
  14. data/app/components/spotlight/tag_list_form_component.html.erb +1 -1
  15. data/app/components/spotlight/tag_selector_component.html.erb +2 -2
  16. data/app/components/spotlight/translations/subheading_component.html.erb +1 -1
  17. data/app/controllers/spotlight/resources_controller.rb +1 -1
  18. data/app/javascript/spotlight/admin/add_another.js +22 -15
  19. data/app/javascript/spotlight/admin/add_image_selector.js +27 -25
  20. data/app/javascript/spotlight/admin/add_new_button.js +47 -43
  21. data/app/javascript/spotlight/admin/blacklight_configuration.js +52 -38
  22. data/app/javascript/spotlight/admin/block_mixins/autocompleteable.js +68 -60
  23. data/app/javascript/spotlight/admin/block_mixins/formable.js +55 -47
  24. data/app/javascript/spotlight/admin/block_mixins/plustextable.js +19 -20
  25. data/app/javascript/spotlight/admin/blocks/block.js +20 -16
  26. data/app/javascript/spotlight/admin/blocks/browse_block.js +42 -37
  27. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +33 -31
  28. data/app/javascript/spotlight/admin/blocks/iframe_block.js +14 -11
  29. data/app/javascript/spotlight/admin/blocks/link_to_search_block.js +4 -7
  30. data/app/javascript/spotlight/admin/blocks/oembed_block.js +13 -10
  31. data/app/javascript/spotlight/admin/blocks/pages_block.js +20 -13
  32. data/app/javascript/spotlight/admin/blocks/resources_block.js +150 -117
  33. data/app/javascript/spotlight/admin/blocks/rule_block.js +11 -10
  34. data/app/javascript/spotlight/admin/blocks/search_result_block.js +16 -17
  35. data/app/javascript/spotlight/admin/blocks/solr_documents_base_block.js +123 -64
  36. data/app/javascript/spotlight/admin/blocks/solr_documents_block.js +8 -8
  37. data/app/javascript/spotlight/admin/blocks/solr_documents_carousel_block.js +63 -43
  38. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +9 -9
  39. data/app/javascript/spotlight/admin/blocks/solr_documents_features_block.js +17 -16
  40. data/app/javascript/spotlight/admin/blocks/solr_documents_grid_block.js +6 -7
  41. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +84 -64
  42. data/app/javascript/spotlight/admin/crop.js +203 -156
  43. data/app/javascript/spotlight/admin/croppable.js +4 -4
  44. data/app/javascript/spotlight/admin/croppable_modal.js +59 -37
  45. data/app/javascript/spotlight/admin/edit_in_place.js +50 -47
  46. data/app/javascript/spotlight/admin/exhibits.js +52 -41
  47. data/app/javascript/spotlight/admin/form_observer.js +59 -53
  48. data/app/javascript/spotlight/admin/iiif.js +26 -25
  49. data/app/javascript/spotlight/admin/index.js +44 -47
  50. data/app/javascript/spotlight/admin/locks.js +14 -14
  51. data/app/javascript/spotlight/admin/multi_image_selector.js +127 -111
  52. data/app/javascript/spotlight/admin/pages.js +21 -21
  53. data/app/javascript/spotlight/admin/progress_monitor.js +67 -65
  54. data/app/javascript/spotlight/admin/readonly_checkbox.js +3 -3
  55. data/app/javascript/spotlight/admin/search_typeahead.js +55 -43
  56. data/app/javascript/spotlight/admin/select_related_input.js +17 -17
  57. data/app/javascript/spotlight/admin/sir-trevor/block_controls.js +100 -84
  58. data/app/javascript/spotlight/admin/sir-trevor/block_limits.js +36 -31
  59. data/app/javascript/spotlight/admin/sir-trevor/locales.js +52 -39
  60. data/app/javascript/spotlight/admin/spotlight_nestable.js +126 -91
  61. data/app/javascript/spotlight/admin/tabs.js +19 -3
  62. data/app/javascript/spotlight/admin/translation_progress.js +13 -7
  63. data/app/javascript/spotlight/admin/users.js +41 -41
  64. data/app/javascript/spotlight/admin/visibility_toggle.js +4 -4
  65. data/app/javascript/spotlight/controllers/clipboard_controller.js +14 -0
  66. data/app/javascript/spotlight/controllers/index.js +4 -2
  67. data/app/javascript/spotlight/controllers/tag_selector_controller.js +116 -79
  68. data/app/javascript/spotlight/core.js +18 -15
  69. data/app/javascript/spotlight/index.js +4 -4
  70. data/app/javascript/spotlight/user/browse_group_categories.js +24 -22
  71. data/app/javascript/spotlight/user/carousel.js +23 -19
  72. data/app/javascript/spotlight/user/clear_form_button.js +15 -15
  73. data/app/javascript/spotlight/user/index.js +4 -4
  74. data/app/javascript/spotlight/user/zpr_links.js +18 -18
  75. data/app/models/spotlight/analytics/ga.rb +0 -1
  76. data/app/models/spotlight/resources/iiif_manifest_v3.rb +2 -2
  77. data/app/services/spotlight/exhibit_import_export_service.rb +0 -2
  78. data/app/views/blacklight/nav/_bookmark.html.erb +1 -1
  79. data/app/views/catalog/_remove_tags.html.erb +1 -1
  80. data/app/views/layouts/spotlight/base.html.erb +1 -1
  81. data/app/views/shared/_header_navbar.html.erb +1 -1
  82. data/app/views/shared/_masthead.html.erb +2 -2
  83. data/app/views/shared/_site_sidebar.html.erb +1 -1
  84. data/app/views/shared/_user_util_links.html.erb +2 -2
  85. data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
  86. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -1
  87. data/app/views/spotlight/admin_users/index.html.erb +11 -9
  88. data/app/views/spotlight/appearances/edit.html.erb +1 -1
  89. data/app/views/spotlight/browse/_search_box.html.erb +1 -1
  90. data/app/views/spotlight/bulk_updates/_download.html.erb +1 -1
  91. data/app/views/spotlight/bulk_updates/_progress_panel.html.erb +6 -6
  92. data/app/views/spotlight/bulk_updates/edit.html.erb +1 -1
  93. data/app/views/spotlight/catalog/_admin_header.html.erb +1 -1
  94. data/app/views/spotlight/catalog/_admin_index_header_default.html.erb +1 -1
  95. data/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb +1 -1
  96. data/app/views/spotlight/catalog/_document.html.erb +2 -2
  97. data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
  98. data/app/views/spotlight/catalog/_edit_sidecar.html.erb +1 -1
  99. data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -1
  100. data/app/views/spotlight/catalog/_reindex_progress_panel.html.erb +6 -6
  101. data/app/views/spotlight/catalog/select_image.html.erb +1 -1
  102. data/app/views/spotlight/contact_mailer/report_problem.html.erb +2 -2
  103. data/app/views/spotlight/exhibits/_contact.html.erb +2 -2
  104. data/app/views/spotlight/exhibits/_delete.html.erb +2 -2
  105. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +1 -1
  106. data/app/views/spotlight/exhibits/_export.html.erb +1 -1
  107. data/app/views/spotlight/exhibits/_form.html.erb +2 -2
  108. data/app/views/spotlight/exhibits/_languages.html.erb +7 -7
  109. data/app/views/spotlight/exhibits/_missing_exhibits.html.erb +1 -1
  110. data/app/views/spotlight/locks/_lock.html.erb +2 -2
  111. data/app/views/spotlight/metadata_configurations/edit.html.erb +1 -1
  112. data/app/views/spotlight/pages/_order_pages.html.erb +3 -3
  113. data/app/views/spotlight/pages/preview.html.erb +1 -1
  114. data/app/views/spotlight/pages/show.html.erb +2 -2
  115. data/app/views/spotlight/resources/_form.html.erb +1 -1
  116. data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
  117. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  118. data/app/views/spotlight/roles/index.html.erb +5 -5
  119. data/app/views/spotlight/search_configurations/_search_fields.html.erb +1 -1
  120. data/app/views/spotlight/search_configurations/edit.html.erb +1 -1
  121. data/app/views/spotlight/searches/index.html.erb +2 -2
  122. data/app/views/spotlight/shared/_configuration_sidebar.html.erb +1 -1
  123. data/app/views/spotlight/shared/_curation_sidebar.html.erb +1 -1
  124. data/app/views/spotlight/shared/_dd3_item.html.erb +1 -1
  125. data/app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb +1 -1
  126. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
  127. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  128. data/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb +2 -2
  129. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  130. data/app/views/spotlight/sir_trevor/blocks/_rule_block.html.erb +1 -1
  131. data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -1
  132. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +1 -1
  133. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +1 -1
  134. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +1 -1
  135. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +1 -1
  136. data/app/views/spotlight/sites/edit_exhibits.html.erb +3 -3
  137. data/app/views/spotlight/translations/_browse_categories.html.erb +2 -2
  138. data/app/views/spotlight/translations/_general.html.erb +21 -21
  139. data/app/views/spotlight/translations/_groups.html.erb +1 -1
  140. data/app/views/spotlight/translations/_metadata.html.erb +8 -8
  141. data/app/views/spotlight/translations/_pages_table.html.erb +2 -2
  142. data/app/views/spotlight/translations/_search_fields.html.erb +13 -13
  143. data/app/views/spotlight/translations/edit.html.erb +5 -5
  144. data/config/importmap.rb +0 -1
  145. data/lib/generators/spotlight/assets/propshaft_generator.rb +0 -1
  146. data/lib/generators/spotlight/templates/solr/conf/admin-extra.html +31 -31
  147. data/lib/spotlight/version.rb +1 -1
  148. data/spec/factories/contact_images.rb +1 -1
  149. data/spec/factories/exhibit_thumbnails.rb +1 -1
  150. data/spec/factories/featured_images.rb +1 -1
  151. data/spec/support/features/test_features_helpers.rb +41 -1
  152. metadata +4 -61
  153. data/app/javascript/spotlight/admin/copy_email_addresses.js +0 -7
  154. data/vendor/assets/javascripts/jquery.waitforimages.min.js +0 -2
@@ -1,33 +1,43 @@
1
- import Iiif from 'spotlight/admin/iiif'
2
- import Core from 'spotlight/core'
3
-
4
- SirTrevor.Blocks.SolrDocumentsBase = (function(){
1
+ import Iiif from "spotlight/admin/iiif"
2
+ import Core from "spotlight/core"
5
3
 
4
+ SirTrevor.Blocks.SolrDocumentsBase = (function () {
6
5
  return Core.Block.Resources.extend({
7
6
  plustextable: true,
8
- autocomplete_url: function() { return this.$instance().closest('form[data-autocomplete-exhibit-catalog-path]').data('autocomplete-exhibit-catalog-path') },
9
- autocomplete_template: function(obj) {
10
- const thumbnail = obj.thumbnail ? `<div class="document-thumbnail"><img class="img-thumbnail" src="${obj.thumbnail}" /></div>` : ''
11
- return `<div class="autocomplete-item${obj.private ? ' blacklight-private' : ''}">${thumbnail}
7
+ autocomplete_url: function () {
8
+ return this.$instance()
9
+ .closest("form[data-autocomplete-exhibit-catalog-path]")
10
+ .data("autocomplete-exhibit-catalog-path")
11
+ },
12
+ autocomplete_template: function (obj) {
13
+ const thumbnail = obj.thumbnail
14
+ ? `<div class="document-thumbnail"><img class="img-thumbnail" src="${obj.thumbnail}" /></div>`
15
+ : ""
16
+ return `<div class="autocomplete-item${obj.private ? " blacklight-private" : ""}">${thumbnail}
12
17
  <span class="autocomplete-title">${this.highlight(obj.title)}</span><br/><small>&nbsp;&nbsp;${this.highlight(obj.description)}</small></div>`
13
18
  },
14
- transform_autocomplete_results: function(response) {
15
- return $.map(response['docs'], function(doc) {
16
- return doc;
19
+ transform_autocomplete_results: function (response) {
20
+ return $.map(response["docs"], function (doc) {
21
+ return doc
17
22
  })
18
23
  },
19
24
 
20
- caption_option_values: function() {
21
- var fields = $('[data-blacklight-configuration-index-fields]').data('blacklight-configuration-index-fields');
25
+ caption_option_values: function () {
26
+ var fields = $("[data-blacklight-configuration-index-fields]").data(
27
+ "blacklight-configuration-index-fields",
28
+ )
22
29
 
23
- return $.map(fields, function(field) {
24
- return $('<option />').val(field.key).text(field.label)[0].outerHTML;
25
- }).join("\n");
30
+ return $.map(fields, function (field) {
31
+ return $("<option />").val(field.key).text(field.label)[0].outerHTML
32
+ }).join("\n")
26
33
  },
27
34
 
28
- item_options: function() { return this.caption_options(); },
35
+ item_options: function () {
36
+ return this.caption_options()
37
+ },
29
38
 
30
- caption_options: function() { return `
39
+ caption_options: function () {
40
+ return `
31
41
  <div class="field-select primary-caption" data-behavior="item-caption-admin">
32
42
  <input name="${this.show_primary_field_key}" type="hidden" value="false" />
33
43
  <input data-input-select-target="#${this.formId(this.primary_field_key)}" name="${this.show_primary_field_key}" id="${this.formId(this.show_primary_field_key)}" type="checkbox" value="true" />
@@ -46,76 +56,125 @@ SirTrevor.Blocks.SolrDocumentsBase = (function(){
46
56
  ${this.caption_option_values()}
47
57
  </select>
48
58
  </div>
49
- `},
59
+ `
60
+ },
50
61
 
51
62
  // Sets the first version of the IIIF information from autocomplete data.
52
- _itemPanelIiifFields: function(index, autocomplete_data) {
63
+ _itemPanelIiifFields: function (index, autocomplete_data) {
53
64
  var iiifFields = [
54
- '<input type="hidden" name="item[' + index + '][thumbnail_image_url]" value="' + (autocomplete_data.thumbnail_image_url || autocomplete_data.thumbnail || "") + '"/>',
55
- '<input type="hidden" name="item[' + index + '][full_image_url]" value="' + (autocomplete_data.full_image_url || autocomplete_data.thumbnail_image_url || autocomplete_data.thumbnail || "") + '"/>',
56
- '<input type="hidden" name="item[' + index + '][iiif_tilesource]" value="' + (autocomplete_data.iiif_tilesource || "") + '"/>',
57
- '<input type="hidden" name="item[' + index + '][iiif_manifest_url]" value="' + (autocomplete_data.iiif_manifest_url || "") + '"/>',
58
- '<input type="hidden" name="item[' + index + '][iiif_canvas_id]" value="' + (autocomplete_data.iiif_canvas_id || "") + '"/>',
59
- '<input type="hidden" name="item[' + index + '][iiif_image_id]" value="' + (autocomplete_data.iiif_image_id || "") + '"/>',
60
- ];
65
+ '<input type="hidden" name="item[' +
66
+ index +
67
+ '][thumbnail_image_url]" value="' +
68
+ (autocomplete_data.thumbnail_image_url ||
69
+ autocomplete_data.thumbnail ||
70
+ "") +
71
+ '"/>',
72
+ '<input type="hidden" name="item[' +
73
+ index +
74
+ '][full_image_url]" value="' +
75
+ (autocomplete_data.full_image_url ||
76
+ autocomplete_data.thumbnail_image_url ||
77
+ autocomplete_data.thumbnail ||
78
+ "") +
79
+ '"/>',
80
+ '<input type="hidden" name="item[' +
81
+ index +
82
+ '][iiif_tilesource]" value="' +
83
+ (autocomplete_data.iiif_tilesource || "") +
84
+ '"/>',
85
+ '<input type="hidden" name="item[' +
86
+ index +
87
+ '][iiif_manifest_url]" value="' +
88
+ (autocomplete_data.iiif_manifest_url || "") +
89
+ '"/>',
90
+ '<input type="hidden" name="item[' +
91
+ index +
92
+ '][iiif_canvas_id]" value="' +
93
+ (autocomplete_data.iiif_canvas_id || "") +
94
+ '"/>',
95
+ '<input type="hidden" name="item[' +
96
+ index +
97
+ '][iiif_image_id]" value="' +
98
+ (autocomplete_data.iiif_image_id || "") +
99
+ '"/>',
100
+ ]
61
101
 
62
102
  // The region input is required for widgets that enable image cropping but not otherwise
63
- if(this.show_image_selection) {
64
- iiifFields.push('<input type="hidden" name="item[' + index + '][iiif_region]" value="' + (autocomplete_data.iiif_region || "") + '"/>');
103
+ if (this.show_image_selection) {
104
+ iiifFields.push(
105
+ '<input type="hidden" name="item[' +
106
+ index +
107
+ '][iiif_region]" value="' +
108
+ (autocomplete_data.iiif_region || "") +
109
+ '"/>',
110
+ )
65
111
  }
66
112
 
67
- return iiifFields.join("\n");
113
+ return iiifFields.join("\n")
68
114
  },
69
115
  // Overwrites the hidden inputs from _itemPanelIiifFields with data from the
70
116
  // manifest. Called by afterPanelRender - the manifest_data here is built
71
117
  // from canvases in the manifest, transformed by spotlight/admin/iiif.js in
72
118
  // the #images method.
73
- setIiifFields: function(panel, manifest_data, initialize) {
74
- var legacyThumbnailField = $(panel).find('[name$="[thumbnail_image_url]"]')
119
+ setIiifFields: function (panel, manifest_data, initialize) {
120
+ var legacyThumbnailField = $(panel).find(
121
+ '[name$="[thumbnail_image_url]"]',
122
+ )
75
123
  var legacyFullField = $(panel).find('[name$="[full_image_url]"]')
76
124
 
77
125
  if (initialize && legacyThumbnailField.val().length > 0) {
78
- return;
126
+ return
79
127
  }
80
128
 
81
- legacyThumbnailField.val("");
82
- legacyFullField.val("");
83
- $(panel).find('[name$="[iiif_image_id]"]').val(manifest_data.imageId);
84
- $(panel).find('[name$="[iiif_tilesource]"]').val(manifest_data.tilesource);
85
- $(panel).find('[name$="[iiif_manifest_url]"]').val(manifest_data.manifest);
86
- $(panel).find('[name$="[iiif_canvas_id]"]').val(manifest_data.canvasId);
87
- $(panel).find('img.img-thumbnail').attr('src', manifest_data.thumbnail_image_url || manifest_data.tilesource.replace("/info.json", "/full/100,100/0/default.jpg"));
129
+ legacyThumbnailField.val("")
130
+ legacyFullField.val("")
131
+ $(panel).find('[name$="[iiif_image_id]"]').val(manifest_data.imageId)
132
+ $(panel).find('[name$="[iiif_tilesource]"]').val(manifest_data.tilesource)
133
+ $(panel).find('[name$="[iiif_manifest_url]"]').val(manifest_data.manifest)
134
+ $(panel).find('[name$="[iiif_canvas_id]"]').val(manifest_data.canvasId)
135
+ $(panel)
136
+ .find("img.img-thumbnail")
137
+ .attr(
138
+ "src",
139
+ manifest_data.thumbnail_image_url ||
140
+ manifest_data.tilesource.replace(
141
+ "/info.json",
142
+ "/full/100,100/0/default.jpg",
143
+ ),
144
+ )
88
145
  },
89
- afterPanelRender: function(data, panel) {
90
- var context = this;
91
- var manifestUrl = data.iiif_manifest || data.iiif_manifest_url;
146
+ afterPanelRender: function (data, panel) {
147
+ var context = this
148
+ var manifestUrl = data.iiif_manifest || data.iiif_manifest_url
92
149
 
93
150
  if (!manifestUrl) {
94
- $(panel).find('[name$="[thumbnail_image_url]"]').val(data.thumbnail_image_url || data.thumbnail);
95
- $(panel).find('[name$="[full_image_url]"]').val(data.full_image_url);
151
+ $(panel)
152
+ .find('[name$="[thumbnail_image_url]"]')
153
+ .val(data.thumbnail_image_url || data.thumbnail)
154
+ $(panel).find('[name$="[full_image_url]"]').val(data.full_image_url)
96
155
 
97
- return;
156
+ return
98
157
  }
99
158
 
100
- $.ajax(manifestUrl).done(
101
- function(manifest) {
102
- var iiifManifest = new Iiif(manifestUrl, manifest);
103
-
104
- var thumbs = iiifManifest.imagesArray();
159
+ $.ajax(manifestUrl).done(function (manifest) {
160
+ var iiifManifest = new Iiif(manifestUrl, manifest)
105
161
 
106
- if (!data.iiif_image_id) {
107
- context.setIiifFields(panel, thumbs[0], !!data.iiif_manifest_url);
108
- }
162
+ var thumbs = iiifManifest.imagesArray()
109
163
 
110
-
111
- if(thumbs.length > 1) {
112
- panel.multiImageSelector(thumbs, function(selectorImage) {
113
- context.setIiifFields(panel, selectorImage, false);
114
- }, data.iiif_image_id);
115
- }
164
+ if (!data.iiif_image_id) {
165
+ context.setIiifFields(panel, thumbs[0], !!data.iiif_manifest_url)
116
166
  }
117
- );
118
- }
119
- });
120
167
 
121
- })();
168
+ if (thumbs.length > 1) {
169
+ panel.multiImageSelector(
170
+ thumbs,
171
+ function (selectorImage) {
172
+ context.setIiifFields(panel, selectorImage, false)
173
+ },
174
+ data.iiif_image_id,
175
+ )
176
+ }
177
+ })
178
+ },
179
+ })
180
+ })()
@@ -1,13 +1,14 @@
1
- SirTrevor.Blocks.SolrDocuments = (function(){
2
-
1
+ SirTrevor.Blocks.SolrDocuments = (function () {
3
2
  return SirTrevor.Blocks.SolrDocumentsBase.extend({
4
3
  type: "solr_documents",
5
4
 
6
5
  icon_name: "items",
7
6
 
8
- item_options: function() { return this.caption_options() + this.zpr_option(); },
7
+ item_options: function () {
8
+ return this.caption_options() + this.zpr_option()
9
+ },
9
10
 
10
- zpr_option: function() {
11
+ zpr_option: function () {
11
12
  return `
12
13
  <div>
13
14
  <input name="${this.zpr_key}" type="hidden" value="false" />
@@ -17,7 +18,6 @@ SirTrevor.Blocks.SolrDocuments = (function(){
17
18
  `
18
19
  },
19
20
 
20
- zpr_key: 'zpr_link'
21
- });
22
-
23
- })();
21
+ zpr_key: "zpr_link",
22
+ })
23
+ })()
@@ -1,5 +1,4 @@
1
- SirTrevor.Blocks.SolrDocumentsCarousel = (function(){
2
-
1
+ SirTrevor.Blocks.SolrDocumentsCarousel = (function () {
3
2
  return SirTrevor.Blocks.SolrDocumentsBase.extend({
4
3
  plustextable: false,
5
4
  type: "solr_documents_carousel",
@@ -11,16 +10,16 @@ SirTrevor.Blocks.SolrDocumentsCarousel = (function(){
11
10
  max_height_key: "max-height",
12
11
 
13
12
  carouselCycleTimesInSeconds: {
14
- values: [ 3, 5, 8, 12, 20 ],
15
- selected: 5
13
+ values: [3, 5, 8, 12, 20],
14
+ selected: 5,
16
15
  },
17
16
 
18
17
  carouselMaxHeights: {
19
- values: { 'Small': 'small', 'Medium': 'medium', 'Large': 'large' },
20
- selected: 'Medium'
18
+ values: { Small: "small", Medium: "medium", Large: "large" },
19
+ selected: "Medium",
21
20
  },
22
21
 
23
- item_options: function() {
22
+ item_options: function () {
24
23
  return `${this.caption_options()}
25
24
  <div class="field-select auto-cycle-images" data-behavior="auto-cycle-images">
26
25
  <input name="${this.auto_play_images_key}" type="hidden" value="false" />
@@ -37,62 +36,83 @@ SirTrevor.Blocks.SolrDocumentsCarousel = (function(){
37
36
  </div>`
38
37
  },
39
38
 
40
- addCarouselCycleOptions: function(options) {
41
- var html = '';
39
+ addCarouselCycleOptions: function (options) {
40
+ var html = ""
42
41
 
43
- $.each(options.values, function(index, interval) {
44
- var selected = (interval === options.selected) ? 'selected' : '',
45
- intervalInMilliSeconds = parseInt(interval, 10) * 1000;
42
+ $.each(options.values, function (index, interval) {
43
+ var selected = interval === options.selected ? "selected" : "",
44
+ intervalInMilliSeconds = parseInt(interval, 10) * 1000
46
45
 
47
- html += '<option value="' + intervalInMilliSeconds + '" ' + selected + '>' + interval + ' seconds</option>';
48
- });
46
+ html +=
47
+ '<option value="' +
48
+ intervalInMilliSeconds +
49
+ '" ' +
50
+ selected +
51
+ ">" +
52
+ interval +
53
+ " seconds</option>"
54
+ })
49
55
 
50
- return html;
56
+ return html
51
57
  },
52
58
 
53
- addCarouselMaxHeightOptions: function(options) {
54
- var html = '',
55
- _this = this;
56
-
57
- $.each(options.values, function(size, px) {
58
- var checked = (size === options.selected) ? 'checked' : '',
59
- id = _this.formId(_this.max_height_key)
60
-
61
- html += '<input data-key="' + _this.max_height_key + '" type="radio" name="' + id + '" value="' + px + '" id="' + id + '" ' + checked + '>';
62
- html += '<label class="carousel-size" for="' + id + '">' + size + '</label>';
63
- });
64
-
65
- return html;
59
+ addCarouselMaxHeightOptions: function (options) {
60
+ var html = "",
61
+ _this = this
62
+
63
+ $.each(options.values, function (size, px) {
64
+ var checked = size === options.selected ? "checked" : "",
65
+ id = _this.formId(_this.max_height_key)
66
+
67
+ html +=
68
+ '<input data-key="' +
69
+ _this.max_height_key +
70
+ '" type="radio" name="' +
71
+ id +
72
+ '" value="' +
73
+ px +
74
+ '" id="' +
75
+ id +
76
+ '" ' +
77
+ checked +
78
+ ">"
79
+ html +=
80
+ '<label class="carousel-size" for="' + id + '">' + size + "</label>"
81
+ })
82
+
83
+ return html
66
84
  },
67
85
 
68
- afterPreviewLoad: function(options) {
69
- $(this.inner).find('.carousel').carousel();
86
+ afterPreviewLoad: function (_options) {
87
+ $(this.inner).find(".carousel").carousel()
70
88
 
71
89
  // the bootstrap carousel only initializes data-bs-slide widgets on page load, so we need
72
90
  // to initialize them ourselves..
73
91
  var clickHandler = function (e) {
74
92
  var href
75
- var $this = $(this)
76
- var $target = $($this.attr('data-bs-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
77
- if (!$target.hasClass('carousel')) return
93
+ var $this = $(this)
94
+ var $target = $(
95
+ $this.attr("data-bs-target") ||
96
+ ((href = $this.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, "")),
97
+ ) // strip for ie7
98
+ if (!$target.hasClass("carousel")) return
78
99
  var options = $.extend({}, $target.data(), $this.data())
79
- var slideIndex = $this.attr('data-bs-slide-to')
100
+ var slideIndex = $this.attr("data-bs-slide-to")
80
101
  if (slideIndex) options.interval = false
81
102
 
82
103
  $.fn.carousel.call($target, options)
83
104
 
84
105
  if (slideIndex) {
85
- $target.data('bs.carousel').to(slideIndex)
106
+ $target.data("bs.carousel").to(slideIndex)
86
107
  }
87
108
 
88
109
  e.preventDefault()
89
110
  }
90
111
 
91
- $(this.inner).find('.carousel')
92
- .on('click.bs.carousel.data-api', '[data-bs-slide]', clickHandler)
93
- .on('click.bs.carousel.data-api', '[data-bs-slide-to]', clickHandler)
94
- }
95
-
96
- });
97
-
98
- })();
112
+ $(this.inner)
113
+ .find(".carousel")
114
+ .on("click.bs.carousel.data-api", "[data-bs-slide]", clickHandler)
115
+ .on("click.bs.carousel.data-api", "[data-bs-slide-to]", clickHandler)
116
+ },
117
+ })
118
+ })()
@@ -1,15 +1,15 @@
1
- SirTrevor.Blocks.SolrDocumentsEmbed = (function(){
2
-
1
+ SirTrevor.Blocks.SolrDocumentsEmbed = (function () {
3
2
  return SirTrevor.Blocks.SolrDocumentsBase.extend({
4
3
  type: "solr_documents_embed",
5
4
  icon_name: "item_embed",
6
5
  show_image_selection: false,
7
6
 
8
- item_options: function() { return "" },
9
-
10
- afterPreviewLoad: function(options) {
11
- $(this.inner).find('picture[data-openseadragon]').openseadragon();
12
- }
13
- });
7
+ item_options: function () {
8
+ return ""
9
+ },
14
10
 
15
- })();
11
+ afterPreviewLoad: function (_options) {
12
+ this.inner.querySelector("picture[data-openseadragon]").openseadragon()
13
+ },
14
+ })
15
+ })()
@@ -1,38 +1,39 @@
1
- SirTrevor.Blocks.SolrDocumentsFeatures = (function(){
2
-
1
+ SirTrevor.Blocks.SolrDocumentsFeatures = (function () {
3
2
  return SirTrevor.Blocks.SolrDocumentsBase.extend({
4
3
  plustextable: false,
5
4
  type: "solr_documents_features",
6
5
 
7
6
  icon_name: "item_features",
8
7
 
9
- afterPreviewLoad: function(options) {
10
- $(this.inner).find('.carousel').carousel();
8
+ afterPreviewLoad: function (_options) {
9
+ $(this.inner).find(".carousel").carousel()
11
10
 
12
11
  // the bootstrap carousel only initializes data-bs-slide widgets on page load, so we need
13
12
  // to initialize them ourselves..
14
13
  var clickHandler = function (e) {
15
14
  var href
16
- var $this = $(this)
17
- var $target = $($this.attr('data-bs-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
18
- if (!$target.hasClass('carousel')) return
15
+ var $this = $(this)
16
+ var $target = $(
17
+ $this.attr("data-bs-target") ||
18
+ ((href = $this.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, "")),
19
+ ) // strip for ie7
20
+ if (!$target.hasClass("carousel")) return
19
21
  var options = $.extend({}, $target.data(), $this.data())
20
- var slideIndex =$this.attr('data-bs-slide-to')
22
+ var slideIndex = $this.attr("data-bs-slide-to")
21
23
  if (slideIndex) options.interval = false
22
24
 
23
25
  $.fn.carousel.call($target, options)
24
26
 
25
27
  if (slideIndex) {
26
- $target.data('bs.carousel').to(slideIndex)
28
+ $target.data("bs.carousel").to(slideIndex)
27
29
  }
28
30
 
29
31
  e.preventDefault()
30
32
  }
31
33
 
32
- $(this.inner).find('.carousel')
33
- .on('click.bs.carousel.data-api', '[data-bs-slide-to]', clickHandler)
34
- }
35
-
36
- });
37
-
38
- })();
34
+ $(this.inner)
35
+ .find(".carousel")
36
+ .on("click.bs.carousel.data-api", "[data-bs-slide-to]", clickHandler)
37
+ },
38
+ })
39
+ })()
@@ -1,12 +1,11 @@
1
- SirTrevor.Blocks.SolrDocumentsGrid = (function(){
2
-
1
+ SirTrevor.Blocks.SolrDocumentsGrid = (function () {
3
2
  return SirTrevor.Blocks.SolrDocumentsBase.extend({
4
3
  type: "solr_documents_grid",
5
4
 
6
5
  icon_name: "item_grid",
7
6
 
8
-
9
- item_options: function() { return "" }
10
- });
11
-
12
- })();
7
+ item_options: function () {
8
+ return ""
9
+ },
10
+ })
11
+ })()