This examples shows how to add custom buttons and behavior with the built-in toolbar class.
Event.observe(window, 'load', function() {
var editor = WysiHat.Editor.attach('content');
var toolbar = new WysiHat.Toolbar(editor);
toolbar.addButton(
{ name: 'bold', label: "Bold" }, function(editor) {
editor.boldSelection();
});
toolbar.addButton(
{ name: 'underline', label: "Underline" }, function(editor) {
editor.underlineSelection();
});
toolbar.addButton(
{ name: 'italic', label: "Italic" }, function(editor) {
editor.italicSelection();
});
});