mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
added loading from zipped epub file
This commit is contained in:
parent
2ddae3a024
commit
1e592badd1
13 changed files with 288 additions and 57 deletions
|
@ -163,3 +163,21 @@ FP.core.dataURLToBlob = function(dataURL) {
|
|||
return new Blob([uInt8Array], {type: contentType});
|
||||
}
|
||||
|
||||
//-- Load scripts async: http://stackoverflow.com/questions/7718935/load-scripts-asynchronously
|
||||
FP.core.loadScript = function(src, callback) {
|
||||
var s, r;
|
||||
r = false;
|
||||
s = document.createElement('script');
|
||||
s.type = 'text/javascript';
|
||||
s.async = true;
|
||||
s.src = src;
|
||||
s.onload = s.onreadystatechange = function() {
|
||||
//console.log( this.readyState ); //uncomment this line to see which ready states are called.
|
||||
if ( !r && (!this.readyState || this.readyState == 'complete') )
|
||||
{
|
||||
r = true;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
document.body.appendChild(s);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue