Skip to content

Commit

Permalink
Merge pull request #1948 from sul-dlss/restore-spotlight
Browse files Browse the repository at this point in the history
Restore Spotlight javascript
  • Loading branch information
corylown authored Jan 24, 2025
2 parents 7011c38 + 90097d5 commit 372c5c7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/blacklight_gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= require blacklight_gallery/blacklight-gallery
10 changes: 10 additions & 0 deletions app/assets/javascripts/spotlight.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// require the parts of spotlight/application rather than using it directly in order to
// work around https://github.com/projectblacklight/spotlight/pull/2921

//= require leaflet
//= require sir-trevor
//= require clipboard
//= require tiny-slider
//= require typeahead.bundle.min.js

//= require spotlight/spotlight
5 changes: 3 additions & 2 deletions app/javascript/entry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// This is the entrypoint for the importmap build.
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import jQuery from 'jquery'
window.jQuery = jQuery
window.$ = jQuery

import "@hotwired/turbo-rails"

Expand All @@ -8,13 +11,11 @@ import "controllers"
import 'bootstrap'
import Blacklight from 'blacklight'
import 'openseadragon-rails/rails'
import 'blacklight-gallery'

window.Blacklight = Blacklight

import { I18n } from 'i18n-js'
export const i18n = new I18n()
window.i18n = i18n

import 'transform_result'
import 'blacklight-hierarchy'
1 change: 0 additions & 1 deletion app/views/layouts/spotlight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<%= description %>
<%= twitter_card %>
<%= opengraph %>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<%= javascript_importmap_tags 'entry' %>
<%= javascript_include_tag "application", defer: true %>
<%= javascript_tag "window.addEventListener('load', () => window.sirTrevorIcon = '#{asset_path('spotlight/blocks/sir-trevor-icons.svg')}')" %>
Expand Down
3 changes: 2 additions & 1 deletion vendor/javascript/blacklight-hierarchy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 372c5c7

Please sign in to comment.