-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CAL-894 Switch to separate static UV (Universal Viewer) (#858)
* CAL-984: Seperate UV from Californica. * CAL-984: Check for RAILS_ENV. * CAL-984: Sub https for http in iiif_manifest url. * CAL-984: Add presenter to iiif url. * CAL-984: Add presenter to iiif url. * CAL-984 * CAL-984 * CAL-984 * CAL-984 * CAL-984: Update formating for rubocop errors. * CAL-984: Update formating for rubocop errors. * CAL-984: Fix test errors. * CAL-984: Add uv css. * CAL-984: Update universal viewer css structure to match ursus. * CAL-984: Add uv css. * CAL-984: Revert gemfile. * CAL-984: Fix rubocop error.
- Loading branch information
Showing
5 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -937,4 +937,4 @@ RUBY VERSION | |
ruby 2.5.7p206 | ||
|
||
BUNDLED WITH | ||
1.17.3 | ||
1.17.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import 'californica/file_upload'; | ||
@import 'californica/main_content'; | ||
@import 'californica/wells'; | ||
@import 'californica/uv'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.media-viewer-container { | ||
margin: 0 auto; | ||
margin-bottom: 3rem; | ||
width: 100%; | ||
} | ||
|
||
.media-viewer-iframe { | ||
width: 100%; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Californica | ||
class IiifService | ||
def http_sub(iiif_manifest_url) | ||
iiif_manifest_url.sub('http:', 'https:') | ||
end | ||
|
||
def src(iiif_manifest_url) | ||
if ENV['RAILS_HOST'] == 'localhost' || ENV['RAILS_HOST'] == 'californica-test.library.ucla.edu' | ||
"https://t-w-dl-viewer01.library.ucla.edu/uv.html#?manifest=#{CGI.escape(http_sub(iiif_manifest_url))}" | ||
elsif ENV['RAILS_HOST'] == 'californica-dev.library.ucla.edu' | ||
"https://d-w-dl-viewer01.library.ucla.edu/uv.html#?manifest=#{CGI.escape(http_sub(iiif_manifest_url))}" | ||
elsif ENV['RAILS_HOST'] == 'californica-stage.library.ucla.edu' | ||
"https://s-w-dl-viewer01.library.ucla.edu/uv.html#?manifest=#{CGI.escape(http_sub(iiif_manifest_url))}" | ||
elsif ENV['RAILS_HOST'] == 'californica.library.ucla.edu' | ||
"https://p-w-dl-viewer01.library.ucla.edu/uv.html#?manifest=#{CGI.escape(http_sub(iiif_manifest_url))}" | ||
end | ||
end | ||
end | ||
end |
14 changes: 11 additions & 3 deletions
14
app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
<%= PulUvRails::UniversalViewer.script_tag %> | ||
<div class="viewer-wrapper"> | ||
<div class="uv viewer" data-uri="<%= presenter.iiif_manifest_url %>"></div> | ||
<div class='media-viewer-container'> | ||
<% iiif_service = Californica::IiifService.new() %> | ||
<iframe | ||
class='media-viewer-iframe' | ||
src= "<%= iiif_service.src(presenter.iiif_manifest_url) %>" | ||
width='924px' | ||
height='668px' | ||
id='media-viewer-iframe' | ||
allowfullscreen | ||
frameborder='0'> | ||
</iframe> | ||
</div> |