Index: gc_lang/fr/tb/content/lex_editor.css ================================================================== --- gc_lang/fr/tb/content/lex_editor.css +++ gc_lang/fr/tb/content/lex_editor.css @@ -86,6 +86,30 @@ width: 120px; } .data { width: 90px; } + +/* + Search tab +*/ + +#search_table { + width: 600px; + height: 650px; +} + +description { + width: 200px; +} + +/* + Informations tab +*/ + +#tags_table { + width: 600px; + height: 650px; + font-family: "Courier new", "Ubuntu Mono", Courier, Consolas, monospace; +} + Index: gc_lang/fr/tb/content/lex_editor.js ================================================================== --- gc_lang/fr/tb/content/lex_editor.js +++ gc_lang/fr/tb/content/lex_editor.js @@ -472,14 +472,48 @@ let sJSON = JSON.stringify(this.oIBDAWG.getJSON()); oFileHandler.saveAs(sJSON); } } + +const oSearch = { + + listen: function () { + document.getElementById("search_similar_button").addEventListener("click", () => { this.searchSimilar(); }, false); + document.getElementById("search_regex_button").addEventListener("click", () => { this.searchRegex() }, false); + }, + + searchSimilar: function () { + let sSimilar = document.getElementById("search_similar").value; + }, + + searchRegex: function () { + let sFlexPattern = document.getElementById("search_flexion_pattern").value; + let sTagsPattern = document.getElementById("search_tags_pattern").value; + } +} + + +const oTagsInfo = { + load: function () { + let lEntry = []; + for (let [sTag, sLabel] of _dTag) { + lEntry.push([sTag, sLabel.trim()]); + } + oTagsTable.fill(lEntry); + } +} + const oGenWordsTable = new Table("generated_words_table", ["Flexions", "Étiquettes"], [1, 1], "progress_new_words"); const oLexiconTable = new Table("lexicon_table", ["Flexions", "Lemmes", "Étiquettes"], [10, 7, 10], "progress_lexicon", "num_entries"); +const oSearchTable = new Table("search_table", ["Flexions", "Lemmes", "Étiquettes"], [10, 7, 10], [10, 7, 10], "progress_search"); +const oTagsTable = new Table("tags_table", ["Étiquette", "Signification"], [1, 10], "progress_lexicon"); conj.init(helpers.loadFile("resource://grammalecte/fr/conj_data.json")); + +oTagsInfo.load(); oBinaryDict.load(); oBinaryDict.listen(); oGenerator.listen(); +oSearch.listen(); Index: gc_lang/fr/tb/content/lex_editor.xul ================================================================== --- gc_lang/fr/tb/content/lex_editor.xul +++ gc_lang/fr/tb/content/lex_editor.xul @@ -30,10 +30,12 @@ + + @@ -207,10 +209,96 @@ + + + + + + +