mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
handle books without internal folders
This commit is contained in:
parent
1e592badd1
commit
7c15cec459
2 changed files with 9 additions and 5 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
@ -96,7 +96,7 @@ FP.Book.prototype.start = function(bookPath){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.isSaved()){
|
if(!this.isSaved(true)){
|
||||||
|
|
||||||
if(!this.online) {
|
if(!this.online) {
|
||||||
console.error("Not Online");
|
console.error("Not Online");
|
||||||
|
@ -240,15 +240,19 @@ FP.Book.prototype.parseContainer = function(path){
|
||||||
rootfile = container.querySelector("rootfile");
|
rootfile = container.querySelector("rootfile");
|
||||||
|
|
||||||
fullpath = rootfile.getAttribute('full-path').split("/");
|
fullpath = rootfile.getAttribute('full-path').split("/");
|
||||||
|
|
||||||
that.basePath = that.bookUrl + fullpath[0] + "/";
|
if(fullpath[1]){
|
||||||
|
that.basePath = that.bookUrl + fullpath[0] + "/";
|
||||||
|
that.contentsPath = that.basePath + fullpath[1];
|
||||||
|
}else{
|
||||||
|
that.basePath = that.bookUrl;
|
||||||
|
that.contentsPath = that.bookUrl + fullpath;
|
||||||
|
}
|
||||||
|
|
||||||
if(that.contained){
|
if(that.contained){
|
||||||
that.basePath = fullpath[0] + "/";
|
that.basePath = fullpath[0] + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
that.contentsPath = that.basePath + fullpath[1];
|
|
||||||
|
|
||||||
localStorage.setItem("basePath", that.basePath);
|
localStorage.setItem("basePath", that.basePath);
|
||||||
localStorage.setItem("contentsPath", that.contentsPath);
|
localStorage.setItem("contentsPath", that.contentsPath);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue