Index: gc_lang/fr/webext/content_scripts/content_modifier.js ================================================================== --- gc_lang/fr/webext/content_scripts/content_modifier.js +++ gc_lang/fr/webext/content_scripts/content_modifier.js @@ -139,11 +139,11 @@ if (oGCPanel !== null) { oGCPanelContent.clear(); oGCPanel.show(); } else { // create the panel - oGCPanel = new GrammalectePanel("grammalecte_gc_panel", "Correcteur", 500, 700); + oGCPanel = new GrammalectePanel("grammalecte_gc_panel", "Grammalecte", 500, 700); oGCPanel.setContentNode(oGCPanelContent.init()); oGCPanel.insertIntoPage(); } } Index: gc_lang/fr/webext/content_scripts/gc_content.js ================================================================== --- gc_lang/fr/webext/content_scripts/gc_content.js +++ gc_lang/fr/webext/content_scripts/gc_content.js @@ -99,13 +99,13 @@ showError(e); } }, recheckParagraph: function (sParagraphNum) { - //startWaitIcon(); let sParagraphId = "grammalecte_paragraph" + sParagraphNum; let xParagraph = document.getElementById(sParagraphId); + this.blockParagraph(xParagraph); let sText = this.getPurgedTextOfParagraph(xParagraph.textContent); xPort.postMessage({ sCommand: "parseAndSpellcheck1", dParam: {sText: sText, sCountry: "FR", bDebug: false, bContext: false}, dInfo: {sParagraphId: sParagraphId} @@ -119,10 +119,11 @@ try { let xParagraph = document.getElementById(sParagraphId); xParagraph.className = (oResult.aGrammErr.length || oResult.aSpellErr.length) ? "grammalecte_paragraph softred" : "grammalecte_paragraph"; xParagraph.textContent = ""; this._tagParagraph(xParagraph, oResult.sParagraph, sParagraphId.slice(21), oResult.aGrammErr, oResult.aSpellErr); + this.freeParagraph(xParagraph); } catch (e) { showError(e); } }, @@ -184,10 +185,21 @@ xNodeErr.dataset.suggestions = oErr["aSuggestions"].join("|"); } xNodeErr.className = (this.aIgnoredErrors.has(xNodeErr.dataset.ignored_key)) ? "ignored" : "error " + oErr['sType']; return xNodeErr; }, + + blockParagraph: function (xParagraph) { + xParagraph.style = "background-color: hsl(30, 100%, 80%)"; + xParagraph.disabled = true; + xParagraph.contentEditable = "false"; + }, + + freeParagraph: function (xParagraph) { + xParagraph.style = ""; + xParagraph.contentEditable = "true"; + }, applySuggestion: function (sNodeSuggId) { // sugg try { console.log(sNodeSuggId); let sErrorId = document.getElementById(sNodeSuggId).dataset.error_id; @@ -196,10 +208,11 @@ let xNodeErr = document.getElementById("grammalecte_err" + sErrorId); xNodeErr.textContent = document.getElementById(sNodeSuggId).textContent; xNodeErr.className = "corrected"; xNodeErr.removeAttribute("style"); this.oTooltip.hide(); + this.recheckParagraph(sErrorId.slice(0, sErrorId.indexOf("-"))); } catch (e) { showError(e); } },