Initial commit
[atlantis.git] / default-services / markup.js
blobf73732d69dd1da0990ab91abc4be2cfe50d5afa8
1 var i;
2 var cmd;
3 var cmds = [
4     ['bold', 'Toggles the bold font.', function() {
5         document.execCommand('bold', undefined, undefined);
6      }, null],
7     ['italic', 'Toggles the italic font.', function() {
8         document.execCommand('italic', undefined, undefined);
9      }, null],
10     ['unordered list', '', function() {
11         document.execCommand('insertUnorderedList', undefined, undefined);
12      }, null],
13     ['ordered list', '', function() {
14         document.execCommand('insertOrderedList', undefined, undefined);
15      }, null],
16     ['paragraph', '', function() {
17         document.execCommand('insertParagraph', undefined, undefined);
18      }, null],
19     ['heading', '', function() {
20         document.execCommand('formatBlock', undefined, 'h1');
21      }, null],
24 for (i in cmds) {
25     cmd = new Atlantis.Command();
26     cmd.name = cmds[i][0];
27     cmd.doc = cmds[i][1];
28     cmd.run = cmds[i][2];
29     cmd.data = cmds[i][3];
30     Atlantis.addCommand(cmd);