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%",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue