From 05524168a957704eabbd3713a6d8efea9f055b80 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 27 Feb 2017 12:30:58 +0300 Subject: display progress % --- read.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'read.html') diff --git a/read.html b/read.html index c705a49..1d1f38a 100644 --- a/read.html +++ b/read.html @@ -144,7 +144,8 @@ @@ -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"); -- cgit v1.2.3