Git Product home page Git Product logo

Comments (4)

OliverUv avatar OliverUv commented on August 10, 2024

Ah, I should note that I've tried this both with english and with korean language.

from entryjs.

chanlee avatar chanlee commented on August 10, 2024

Actually entryjs does not save an image. see below code (from src/painter.js)


Entry.Painter.prototype.file_save = function(saveChanges) {

    this.clearHandle();
    this.transparent();
    this.trim();

    var canvasImage = this.canvas_.toDataURL();
    Entry.dispatchEvent('saveCanvasImage', {
                        file: (saveChanges ? this.file_ : this.file),
                        image: canvasImage
    });

    this.file.modified = false;

};

As see above, entryjs's painter does just dispatch "saveCanvasImage" event with DataURL.
So, you have to implement rest of things like this.

Entry.addEventListener('saveCanvasImage', saveImage);
...
function saveImage(dataURL) {
    var formData = new FormData();
    formData.append("data", dataURL.image);
    $.ajax({
        url: '/api/for/saving/image'
        data: formData,
        type: post,
        ....
}

good luck!

from entryjs.

OliverUv avatar OliverUv commented on August 10, 2024

Ah! That is good to know. But the more important thing is that I cannot Add new object to the project. This should work, right?

It would be good if I can fix all these things, so that I can publish a small reference project that uses entryjs. This way it will be easier for others to get started, too.

from entryjs.

chanlee avatar chanlee commented on August 10, 2024

I think entry-offline is good reference project for you. It is electron based offline version of Entry.
It implements most of Entry workspace functions.

Look into the app/src/workspace.js. I think 624 to 690 lines might be help you.

Have fun~

from entryjs.

Related Issues (20)

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.