JavaScript Editor
Set the createCommand property of the jqxEditor.
Author: http://jqwidgets.com
HTML
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<textarea id="editor"></textarea>
JavaScript
$('#editor').jqxEditor({
height: 400,
width: 500,
theme: 'energyblue',
tools: 'Indent',
createCommand: function (name) {
switch (name) {
case "Indent":
return {
type: 'button',
tooltip: 'Print',
init: function (widget) {
widget.jqxButton({
height: 25,
width: 60
});
widget.html("<span style='line-height: 23px;'>Indent</span>");
},
action: function (widget, editor) {
// return nothing and perform a custom action.
return { command: "inserthtml", value: '<p style="text-indent:25px">Some text</p>' };
}
}
}
}
});