blacklight-spotlight 4.3.6 → 4.5.0

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spotlight/spotlight.esm.js +20 -11
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  4. data/app/assets/javascripts/spotlight/spotlight.js +20 -11
  5. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  6. data/app/assets/stylesheets/spotlight/_accessibility.scss +9 -0
  7. data/app/assets/stylesheets/spotlight/_browse.scss +4 -11
  8. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +4 -2
  9. data/app/assets/stylesheets/spotlight/_mixins.scss +1 -0
  10. data/app/components/spotlight/edit_view_links_component.html.erb +13 -0
  11. data/app/components/spotlight/edit_view_links_component.rb +16 -0
  12. data/app/components/spotlight/solr_document_legacy_embed_component.rb +1 -1
  13. data/app/components/spotlight/tag_list_form_component.html.erb +1 -1
  14. data/app/controllers/spotlight/accessibility_controller.rb +45 -0
  15. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  16. data/app/helpers/spotlight/title_helper.rb +4 -0
  17. data/app/javascript/spotlight/admin/blocks/resources_block.js +16 -7
  18. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +0 -1
  19. data/app/javascript/spotlight/admin/pages.js +1 -0
  20. data/app/javascript/spotlight/admin/visibility_toggle.js +1 -1
  21. data/app/javascript/spotlight/user/clear_form_button.js +2 -2
  22. data/app/models/sir_trevor_rails/block.rb +12 -0
  23. data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +4 -0
  24. data/app/models/sir_trevor_rails/blocks/solr_documents_embed_block.rb +3 -0
  25. data/app/models/sir_trevor_rails/blocks/uploaded_items_block.rb +4 -0
  26. data/app/models/spotlight/blacklight_configuration.rb +2 -1
  27. data/app/models/spotlight/custom_field.rb +1 -1
  28. data/app/services/spotlight/exhibit_import_export_service.rb +1 -0
  29. data/app/views/layouts/spotlight/base.html.erb +1 -1
  30. data/app/views/shared/_masthead.html.erb +1 -1
  31. data/app/views/spotlight/accessibility/alt_text.html.erb +64 -0
  32. data/app/views/spotlight/browse/_search_box.html.erb +9 -11
  33. data/app/views/spotlight/bulk_updates/_upload.html.erb +1 -1
  34. data/app/views/spotlight/custom_fields/form_group/_text.html.erb +1 -1
  35. data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +1 -1
  36. data/app/views/spotlight/dashboards/_page.html.erb +1 -9
  37. data/app/views/spotlight/exhibits/_form.html.erb +2 -2
  38. data/app/views/spotlight/feature_pages/_header.html.erb +3 -6
  39. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +7 -0
  40. data/app/views/spotlight/metadata_configurations/edit.html.erb +1 -0
  41. data/app/views/spotlight/pages/_form.html.erb +1 -1
  42. data/app/views/spotlight/pages/_page.html.erb +1 -5
  43. data/app/views/spotlight/searches/_form.html.erb +3 -3
  44. data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +1 -0
  45. data/app/views/spotlight/shared/_honeypot_field.html.erb +2 -2
  46. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
  47. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  48. data/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb +1 -1
  49. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  50. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +2 -2
  51. data/app/views/spotlight/translations/_import.html.erb +1 -1
  52. data/config/locales/spotlight.en.yml +15 -2
  53. data/config/routes.rb +2 -0
  54. data/lib/spotlight/version.rb +1 -1
  55. metadata +6 -2
@@ -64,10 +64,10 @@
64
64
  class ClearFormButton {
65
65
  connect() {
66
66
  var $clearBtn = $('.btn-reset');
67
- var $input = $clearBtn.parent().prev('input');
67
+ var $input = $clearBtn.prev('#browse_q');
68
68
  var btnCheck = function(){
69
69
  if ($input.val() !== '') {
70
- $clearBtn.css('display', 'inline-block');
70
+ $clearBtn.css('display', 'block');
71
71
  } else {
72
72
  $clearBtn.css('display', 'none');
73
73
  }
@@ -5166,6 +5166,7 @@
5166
5166
  var editor = new SirTrevor.Editor({
5167
5167
  el: instance[0],
5168
5168
  blockTypes: instance.data('blockTypes'),
5169
+ altTextSettings: instance.data('altTextSettings'),
5169
5170
  defaultType:["Text"],
5170
5171
  onEditorRender: function() {
5171
5172
  $.SerializedForm();
@@ -5615,7 +5616,7 @@
5615
5616
  if (e.target.matches('[data-checkboxsubmit-target="checkbox"]')) {
5616
5617
  const form = e.target.closest('form');
5617
5618
  if (form) {
5618
- new CheckboxSubmit(form).clicked(e);
5619
+ if (!Blacklight.BookmarkToggle) new CheckboxSubmit(form).clicked(e);
5619
5620
 
5620
5621
  // Add/remove the "private" label to the document row when visibility is toggled
5621
5622
  const docRow = form.closest('tr');
@@ -5936,18 +5937,16 @@
5936
5937
  formable: true,
5937
5938
  autocompleteable: true,
5938
5939
  show_heading: true,
5939
- show_alt_text: true,
5940
-
5941
5940
  title: function() { return i18n.t("blocks:" + this.type + ":title"); },
5942
5941
  description: function() { return i18n.t("blocks:" + this.type + ":description"); },
5943
- alt_text_guidelines: function() {
5944
- if (this.show_alt_text) {
5942
+ alt_text_guidelines: function() {
5943
+ if (this.showAltText()) {
5945
5944
  return i18n.t("blocks:alt_text_guidelines:intro");
5946
5945
  }
5947
5946
  return "";
5948
5947
  },
5949
5948
  alt_text_guidelines_link: function() {
5950
- if (this.show_alt_text) {
5949
+ if (this.showAltText()) {
5951
5950
  var link_url = i18n.t("blocks:alt_text_guidelines:link_url");
5952
5951
  var link_label = i18n.t("blocks:alt_text_guidelines:link_label");
5953
5952
  return '<a target="_blank" href="' + link_url + '">' + link_label + '</a>';
@@ -5973,12 +5972,23 @@
5973
5972
  },
5974
5973
 
5975
5974
  _altTextFieldsHTML: function(index, data) {
5976
- if (this.show_alt_text) {
5975
+ if (this.showAltText()) {
5977
5976
  return this.altTextHTML(index, data);
5978
5977
  }
5979
5978
  return "";
5980
5979
  },
5981
5980
 
5981
+ showAltText: function() {
5982
+ return this.editorOptions.altTextSettings[this._typeAsCamelCase()]
5983
+ },
5984
+
5985
+ _typeAsCamelCase: function() {
5986
+ return this.type
5987
+ .split('_')
5988
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
5989
+ .join('');
5990
+ },
5991
+
5982
5992
  _itemPanel: function(data) {
5983
5993
  var index = "item_" + this.globalIndex++;
5984
5994
  var checked;
@@ -6116,7 +6126,7 @@
6116
6126
  },
6117
6127
 
6118
6128
  attachAltTextHandlers: function(panel) {
6119
- if (this.show_alt_text) {
6129
+ if (this.showAltText()) {
6120
6130
  const decorativeCheckbox = $('input[name$="[decorative]"]', panel);
6121
6131
  const altTextInput = $('textarea[name$="[alt_text]"]', panel);
6122
6132
  const altTextBackupInput = $('input[name$="[alt_text_backup]"]', panel);
@@ -6764,7 +6774,6 @@
6764
6774
 
6765
6775
  return SirTrevor.Blocks.SolrDocumentsBase.extend({
6766
6776
  type: "solr_documents_embed",
6767
- show_alt_text: false,
6768
6777
  icon_name: "item_embed",
6769
6778
 
6770
6779
  item_options: function() { return "" },