editor.addCommand("mySimpleCommand", { // create named command
exec: function(edt) {
CKEDITOR.instances.ckeditor.setData("yes i am working");
}
});
editor.ui.addButton('SuperButton', { // add new button and bind our command
label: "Spine",
command: 'mySimpleCommand',
toolbar: 'insert',
icon: 'https://avatars1.githubusercontent.com/u/5500999?v=2&s=16'
});
editor.on( 'change', function( evt ) {
// getData() returns CKEditor's HTML content.
console.log( 'Total bytes: ' + evt.editor.getData());
});
exec: function(edt) {
CKEDITOR.instances.ckeditor.setData("yes i am working");
}
});
editor.ui.addButton('SuperButton', { // add new button and bind our command
label: "Spine",
command: 'mySimpleCommand',
toolbar: 'insert',
icon: 'https://avatars1.githubusercontent.com/u/5500999?v=2&s=16'
});
editor.on( 'change', function( evt ) {
// getData() returns CKEditor's HTML content.
console.log( 'Total bytes: ' + evt.editor.getData());
});