addFormattingHandler

Availability: >= 3.0

Type: Object Method

Description: Registers a new formatting handler to be used with the callFormatting function.

Syntax:

editor.addFormattingHandlerstring handlerid, function function );

This method registers a new formatting command that can be used with the callFormatting method. 

Parameters:

handlerid
An id name for the command. If you register a new handler for an existing command it's functionality will be replaced by your new handler.

When this value is passed as the first parameter of the callFormatting method the formatting will be handled by your function.

function
JavaScript function to handle the new formatting command.

When your formatting command is called it will be passed 3 parameters. The first will be the current editor object, the second will be the ID of the formatting command (this allows one function to handle several commands) and lastly an optional value.