15.08.2013 Views

Ektron® eWebEditPro Developer's Reference Guide

Ektron® eWebEditPro Developer's Reference Guide

Ektron® eWebEditPro Developer's Reference Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

JavaScript Objects<br />

<strong>eWebEditPro</strong>.instances[sEditorName].editor.ExecCommand("cmdselstyle", ".highlight", 0);<br />

Note that each array entry defines a handler for one command. If more than one<br />

command uses the same function, set each array entry to the same function (for<br />

example, setStyleSheet). The syntax is:<br />

<strong>eWebEditPro</strong>ExecCommandHandlers[command_name] = your_handler_function<br />

The handler must be a function with the same parameters as<br />

<strong>eWebEditPro</strong>ExecCommand, namely,<br />

function(sEditorName, strCmdName, strTextData, lData)<br />

ExecCommandHandlersArray Parameters<br />

Parameter Type Description<br />

sEditorName String The name of the occurrence of <strong>eWebEditPro</strong>. To access the<br />

<strong>eWebEditPro</strong> methods, use<br />

<strong>eWebEditPro</strong>.instances[sEditorName].editor.<br />

See Also: “Appendix A: Naming the <strong>eWebEditPro</strong> Editor” on<br />

page 576<br />

Note: If your Web server is running ASP.NET, use this syntax:<br />

<strong>eWebEditPro</strong>.instances[sEditorName].editor<br />

strCmdName String The name of the JavaScript command that was just executed (if a<br />

standard command) or to be executed (if a custom command).<br />

Standard commands begin with cmd; custom commands begin with<br />

js.<br />

An example of a JavaScript function that executes after a standard<br />

command executes is checking spelling within all instances of the<br />

editor on a page. If the user presses the spellcheck button in one<br />

editor, he is prompted to continue to the next editor. If confirmed, the<br />

command is sent to the next editor on the page and will loop back to<br />

the first editor on the page.<br />

strTextData String A string that may contain text data related to the command. Typically<br />

not used.<br />

lData Long A long integer value that may contain numeric data related to the<br />

command. Typically not used.<br />

Parameter Requirements for Commands<br />

Most commands do not require parameters. For example, cmdbold bolds (or<br />

unbolds) selected text, ignoring the strTextData and lData parameters.<br />

<strong>Ektron®</strong> <strong>eWebEditPro</strong> Developer’s <strong>Reference</strong> <strong>Guide</strong>, Release 5.1, Revision 1 238

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!