<action> Configuration Element

This element specifies a custom action to be performed with empty tags (i.e. tags with no body such as <img>) within EditLive! for XML.

Configuration Element Tree Structure

<editLive>
     ...
     <wysiwygEditor>
       <customTags>
         <doubleClickActions>
           <action ... />
         </doubleClickActions>
       </customTags>
     </wysiwygEditor>
     ...
</editLive>

Required Attributes

name

The empty tag for which this action applies.

action

The action which this custom action performs.

Note

This attribute has the following possible values:

  • insertHTMLAtCursor - Insert the given HTML at the cursor

  • insertHyperlinkAtCursor - Insert the given hyperlink at the cursor

  • raiseEvent -Call a JavaScript function with the given name

  • customPropertiesDialog - Call a JavaScript function with the given name and pass it the current tag's properties

  • PostDocument - Post the content of the applet to a server side script

value

The value of the text or hyperlink to be inserted or the name of the JavaScript function to be called when this action is performed.

Note

When using the insertHTMLAtCursor action the HTML to be inserted must be URL encoded in the XML file. For example, <p>HTML to insert<p> becomes %3Cp%3EHTML%20to%20insert%3C/p%3E.

Examples

The following example demonstrates how to define a custom properties dialog which is launched from a custom double click action for use within EditLive! for XML. The custom properties dialog will be available for use when the cursor is inside any <img> tag.

<editLive>
  ...
  <wysiwygEditor>
    <customTags>
      <doubleClickActions>
        <action 
          name="img"
          action="customPropertiesDialog"
          value="jsFunction"
        />
      </doubleClickActions>
    </customTags>
    ...
  </wysiwygEditor>    
  ...
</editLive> 

Remarks

The <action> element can appear multiple times within the <doubleClickActions> element.

The <action> element must be a complete tag, it cannot contain a tag body. Therefore the tag must be closed in the same line. See the example below:

<action name=... />
Text assigned to the value attribute must be URL encoded as it is in the example above.

See Also