Customizing the Editor
Developer provides a number of extension points that allow you to extend the editor’s functionality, providing a better user experience and deeper integration into a Content Management System/Application. Extensions are registered with a JavaScript call before the instance of the editor is rendered. You can perform this by calling:
ditaStorm.registerExtension(...)
method and providing the necessary parameters. Depending on the type of extension parameters, this could be different. See the descriptions of particular extension points for parameter details.
Facilitating Conref/Href Lookup
Extend Developer by defining custom actions that are executed when a user edits the href/conref attributes and clicks the related browse button.

This can be achived by registering 'ditastorm.conref' extension.
Tip: To see how it might look if implemented for local files visit the Online editor section.
A JavaScript method must be provided to call when the corresponding button is clicked. This method accepts one parameter - a reference to a property form control, in which the value is set as a result (HRef on the picture above). Sample code:
<SCRIPT> function onBrowse(control) { var hrefValue = ...; // lookup the value control.value = hrefValue; // assign value back to the form } </SCRIPT> ... <SCRIPT> ditaStorm.registerExtension('ditastorm.conref',onBrowse); ditaStorm.render(...); </SCRIPT>
Please remember, as with all extensions, your function will be executed in the context of the Developer frame, not in the page context. To refer to external resources (such as when opening a popup window or loading data from a server), you need to either provide a URL related to the Developer location or use the utility method to automatically calculate an absolute URL:
ditaStorm.getAbsoluteUrl(<base_url>,<relative_url>)
for example
ditaStorm.getAbsoluteUrl( window.location.href,'../../editMyConref.php'); |