addButton

public function addButton(name:String, settings:Object):void
Adds a button that later gets created by the ControlManager. This is a shorter and easier method of adding buttons without the need to deal with the ControlManager directly. But it's also less powerfull if you need more control use the ControlManagers factory methods instead.

Examples

// Adds a custom button to the editor and when a user clicks the button it will open
// an alert box with the selected contents as plain text.
tinyMCE.init({
   ...

   theme_advanced_buttons1 : 'example,..'

   setup : function(ed) {
      // Register example button
      ed.addButton('example', {
         title : 'example.desc',
         image : '../jscripts/tiny_mce/plugins/example/img/example.gif',
         onclick : function() {
            ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format : 'text'}));
         }
      });
   }
});

Params

Name Type Description
name String Button name to add.
settings Object Settings object with title, cmd etc.