Index: gc_lang/fr/xpi/data/gc_panel.css ================================================================== --- gc_lang/fr/xpi/data/gc_panel.css +++ gc_lang/fr/xpi/data/gc_panel.css @@ -258,11 +258,11 @@ /* Action buttons */ .actions { - margin-top: -10px; + margin-top: -20px; margin-bottom: 10px; } .actions .button { background-color: hsl(0, 0%, 50%); Index: gc_lang/fr/xpi/data/gc_panel.js ================================================================== --- gc_lang/fr/xpi/data/gc_panel.js +++ gc_lang/fr/xpi/data/gc_panel.js @@ -84,12 +84,12 @@ applySuggestion(xElem.id); } else if (xElem.id.endsWith("_ignore")) { ignoreError(xElem.id); } else if (xElem.id.startsWith("check")) { sendBackAndCheck(xElem.id); - } else if (xElem.id.startsWith("edit")) { - switchEdition(xElem.id); + /*} else if (xElem.id.startsWith("edit")) { + switchEdition(xElem.id);*/ } else if (xElem.id.startsWith("end")) { document.getElementById(xElem.id).parentNode.parentNode.style.display = "none"; } else if (xElem.tagName === "U" && xElem.id.startsWith("err") && xElem.className !== "corrected" && xElem.className !== "ignored") { showTooltip(xElem.id); @@ -134,38 +134,39 @@ function addParagraph (sText, iParagraph, sJSON) { try { let xNodeDiv = document.createElement("div"); xNodeDiv.className = "paragraph_block"; - // paragraph - let xParagraph = document.createElement("p"); - xParagraph.id = "paragr" + iParagraph.toString(); - xParagraph.lang = "fr"; - xParagraph.setAttribute("spellcheck", false); - let oErrors = JSON.parse(sJSON); - xParagraph.className = (oErrors.aGrammErr.length || oErrors.aSpellErr.length) ? "paragraph softred" : "paragraph"; - _tagParagraph(sText, xParagraph, iParagraph, oErrors.aGrammErr, oErrors.aSpellErr); - xNodeDiv.appendChild(xParagraph); // actions let xDivActions = document.createElement("div"); xDivActions.className = "actions"; let xDivClose = document.createElement("div"); xDivClose.id = "end" + iParagraph.toString(); xDivClose.className = "button red"; xDivClose.textContent = "×"; - let xDivEdit = document.createElement("div"); + /*let xDivEdit = document.createElement("div"); xDivEdit.id = "edit" + iParagraph.toString(); xDivEdit.className = "button"; - xDivEdit.textContent = "Éditer"; + xDivEdit.textContent = "Éditer";*/ let xDivCheck = document.createElement("div"); xDivCheck.id = "check" + iParagraph.toString(); xDivCheck.className = "button green"; xDivCheck.textContent = "Réanalyser"; xDivActions.appendChild(xDivClose); - xDivActions.appendChild(xDivEdit); + //xDivActions.appendChild(xDivEdit); xDivActions.appendChild(xDivCheck); xNodeDiv.appendChild(xDivActions); + // paragraph + let xParagraph = document.createElement("p"); + xParagraph.id = "paragr" + iParagraph.toString(); + xParagraph.lang = "fr"; + xParagraph.setAttribute("spellcheck", false); + xParagraph.setAttribute("contenteditable", true); + let oErrors = JSON.parse(sJSON); + xParagraph.className = (oErrors.aGrammErr.length || oErrors.aSpellErr.length) ? "paragraph softred" : "paragraph"; + _tagParagraph(sText, xParagraph, iParagraph, oErrors.aGrammErr, oErrors.aSpellErr); + xNodeDiv.appendChild(xParagraph); document.getElementById("errorlist").appendChild(xNodeDiv); } catch (e) { showError(e); } @@ -326,11 +327,11 @@ xNodeSugg.dataset.error_id = sErrId; xNodeSugg.textContent = sSugg; return xNodeSugg; } -function switchEdition (sEditButtonId) { // edit +/*function switchEdition (sEditButtonId) { // edit let xParagraph = document.getElementById("paragr" + sEditButtonId.slice(4)); if (xParagraph.hasAttribute("contenteditable") === false || xParagraph.getAttribute("contenteditable") === "false") { xParagraph.setAttribute("contenteditable", true); document.getElementById(sEditButtonId).className = "button orange"; @@ -337,11 +338,11 @@ xParagraph.focus(); } else { xParagraph.setAttribute("contenteditable", false); document.getElementById(sEditButtonId).className = "button"; } -} +}*/ function sendBackAndCheck (sCheckButtonId) { // check startWaitIcon(); let sIdParagr = sCheckButtonId.slice(5); self.port.emit("modifyAndCheck", sIdParagr, document.getElementById("paragr"+sIdParagr).textContent);