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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Double-Click Element Handlers<br />

JavaScript Objects<br />

To add your own double-click element handler, define a JavaScript function in<br />

your Web page to run as shown below.<br />

<strong>eWebEditPro</strong>DblClickElement(oElement)<br />

{<br />

return true or false<br />

}<br />

The <strong>eWebEditPro</strong>DblClickElement function runs when certain elements are<br />

double-clicked. It may be easier, however, to define the applicable handler<br />

function for a specific object.<br />

The hyperlink, image, and table element objects have their own functions that run<br />

when they are double-clicked.<br />

See Also:<br />

• ”Event: <strong>eWebEditPro</strong>DblClickElement” on page 154<br />

• ”Event: <strong>eWebEditPro</strong>DblClickHyperlink” on page 155<br />

• ”Event: <strong>eWebEditPro</strong>DblClickImage” on page 155<br />

• ”Event: <strong>eWebEditPro</strong>DblClickTable” on page 155<br />

The <strong>eWebEditPro</strong>ExecCommandHandlers Array<br />

The <strong>eWebEditPro</strong>ExecCommandHandlers array helps you add custom<br />

commands or define command event handlers for standard commands. You can<br />

define the code to process a command in customevents.js or the page that<br />

displays the editor.<br />

For example (taken from editorwithstyle.htm),<br />

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

{<br />

var strStyleSheet = myStyleSheets[strCmdName];<br />

if ("string" == typeof strStyleSheet)<br />

{<br />

<strong>eWebEditPro</strong>.instances[sEditorName].editor.setProperty("StyleSheet", strStyleSheet);<br />

bStylesheetDisabled = false;<br />

}<br />

}<br />

<strong>eWebEditPro</strong>ExecCommandHandlers["jsstyledefault"] = setStyleSheet;<br />

<strong>eWebEditPro</strong>ExecCommandHandlers["jsstyle1"] = setStyleSheet;<br />

<strong>eWebEditPro</strong>ExecCommandHandlers["jsstyle2"] = setStyleSheet;<br />

<strong>eWebEditPro</strong>ExecCommandHandlers["jsstyleparagraph"] = setStyleSheet;<br />

<strong>eWebEditPro</strong>ExecCommandHandlers["jsstylenone"] = function(sEditorName, strCmdName,<br />

strTextData, lData)<br />

{<br />

<strong>eWebEditPro</strong>.instances[sEditorName].editor.disableAllStyleSheets();<br />

bStylesheetDisabled = true;<br />

}<br />

<strong>eWebEditPro</strong>ExecCommandHandlers["jshighlight"] = function(sEditorName, strCmdName,<br />

strTextData, lData)<br />

{<br />

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

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

Saved successfully!

Ooh no, something went wrong!