Hi
I have this code:
img.setAttribute('src',encodeURI(imageUrl));
It modifies the DOM (CKEditor-DOM?) of the HTML document in the editor, as it should: The replacement image is shown.
But this doesn't affect CKEditor's Preview window.
How to make it work? What to do so that the modification has an effect on the Preview window? (and on the data gotten from getData() )
Tobi
I have this code:
img.setAttribute('src',encodeURI(imageUrl));
It modifies the DOM (CKEditor-DOM?) of the HTML document in the editor, as it should: The replacement image is shown.
But this doesn't affect CKEditor's Preview window.
How to make it work? What to do so that the modification has an effect on the Preview window? (and on the data gotten from getData() )
Tobi
Re: Modifying the editor's DOM doesn't affect Preview window
It would be great if someone could help me with this issue.
Tobi
Re: Modifying the editor's DOM doesn't affect Preview window
Re: Modifying the editor's DOM doesn't affect Preview window
How to (using JS) modify the HTML code of the document in the proper way - so that it will really be changed: so that I can expect the preview window (and the data from getData() ) to reflect these changes.
Tobi
Re: Modifying the editor's DOM doesn't affect Preview window
What I've described is more or less how the majority of the important bits of the plugin system in CKEditor work. Look at the source code for examples. It's all in there. It's very simple and easy to understand javascript.
Once you learn what an event listener is, how to fire an event and how to create new CKEditor commands, you should be able to do what you want.
Thanks,
Zanpakutō