mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Add canonical function to Hypothesis example
This commit is contained in:
parent
e3a8e9c205
commit
1037e867d2
2 changed files with 13 additions and 8 deletions
|
@ -3,9 +3,14 @@
|
|||
function start() {
|
||||
var params = URLSearchParams && new URLSearchParams(document.location.search.substring(1));
|
||||
var url = params && params.get("url") && decodeURIComponent(params.get("url"));
|
||||
|
||||
var defaultUrl = window.location.protocol + "//s3.amazonaws.com/epubjs.org/books/moby-dick-hypothesis-demo.epub";
|
||||
// Load the opf
|
||||
var book = ePub(url || window.location.protocol + "//s3.amazonaws.com/epubjs.org/books/moby-dick-hypothesis-demo.epub");
|
||||
var book = ePub(url || defaultUrl, {
|
||||
canonical: function(path) {
|
||||
var url = window.location.href.replace(/loc=([^&]*)/, "loc="+path);
|
||||
return url;
|
||||
}
|
||||
});
|
||||
var rendition = book.renderTo("viewer", {
|
||||
ignoreClass: "annotator-hl",
|
||||
width: "100%",
|
||||
|
|
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "epubjs",
|
||||
"version": "0.3.61",
|
||||
"version": "0.3.63",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -4741,7 +4741,7 @@
|
|||
"esprima": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
|
||||
"integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=",
|
||||
"integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
|
||||
"dev": true
|
||||
},
|
||||
"esquery": {
|
||||
|
@ -4830,7 +4830,7 @@
|
|||
},
|
||||
"event-stream": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
|
||||
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
|
||||
"integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -8641,7 +8641,7 @@
|
|||
"is-plain-object": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
|
||||
"integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=",
|
||||
"integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isobject": "^3.0.1"
|
||||
|
@ -8836,7 +8836,7 @@
|
|||
"jschardet": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz",
|
||||
"integrity": "sha1-xRn2KfhrOlvtuliojTETCe7Al/k=",
|
||||
"integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==",
|
||||
"dev": true
|
||||
},
|
||||
"jsesc": {
|
||||
|
@ -9116,7 +9116,7 @@
|
|||
"karma-chrome-launcher": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz",
|
||||
"integrity": "sha1-zxudBxNswY/iOTJ9JGVMPbw2is8=",
|
||||
"integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs-access": "^1.0.0",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue