WIP: Note editing, markdown to html
[oweals/karmaworld.git] / karmaworld / apps / wysihtml5 / static / wysihtml5 / wysihtml-0.4.17 / src / commands / foreColor.js
1 /**
2  * document.execCommand("foreColor") will create either inline styles (firefox, chrome) or use font tags
3  * which we don't want
4  * Instead we set a css class
5  */
6 (function(wysihtml5) {
7   var REG_EXP = /wysiwyg-color-[0-9a-z]+/g;
8
9   wysihtml5.commands.foreColor = {
10     exec: function(composer, command, color) {
11         wysihtml5.commands.formatInline.execWithToggle(composer, command, "span", "wysiwyg-color-" + color, REG_EXP);
12     },
13
14     state: function(composer, command, color) {
15       return wysihtml5.commands.formatInline.state(composer, command, "span", "wysiwyg-color-" + color, REG_EXP);
16     }
17   };
18 })(wysihtml5);