Index: gc_lang/fr/webext/panel/lex_editor.css ================================================================== --- gc_lang/fr/webext/panel/lex_editor.css +++ gc_lang/fr/webext/panel/lex_editor.css @@ -34,11 +34,11 @@ border: 2px solid #F0F0F0; border-radius: 20px; } h1 { - margin: 5px 0 20px 0; + margin: 5px 0 5px 0; color: hsl(210, 50%, 50%); font: bold 30px "Trebuchet MS", "Fira Sans", "Liberation Sans", sans-serif; text-align: center; } h2 { @@ -51,11 +51,11 @@ color: hsl(210, 50%, 50%); font: bold 16px "Trebuchet MS", "Fira Sans", "Liberation Sans", sans-serif; } #buttons { - padding: 10px; + padding: 2px; justify-content: center; } #lexicon_button { background-color: hsl(210, 80%, 90%); } @@ -65,26 +65,31 @@ background-color: hsl(210, 10%, 95%); border-radius: 5px; cursor: pointer; } - .big_block { margin: 10px 0; padding: 10px; background-color: hsl(210, 20%, 96%); border-radius: 5px; } - #add_word_page { display: none; } .columns { display: flex; } + +#word_generator { + width: 400px; +} +#generated_words { + width: 400px; +} #editor { display: none; } @@ -137,11 +142,11 @@ flex-grow: 1; margin: 2px; padding: 10px; background-color: hsl(120, 10%, 90%); color: hsl(120, 10%, 50%); - font-size: 14px; + font-size: 12px; border-radius: 3px; } .examples_false { flex-grow: 1; margin: 2px; @@ -171,23 +176,14 @@ input[placeholder] { color: hsl(0, 0%, 50%); } -#generated_words { - -} - -#results { - padding: 10px; - background-color: hsl(210, 10%, 90%); - border-radius: 3px; - margin: 5px 0; - font-family: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace; -} + #buttonline { + margin-top: 10px; text-align: right; } #add_to_lexicon { display: inline-block; @@ -238,12 +234,18 @@ display: none; } #wait_progress { width: 100%; + height: 4px; } +table { + border: 1px solid hsl(210, 10%, 50%); + width: 100%; + min-height: 200px; +} th { padding: 5px 10px; border-left: 1px solid hsl(210, 10%, 90%); text-align: left; } @@ -254,5 +256,13 @@ .delete_entry { cursor: pointer; font-weight: bold; color: hsl(0, 100%, 50%); } + + +details { + font-size: 11px; + font-variant: small-caps; + color: hsl(210, 50%, 50%); + cursor: pointer; +} Index: gc_lang/fr/webext/panel/lex_editor.html ================================================================== --- gc_lang/fr/webext/panel/lex_editor.html +++ gc_lang/fr/webext/panel/lex_editor.html @@ -27,18 +27,16 @@

Dictionnaire personnel : 0 entrées.
Date d’enregistrement : néant.

-

+ - -
-
+

Nouveau mot (lemme)

Index: gc_lang/fr/webext/panel/lex_editor.js ================================================================== --- gc_lang/fr/webext/panel/lex_editor.js +++ gc_lang/fr/webext/panel/lex_editor.js @@ -88,12 +88,12 @@ this.listen(); } _createHeader () { let xRowNode = createNode("tr"); - xRowNode.appendChild(createNode("th", { textContent: "·" })); - xRowNode.appendChild(createNode("th", { textContent: "#" })); + xRowNode.appendChild(createNode("th", { textContent: "·", width: "12px" })); + //xRowNode.appendChild(createNode("th", { textContent: "#" })); for (let sColumn of this.lColumn) { xRowNode.appendChild(createNode("th", { textContent: sColumn })); } this.xTable.appendChild(xRowNode); } @@ -115,10 +115,11 @@ this._addRow(lData); this.xProgressBar.value += 1; } this.xProgressBar.value = this.xProgressBar.max; } + this.lEntry = lFlex; this.nEntry = lFlex.length; this.showEntryNumber(); } addEntries (lFlex) { @@ -130,18 +131,18 @@ this.showEntryNumber(); } showEntryNumber () { if (this.xNumEntry) { - this.xNumEntry.textContent = "Entrées : " + this.nEntry; + this.xNumEntry.textContent = this.nEntry; } } _addRow (lData) { let xRowNode = createNode("tr", { id: this.sNodeId + "_row_" + this.iEntryIndex }); xRowNode.appendChild(createNode("td", { textContent: "×", className: "delete_entry", title: "Effacer cette entrée" }, { id_entry: this.iEntryIndex })); - xRowNode.appendChild(createNode("td", { textContent: this.iEntryIndex })); + //xRowNode.appendChild(createNode("td", { textContent: this.iEntryIndex })); for (let data of lData) { xRowNode.appendChild(createNode("td", { textContent: data })); } this.xTable.appendChild(xRowNode); this.iEntryIndex += 1; @@ -194,22 +195,27 @@ document.getElementById("flexion").addEventListener("keyup", () => { this.update(); }, false); document.getElementById("tags").addEventListener("keyup", () => { this.update(); }, false); document.getElementById("add_to_lexicon").addEventListener("click", () => { this.addToLexicon(); }, false); }, - lSection: ["section_nom", "section_verbe", "section_adverbe", "section_prenom", "section_patronyme", "section_nom_propre", "section_autre"], + lSection: ["nom", "verbe", "adverbe", "prenom", "patronyme", "nom_propre", "autre"], hideAllSections: function () { for (let sSection of this.lSection) { - hideElement(sSection); + hideElement("section_" + sSection); + document.getElementById("select_" + sSection).style.backgroundColor = ""; } }, showSection: function (sName) { this.clear(); this.hideAllSections(); - showElement(sName); + if (document.getElementById(sName).style.display == "none") { + showElement(sName); + } else { + hideElement(sName); + } }, clear: function () { try { document.getElementById("lemma2").value = ""; @@ -255,10 +261,11 @@ try { let xElem = xEvent.target; if (xElem.id) { if (xElem.id.startsWith("select_")) { this.showSection("section_" + xElem.id.slice(7)); + xElem.style.backgroundColor = "hsl(210, 50%, 90%)"; this.cMainTag = xElem.dataset.tag; this.update(); } else if (xElem.id.startsWith("up_")) { this.update(); } @@ -432,11 +439,11 @@ }, createFlexLemmaTagArray: function () { let sLemma = document.getElementById("lemma").value.trim(); let lEntry = []; - for (let [sFlex, sTags] of this.lFlexion) { + for (let [sFlex, sTags] of oGenWordsTable.getEntries()) { lEntry.push([sFlex, sLemma, sTags]); } return lEntry; }, @@ -444,12 +451,12 @@ try { oLexiconTable.addEntries(this.createFlexLemmaTagArray()); oGenWordsTable.clear(); document.getElementById("lemma").value = ""; document.getElementById("lemma").focus(); + this.hideAllSections(); hideElement("editor"); - oGenerator.clear(); showElement("save_button"); this.clear(); this.cMainTag = ""; } catch (e) {