blacklight-spotlight 5.3.0 → 5.3.1

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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +1679 -1228
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +1682 -1231
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/components/spotlight/analytics/aggregation_component.html.erb +1 -1
  8. data/app/components/spotlight/document_admin_table_component.html.erb +2 -2
  9. data/app/components/spotlight/edit_view_links_component.html.erb +1 -1
  10. data/app/components/spotlight/header_component.html.erb +1 -1
  11. data/app/components/spotlight/tag_list_form_component.html.erb +1 -1
  12. data/app/components/spotlight/tag_selector_component.html.erb +2 -2
  13. data/app/components/spotlight/translations/subheading_component.html.erb +1 -1
  14. data/app/controllers/spotlight/resources_controller.rb +1 -1
  15. data/app/javascript/spotlight/admin/add_another.js +22 -15
  16. data/app/javascript/spotlight/admin/add_image_selector.js +27 -25
  17. data/app/javascript/spotlight/admin/add_new_button.js +47 -43
  18. data/app/javascript/spotlight/admin/blacklight_configuration.js +52 -38
  19. data/app/javascript/spotlight/admin/block_mixins/autocompleteable.js +68 -60
  20. data/app/javascript/spotlight/admin/block_mixins/formable.js +55 -47
  21. data/app/javascript/spotlight/admin/block_mixins/plustextable.js +19 -20
  22. data/app/javascript/spotlight/admin/blocks/block.js +20 -16
  23. data/app/javascript/spotlight/admin/blocks/browse_block.js +42 -37
  24. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +33 -31
  25. data/app/javascript/spotlight/admin/blocks/iframe_block.js +14 -11
  26. data/app/javascript/spotlight/admin/blocks/link_to_search_block.js +4 -7
  27. data/app/javascript/spotlight/admin/blocks/oembed_block.js +13 -10
  28. data/app/javascript/spotlight/admin/blocks/pages_block.js +20 -13
  29. data/app/javascript/spotlight/admin/blocks/resources_block.js +150 -117
  30. data/app/javascript/spotlight/admin/blocks/rule_block.js +11 -10
  31. data/app/javascript/spotlight/admin/blocks/search_result_block.js +16 -17
  32. data/app/javascript/spotlight/admin/blocks/solr_documents_base_block.js +123 -64
  33. data/app/javascript/spotlight/admin/blocks/solr_documents_block.js +8 -8
  34. data/app/javascript/spotlight/admin/blocks/solr_documents_carousel_block.js +63 -43
  35. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +9 -9
  36. data/app/javascript/spotlight/admin/blocks/solr_documents_features_block.js +17 -16
  37. data/app/javascript/spotlight/admin/blocks/solr_documents_grid_block.js +6 -7
  38. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +84 -64
  39. data/app/javascript/spotlight/admin/crop.js +203 -156
  40. data/app/javascript/spotlight/admin/croppable.js +4 -4
  41. data/app/javascript/spotlight/admin/croppable_modal.js +59 -37
  42. data/app/javascript/spotlight/admin/edit_in_place.js +50 -47
  43. data/app/javascript/spotlight/admin/exhibits.js +52 -41
  44. data/app/javascript/spotlight/admin/form_observer.js +59 -53
  45. data/app/javascript/spotlight/admin/iiif.js +26 -25
  46. data/app/javascript/spotlight/admin/index.js +44 -47
  47. data/app/javascript/spotlight/admin/locks.js +14 -14
  48. data/app/javascript/spotlight/admin/multi_image_selector.js +127 -111
  49. data/app/javascript/spotlight/admin/pages.js +21 -21
  50. data/app/javascript/spotlight/admin/progress_monitor.js +67 -65
  51. data/app/javascript/spotlight/admin/readonly_checkbox.js +3 -3
  52. data/app/javascript/spotlight/admin/search_typeahead.js +55 -43
  53. data/app/javascript/spotlight/admin/select_related_input.js +17 -17
  54. data/app/javascript/spotlight/admin/sir-trevor/block_controls.js +100 -84
  55. data/app/javascript/spotlight/admin/sir-trevor/block_limits.js +36 -31
  56. data/app/javascript/spotlight/admin/sir-trevor/locales.js +52 -39
  57. data/app/javascript/spotlight/admin/spotlight_nestable.js +112 -90
  58. data/app/javascript/spotlight/admin/tabs.js +16 -3
  59. data/app/javascript/spotlight/admin/translation_progress.js +13 -7
  60. data/app/javascript/spotlight/admin/users.js +41 -41
  61. data/app/javascript/spotlight/admin/visibility_toggle.js +4 -4
  62. data/app/javascript/spotlight/controllers/clipboard_controller.js +14 -0
  63. data/app/javascript/spotlight/controllers/index.js +4 -2
  64. data/app/javascript/spotlight/controllers/tag_selector_controller.js +116 -79
  65. data/app/javascript/spotlight/core.js +18 -15
  66. data/app/javascript/spotlight/index.js +4 -4
  67. data/app/javascript/spotlight/user/browse_group_categories.js +24 -22
  68. data/app/javascript/spotlight/user/carousel.js +23 -19
  69. data/app/javascript/spotlight/user/clear_form_button.js +15 -15
  70. data/app/javascript/spotlight/user/index.js +4 -4
  71. data/app/javascript/spotlight/user/zpr_links.js +18 -18
  72. data/app/models/spotlight/analytics/ga.rb +0 -1
  73. data/app/models/spotlight/resources/iiif_manifest_v3.rb +2 -2
  74. data/app/services/spotlight/exhibit_import_export_service.rb +0 -2
  75. data/app/views/blacklight/nav/_bookmark.html.erb +1 -1
  76. data/app/views/catalog/_remove_tags.html.erb +1 -1
  77. data/app/views/layouts/spotlight/base.html.erb +1 -1
  78. data/app/views/shared/_header_navbar.html.erb +1 -1
  79. data/app/views/shared/_masthead.html.erb +2 -2
  80. data/app/views/shared/_site_sidebar.html.erb +1 -1
  81. data/app/views/shared/_user_util_links.html.erb +2 -2
  82. data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
  83. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -1
  84. data/app/views/spotlight/admin_users/index.html.erb +11 -9
  85. data/app/views/spotlight/appearances/edit.html.erb +1 -1
  86. data/app/views/spotlight/browse/_search_box.html.erb +1 -1
  87. data/app/views/spotlight/bulk_updates/_download.html.erb +1 -1
  88. data/app/views/spotlight/bulk_updates/_progress_panel.html.erb +6 -6
  89. data/app/views/spotlight/bulk_updates/edit.html.erb +1 -1
  90. data/app/views/spotlight/catalog/_admin_header.html.erb +1 -1
  91. data/app/views/spotlight/catalog/_admin_index_header_default.html.erb +1 -1
  92. data/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb +1 -1
  93. data/app/views/spotlight/catalog/_document.html.erb +2 -2
  94. data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
  95. data/app/views/spotlight/catalog/_edit_sidecar.html.erb +1 -1
  96. data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -1
  97. data/app/views/spotlight/catalog/_reindex_progress_panel.html.erb +6 -6
  98. data/app/views/spotlight/catalog/select_image.html.erb +1 -1
  99. data/app/views/spotlight/contact_mailer/report_problem.html.erb +2 -2
  100. data/app/views/spotlight/exhibits/_contact.html.erb +2 -2
  101. data/app/views/spotlight/exhibits/_delete.html.erb +2 -2
  102. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +1 -1
  103. data/app/views/spotlight/exhibits/_export.html.erb +1 -1
  104. data/app/views/spotlight/exhibits/_form.html.erb +2 -2
  105. data/app/views/spotlight/exhibits/_languages.html.erb +7 -7
  106. data/app/views/spotlight/exhibits/_missing_exhibits.html.erb +1 -1
  107. data/app/views/spotlight/locks/_lock.html.erb +2 -2
  108. data/app/views/spotlight/metadata_configurations/edit.html.erb +1 -1
  109. data/app/views/spotlight/pages/_order_pages.html.erb +3 -3
  110. data/app/views/spotlight/pages/preview.html.erb +1 -1
  111. data/app/views/spotlight/pages/show.html.erb +2 -2
  112. data/app/views/spotlight/resources/_form.html.erb +1 -1
  113. data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
  114. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  115. data/app/views/spotlight/roles/index.html.erb +5 -5
  116. data/app/views/spotlight/search_configurations/_search_fields.html.erb +1 -1
  117. data/app/views/spotlight/search_configurations/edit.html.erb +1 -1
  118. data/app/views/spotlight/searches/index.html.erb +2 -2
  119. data/app/views/spotlight/shared/_configuration_sidebar.html.erb +1 -1
  120. data/app/views/spotlight/shared/_curation_sidebar.html.erb +1 -1
  121. data/app/views/spotlight/shared/_dd3_item.html.erb +1 -1
  122. data/app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb +1 -1
  123. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
  124. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  125. data/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb +2 -2
  126. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  127. data/app/views/spotlight/sir_trevor/blocks/_rule_block.html.erb +1 -1
  128. data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -1
  129. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +1 -1
  130. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +1 -1
  131. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +1 -1
  132. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +1 -1
  133. data/app/views/spotlight/sites/edit_exhibits.html.erb +3 -3
  134. data/app/views/spotlight/translations/_browse_categories.html.erb +2 -2
  135. data/app/views/spotlight/translations/_general.html.erb +21 -21
  136. data/app/views/spotlight/translations/_groups.html.erb +1 -1
  137. data/app/views/spotlight/translations/_metadata.html.erb +8 -8
  138. data/app/views/spotlight/translations/_pages_table.html.erb +2 -2
  139. data/app/views/spotlight/translations/_search_fields.html.erb +13 -13
  140. data/app/views/spotlight/translations/edit.html.erb +5 -5
  141. data/config/importmap.rb +0 -1
  142. data/lib/generators/spotlight/assets/propshaft_generator.rb +0 -1
  143. data/lib/generators/spotlight/templates/solr/conf/admin-extra.html +31 -31
  144. data/lib/spotlight/version.rb +1 -1
  145. data/spec/factories/contact_images.rb +1 -1
  146. data/spec/factories/exhibit_thumbnails.rb +1 -1
  147. data/spec/factories/featured_images.rb +1 -1
  148. data/spec/support/features/test_features_helpers.rb +10 -1
  149. metadata +4 -61
  150. data/app/javascript/spotlight/admin/copy_email_addresses.js +0 -7
  151. data/vendor/assets/javascripts/jquery.waitforimages.min.js +0 -2
@@ -1,78 +1,86 @@
1
- (function ($){
2
- SirTrevor.BlockMixins.Formable = {
1
+ ;(function ($) {
2
+ ;((SirTrevor.BlockMixins.Formable = {
3
3
  mixinName: "Formable",
4
4
  preload: true,
5
5
 
6
- initializeFormable: function() {
7
-
8
- if (this['afterLoadData'] === undefined) {
9
- this['afterLoadData'] = function(data) { };
6
+ initializeFormable: function () {
7
+ if (this["afterLoadData"] === undefined) {
8
+ this["afterLoadData"] = function (_data) {}
10
9
  }
11
10
  },
12
11
 
13
- formId: function(id) {
14
- return this.blockID + "_" + id;
12
+ formId: function (id) {
13
+ return this.blockID + "_" + id
15
14
  },
16
15
 
17
- _serializeData: function() {
18
-
19
- var data = $(":input,textarea,select", this.inner).not(':input:radio').serializeJSON();
16
+ _serializeData: function () {
17
+ var data = $(":input,textarea,select", this.inner)
18
+ .not(":input:radio")
19
+ .serializeJSON()
20
20
 
21
- $(':input:radio:checked', this.inner).each(function(index, input) {
22
- var key = $(input).data('key') || input.getAttribute('name');
21
+ $(":input:radio:checked", this.inner).each(function (index, input) {
22
+ var key = $(input).data("key") || input.getAttribute("name")
23
23
 
24
24
  if (!key.match("\\[")) {
25
- data[key] = $(input).val();
25
+ data[key] = $(input).val()
26
26
  }
27
- });
27
+ })
28
28
 
29
29
  /* Simple to start. Add conditions later */
30
30
  if (this.hasTextBlock()) {
31
- data.text = this.getTextBlockHTML();
32
- data.format = 'html';
33
- if (data.text && data.text.length > 0 && this.options.convertToMarkdown) {
34
- data.text = stToMarkdown(data.text, this.type);
35
- data.format = 'markdown';
31
+ data.text = this.getTextBlockHTML()
32
+ data.format = "html"
33
+ if (
34
+ data.text &&
35
+ data.text.length > 0 &&
36
+ this.options.convertToMarkdown
37
+ ) {
38
+ data.text = stToMarkdown(data.text, this.type)
39
+ data.format = "markdown"
36
40
  }
37
41
  }
38
42
 
39
- return data;
43
+ return data
40
44
  },
41
45
 
42
- loadData: function(data){
46
+ loadData: function (data) {
43
47
  if (this.hasTextBlock()) {
44
- if (data.text && data.text.length > 0 && this.options.convertFromMarkdown && data.format !== "html") {
45
- this.setTextBlockHTML(SirTrevor.toHTML(data.text, this.type));
48
+ if (
49
+ data.text &&
50
+ data.text.length > 0 &&
51
+ this.options.convertFromMarkdown &&
52
+ data.format !== "html"
53
+ ) {
54
+ this.setTextBlockHTML(SirTrevor.toHTML(data.text, this.type))
46
55
  } else {
47
- this.setTextBlockHTML(data.text);
56
+ this.setTextBlockHTML(data.text)
48
57
  }
49
58
  }
50
- this.loadFormDataByKey(data);
51
- this.afterLoadData(data);
59
+ this.loadFormDataByKey(data)
60
+ this.afterLoadData(data)
52
61
  },
53
62
 
54
- loadFormDataByKey: function(data) {
55
- $(':input', this.inner).not('button,:input[type=hidden]').each(function(index, input) {
56
- var key = $(input).data('key') || input.getAttribute('name');
63
+ loadFormDataByKey: function (data) {
64
+ $(":input", this.inner)
65
+ .not("button,:input[type=hidden]")
66
+ .each(function (index, input) {
67
+ var key = $(input).data("key") || input.getAttribute("name")
57
68
 
58
- if (key) {
59
-
60
- if (key.match("\\[\\]$")) {
61
- key = key.replace("[]", "");
62
- }
69
+ if (key) {
70
+ if (key.match("\\[\\]$")) {
71
+ key = key.replace("[]", "")
72
+ }
63
73
 
64
- // by wrapping it in an array, this'll "just work" for radio and checkbox fields too
65
- var input_data = data[key];
74
+ // by wrapping it in an array, this'll "just work" for radio and checkbox fields too
75
+ var input_data = data[key]
66
76
 
67
- if (!(input_data instanceof Array)) {
68
- input_data = [input_data];
77
+ if (!(input_data instanceof Array)) {
78
+ input_data = [input_data]
79
+ }
80
+ $(this).val(input_data)
69
81
  }
70
- $(this).val(input_data);
71
- }
72
- });
82
+ })
73
83
  },
74
- },
75
-
76
-
77
- SirTrevor.Block.prototype.availableMixins.push("formable");
78
- })(jQuery);
84
+ }),
85
+ SirTrevor.Block.prototype.availableMixins.push("formable"))
86
+ })(jQuery)
@@ -1,23 +1,23 @@
1
- (function ($){
1
+ ;(function (_$) {
2
2
  SirTrevor.BlockMixins.Plustextable = {
3
3
  mixinName: "Textable",
4
4
  preload: true,
5
5
 
6
- initializeTextable: function() {
7
- if (this['formId'] === undefined) {
8
- this.withMixin(SirTrevor.BlockMixins.Formable);
6
+ initializeTextable: function () {
7
+ if (this["formId"] === undefined) {
8
+ this.withMixin(SirTrevor.BlockMixins.Formable)
9
9
  }
10
-
11
- if (this['show_heading'] === undefined) {
12
- this.show_heading = true;
10
+
11
+ if (this["show_heading"] === undefined) {
12
+ this.show_heading = true
13
13
  }
14
14
  },
15
-
16
- align_key:"text-align",
17
- text_key:"item-text",
15
+
16
+ align_key: "text-align",
17
+ text_key: "item-text",
18
18
  heading_key: "title",
19
-
20
- text_area: function() {
19
+
20
+ text_area: function () {
21
21
  return `
22
22
  <div class="row">
23
23
  <div class="col-md-8">
@@ -40,19 +40,18 @@
40
40
  </div>
41
41
  </div>`
42
42
  },
43
-
44
- heading: function() {
45
- if(this.show_heading) {
43
+
44
+ heading: function () {
45
+ if (this.show_heading) {
46
46
  return `<div class="field">
47
47
  <label for="${this.formId(this.heading_key)}" class="col-form-label">${i18n.t("blocks:textable:heading")}</label>
48
48
  <input type="text" class="form-control" id="${this.formId(this.heading_key)}" name="${this.heading_key}" />
49
49
  </div>`
50
50
  } else {
51
- return "";
51
+ return ""
52
52
  }
53
53
  },
54
- };
55
-
54
+ }
56
55
 
57
- SirTrevor.Block.prototype.availableMixins.push("plustextable");
58
- })(jQuery);
56
+ SirTrevor.Block.prototype.availableMixins.push("plustextable")
57
+ })(jQuery)
@@ -1,25 +1,29 @@
1
- import Core from 'spotlight/core'
2
-
3
- (function ($){
1
+ import Core from "spotlight/core"
2
+ ;(function ($) {
4
3
  Core.Block = SirTrevor.Block.extend({
5
4
  scribeOptions: {
6
5
  allowBlockElements: true,
7
- tags: { p: true }
6
+ tags: { p: true },
8
7
  },
9
8
  formable: true,
10
- editorHTML: function() {
11
- return '';
9
+ editorHTML: function () {
10
+ return ""
12
11
  },
13
- beforeBlockRender: function() {
14
- this.availableMixins.forEach(function(mixin) {
15
- if (this[mixin] && SirTrevor.BlockMixins[this.capitalize(mixin)].preload) {
16
- this.withMixin(SirTrevor.BlockMixins[this.capitalize(mixin)]);
12
+ beforeBlockRender: function () {
13
+ this.availableMixins.forEach(function (mixin) {
14
+ if (
15
+ this[mixin] &&
16
+ SirTrevor.BlockMixins[this.capitalize(mixin)].preload
17
+ ) {
18
+ this.withMixin(SirTrevor.BlockMixins[this.capitalize(mixin)])
17
19
  }
18
- }, this);
20
+ }, this)
21
+ },
22
+ $instance: function () {
23
+ return $("#" + this.instanceID)
24
+ },
25
+ capitalize: function (string) {
26
+ return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase()
19
27
  },
20
- $instance: function() { return $('#' + this.instanceID); },
21
- capitalize: function(string) {
22
- return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
23
- }
24
28
  })
25
- })(jQuery);
29
+ })(jQuery)
@@ -1,40 +1,46 @@
1
- import Core from 'spotlight/core'
2
-
3
- SirTrevor.Blocks.Browse = (function(){
1
+ import Core from "spotlight/core"
4
2
 
3
+ SirTrevor.Blocks.Browse = (function () {
5
4
  return Core.Block.Resources.extend({
6
5
  type: "browse",
7
6
 
8
7
  icon_name: "browse",
9
8
 
10
- autocomplete_url: function() {
11
- return document.getElementById(this.instanceID).closest('form[data-autocomplete-exhibit-searches-path]').dataset.autocompleteExhibitSearchesPath;
9
+ autocomplete_url: function () {
10
+ return document
11
+ .getElementById(this.instanceID)
12
+ .closest("form[data-autocomplete-exhibit-searches-path]").dataset
13
+ .autocompleteExhibitSearchesPath
12
14
  },
13
15
 
14
- autocomplete_fetch: function(url) {
15
- return this.fetchOnceAndFilterLocalResults(url);
16
+ autocomplete_fetch: function (url) {
17
+ return this.fetchOnceAndFilterLocalResults(url)
16
18
  },
17
19
 
18
- autocomplete_template: function(obj) {
19
- const thumbnail = obj.thumbnail_image_url ? `<div class="document-thumbnail"><img class="img-thumbnail" src="${obj.thumbnail_image_url}" /></div>` : ''
20
- const description = obj.description ? `<small>&nbsp;&nbsp;${obj.description}</small>` : '';
21
- return `<div class="autocomplete-item${!obj.published ? ' blacklight-private' : ''}">${thumbnail}
22
- <span class="autocomplete-title">${this.highlight(obj.full_title)}</span>${description}</div>`;
20
+ autocomplete_template: function (obj) {
21
+ const thumbnail = obj.thumbnail_image_url
22
+ ? `<div class="document-thumbnail"><img class="img-thumbnail" src="${obj.thumbnail_image_url}" /></div>`
23
+ : ""
24
+ const description = obj.description
25
+ ? `<small>&nbsp;&nbsp;${obj.description}</small>`
26
+ : ""
27
+ return `<div class="autocomplete-item${!obj.published ? " blacklight-private" : ""}">${thumbnail}
28
+ <span class="autocomplete-title">${this.highlight(obj.full_title)}</span>${description}</div>`
23
29
  },
24
30
 
25
- _itemPanel: function(data) {
26
- var index = "item_" + this.globalIndex++;
27
- var checked;
31
+ _itemPanel: function (data) {
32
+ var index = "item_" + this.globalIndex++
33
+ var checked
28
34
  if (data.display == "true") {
29
35
  checked = "checked='checked'"
30
36
  } else {
31
- checked = "";
37
+ checked = ""
32
38
  }
33
- var resource_id = data.slug || data.id;
39
+ var resource_id = data.slug || data.id
34
40
  var markup = `
35
41
  <li class="field dd-item dd3-item" data-resource-id="${resource_id}" data-id="${index}" id="${this.formId(index)}">
36
42
  <input type="hidden" name="item[${index}][id]" value="${resource_id}" />
37
- <input type="hidden" name="item[${index}][full_title]" value="${(data.full_title || data.title)}" />
43
+ <input type="hidden" name="item[${index}][full_title]" value="${data.full_title || data.title}" />
38
44
  <input data-property="weight" type="hidden" name="item[${index}][weight]" value="${data.weight}" />
39
45
  <div class="card d-flex dd3-content">
40
46
  <div class="dd-handle dd3-handle">${i18n.t("blocks:resources:panel:drag")}</div>
@@ -42,15 +48,15 @@ SirTrevor.Blocks.Browse = (function(){
42
48
  <div class="d-flex">
43
49
  <div class="checkbox">
44
50
  <input name="item[${index}][display]" type="hidden" value="false" />
45
- <input name="item[${index}][display]" id="${this.formId(this.display_checkbox + '_' + data.id)}" type="checkbox" ${checked} class="item-grid-checkbox" value="true" />
46
- <label class="visually-hidden" for="${this.formId(this.display_checkbox + '_' + data.id)}">${i18n.t("blocks:resources:panel:display")}</label>
51
+ <input name="item[${index}][display]" id="${this.formId(this.display_checkbox + "_" + data.id)}" type="checkbox" ${checked} class="item-grid-checkbox" value="true" />
52
+ <label class="visually-hidden" for="${this.formId(this.display_checkbox + "_" + data.id)}">${i18n.t("blocks:resources:panel:display")}</label>
47
53
  </div>
48
54
  <div class="pic">
49
- <img class="img-thumbnail" src="${(data.thumbnail_image_url || ((data.iiif_tilesource || "").replace("/info.json", "/full/!100,100/0/default.jpg")))}" />
55
+ <img class="img-thumbnail" src="${data.thumbnail_image_url || (data.iiif_tilesource || "").replace("/info.json", "/full/!100,100/0/default.jpg")}" />
50
56
  </div>
51
57
  <div class="main">
52
- <div class="title card-title">${(data.full_title || data.title)}</div>
53
- <div>${(data.slug || data.id)}</div>
58
+ <div class="title card-title">${data.full_title || data.title}</div>
59
+ <div>${data.slug || data.id}</div>
54
60
  </div>
55
61
  <div class="remove float-end">
56
62
  <a data-item-grid-panel-remove="true" href="#">${i18n.t("blocks:resources:panel:remove")}</a>
@@ -60,28 +66,27 @@ SirTrevor.Blocks.Browse = (function(){
60
66
  </div>
61
67
  </li>`
62
68
 
63
- var panel = $(markup);
64
- var context = this;
65
-
66
- $('.remove a', panel).on('click', function(e) {
67
- e.preventDefault();
68
- $(this).closest('.field').remove();
69
- context.afterPanelDelete();
69
+ var panel = $(markup)
70
+ var context = this
70
71
 
71
- });
72
+ $(".remove a", panel).on("click", function (e) {
73
+ e.preventDefault()
74
+ $(this).closest(".field").remove()
75
+ context.afterPanelDelete()
76
+ })
72
77
 
73
- this.afterPanelRender(data, panel);
78
+ this.afterPanelRender(data, panel)
74
79
 
75
- return panel;
80
+ return panel
76
81
  },
77
82
 
78
- item_options: function() { return `
83
+ item_options: function () {
84
+ return `
79
85
  <label>
80
86
  <input type="hidden" name="display-item-counts" value="false" />
81
87
  <input type="checkbox" name="display-item-counts" value="true" checked />
82
88
  ${i18n.t("blocks:browse:item_counts")}
83
89
  </label>`
84
90
  },
85
- });
86
-
87
- })();
91
+ })
92
+ })()
@@ -1,42 +1,44 @@
1
1
  /*
2
2
  Sir Trevor BrowseGroupCategories
3
3
  */
4
- import Core from 'spotlight/core'
5
-
6
- SirTrevor.Blocks.BrowseGroupCategories = (function(){
4
+ import Core from "spotlight/core"
7
5
 
6
+ SirTrevor.Blocks.BrowseGroupCategories = (function () {
8
7
  return Core.Block.Resources.extend({
9
8
  type: "browse_group_categories",
10
9
  icon_name: "browse",
11
10
 
12
- autocomplete_control: function() {
13
- const autocompleteID = this.blockID + '-autocomplete';
11
+ autocomplete_control: function () {
12
+ const autocompleteID = this.blockID + "-autocomplete"
14
13
  return `<auto-complete src="${this.autocomplete_url()}" for="${autocompleteID}-popup" fetch-on-empty>
15
14
  <input type="text" name="${autocompleteID}" placeholder="${i18n.t("blocks:browse_group_categories:autocomplete")}" data-default-typeahead>
16
15
  <ul id="${autocompleteID}-popup"></ul>
17
16
  <div id="${autocompleteID}-popup-feedback" class="visually-hidden"></div>
18
17
  </auto-complete>`
19
18
  },
20
- autocomplete_template: function(obj) {
21
- return `<div class="autocomplete-item${!obj.published ? ' blacklight-private' : ''}">
19
+ autocomplete_template: function (obj) {
20
+ return `<div class="autocomplete-item${!obj.published ? " blacklight-private" : ""}">
22
21
  <span class="autocomplete-title">${this.highlight(obj.title)}</span><br/></div>`
23
22
  },
24
23
 
25
- autocomplete_url: function() {
26
- return document.getElementById(this.instanceID).closest('form[data-autocomplete-exhibit-browse-groups-path]').dataset.autocompleteExhibitBrowseGroupsPath;
24
+ autocomplete_url: function () {
25
+ return document
26
+ .getElementById(this.instanceID)
27
+ .closest("form[data-autocomplete-exhibit-browse-groups-path]").dataset
28
+ .autocompleteExhibitBrowseGroupsPath
27
29
  },
28
- autocomplete_fetch: function(url) {
29
- return this.fetchOnceAndFilterLocalResults(url);
30
+ autocomplete_fetch: function (url) {
31
+ return this.fetchOnceAndFilterLocalResults(url)
30
32
  },
31
- _itemPanel: function(data) {
32
- var index = "item_" + this.globalIndex++;
33
- var checked;
33
+ _itemPanel: function (data) {
34
+ var index = "item_" + this.globalIndex++
35
+ var checked
34
36
  if (data.display == "true") {
35
37
  checked = "checked='checked'"
36
38
  } else {
37
- checked = "";
39
+ checked = ""
38
40
  }
39
- var resource_id = data.slug || data.id;
41
+ var resource_id = data.slug || data.id
40
42
  var markup = `
41
43
  <li class="field dd-item dd3-item" data-resource-id="${resource_id}" data-id="${index}" id="${this.formId(index)}">
42
44
  <input type="hidden" name="item[${index}][id]" value="${resource_id}" />
@@ -48,8 +50,8 @@ SirTrevor.Blocks.BrowseGroupCategories = (function(){
48
50
  <div class="d-flex flex-grow-1">
49
51
  <div class="checkbox">
50
52
  <input name="item[${index}][display]" type="hidden" value="false" />
51
- <input name="item[${index}][display]" id="${this.formId(this.display_checkbox + '_' + data.id)}" type="checkbox" ${checked} class="item-grid-checkbox" value="true" />
52
- <label class="visually-hidden" for="${this.formId(this.display_checkbox + '_' + data.id)}">${i18n.t("blocks:resources:panel:display")}</label>
53
+ <input name="item[${index}][display]" id="${this.formId(this.display_checkbox + "_" + data.id)}" type="checkbox" ${checked} class="item-grid-checkbox" value="true" />
54
+ <label class="visually-hidden" for="${this.formId(this.display_checkbox + "_" + data.id)}">${i18n.t("blocks:resources:panel:display")}</label>
53
55
  </div>
54
56
  <div class="main">
55
57
  <div class="title card-title">${data.title}</div>
@@ -62,27 +64,27 @@ SirTrevor.Blocks.BrowseGroupCategories = (function(){
62
64
  </div>
63
65
  </li>`
64
66
 
65
- const panel = $(markup);
66
- var context = this;
67
-
68
- $('a[data-item-grid-panel-remove]', panel).on('click', function(e) {
69
- e.preventDefault();
70
- $(this).closest('.field').remove();
71
- context.afterPanelDelete();
67
+ const panel = $(markup)
68
+ var context = this
72
69
 
73
- });
70
+ $("a[data-item-grid-panel-remove]", panel).on("click", function (e) {
71
+ e.preventDefault()
72
+ $(this).closest(".field").remove()
73
+ context.afterPanelDelete()
74
+ })
74
75
 
75
- this.afterPanelRender(data, panel);
76
+ this.afterPanelRender(data, panel)
76
77
 
77
- return panel;
78
+ return panel
78
79
  },
79
80
 
80
- item_options: function() { return `
81
+ item_options: function () {
82
+ return `
81
83
  <label>
82
84
  <input type="hidden" name="display-item-counts" value="false" />
83
85
  <input type="checkbox" name="display-item-counts" value="true" checked />
84
86
  ${i18n.t("blocks:browse_group_categories:item_counts")}
85
87
  </label>`
86
88
  },
87
- });
88
- })();
89
+ })
90
+ })()
@@ -7,24 +7,27 @@
7
7
  and displays them.
8
8
  */
9
9
 
10
- SirTrevor.Blocks.Iframe = (function(){
11
-
10
+ SirTrevor.Blocks.Iframe = (function () {
12
11
  return SirTrevor.Block.extend({
13
12
  type: "Iframe",
14
13
  formable: true,
15
-
16
- title: function() { return i18n.t('blocks:iframe:title'); },
17
- description: function() { return i18n.t('blocks:iframe:description'); },
14
+
15
+ title: function () {
16
+ return i18n.t("blocks:iframe:title")
17
+ },
18
+ description: function () {
19
+ return i18n.t("blocks:iframe:description")
20
+ },
18
21
 
19
22
  icon_name: "iframe",
20
-
21
- editorHTML: function() {
23
+
24
+ editorHTML: function () {
22
25
  return `<div class="clearfix">
23
26
  <div class="widget-header">
24
27
  ${this.description()}
25
28
  </div>
26
29
  <textarea name="code" class="form-control" rows="5" placeholder="${i18n.t("blocks:iframe:placeholder")}"></textarea>
27
- </div>`;
28
- }
29
- });
30
- })();
30
+ </div>`
31
+ },
32
+ })
33
+ })()
@@ -1,14 +1,11 @@
1
- SirTrevor.Blocks.LinkToSearch = (function(){
2
-
1
+ SirTrevor.Blocks.LinkToSearch = (function () {
3
2
  return SirTrevor.Blocks.Browse.extend({
4
-
5
3
  type: "link_to_search",
6
4
 
7
- icon_name: 'search_results',
5
+ icon_name: "search_results",
8
6
 
9
7
  searches_key: "slug",
10
8
  view_key: "view",
11
9
  plustextable: false,
12
-
13
- });
14
- })();
10
+ })
11
+ })()
@@ -6,19 +6,22 @@
6
6
  and any provided text
7
7
  and displays them.
8
8
  */
9
- import Core from 'spotlight/core'
10
-
11
- SirTrevor.Blocks.Oembed = (function(){
9
+ import Core from "spotlight/core"
12
10
 
11
+ SirTrevor.Blocks.Oembed = (function () {
13
12
  return Core.Block.extend({
14
13
  plustextable: true,
15
14
 
16
- id_key:"url",
15
+ id_key: "url",
17
16
 
18
17
  type: "oembed",
19
-
20
- title: function() { return i18n.t('blocks:oembed:title'); },
21
- description: function() { return i18n.t('blocks:oembed:description'); },
18
+
19
+ title: function () {
20
+ return i18n.t("blocks:oembed:title")
21
+ },
22
+ description: function () {
23
+ return i18n.t("blocks:oembed:description")
24
+ },
22
25
 
23
26
  icon_name: "oembed",
24
27
  show_heading: false,
@@ -36,6 +39,6 @@ SirTrevor.Blocks.Oembed = (function(){
36
39
  </div>
37
40
  ${this.text_area()}
38
41
  </div>`
39
- }
40
- });
41
- })();
42
+ },
43
+ })
44
+ })()
@@ -1,7 +1,6 @@
1
- import Core from 'spotlight/core'
2
-
3
- SirTrevor.Blocks.FeaturedPages = (function(){
1
+ import Core from "spotlight/core"
4
2
 
3
+ SirTrevor.Blocks.FeaturedPages = (function () {
5
4
  return Core.Block.Resources.extend({
6
5
  type: "featured_pages",
7
6
 
@@ -9,16 +8,24 @@ SirTrevor.Blocks.FeaturedPages = (function(){
9
8
 
10
9
  show_image_selection: false,
11
10
 
12
- autocomplete_url: function() { return document.getElementById(this.instanceID).closest('form[data-autocomplete-exhibit-pages-path]').dataset.autocompleteExhibitPagesPath; },
13
- autocomplete_fetch: function(url) {
14
- return this.fetchOnceAndFilterLocalResults(url);
11
+ autocomplete_url: function () {
12
+ return document
13
+ .getElementById(this.instanceID)
14
+ .closest("form[data-autocomplete-exhibit-pages-path]").dataset
15
+ .autocompleteExhibitPagesPath
16
+ },
17
+ autocomplete_fetch: function (url) {
18
+ return this.fetchOnceAndFilterLocalResults(url)
15
19
  },
16
- autocomplete_template: function(obj) {
17
- const description = obj.description ? `<small>&nbsp;&nbsp;${obj.description}</small>` : '';
18
- const thumbnail = obj.thumbnail_image_url ? `<div class="document-thumbnail"><img class="img-thumbnail" src="${obj.thumbnail_image_url}" /></div>` : ''
19
- return `<div class="autocomplete-item${!obj.published ? ' blacklight-private' : ''}">${thumbnail}
20
+ autocomplete_template: function (obj) {
21
+ const description = obj.description
22
+ ? `<small>&nbsp;&nbsp;${obj.description}</small>`
23
+ : ""
24
+ const thumbnail = obj.thumbnail_image_url
25
+ ? `<div class="document-thumbnail"><img class="img-thumbnail" src="${obj.thumbnail_image_url}" /></div>`
26
+ : ""
27
+ return `<div class="autocomplete-item${!obj.published ? " blacklight-private" : ""}">${thumbnail}
20
28
  <span class="autocomplete-title">${this.highlight(obj.title)}</span><br/>${description}</div>`
21
29
  },
22
- });
23
-
24
- })();
30
+ })
31
+ })()