For instructions on setting up SCEditor, see here. Custom command support requires SCEditor version 1.2.4+.
Adding Custom Command
SCEditor has a function called setCommand which updates a command if it already exists or adds it if it doesn’t. setCommand must be called before the editor is initialised otherwise the command may not show in the editors toolbar.
setCommand parameters:
Name (string): The name of the command, should be lower-case and not contain any spaces.
Exec (string or function): Should be a function which will be called when the command is clicked or a string which will be passed to the browsers built-in execCommand function.
Tooltip (string): The commands tooltip text
Keypress: Unless the command needs to handle keypress events, omit this parameter. For an example of keypress handler see the emoticon command.