73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
}
createMenu () {
this.xMenu = oGrammalecte.createNode("div", {className: "grammalecte_panel_menu"});
this.xTFButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Formateur de texte"});
this.xEditorButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur"});
this.xLxgButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Lexicographe"});
this.xConjButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Conjugueur "});
this.xLEButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur lexical "});
this.xTFButton.onclick = () => {
if (this.xNode && (this.xNode.tagName == "TEXTAREA" || this.xNode.tagName == "INPUT" || this.xNode.isContentEditable)) {
oGrammalecte.createTFPanel();
oGrammalecte.oTFPanel.start(this);
oGrammalecte.oTFPanel.show();
} else {
oGrammalecte.showMessage("Aucune zone de texte éditable sur laquelle appliquer le formatage de texte.")
|
|
|
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
}
createMenu () {
this.xMenu = oGrammalecte.createNode("div", {className: "grammalecte_panel_menu"});
this.xTFButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Formateur de texte"});
this.xEditorButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur"});
this.xLxgButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Lexicographe"});
this.xConjButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Conjugueur"});
this.xLEButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur lexical ⮭"});
this.xTFButton.onclick = () => {
if (this.xNode && (this.xNode.tagName == "TEXTAREA" || this.xNode.tagName == "INPUT" || this.xNode.isContentEditable)) {
oGrammalecte.createTFPanel();
oGrammalecte.oTFPanel.start(this);
oGrammalecte.oTFPanel.show();
} else {
oGrammalecte.showMessage("Aucune zone de texte éditable sur laquelle appliquer le formatage de texte.")
|
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
let sText = "";
// Quand c'est dans un shadow "this.xParent.getElementsByClassName" n'existe pas.
let xElem = this.xParent.getElementById("grammalecte_gc_panel");
for (let xNode of xElem.getElementsByClassName("grammalecte_paragraph")) {
sText += xNode.textContent + "\n";
}
this._copyToClipboard(sText);
xClipboardButton.textContent = "OK";
window.setTimeout(function() { xClipboardButton.textContent = "∑"; } , 2000);
}
catch (e) {
showError(e);
}
this.stopWaitIcon();
}
|
|
|
|
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
let sText = "";
// Quand c'est dans un shadow "this.xParent.getElementsByClassName" n'existe pas.
let xElem = this.xParent.getElementById("grammalecte_gc_panel");
for (let xNode of xElem.getElementsByClassName("grammalecte_paragraph")) {
sText += xNode.textContent + "\n";
}
this._copyToClipboard(sText);
xClipboardButton.textContent = "⇒ presse-papiers";
window.setTimeout(function() { xClipboardButton.textContent = "📋"; } , 2000);
}
catch (e) {
showError(e);
}
this.stopWaitIcon();
}
|