diff --git a/Gemfile b/Gemfile index 06c5bc27c..ce2e92bda 100644 --- a/Gemfile +++ b/Gemfile @@ -16,8 +16,6 @@ gem 'puma', '~> 6.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby -# Use jquery as the JavaScript library -gem 'jquery-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder @@ -139,4 +137,4 @@ gem 'cssbundling-rails', '~> 1.4' gem 'jsbundling-rails', '~> 1.3' -gem "turbo-rails", "~> 2.0" +gem 'turbo-rails', '~> 2.0' diff --git a/Gemfile.lock b/Gemfile.lock index cf6e30454..a6faf5dce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -935,7 +935,6 @@ DEPENDENCIES honeybadger iiif-presentation jbuilder (~> 2.7) - jquery-rails jsbundling-rails (~> 1.3) jsonpath letter_opener diff --git a/app/javascript/bibliography.js b/app/javascript/bibliography.js index 3d0d80bbf..f1f5b80c4 100644 --- a/app/javascript/bibliography.js +++ b/app/javascript/bibliography.js @@ -1,5 +1,6 @@ /* eslint-disable camelcase */ /* global Bibliography */ +import Blacklight from "blacklight-frontend"; (function (global) { var Bibliography; @@ -60,7 +61,7 @@ // This string contains the formatted bibliography for this item. // This string can contain HTML elements as well which should be displayed correctly. var formatted_bibliography = bibEntry.attributes.formatted_bibliography_ts.attributes.value; - + return '

' + formatted_bibliography + ' ' + diff --git a/app/javascript/blacklight_gallery.js b/app/javascript/blacklight_gallery.js index 992a7d4df..94f3dc601 100644 --- a/app/javascript/blacklight_gallery.js +++ b/app/javascript/blacklight_gallery.js @@ -1 +1,3 @@ -//= require blacklight_gallery/default \ No newline at end of file +import 'blacklight-gallery/vendor/assets/javascripts/imagesloaded.min.js' +import 'blacklight-gallery/app/assets/javascripts/blacklight_gallery/slideshow' +import 'blacklight-gallery/app/assets/javascripts/blacklight_gallery/masonry' diff --git a/app/javascript/blacklight_oembed.js b/app/javascript/blacklight_oembed.js index 72acb3e2d..379980941 100644 --- a/app/javascript/blacklight_oembed.js +++ b/app/javascript/blacklight_oembed.js @@ -1,5 +1,7 @@ //= require 'blacklight_oembed/jquery.oembed.js' +import Blacklight from "blacklight-frontend"; + Blacklight.onLoad(function() { $('[data-embed-url]').oEmbed(); -}); \ No newline at end of file +}); diff --git a/app/javascript/cited_documents.js b/app/javascript/cited_documents.js index 6c75eac58..fe2382bb2 100644 --- a/app/javascript/cited_documents.js +++ b/app/javascript/cited_documents.js @@ -1,6 +1,7 @@ /* eslint-disable camelcase */ /* global CitedDocuments */ -/* global Blacklight */ + +import Blacklight from "blacklight-frontend"; (function (global) { var CitedDocuments; diff --git a/app/javascript/exhibit_search_typeahead.js b/app/javascript/exhibit_search_typeahead.js index c46002d26..3e0c2db31 100644 --- a/app/javascript/exhibit_search_typeahead.js +++ b/app/javascript/exhibit_search_typeahead.js @@ -1,7 +1,8 @@ -/* global Blacklight */ /* global Bloodhound */ /* global ExhibitSearchTypeahead */ +import Blacklight from "blacklight-frontend"; + (function (global) { var ExhibitSearchTypeahead; diff --git a/app/javascript/full_text_collapse.js b/app/javascript/full_text_collapse.js index 1d1e6b044..e282cf33a 100644 --- a/app/javascript/full_text_collapse.js +++ b/app/javascript/full_text_collapse.js @@ -1,4 +1,5 @@ /* global Blacklight */ +import Blacklight from "blacklight-frontend"; Blacklight.onLoad(function(){ var uniqueId = (function() { diff --git a/app/javascript/index_status_typeahead.js b/app/javascript/index_status_typeahead.js index 12d32313c..9c3d0a909 100644 --- a/app/javascript/index_status_typeahead.js +++ b/app/javascript/index_status_typeahead.js @@ -1,6 +1,6 @@ -/* global Blacklight */ /* global Bloodhound */ /* global IndexStatusTypeahead */ +import Blacklight from "blacklight-frontend"; (function (global) { var IndexStatusTypeahead; diff --git a/app/javascript/nested_related_items.js b/app/javascript/nested_related_items.js index 15b8219ee..907366833 100644 --- a/app/javascript/nested_related_items.js +++ b/app/javascript/nested_related_items.js @@ -1,5 +1,5 @@ -/* global Blacklight */ /* global NestedRelatedItems */ +import Blacklight from "blacklight-frontend"; (function (global) { var NestedRelatedItems; diff --git a/app/javascript/site_search_type_toggle.js b/app/javascript/site_search_type_toggle.js index 9922ef123..740ca97a3 100644 --- a/app/javascript/site_search_type_toggle.js +++ b/app/javascript/site_search_type_toggle.js @@ -1,5 +1,5 @@ -/* global Blacklight */ /* global SiteSearchTypeToggle */ +import Blacklight from "blacklight-frontend"; (function (global) { var SiteSearchTypeToggle; diff --git a/app/javascript/table_of_contents.js b/app/javascript/table_of_contents.js index 055cfd8de..129050101 100644 --- a/app/javascript/table_of_contents.js +++ b/app/javascript/table_of_contents.js @@ -1,4 +1,4 @@ -/* global Blacklight */ +import Blacklight from "blacklight-frontend"; Blacklight.onLoad(function() { $('.blacklight-toc_search').on('show.bs.collapse hide.bs.collapse', function(){ diff --git a/app/views/layouts/spotlight/base.html.erb b/app/views/layouts/spotlight/base.html.erb index ebc965eab..61ec84301 100644 --- a/app/views/layouts/spotlight/base.html.erb +++ b/app/views/layouts/spotlight/base.html.erb @@ -18,6 +18,9 @@ <% end %> <%= stylesheet_link_tag "component_library_overrides" %> + + + <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>