tinymce.full.js
function (name, settings) {
        var self = this;

        if (settings.cmd) {
          settings.onclick = function () {
            self.execCommand(settings.cmd);
          };
        }

        self.menuItems = self.menuItems || {};
        self.menuItems[name] = settings;
      }
function (name, settings) {
        var self = this;

        if (settings.cmd) {
          settings.onclick = function () {
            self.execCommand(settings.cmd);
          };
        }

        self.menuItems = self.menuItems || {};
        self.menuItems[name] = settings;
      }
function ( name , settings ) { var self = this ; if ( settings . cmd ) { settings . onclick = function ( ) { self . execCommand ( settings . cmd ) ; } ; } self . menuItems = self . menuItems || { } ; self . menuItems [ name ] = settings ; }
Adds a menu item to be used in the menus of the theme. There might be multiple instances
of this menu item for example it might be used in the main menus of the theme but also in
the context menu so make sure that it's self contained and supports multiple instances.

@method addMenuItem
@param {String} name Menu item name to add.
@param {Object} settings Settings object with title, cmd etc.
@example
// 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', {
text: 'My menu item',
context: 'tools',
onclick: function() {
ed.insertContent('Hello world!!');
}
});
}
});
Adds a menu item to be used in the menus of the theme . There might be multiple instances of this menu item for example it might be used in the main menus of the theme but also in the context menu so make sure that it s self contained and supports multiple instances .