-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace pul_uv_rails with a direct install of universal viewer. pul_u…
…v_rail is no longer maintained.
- Loading branch information
Julie Allinson
committed
Apr 8, 2019
1 parent
6250312
commit cd73f28
Showing
13 changed files
with
162 additions
and
10 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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
// Default for smaller screens, uses mobile panel | ||
.viewer-wrapper { | ||
height: 500px; | ||
height: 390px; | ||
} | ||
|
||
.viewer { | ||
.viewer-wrapper iframe { | ||
height: 100%; | ||
padding: 10px; | ||
width: 100%; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} | ||
|
||
// Show various footer, header, left and right panels on larger screens only | ||
@media only screen and (min-width: 640px) { | ||
.viewer-wrapper { | ||
height: 640px; | ||
} | ||
} |
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
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,7 @@ | ||
<%= PulUvRails::UniversalViewer.script_tag %> | ||
<div class="viewer-wrapper"> | ||
<div class="uv viewer" data-uri="<%= main_app.polymorphic_url [main_app, :manifest, presenter], { locale: nil } %>"></div> | ||
<iframe | ||
src="<%= universal_viewer_base_url %>#?manifest=<%= main_app.polymorphic_url [main_app, :manifest, presenter], { locale: nil } %>&config=<%= universal_viewer_config_url %>" | ||
allowfullscreen="true" | ||
frameborder="0" | ||
></iframe> | ||
</div> |
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
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
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,11 @@ | ||
{ | ||
"name": "hyrax", | ||
"private": true, | ||
"repository": "git@github.com:samvera/hyrax.git", | ||
"scripts": { | ||
"install-uv": "yarn install --modules-folder ./public/uv" | ||
}, | ||
"dependencies": { | ||
"universalviewer": "^3.0.16" | ||
} | ||
} |
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,87 @@ | ||
|
||
<!-- | ||
This is what the embed iframe src links to. It doesn't need to communicate with the parent page, only fill the available space and look for #? parameters | ||
--> | ||
|
||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | ||
<link rel="icon" href="favicon.ico"> | ||
<link rel="stylesheet" type="text/css" href="uv/universalviewer/uv/uv.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> | ||
<script type="text/javascript" src="uv/universalviewer/uv/lib/offline.js"></script> | ||
<script type="text/javascript" src="uv/universalviewer/uv/helpers.js"></script> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
</style> | ||
<script type="text/javascript"> | ||
window.addEventListener('uvLoaded', function(e) { | ||
urlDataProvider = new UV.URLDataProvider(true); | ||
var formattedLocales; | ||
var locales = urlDataProvider.get('locales', ''); | ||
|
||
if (locales) { | ||
var names = locales.split(','); | ||
formattedLocales = []; | ||
|
||
for (var i in names) { | ||
var nameparts = String(names[i]).split(':'); | ||
formattedLocales[i] = {name: nameparts[0], label: nameparts[1]}; | ||
} | ||
|
||
} else { | ||
formattedLocales = [ | ||
{ | ||
name: 'en-GB' | ||
} | ||
] | ||
} | ||
|
||
uv = createUV('#uv', { | ||
root: './uv/universalviewer/uv', | ||
iiifResourceUri: urlDataProvider.get('manifest'), | ||
configUri: urlDataProvider.get('config'), | ||
collectionIndex: Number(urlDataProvider.get('c', 0)), | ||
manifestIndex: Number(urlDataProvider.get('m', 0)), | ||
sequenceIndex: Number(urlDataProvider.get('s', 0)), | ||
canvasIndex: Number(urlDataProvider.get('cv', 0)), | ||
rangeId: urlDataProvider.get('rid', 0), | ||
rotation: Number(urlDataProvider.get('r', 0)), | ||
xywh: urlDataProvider.get('xywh', ''), | ||
embedded: true, | ||
locales: formattedLocales | ||
}, urlDataProvider); | ||
}, false); | ||
</script> | ||
</head> | ||
<body> | ||
|
||
<div id="uv" class="uv"></div> | ||
|
||
<script> | ||
$(function() { | ||
|
||
var $UV = $('#uv'); | ||
|
||
function resize() { | ||
var windowWidth = window.innerWidth; | ||
var windowHeight = window.innerHeight; | ||
$UV.width(windowWidth); | ||
$UV.height(windowHeight); | ||
} | ||
|
||
$(window).on('resize' ,function() { | ||
resize(); | ||
}); | ||
|
||
resize(); | ||
}); | ||
|
||
</script> | ||
<script type="text/javascript" src="uv/universalviewer/uv/uv.js"></script> | ||
</body> | ||
</html> |
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,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
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
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
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
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