JSFiddle - React, Tailwind, and code Playground
by Scott C
HTML
<script src="//cdn.ckeditor.com/4.5.11/standard/ckeditor.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<textarea name='editor'>
test text
</textarea>
<button id="start">
Start
</button>
<button id="finish">
Finish
</button>
JavaScript
CKEDITOR.replace('editor');
CKEDITOR.instances.editor.addCommand('testCommand', {
async: true,
contextSensitive: false,
exec: function(editor) {
console.log("handler attached!");
$("#finish").click(function() {
editor.fire('afterCommandExec')
});
}
});
$("#start").click(function() {
CKEDITOR.instances.editor.execCommand('testCommand');
});