Google help on software/programming And Windows Tricks: Add Extra Button in CK Editor

helponsoftware

Friday 5 June 2015

Add Extra Button in CK Editor

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());
});

No comments:

Post a Comment