mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
style highlights examples
This commit is contained in:
parent
98ce08091d
commit
d9a19e5a28
10 changed files with 445 additions and 156 deletions
|
@ -53,7 +53,7 @@ function request(url, type, withCredentials, headers) {
|
|||
|
||||
if(core.isXml(type)) {
|
||||
xhr.responseType = "document";
|
||||
// xhr.overrideMimeType('text/xml'); // for OPF parsing
|
||||
xhr.overrideMimeType('text/xml'); // for OPF parsing
|
||||
}
|
||||
|
||||
if(type == 'xhtml') {
|
||||
|
@ -81,6 +81,15 @@ function request(url, type, withCredentials, headers) {
|
|||
if (this.status === 200 || this.responseXML ) { //-- Firefox is reporting 0 for blob urls
|
||||
var r;
|
||||
|
||||
if (!this.response && !this.responseXML) {
|
||||
deferred.reject({
|
||||
status: this.status,
|
||||
message : "Empty Response",
|
||||
stack : new Error().stack
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
if((this.responseType == '' || this.responseType == 'document')
|
||||
&& this.responseXML){
|
||||
r = this.responseXML;
|
||||
|
@ -91,6 +100,7 @@ function request(url, type, withCredentials, headers) {
|
|||
r = new DOMParser().parseFromString(this.response, "text/xml");
|
||||
}else
|
||||
if(type == 'xhtml'){
|
||||
console.log(this.response);
|
||||
r = new DOMParser().parseFromString(this.response, "application/xhtml+xml");
|
||||
}else
|
||||
if(type == 'html' || type == 'htm'){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue