I have learned how to integrate custom commands in the Tiny Toolbar with the ed.addButton() Function.
Is there a similar way to add functionality to the Upper menu, the menubar ?
In the Tiny Documentation I just found how to change the order of the menu secton with this code in the init function:
menubar: "tools table format view insert edit",
Examples :
// Adds a custom menu item to the editor that inserts contents when clicked
// The context option allows you to add the menu item to an existing default menu
tinymce.init({
...
setup: function(ed) {
ed.addMenuItem('example', {
title: 'My menu item',
context: 'tools',
onclick: function() {
ed.insertContent('Hello world!!');
}
});
}
});
来源:https://stackoverflow.com/questions/18250656/is-it-possible-to-have-custom-functions-and-commands-in-the-tinymce4-menubar