Index: gc_lang/fr/webext/content_scripts/init.js ================================================================== --- gc_lang/fr/webext/content_scripts/init.js +++ gc_lang/fr/webext/content_scripts/init.js @@ -89,11 +89,11 @@ // textarea for (let xNode of document.getElementsByTagName("textarea")) { if (xNode.dataset.grammalecte_callbutton && document.getElementById(xNode.dataset.grammalecte_callbutton)) { let xButton = document.getElementById(xNode.dataset.grammalecte_callbutton) xButton.onclick = () => { - oGrammalecte.startGCPanel(xNode, true, true); + oGrammalecte.startGCPanel(xNode); }; this.lButton.push(xButton); this.nButton += 1; } else if (this.oOptions.textarea && xNode.style.display !== "none" && xNode.style.visibility !== "hidden" && xNode.getAttribute("spellcheck") !== "false") { @@ -104,11 +104,11 @@ // editable nodes for (let xNode of document.querySelectorAll("[contenteditable]")) { if (xNode.dataset.grammalecte_callbutton && document.getElementById(xNode.dataset.grammalecte_callbutton)) { let xButton = document.getElementById(xNode.dataset.grammalecte_callbutton) xButton.onclick = () => { - oGrammalecte.startGCPanel(xNode, true, true); + oGrammalecte.startGCPanel(xNode); }; this.lButton.push(xButton); this.nButton += 1; } else if (this.oOptions.editablenode && xNode.style.display !== "none" && xNode.style.visibility !== "hidden") { @@ -174,16 +174,16 @@ this.oMessageBox = new GrammalecteMessageBox("grammalecte_message_box", "Grammalecte"); this.oMessageBox.insertIntoPage(); } }, - startGCPanel: function (what, bCheckText=true, bResultInEvent=false) { + startGCPanel: function (what, bCheckText=true) { this.createGCPanel(); this.oGCPanel.clear(); this.oGCPanel.show(); this.oGCPanel.showEditor(); - this.oGCPanel.start(what, bResultInEvent); + this.oGCPanel.start(what); this.oGCPanel.startWaitIcon(); if (what && bCheckText) { let sText = this.oGCPanel.oTextControl.getText(); xGrammalectePort.postMessage({ sCommand: "parseAndSpellcheck", Index: gc_lang/fr/webext/content_scripts/panel_gc.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel_gc.js +++ gc_lang/fr/webext/content_scripts/panel_gc.js @@ -137,14 +137,13 @@ this.xMenu.appendChild(this.xLxgButton) this.xMenu.appendChild(this.xConjButton) this.xPanelBar.appendChild(this.xMenu); } - start (what, bResultInEvent=false) { + start (what) { this.oTooltip.hide(); this.bWorking = false; - this.oTextControl.bResultInEvent = bResultInEvent; this.clear(); this.hideMessage(); this.resetTimer(); if (typeof(what) === "string") { // text @@ -964,10 +963,11 @@ this.bTextArea = (xNode.tagName == "TEXTAREA" || xNode.tagName == "INPUT"); if (!this.bTextArea) { oGrammalecte.oGCPanel.addMessageToGCPanel("Attention : La zone de texte analysée est un champ textuel enrichi susceptible de contenir des éléments non textuels qui seront effacés lors de la correction."); } this.xNode.disabled = true; + this.bResultInEvent = Boolean(xNode.dataset.grammalecte_callbutton); this.loadText((this.bTextArea) ? this.xNode.value : this.xNode.innerText); } setText (sText) { this.clear();