TinyMCE:API/tinymce.Editor/onExecCommand

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Event: onExecCommand

Summary

This event gets executed after a command has been executed like Bold or CreateLink.

Syntax

event_callback(<tinymce.Editor> ed, <String> cmd, <Boolean> ui, <Object> val)

Parameters

ed
Sender object/Editor instance that is serializing an element.
cmd
Command name like Bold or CreateLink.
ui
User interface state, should a dialog be displayed or not.
val
Value object, can be the URL for a link or similar.

Examples

// Adds an observer to the onExecCommand event using tinyMCE.init
tinyMCE.init({
   ...
   setup : function(ed) {
      ed.onExecCommand.add(function(ed, cmd, ui, val) {
          console.debug('Command was executed: ' + cmd);
      });
   }
});

// Adds an observer to the onExecCommand event using the render method
var ed = new tinymce.Editor('someid', {
   .. Some settings
});

ed.onExecCommand.add(function(ed, cmd, ui, val) {
   console.debug('Command was executed: ' + cmd);
});

ed.render();
Personal tools