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

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

        if (!settings.text && !settings.icon) {
          settings.icon = name;
        }

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

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

        if (!settings.text && !settings.icon) {
          settings.icon = name;
        }

        self.buttons = self.buttons || {};
        settings.tooltip = settings.tooltip || settings.title;
        self.buttons[name] = settings;
      }
function ( name , settings ) { var self = this ; if ( settings . cmd ) { settings . onclick = function ( ) { self . execCommand ( settings . cmd ) ; } ; } if ( ! settings . text && ! settings . icon ) { settings . icon = name ; } self . buttons = self . buttons || { } ; settings . tooltip = settings . tooltip || settings . title ; self . buttons [ name ] = settings ; }
Adds a button that later gets created by the theme in the editors toolbars.

@method addButton
@param {String} name Button name to add.
@param {Object} settings Settings object with title, cmd etc.
@example
// Adds a custom button to the editor that inserts contents when clicked
tinymce.init({
...

toolbar: 'example'

setup: function(ed) {
ed.addButton('example', {
title: 'My title',
image: '../js/tinymce/plugins/example/img/example.gif',
onclick: function() {
ed.insertContent('Hello world!!');
}
});
}
});
Adds a button that later gets created by the theme in the editors toolbars .