1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <title>Option: execcommand_callback
</title>
5 <link href=
"css/screen.css" rel=
"stylesheet" type=
"text/css" />
10 <h1>Option: execcommand_callback
</h1>
15 This option allows you to add a custom callback function for execCommand handling. This enables you to override internal
16 command functions in TinyMCE. The example below shows how the mceLink and mceImage are overriden.
19 <div class=
"separator"></div>
21 <h3>Example of usage of the execcommand_callback option:
</h3>
24 function
<strong>myCustomExecCommandHandler
</strong>(editor_id, elm, command, user_interface, value) {
25 var linkElm, imageElm, inst;
29 inst = tinyMCE.getInstanceById(editor_id);
30 linkElm = tinyMCE.getParentElement(inst.selection.getFocusElement(),
"a");
33 alert(
"Link dialog has been overriden. Found link href: " + tinyMCE.getAttrib(linkElm,
"href"));
35 alert(
"Link dialog has been overriden.");
40 inst = tinyMCE.getInstanceById(editor_id);
41 imageElm = tinyMCE.getParentElement(inst.selection.getFocusElement(),
"img");
44 alert(
"Image dialog has been overriden. Found image src: " + tinyMCE.getAttrib(imageElm,
"src"));
46 alert(
"Image dialog has been overriden.");
51 return false; // Pass to next handler in chain
56 <strong>execcommand_callback :
"myCustomExecCommandHandler"</strong>
63 <div class=
"helpindexlink"><a href=
"index.html">Index
</a></div>
64 <div class=
"copyright">Copyright
© 2003-
2006 <a href=
"http://www.moxiecode.com">Moxiecode Systems AB
</a></div>
65 <br style=
"clear: both" />