Page tree
Skip to end of metadata
Go to start of metadata

Notes on Developing Custom Extensions

This document outlines a generic extension point for custom JavaScript for use with Textbox.io within IBM Connections. It is designed for use by developers and integrators familiar with JavaScript development techniques. It's strongly recommended that you ensure that you have expertise with JavaScript if you wish to use this extension point.

Also note, custom extensions for the Ephox Editors for IBM Connections are not supported by IBM. This functionality is used at your own risk. When logging a PMR with IBM you may be required to deactivate or remove any custom extensions and replicate the issue before IBM will accept the PMR.

Developers and integrators can customize and extend the functionality of Textbox.io using Textbox.io's runtime JavaScript API.  

The extension point provides an instance of the editor object representing the Textbox.io instance that has been created within IBM Connections.  The developer can use this object to call any of the functions available on the editor object within the Textbox.io API.

Customization and Extension Point

The extension point enables the developer to provide a JavaScript function that is executed immediately after the editor instance has been created by the integration but before it has been loaded into the page.  Developers can specify arbitary JavaScript in this function;  The editor object is passed in simply for convenience.

To make use of this extension point developers need to define their function in the postCreateTextboxio attribute of the integrationConfig object in the config/config.js file.  When you open the config/config.js file you will see a blank template function available that you can populate with the code for your extension.  The function receives the Textbox.io editor instance.  

Best Practices for Extension Development

Ephox recommends that when developing extensions you make your modifications to a copy of the Ephox Editors for IBM Connections deployment package. Once your customizations have been made you can then re-run the deployment script provided with the integration to deploy your changes to the server. This ensures that you have a backup of code that's executing on the server.

In some cases though, it can be useful to develop directly against the server, particularly when using a development or staging server. In this case you can follow the steps in the Changing Customizations After Deployment documentation.

Example

The example extension below shows how to define a macro as discussed in the Textbox.io documentation.

This macro will convert any text between [red] and [/red] "tags" into red text.

postCreateTextboxio: function(editor) {
	editor.macros.addSimpleMacro('[red]', '[/red]', function(match) {
		return '<span style="color: red">' + match + '</span>';
	});
}
  • No labels