Hi all -
I'm trying to implement a custom command in visual formatter, and it doesn't seem to be firing the command. I've been banging my head against the wall for a couple of hours and have simplified it down to a copy of Interwoven's jshyperlink just as a test case, and still don't seem to be getting it. So, what I have now (which I realize is not what I want to do ultimately, so don't feel the need to point that out), is a custom VFE config that includes this list of commands:
<features>
<!-- Possible command styles are:
Icon Button: "default", "icon", not specified
Icon Toggle: "toggle"
Text Listbox: "list", "listbox"
Text Editbox: "edit", "text"
-->
<external>
<command name="jstm">
<caption localeRef="btnCapTM" />
<tooltiptext localeRef="cmdTM" />
</command>
<command name="jshyperlink" enabled="true">
<image src="[eWebEditProPath]/btnhy.gif" />
<caption localeRef="cmdNewHyp" />
<tooltiptext localeRef="cmdNewHyp" />
</command>
<command name="jsReuseObject" enabled="true">
<image src="[eWebEditProPath]/btnhy.gif" />
<caption localeRef="cmdNewHyp" />
<tooltiptext localeRef="cmdNewHyp" />
</command>
Up above that, I have buttons for jshyperlink and jsReuseObject.
<interface name="iw3" allowCustomize="false" context="false">
<menu name="editbar" newRow="false" showButtonsCaptions="false" wrap="false">
<caption localeRef="mnuEdit" />
<button command="jsReuseObject" />
<button command="jshyperlink" />
I modified the ewebeditproevents.js file to add my new event. When I do this for real, I'll put it in my own customevents.js file and register that in ewebeditpro.js. For now, the eWebEditProExecCommand function looks like this:
function eWebEditProExecCommand(sEditorName, strCmdName, strTextData, lData)
{
if ("jshyperlink" == strCmdName)
{
//Custom Hyperlink popup
InsertHyperlink(sEditorName);
}
else if ("cmdspellcheck" == strCmdName)
{
forAllInstances(sEditorName, strCmdName, strTextData, lData);
}
else if ("cmdfind" == strCmdName)
{
forAllInstances(sEditorName, strCmdName, strTextData, lData);
}
else if ("jsReuseObject" == strCmdName)
{
//Custom Hyperlink popup
InsertHyperlink(sEditorName);
}
}
Both buttons show up in the VFE as expected. The jshyperlink button brings up the dialog as expected. The jsReuseObject button does nothing. Can anyone give me a pointer about what might be doing on here? I've tried putting in an alert to tell me what the value of strCmdName is, but it doesn't fire (which makes me question if I'm even editing the real file).
Thanks
Rob