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 @@ -118,11 +118,11 @@ } }, createMessageBox: function () { if (this.oMessageBox === null) { - this.oMessageBox = new GrammalecteMessageBox("grammalecte_message_box", "Grammalecte", 400, 300); + this.oMessageBox = new GrammalecteMessageBox("grammalecte_message_box", "Grammalecte", 400, 250); this.oMessageBox.insertIntoPage(); } }, startGCPanel: function (xNode=null) { @@ -146,12 +146,12 @@ oGrammalecte.oTFPanel.show(); }, showMessage: function (sMessage) { oGrammalecte.createMessageBox(); - oGrammalecte.oMessageBox.setMessage(sMessage); oGrammalecte.oMessageBox.show(); + oGrammalecte.oMessageBox.addMessage(sMessage); }, getPageText: function () { let sPageText = document.body.innerText; let nPos = sPageText.indexOf("__grammalecte_panel__"); Index: gc_lang/fr/webext/content_scripts/message_box.js ================================================================== --- gc_lang/fr/webext/content_scripts/message_box.js +++ gc_lang/fr/webext/content_scripts/message_box.js @@ -24,10 +24,11 @@ let xTitle = oGrammalecte.createNode("div", {className: "grammalecte_panel_title"}); xTitle.appendChild(this._createLogo()); xTitle.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_message_box_label", textContent: sTitle})); this.xMessageBoxBar.appendChild(xTitle); xMessageBox.appendChild(this.xMessageBoxBar); + xMessageBox.appendChild(this.xMessageBoxContent); return xMessageBox; } catch (e) { showError(e); @@ -60,15 +61,22 @@ this.xMessageBox.style.display = "block"; } hide () { this.xMessageBox.style.display = "none"; + this.clear(); + } + + addMessage (sMessage) { + this.xMessageBoxContent.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_message_box_message", textContent: sMessage})); } - setMessage (sMessage) { - this.xMessageBoxContent.textContent = sMessage; + clear () { + while (this.xMessageBoxContent.firstChild) { + this.xMessageBoxContent.removeChild(this.xMessageBoxContent.firstChild); + } } center () { this.xMessageBox.style = `top: 50%; left: 50%; width: ${this.nWidth}px; height: ${this.nHeight}px; margin-top: -${this.nHeight/2}px; margin-left: -${this.nWidth/2}px;`; } }