Git Product home page Git Product logo

js-epub's Introduction

js-epub's People

Contributors

augustl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-epub's Issues

Variable hoisting cause unpredictable postProcess behaviors

postProcess: function () {
    for (var key in this.opf.manifest) {
        var mediaType = this.opf.manifest[key]["media-type"]
        var href = this.opf.manifest[key]["href"]
        var result = undefined;   // "result" is hoisted, so it must be initialize to undefined explicitly

        if (mediaType === "text/css") {
            result = this.postProcessCSS(href);
        } else if (mediaType === "application/xhtml+xml") {
            result = this.postProcessHTML(href);
        }

        if (result !== undefined) {
            this.files[href] = result;
        }
    }
}

TypeError: 'undefined' is not an object (evaluating 'c.getElementsByTagName("rootfile")[0].getAttribute')

Hey there,
it seems like a very nice library. However, whenever I try to read a file from a servlet written in Java, I get the following error (Safari 5.1.2/Chrome 16.0.912.77):
TypeError: 'undefined' is not an object (evaluating 'c.getElementsByTagName("rootfile")[0].getAttribute')

I have tried with Base64 encoding, without, but it still gives me the same error. What do you think could be the problem?

Thanks!

Rewrite DOM href parser

The parser manually scans for img tags now, with a regexp.

Rewrite it to use DOMParser. Look for <a> and <link> as well as <img>.

fails in post processsing

hai,
i am using the following code but it does not goes beyond step3.pls help me by providing some suggestions.

$(document).ready(function(){
$.ajax({
url: "alice.epub",
complete: function(response, status, request) {
var the_zip = new JSUnzip(response.responseText);
$('#something').html('finished with ' + status);
console.log("is it zip?" + the_zip.isZipFile());
var epub = new JSEpub(response.responseText);
alert(epub);
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 OPS";
}
else if (step === 4) {
msg = "Post processing";
alert(msg);
}
else if (step === 5) {
msg = "Finishing";
alert('done!');
}
else {
msg = "Error!";
}
$('#something').html(msg);

});
}
});
});

Example needed

Hello, the script seems good when reading the source code, but the documentation isn't clear and I can't test it locally. I tried downloading an epub file with XHR as is suggested in Usage, but I can't make it work. It would be wonderful if you could provide an example HTML file to test the script and also use it as a starting point, or at least point to a webpage using js-epub in order to see how it is done.
Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.