1
0
Fork 0
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:
Fred Chasen 2013-01-26 21:19:20 -08:00
parent 1e592badd1
commit 7c15cec459
2 changed files with 9 additions and 5 deletions

View file

@ -96,7 +96,7 @@ FP.Book.prototype.start = function(bookPath){
}
}
if(!this.isSaved()){
if(!this.isSaved(true)){
if(!this.online) {
console.error("Not Online");
@ -240,15 +240,19 @@ FP.Book.prototype.parseContainer = function(path){
rootfile = container.querySelector("rootfile");
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){
that.basePath = fullpath[0] + "/";
}
that.contentsPath = that.basePath + fullpath[1];
localStorage.setItem("basePath", that.basePath);
localStorage.setItem("contentsPath", that.contentsPath);