-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from UCLALibrary/uv/restore-config
Restore UV config
- Loading branch information
Showing
4 changed files
with
100 additions
and
2 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
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,14 @@ | ||
{ | ||
"options": { | ||
"rightPanelEnabled": false | ||
}, | ||
"modules": { | ||
"footerPanel": { | ||
"options": { | ||
"downloadEnabled": false, | ||
"fullscreenEnabled": true, | ||
"shareEnabled": false | ||
} | ||
} | ||
} | ||
} |
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,82 @@ | ||
<!-- | ||
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 | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
<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.css"> | ||
<script type="text/javascript" src="lib/offline.js"></script> | ||
<script type="text/javascript" src="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: '.', | ||
iiifResourceUri: urlDataProvider.get('manifest'), | ||
configUri: 'uv-config.json', | ||
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.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