Created
December 10, 2010 22:01
-
-
Save pierrel/736892 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $j('#something').html('fetching'); | |
| $j.ajax({ | |
| url: '/path/to/epub.epub', | |
| complete: function(response, status, request) { | |
| var the_zip = new JSUnzip(response.responseText); | |
| $j('#something').html('finished with ' + status); | |
| console.log("is it zip?" + the_zip.isZipFile()); | |
| var epub = new JSEpub(response.responseText); | |
| epub.processInSteps(function (step, extras) { | |
| var msg = ''; | |
| console.log(step); | |
| if (step === 1) { | |
| msg = "Unzipping"; | |
| } else if (step === 2) { | |
| msg = "Uncompressing " + extras; | |
| } else if (step === 3) { | |
| msg = "Reading OPF"; | |
| } else if (step === 4) { | |
| msg = "Post processing"; | |
| } else if (step === 5) { | |
| msg = "Finishing"; | |
| alert('done!'); | |
| } else { | |
| msg = "Error!"; | |
| } | |
| $j('#something').html(msg); | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment