-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
124 lines (90 loc) · 3.24 KB
/
index.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="images/readium_favicon.png" rel="shortcut icon"/>
<link href="images/readium-touch-icon.png" rel="apple-touch-icon"/>
<style>
.library-item{
height: 100px;
}
body:not(.list-view) .library-item .no-cover{
width: 300px;
height: 400px;
font-size: 40px;
}
</style>
<link rel="stylesheet" type="text/css" href="css/readium-all.css">
<script type="text/javascript" src="scripts/readium-js-viewer_all.js"> </script>
<script type="text/javascript">
var HTMLFILENAME = "index.html";
var HTTPServerRootFolder =
window.location ? (
window.location.protocol
+ "//"
+ window.location.hostname
+ (window.location.port ? (':' + window.location.port) : '')
+ (window.location.pathname ?
(
(
window.location.pathname.indexOf(HTMLFILENAME) == (window.location.pathname.length - HTMLFILENAME.length)
? window.location.pathname.substr(0, window.location.pathname.length - HTMLFILENAME.length - 1)
: (
window.location.pathname.charAt(window.location.pathname.length-1) == '/'
? window.location.pathname.substr(0, window.location.pathname.length-1)
: window.location.pathname
)
)
)
: '')
) : ''
;
console.log(HTTPServerRootFolder);
var getURLQueryParams = function() {
var params = {};
var query = window.location.search;
if (query && query.length) {
query = query.substring(1);
var keyParams = query.split('&');
for (var x = 0; x < keyParams.length; x++)
{
var keyVal = keyParams[x].split('=');
if (keyVal.length > 1) {
params[keyVal[0]] = decodeURIComponent(keyVal[1]);
}
}
}
return params;
};
var urlParams = getURLQueryParams();
console.log(urlParams);
// MUST BE *SINGLE* CALL TO require.config() FOR ALMOND (SINGLE BUNDLE) TO WORK CORRECTLY!!!
require.config({
/* http://requirejs.org/docs/api.html#config-waitSeconds */
waitSeconds: 0,
config : {
'readium_js_viewer/ModuleConfig' : {
'mathJaxUrl': HTTPServerRootFolder + '/scripts/mathjax/MathJax.js',
'annotationCSSUrl': HTTPServerRootFolder + '/css/annotations.css',
'jsLibRoot': HTTPServerRootFolder + '/scripts/zip/',
'useSimpleLoader' : false, // cloud reader (strictly-speaking, this config option is false by default, but we prefer to have it explicitly set here).
'epubLibraryPath': urlParams['epubs'] ? urlParams['epubs'] : undefined, // defaults to /epub_content/epub_library.json relative to the application's root index.html
'imagePathPrefix': undefined,
'canHandleUrl' : false,
'canHandleDirectory' : false,
'workerUrl': undefined,
'epubReadingSystemUrl': undefined
}
}
});
</script>
</head>
<!-- This is all application-specific HTML -->
<body>
<nav id="app-navbar" class="navbar" role="banner" aria-label="{{Strings.i18n_toolbar}}">
</nav>
<div id="app-container">
</div>
</body>
</html>