Skip to content

Commit

Permalink
Run the OpenSeadragon rails installer
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Dec 19, 2024
1 parent 105986e commit 9f9dd1f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/views/layouts/spotlight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
<%= javascript_include_tag 'leaflet-iiif', "data-turbo-track": "reload", defer: true %>
<%= javascript_include_tag 'Leaflet.Editable', "data-turbo-track": "reload", defer: true %>
<%= javascript_include_tag 'Path.Drag', "data-turbo-track": "reload", defer: true %>
<%= javascript_include_tag 'openseadragon/openseadragon', "data-turbo-track": "reload", defer: true %>
<%= javascript_include_tag 'openseadragon/jquery', "data-turbo-track": "reload", defer: true %>
<% if defined? Importmap %>
<%= javascript_importmap_tags %>
<% else %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
<% end %>
<%= javascript_include_tag 'openseadragon/rails', "data-turbo-track": "reload", defer: true %>
<%= csrf_meta_tags %>
<%= content_for(:head) %>
<% if @document %>
Expand Down
12 changes: 12 additions & 0 deletions lib/generators/spotlight/assets/propshaft_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ def add_javascript
end
end

def add_osd_rails
# generate 'openseadragon:install' This isn't working'
run "yarn add openseadragon-rails"
append_to_file 'app/javascript/application.js' do
<<~CONTENT
import "openseadragon-rails/app/assets/javascripts/openseadragon/rails"
CONTENT
end
end

def add_stylesheets
copy_file 'assets/spotlight.scss', 'app/assets/stylesheets/spotlight.scss'
append_to_file 'app/assets/stylesheets/application.bootstrap.scss', "\n@import \"spotlight\";\n"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"jquery-serializejson": "^3.2.1",
"leaflet": "^1.9.4",
"leaflet-iiif": "^3.0.0",
"openseadragon-rails": "^1.0.1",
"sir-trevor": "^0.8.2",
"sortablejs": "^1.15.3"
}
Expand Down

0 comments on commit 9f9dd1f

Please sign in to comment.