commands

The list of supported commands for the editor instance.

All supported built-in commands can be seen in this demo.

Custom commands should be specified as JavaScript dictionaries containing the following properties:
- text - the contents of the toolbar button, corresponding to this command
- tooltip - an optional tooltip text to display for the toolbar button
- exec - a handler function to be called when the command button is clicked. It receives the following parameters - (options, doneCallback) - at the end of its body, the implementation must call the doneCallback() passed to it.

A live demo of custom command implementation can be seen here.

<textarea id="editor"></textarea>

<script type="text/javascript">
    jQuery(function ($) {
        $('#editor').shieldEditor({
            commands: [
                "bold", "italic", "underline",
                "justifyLeft", "justifyCenter", "justifyRight", "justifyFull",
                {
                    text: '',
                    tooltip: "Insert a horizontal line",
                    exec: function (options, doneCallback) {
                        this.paste("");
                        doneCallback();
                    }
                }
            ]
        });
    });
</script>