WIP: Note editing, markdown to html
[oweals/karmaworld.git] / karmaworld / apps / wysihtml5 / static / wysihtml5 / wysihtml-0.4.17 / src / dom / text_content.js
1 (function(dom) {
2   var documentElement = document.documentElement;
3   if ("textContent" in documentElement) {
4     dom.setTextContent = function(element, text) {
5       element.textContent = text;
6     };
7
8     dom.getTextContent = function(element) {
9       return element.textContent;
10     };
11   } else if ("innerText" in documentElement) {
12     dom.setTextContent = function(element, text) {
13       element.innerText = text;
14     };
15
16     dom.getTextContent = function(element) {
17       return element.innerText;
18     };
19   } else {
20     dom.setTextContent = function(element, text) {
21       element.nodeValue = text;
22     };
23
24     dom.getTextContent = function(element) {
25       return element.nodeValue;
26     };
27   }
28 })(wysihtml5.dom);
29