Guest User

Untitled

a guest
Jul 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. $j('#something').html('fetching');
  2. $j.ajax({
  3. url: '/path/to/epub.epub',
  4. complete: function(response, status, request) {
  5. var the_zip = new JSUnzip(response.responseText);
  6. $j('#something').html('finished with ' + status);
  7.  
  8. console.log("is it zip?" + the_zip.isZipFile());
  9. var epub = new JSEpub(response.responseText);
  10.  
  11. epub.processInSteps(function (step, extras) {
  12. var msg = '';
  13. console.log(step);
  14. if (step === 1) {
  15. msg = "Unzipping";
  16. } else if (step === 2) {
  17. msg = "Uncompressing " + extras;
  18. } else if (step === 3) {
  19. msg = "Reading OPF";
  20. } else if (step === 4) {
  21. msg = "Post processing";
  22. } else if (step === 5) {
  23. msg = "Finishing";
  24. alert('done!');
  25. } else {
  26. msg = "Error!";
  27. }
  28.  
  29. $j('#something').html(msg);
  30. });
  31.  
  32. }
  33. });
Add Comment
Please, Sign In to add comment