GithubHelp home page GithubHelp logo

Comments (4)

tiff avatar tiff commented on July 28, 2024

Hey Chris, sorry, what save feature are you talking about?

from wysihtml5.

chrisjstevenson avatar chrisjstevenson commented on July 28, 2024

Hi, I'm trying to figure out how I can save the editor's markup back to some server side code. I was looking through your examples but the only related content involved [data-wysihtml5-dialog-action="save"], and I'm not sure that's relevant.

Ideally I'd be looking for a way to trigger an callback function that would allow me to get at the HTML markup that's created when a person formats text in the editor.

from wysihtml5.

tiff avatar tiff commented on July 28, 2024

Hi @chrisjstevenson,

First of all: [data-wysihtml5-dialog-action="save"]is not what you are looking for.
It's used for applying the values of a dialog (insertImage, insertLink, ...).

The editor always keeps its corresponding <textarea> in sync.
The <textarea> will always hold the current generated html markup.
In order to send the html to the server just put your <textarea> in a <form> and submit it.

If you want to access the current editor value via JS api:

var editor = new wysihtml5(...);
var currentValue = editor.getValue(); // there you go!

If you need to execute something when the user formatted:

editor.on("aftercommand:composer", function() {
    doSomething();
});

(make sure to use wysihtml5 0.3 RC1)

Please close this issue if it answered your questions.

from wysihtml5.

chrisjstevenson avatar chrisjstevenson commented on July 28, 2024

Thanks, will try this

from wysihtml5.

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.