I'm doing my own TinyMCE toolbar and I want to add the exact same functionality as when you choose Format>Code, but as its own button in the toolbar. Is that possible and how should I do that?
Thank you!
I figured it out. You can add your own button and then have it execute a command.
setup: function(editor) {
editor.ui.registry.addButton('strikeout', {
icon: 'sourcecode',
tooltip: "Format as code",
onAction: function() {
editor.execCommand('mceToggleFormat', false, 'code');
}
});
}