summaryrefslogtreecommitdiff
path: root/read.html
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-02-27 12:30:58 +0300
committerAndrew Dolgov <[email protected]>2017-02-27 12:30:58 +0300
commit05524168a957704eabbd3713a6d8efea9f055b80 (patch)
tree31735dfe51b544b3e6b24946433464945ca5fe78 /read.html
parentcb7efee819f84425c23746250c9df19b18cd5c96 (diff)
display progress %
Diffstat (limited to 'read.html')
-rw-r--r--read.html19
1 files changed, 17 insertions, 2 deletions
diff --git a/read.html b/read.html
index c705a49..1d1f38a 100644
--- a/read.html
+++ b/read.html
@@ -144,7 +144,8 @@
<div class="footer">
<div class="notice bg-warning text-warning" style="display : none"></div>
<div class="location">
- Loc: <span id="cur_page">-1</span> / <span id="total_pages">-1</span>
+ Loc: <span id="cur_page">?</span> / <span id="total_pages">?</span>
+ (<span id="page_pct">?</span>)
</div>
</div>
@@ -420,8 +421,15 @@
});
}
+ var curPage = book.pagination.pageFromCfi(book.getCurrentLocationCfi());
+
$("#total_pages").html(book.pagination.totalPages);
- $("#cur_page").html(book.pagination.pageFromCfi(book.getCurrentLocationCfi()));
+ $("#cur_page").html(curPage);
+
+ if (book.pagination.totalPages > 0) {
+ var pct = parseInt(curPage / book.pagination.totalPages * 100);
+ $("#page_pct").html(pct + "%");
+ }
window.setTimeout(function() {
$(".loading").hide();
@@ -447,6 +455,13 @@
$(".loading").hide();
$("#cur_page").html(location.anchorPage);
+ var total = book.pagination.totalPages;
+
+ if (book.pagination.totalPages > 0) {
+ var pct = parseInt(location.anchorPage / book.pagination.totalPages * 100);
+ $("#page_pct").html(pct + "%");
+ }
+
if (_store_position && new Date().getTime()/1000 - _last_position_sync > 60) {
console.log("storing lastread");