Skip to content

Commit

Permalink
Xpath not used if unavailable, location percent returned from 0-1 (no…
Browse files Browse the repository at this point in the history
… rounding)
  • Loading branch information
fchasen committed Aug 7, 2015
1 parent 63aca34 commit 2b88e70
Show file tree
Hide file tree
Showing 15 changed files with 1,884 additions and 1,818 deletions.
904 changes: 460 additions & 444 deletions build/epub.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/epub.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/epub.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/epub.min.map

Large diffs are not rendered by default.

904 changes: 460 additions & 444 deletions build/epub_no_underscore.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/epub_no_underscore.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<script>
"use strict";

var Book = ePub("../reader/moby-dick/");
var Book = ePub("../books/moby-dick/");

</script>
</head>
Expand Down
9 changes: 5 additions & 4 deletions examples/locations.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
book.ready.all.then(function(){
// Load in stored locations from json or local storage
var key = book.generateBookKey()+'-locations';
var stored = false;//localStorage.getItem(key);
var stored = localStorage.getItem(key);
if (stored) {
return book.locations.load(stored);
} else {
Expand Down Expand Up @@ -166,17 +166,18 @@
controls.appendChild(slider);

currentPage.addEventListener("change", function(){
var cfi = book.locations.cfiFromPercentage(currentPage.value);
var cfi = book.locations.cfiFromPercentage(currentPage.value/100);
book.gotoCfi(cfi);
}, false);

// Listen for location changed event, get percentage from CFI
book.on('renderer:locationChanged', function(location){
var percent = book.locations.percentageFromCfi(location);
var percentage = Math.floor(percent * 100);
if(!mouseDown) {
slider.value = percent;
slider.value = percentage;
}
currentPage.value = percent;
currentPage.value = percentage;
});

// Save out the generated locations to JSON
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EpubJS",
"version": "0.2.6",
"version": "0.2.7",
"repository": "https://github.com/futurepress/epub.js",
"devDependencies": {
"colors": "~0.6.2",
Expand Down
2 changes: 1 addition & 1 deletion reader/js/epub.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 2b88e70

Please sign in to comment.