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.

The ewebeditproevents File<br />

Customizable JavaScript Files<br />

When the user presses a button on the toolbar or double-clicks an element (for<br />

example, a hyperlink or image) in the content, an event is raised. When the event<br />

fires, it can run a JavaScript function.<br />

The ewebeditproevents.js file contains JavaScript event handler functions that<br />

perform actions. These actions could include inserting HTML into the content (for<br />

example, the trademark symbol) and opening a window to a hyperlink that was<br />

double-clicked.<br />

The ewebeditproevents.js file can call the following event handler functions that<br />

you can define in a custom JavaScript file. In this way, you can customize what<br />

happens when the event fires.<br />

Event Determines How to Respond When<br />

onDblClickElemen<br />

tHandler<br />

onDblClickHyperli<br />

nkHandler<br />

onExecCommand<br />

Handler<br />

A user double-clicks.<br />

A user double-clicks on a hyperlink.<br />

See Also: “Determining which Fonts, Font Sizes, and<br />

Headings are Available” on page 182<br />

A toolbar button is pressed or the user selects an item<br />

from the context-sensitive menu.<br />

To add your own commands, define one or both of the following.<br />

function <strong>eWebEditPro</strong>ExecCommand(sEditorName, strCmdName, strTextData, lData) { }<br />

<strong>eWebEditPro</strong>.onexeccommand = your_custom_event_handler;<br />

For more information, see “Event Handler Functions” on page 236.<br />

To add your own media file handler, define:<br />

function <strong>eWebEditPro</strong>MediaSelection(sEditorName) { }<br />

For more information, see “The ewebeditpromedia File” on page 232.<br />

To add your own double-click element handlers, define one or more of the<br />

following:<br />

function <strong>eWebEditPro</strong>DblClickElement(oElement) { }<br />

function <strong>eWebEditPro</strong>DblClickHyperlink(oElement) { }<br />

function <strong>eWebEditPro</strong>DblClickImage(oElement) { }<br />

function <strong>eWebEditPro</strong>DblClickTable(oElement) { }<br />

<strong>eWebEditPro</strong>.ondblclickelement = your_custom_event_handler;<br />

For more information, see “Event Handler Functions” on page 236.<br />

Add your custom JavaScript file to the list in ewebeditpro.js, as shown below.<br />

var <strong>eWebEditPro</strong>Includes = [<br />

"ewebeditproevents.js",<br />

"ewebeditprodefaults.js",<br />

"ewebeditpromedia.js",<br />

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

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

Saved successfully!

Ooh no, something went wrong!