Index: gc_lang/fr/webext/content_scripts/panel.css ================================================================== --- gc_lang/fr/webext/content_scripts/panel.css +++ gc_lang/fr/webext/content_scripts/panel.css @@ -116,15 +116,39 @@ width: 100%; height: calc(100% - 65px); /* panel height - title_bar */ overflow: auto; } -div.grammalecte_panel_message { +div#grammalecte_panel_message_block { + display: none; + padding: 10px; + background-color: hsl(0, 50%, 50%); + color: hsl(0, 10%, 96%); + font-family: "Trebuchet MS", "Fira Sans", "Liberation Sans", sans-serif; + font-size: 14px; +} +div#grammalecte_panel_message_close_button { + float: right; + margin: 0 0 10px 10px; + padding: 2px 5px; + border-radius: 5px; + background-color: hsl(0, 50%, 40%); + color: hsl(0, 50%, 80%); + font-size: 14px; + font-weight: bold; + cursor: pointer; +} +div#grammalecte_panel_message_close_button:hover { + background-color: hsl(0, 100%, 60%); + color: hsl(0, 50%, 100%); +} + +div.grammalecte_panel_flow_message { margin: 10px; padding: 10px; border-radius: 5px; - background-color: hsl(0, 50%, 40%); + background-color: hsl(0, 0%, 50%); color: hsl(0, 50%, 96%); font-family: "Trebuchet MS", "Fira Sans", "Liberation Sans", sans-serif; font-size: 16px; } Index: gc_lang/fr/webext/content_scripts/panel.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel.js +++ gc_lang/fr/webext/content_scripts/panel.js @@ -42,10 +42,12 @@ let xTitle = oGrammalecte.createNode("div", {className: "grammalecte_panel_title"}); xTitle.appendChild(this._createLogo()); xTitle.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_panel_label", textContent: sTitle})); this.xPanelBar.appendChild(xTitle); xPanel.appendChild(this.xPanelBar); + this._createMesssageBlock(); + xPanel.appendChild(this.xPanelMessageBlock); xPanel.appendChild(this.xPanelContent); return xPanel; } catch (e) { showError(e); @@ -94,10 +96,19 @@ _createCloseButton () { let xButton = oGrammalecte.createNode("div", {className: "grammalecte_panel_button grammalecte_close_button", textContent: "×", title: "Fermer la fenêtre"}); xButton.onclick = () => { this.hide(); }; return xButton; } + + _createMesssageBlock () { + this.xPanelMessageBlock = oGrammalecte.createNode("div", {id: "grammalecte_panel_message_block"}); + let xPanelMessageCloseButton = oGrammalecte.createNode("div", {id: "grammalecte_panel_message_close_button", textContent: "×"}); + xPanelMessageCloseButton.onclick = () => { this.hideMessage() }; + this.xPanelMessageBlock.appendChild(xPanelMessageCloseButton); + this.xPanelMessage = oGrammalecte.createNode("div", {id: "grammalecte_panel_message"}); + this.xPanelMessageBlock.appendChild(this.xPanelMessage); + } insertIntoPage () { if (this.bShadow) { oGrammalecte.createStyle("content_scripts/panel.css", null, this.xShadow); oGrammalecte.createStyle("content_scripts/panel_gc.css", null, this.xShadow); @@ -190,14 +201,23 @@ stopWaitIcon () { this.bWorking = false; this.xWaitIcon.style.visibility = "hidden"; } + + showMessage (sMessage) { + this.xPanelMessageBlock.style.display = "block"; + this.xPanelMessage.textContent = sMessage; + } + + hideMessage () { + this.xPanelMessageBlock.style.display = "none"; + } openURL (sURL) { xGrammalectePort.postMessage({ sCommand: "openURL", dParam: {"sURL": sURL}, dInfo: {} }); } } 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 @@ -129,11 +129,11 @@ this.bWorking = false; this.clear(); if (xNode) { this.oNodeControl.setNode(xNode); if (!(xNode.tagName == "TEXTAREA" || xNode.tagName == "INPUT")) { - this.addMessage("Note : cette zone de texte n’est pas un champ de formulaire “textarea” mais un node HTML éditable. Une telle zone de texte est susceptible de contenir des éléments non textuels qui seront effacés lors de la correction."); + this.showMessage("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."); } } else { this.oNodeControl.clear(); } } @@ -378,12 +378,12 @@ addSummary () { // todo } - addMessage (sMessage) { - let xNode = oGrammalecte.createNode("div", {className: "grammalecte_panel_message", textContent: sMessage}); + addMessageToGCPanel (sMessage) { + let xNode = oGrammalecte.createNode("div", {className: "grammalecte_panel_flow_message", textContent: sMessage}); this.xParagraphList.appendChild(xNode); } _copyToClipboard (sText) { // recipe from https://github.com/mdn/webextensions-examples/blob/master/context-menu-copy-link-with-types/clipboard-helper.js @@ -431,12 +431,12 @@ if (this.xLxgPanelContent.textContent !== "") { this.xLxgPanelContent.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_lxg_separator", textContent: sText})); } } - addMessage (sMessage) { - let xNode = oGrammalecte.createNode("div", {className: "grammalecte_panel_message", textContent: sMessage}); + addMessageToLxgPanel (sMessage) { + let xNode = oGrammalecte.createNode("div", {className: "grammalecte_panel_flow_message", textContent: sMessage}); this.xLxgPanelContent.appendChild(xNode); } addListOfTokens (lToken) { try {