mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Updated URL parsing to handle remote book paths
This commit is contained in:
parent
b6b48e0b08
commit
fe8edc77c1
3 changed files with 34 additions and 9 deletions
|
@ -3,7 +3,7 @@ EPUBJS.Book = function(_url){
|
|||
this.opening = new RSVP.defer();
|
||||
this.opened = this.opening.promise;
|
||||
|
||||
this.baseUrl = undefined;
|
||||
this.url = undefined;
|
||||
|
||||
this.spine = undefined;
|
||||
|
||||
|
@ -59,9 +59,14 @@ EPUBJS.Book.prototype.open = function(_url){
|
|||
// Find path to the Container
|
||||
if(uri.extension === "opf") {
|
||||
// Direct link to package, no container
|
||||
this.packageUrl = uri.path;
|
||||
this.packageUrl = uri.href;
|
||||
this.containerUrl = '';
|
||||
this.url = uri.directory;
|
||||
|
||||
if(uri.origin) {
|
||||
this.url = uri.origin + "/" + uri.directory;
|
||||
} else {
|
||||
this.url = uri.directory;
|
||||
}
|
||||
|
||||
epubPackage = this.request(this.packageUrl);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue