19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
+
+
+
|
xReferenceNode.parentNode.insertBefore(xNewNode, xReferenceNode.nextSibling);
}
_createMenu (xNode) {
try {
let sText = (xNode.tagName == "TEXTAREA") ? xNode.value : xNode.textContent;
let xMenu = oGrammalecte.createNode("div", {id: this.sMenuId, className: "grammalecte_menu"});
let xCloseButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_close_button", textContent: "×"} );
xCloseButton.onclick = () => { this.switchMenu(); }
xMenu.appendChild(xCloseButton);
xMenu.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_menu_header", textContent: "GRAMMALECTE"}));
// Text formatter
if (xNode.tagName == "TEXTAREA") {
let xTFButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_item", textContent: "Formateur de texte"});
xTFButton.onclick = () => {
this.switchMenu();
oGrammalecte.createTFPanel();
|