1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Built, adding to v0.2.3

This commit is contained in:
fchasen 2014-12-04 23:10:04 -05:00
parent 274f11c0bf
commit e9ebec3f64
9 changed files with 80 additions and 38 deletions

View file

@ -2486,7 +2486,9 @@ EPUBJS.Book.prototype.unpack = function(packageXml){
//-- Set Globbal Layout setting based on metadata
book.globalLayoutProperties = book.parseLayoutProperties(book.metadata);
book.cover = book.contents.cover = book.settings.contentsPath + book.contents.coverPath;
if(book.contents.coverPath) {
book.cover = book.contents.cover = book.settings.contentsPath + book.contents.coverPath;
}
book.spineNodeIndex = book.contents.spineNodeIndex;
@ -3905,6 +3907,7 @@ EPUBJS.core.uri = function(url){
fragment : '',
href : url
},
blob = url.indexOf('blob:'),
doubleSlash = url.indexOf('://'),
search = url.indexOf('?'),
fragment = url.indexOf("#"),
@ -3912,6 +3915,12 @@ EPUBJS.core.uri = function(url){
dot,
firstSlash;
if(blob === 0) {
uri.protocol = "blob";
uri.base = url.indexOf(0, fragment);
return uri;
}
if(fragment != -1) {
uri.fragment = url.slice(fragment + 1);
url = url.slice(0, fragment);
@ -5753,7 +5762,7 @@ EPUBJS.Render.Iframe.prototype.load = function(chapter){
render.document = render.iframe.contentDocument;
render.docEl = render.document.documentElement;
render.headEl = render.document.head;
render.bodyEl = render.document.body;
render.bodyEl = render.document.body || render.document.querySelector("body");
render.window = render.iframe.contentWindow;
render.window.addEventListener("resize", render.resized.bind(render), false);
@ -7192,16 +7201,21 @@ EPUBJS.replace.hrefs = function(callback, renderer){
var href = link.getAttribute("href"),
isRelative = href.search("://"),
directory,
relative;
relative,
location;
if(isRelative != -1){
link.setAttribute("target", "_blank");
}else{
// Links may need to be resolved, such as ../chp1.xhtml
directory = EPUBJS.core.uri(renderer.render.window.location.href).directory;
relative = EPUBJS.core.resolveUrl(directory, href);
if(directory) {
relative = EPUBJS.core.resolveUrl(directory, href);
} else {
relative = href;
}
link.onclick = function(){
book.goto(relative);
@ -7357,7 +7371,7 @@ EPUBJS.Unarchiver.prototype.getXml = function(url, encoding){
return this.getText(url, encoding).
then(function(text){
var parser = new DOMParser();
return parser.parseFromString(text, "application/xml");
return parser.parseFromString(text, "text/xml");
});
};

File diff suppressed because one or more lines are too long

6
build/epub.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2485,7 +2485,9 @@ EPUBJS.Book.prototype.unpack = function(packageXml){
//-- Set Globbal Layout setting based on metadata
book.globalLayoutProperties = book.parseLayoutProperties(book.metadata);
book.cover = book.contents.cover = book.settings.contentsPath + book.contents.coverPath;
if(book.contents.coverPath) {
book.cover = book.contents.cover = book.settings.contentsPath + book.contents.coverPath;
}
book.spineNodeIndex = book.contents.spineNodeIndex;
@ -3904,6 +3906,7 @@ EPUBJS.core.uri = function(url){
fragment : '',
href : url
},
blob = url.indexOf('blob:'),
doubleSlash = url.indexOf('://'),
search = url.indexOf('?'),
fragment = url.indexOf("#"),
@ -3911,6 +3914,12 @@ EPUBJS.core.uri = function(url){
dot,
firstSlash;
if(blob === 0) {
uri.protocol = "blob";
uri.base = url.indexOf(0, fragment);
return uri;
}
if(fragment != -1) {
uri.fragment = url.slice(fragment + 1);
url = url.slice(0, fragment);
@ -5752,7 +5761,7 @@ EPUBJS.Render.Iframe.prototype.load = function(chapter){
render.document = render.iframe.contentDocument;
render.docEl = render.document.documentElement;
render.headEl = render.document.head;
render.bodyEl = render.document.body;
render.bodyEl = render.document.body || render.document.querySelector("body");
render.window = render.iframe.contentWindow;
render.window.addEventListener("resize", render.resized.bind(render), false);
@ -7191,16 +7200,21 @@ EPUBJS.replace.hrefs = function(callback, renderer){
var href = link.getAttribute("href"),
isRelative = href.search("://"),
directory,
relative;
relative,
location;
if(isRelative != -1){
link.setAttribute("target", "_blank");
}else{
// Links may need to be resolved, such as ../chp1.xhtml
directory = EPUBJS.core.uri(renderer.render.window.location.href).directory;
relative = EPUBJS.core.resolveUrl(directory, href);
if(directory) {
relative = EPUBJS.core.resolveUrl(directory, href);
} else {
relative = href;
}
link.onclick = function(){
book.goto(relative);
@ -7356,7 +7370,7 @@ EPUBJS.Unarchiver.prototype.getXml = function(url, encoding){
return this.getText(url, encoding).
then(function(text){
var parser = new DOMParser();
return parser.parseFromString(text, "application/xml");
return parser.parseFromString(text, "text/xml");
});
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

26
reader/js/epub.min.js vendored
View file

@ -2486,7 +2486,9 @@ EPUBJS.Book.prototype.unpack = function(packageXml){
//-- Set Globbal Layout setting based on metadata
book.globalLayoutProperties = book.parseLayoutProperties(book.metadata);
book.cover = book.contents.cover = book.settings.contentsPath + book.contents.coverPath;
if(book.contents.coverPath) {
book.cover = book.contents.cover = book.settings.contentsPath + book.contents.coverPath;
}
book.spineNodeIndex = book.contents.spineNodeIndex;
@ -3905,6 +3907,7 @@ EPUBJS.core.uri = function(url){
fragment : '',
href : url
},
blob = url.indexOf('blob:'),
doubleSlash = url.indexOf('://'),
search = url.indexOf('?'),
fragment = url.indexOf("#"),
@ -3912,6 +3915,12 @@ EPUBJS.core.uri = function(url){
dot,
firstSlash;
if(blob === 0) {
uri.protocol = "blob";
uri.base = url.indexOf(0, fragment);
return uri;
}
if(fragment != -1) {
uri.fragment = url.slice(fragment + 1);
url = url.slice(0, fragment);
@ -5753,7 +5762,7 @@ EPUBJS.Render.Iframe.prototype.load = function(chapter){
render.document = render.iframe.contentDocument;
render.docEl = render.document.documentElement;
render.headEl = render.document.head;
render.bodyEl = render.document.body;
render.bodyEl = render.document.body || render.document.querySelector("body");
render.window = render.iframe.contentWindow;
render.window.addEventListener("resize", render.resized.bind(render), false);
@ -7192,16 +7201,21 @@ EPUBJS.replace.hrefs = function(callback, renderer){
var href = link.getAttribute("href"),
isRelative = href.search("://"),
directory,
relative;
relative,
location;
if(isRelative != -1){
link.setAttribute("target", "_blank");
}else{
// Links may need to be resolved, such as ../chp1.xhtml
directory = EPUBJS.core.uri(renderer.render.window.location.href).directory;
relative = EPUBJS.core.resolveUrl(directory, href);
if(directory) {
relative = EPUBJS.core.resolveUrl(directory, href);
} else {
relative = href;
}
link.onclick = function(){
book.goto(relative);
@ -7357,7 +7371,7 @@ EPUBJS.Unarchiver.prototype.getXml = function(url, encoding){
return this.getText(url, encoding).
then(function(text){
var parser = new DOMParser();
return parser.parseFromString(text, "application/xml");
return parser.parseFromString(text, "text/xml");
});
};

View file

@ -123,7 +123,7 @@ EPUBJS.core.uri = function(url){
dot,
firstSlash;
if(blob == 0) {
if(blob === 0) {
uri.protocol = "blob";
uri.base = url.indexOf(0, fragment);
return uri;