-
Notifications
You must be signed in to change notification settings - Fork 1
/
uv.html
90 lines (74 loc) · 2.71 KB
/
uv.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!--
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: 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.js"></script>
</body>
</html>