Oops, you need to build the package before running this example. It's easy: just run rake
in the project's directory.
This example shows you how to create a simple UI for inserting (un)ordered Lists
document.on("dom:loaded", function() {
var editor = WysiHat.Editor.attach('content');
var toolbar = new WysiHat.Toolbar(editor);
toolbar.addButton({
label: "Ordered List",
handler: function(editor) { return editor.toggleOrderedList(); }
});
toolbar.addButton({
label: "Unordered List",
handler: function(editor) { return editor.toggleUnorderedList(); }
});
});