TinyMCE:API/tinymce.Editor/onExecCommand
From Moxiecode Documentation Wiki
Contents |
[edit]
Event: onExecCommand
[edit]
Summary
This event gets executed after a command has been executed like Bold or CreateLink.
[edit]
Syntax
event_callback(<tinymce.Editor> ed, <String> cmd, <Boolean> ui, <Object> val)
[edit]
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.
[edit]
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();
