-
Notifications
You must be signed in to change notification settings - Fork 186
/
requirejs-config.js
66 lines (48 loc) · 2.24 KB
/
requirejs-config.js
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
// Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation and/or
// other materials provided with the distribution.
// 3. Neither the name of the organization nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
var currentURL =
self.location ? (
self.location.protocol
+ "//"
+ self.location.hostname
+ (self.location.port ? (':' + self.location.port) : '')
+ (self.location.pathname ? self.location.pathname : '')
) : ''
;
console.log(currentURL);
// self.location.origin == self.location.protocol + '//' + self.location.host
console.log(self.location.origin);
var fontsArray = [];
if (typeof getFontFaces != "undefined") { // defined externally
fontsArray = getFontFaces(self.location.origin + "/font-faces/");
}
// 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': self.location.origin + '/scripts/mathjax/MathJax.js',
'fonts': fontsArray,
'annotationCSSUrl': self.location.origin + '/css/annotations.css',
'jsLibRoot': '/scripts/zip/',
'useSimpleLoader' : true,
'epubLibraryPath': undefined, // defaults to /epub_content/epub_library.json inside Chrome's filesystem storage
'imagePathPrefix': undefined,
'canHandleUrl' : false,
'canHandleDirectory' : true,
'workerUrl': '/scripts/readium-js-viewer_CHROMEAPP-WORKER.js',
'epubReadingSystemUrl': self.location.origin + '/scripts/epubReadingSystem.js'
}
}
});