summaryrefslogtreecommitdiff
path: root/read.html
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-02-26 13:42:00 +0300
committerAndrew Dolgov <[email protected]>2017-02-26 13:42:00 +0300
commit8aaf1fad0c1cfa65132f052f0f98b3452ddc4eeb (patch)
tree2b44d22cb37d126caca770eb63d6608b6efb8000 /read.html
parent84230a6809d7ce8bd5d0161d1f91df4a4b7b32a0 (diff)
various offline-related fixes
Diffstat (limited to 'read.html')
-rw-r--r--read.html9
1 files changed, 5 insertions, 4 deletions
diff --git a/read.html b/read.html
index 8db7e60..aafbc96 100644
--- a/read.html
+++ b/read.html
@@ -343,10 +343,10 @@
var url = "backend.php?op=getpagination&id=" + encodeURIComponent($.urlParam("id"));
EPUBJS.core.request(url).then(function(pageList) {
- console.log("pagination: requesting remote");
+ console.log("pagination: requesting remote: ");
if (book.loadPagination(pageList).length > 0) {
- localforage.setItem(cacheId("pagination"), pageList);
+ localforage.setItem(cacheId("pagination"), JSON.parse(pageList));
_pagination_stored = 1;
} else {
book.generatePagination();
@@ -417,7 +417,8 @@
var currentCfi = book.getCurrentLocationCfi();
var currentPage = location.anchorPage;
-
+ var totalPages = book.pagination.totalPages;
+
if (navigator.onLine) {
$.post("backend.php", { op: "storelastread", id: $.urlParam("id"), page: currentPage,
@@ -436,7 +437,7 @@
}
localforage.setItem(cacheId("lastread"),
- {cfi: currentCfi, page: currentPage});
+ {cfi: currentCfi, page: currentPage, total: totalPages});
}
});