Grammalecte  Check-in [2db0f91eb2]

Overview
Comment:[fx] lexicon editor: adapt labels
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: 2db0f91eb2cf90168bc125195c2c237a66352e6557f1a95adcb6777b53fd296b
User & Date: olr on 2019-05-23 06:21:08
Other Links: manifest | tags
Context
2019-05-23
10:57
[fr] ajustements check-in: d04bf88afa user: olr tags: fr, trunk
06:21
[fx] lexicon editor: adapt labels check-in: 2db0f91eb2 user: olr tags: fx, trunk
06:03
[fx] lexicon editor: remove cruft check-in: 53f1e213c5 user: olr tags: fx, trunk
Changes

Modified gc_lang/fr/webext/panel/lex_editor.html from [3be21fe839] to [70c5533f4c].

    20     20                 <option value="__personal__">__personnel__</option>
    21     21               </select>
    22     22               <!--<div id="new_dictionary_button" title="Créer un dictionnaire partagé">+</div>-->
    23     23               <div id="delete_dictionary_button" title="Supprimer ce dictionnaire">−</div>
    24     24             </div>
    25     25   
    26     26             <div>[<span id="dic_save_date">—</span>]</div>
    27         -          <div><span id="dic_num_entries">0</span> entrées</div>
           27  +          <div><span id="dic_num_entries">[rien]</span> </div>
    28     28             <div>
    29     29               <input type="file" id="import_input" accept=".json" style="display: none;">
    30     30               <label id="import_button" for="import_input">Importer</label>
    31     31             </div>
    32     32             <div id="export_button">Exporter</div>
    33     33           </div>
    34     34           <div id="new_dictionary_section" style="display: none;">
................................................................................
    39     39             </div>
    40     40           </div>
    41     41           <progress id="wait_progress" value="0"></progress>
    42     42         </div>
    43     43   
    44     44         <div id="buttons" class="container">
    45     45           <div id="lexicon_button" class="main_button">
    46         -          Lexique · <span id="num_entries">0</span> entrées <span id="save_button">Enregistrer</span>
           46  +          Lexique · <span id="num_entries">[rien]</span> <span id="save_button">Enregistrer</span>
    47     47           </div>
    48     48           <div id="add_button" class="main_button">Ajout</div>
    49     49           <div id="search_button" class="main_button">Recherche</div>
    50     50           <div id="info_button" class="main_button">Informations</div>
    51     51         </div>
    52     52   
    53     53         <div id="add_page">

Modified gc_lang/fr/webext/panel/lex_editor.js from [b73a329e9e] to [a72eb5ad85].

   113    113   
   114    114       constructor (sNodeId, lColumn, sProgressBarId, sResultId="", bDeleteButtons=true) {
   115    115           this.sNodeId = sNodeId;
   116    116           this.xTable = document.getElementById(sNodeId);
   117    117           this.nColumn = lColumn.length;
   118    118           this.lColumn = lColumn;
   119    119           this.xProgressBar = document.getElementById(sProgressBarId);
   120         -        this.xNumEntry = document.getElementById(sResultId);
          120  +        this.xNumEntry = (sResultId) ? document.getElementById(sResultId) : null;
   121    121           this.iEntryIndex = 0;
   122    122           this.lEntry = [];
   123    123           this.nEntry = 0;
   124    124           this.bDeleteButtons = bDeleteButtons;
   125    125           this._createHeader();
   126    126           this.listen();
   127    127       }
................................................................................
   171    171           }
   172    172           this.nEntry += lFlex.length;
   173    173           this.showEntryNumber();
   174    174       }
   175    175   
   176    176       showEntryNumber () {
   177    177           if (this.xNumEntry) {
   178         -            this.xNumEntry.textContent = this.nEntry;
          178  +            this.xNumEntry.textContent = this.nEntry.toString() + ((this.nEntry > 1) ? " entrées" : " entrée");
   179    179           }
   180    180       }
   181    181   
   182    182       _addRow (lData) {
   183    183           let xRowNode = createNode("tr", { id: this.sNodeId + "_row_" + this.iEntryIndex });
   184    184           if (this.bDeleteButtons) {
   185    185               xRowNode.appendChild(createNode("td", { textContent: "×", className: "delete_entry", title: "Effacer cette entrée" }, { id_entry: this.iEntryIndex }));
................................................................................
   724    724           } else {
   725    725               this.setDictData(0, "[néant]");
   726    726               oDictHandler.saveDictionary(this.sName, null);
   727    727           }
   728    728       },
   729    729   
   730    730       setDictData: function (nEntries, sDate) {
   731         -        document.getElementById("dic_num_entries").textContent = nEntries;
          731  +        document.getElementById("dic_num_entries").textContent = nEntries.toString() + ((this.nEntry > 1) ? " entrées" : " entrée");
   732    732           document.getElementById("dic_save_date").textContent = sDate;
   733    733           if (nEntries == 0) {
   734    734               hideElement("export_button");
   735    735           } else {
   736    736               showElement("export_button");
   737    737           }
   738    738       },
................................................................................
   831    831           oTagsTable.fill(lEntry);
   832    832       }
   833    833   }
   834    834   
   835    835   
   836    836   const oGenWordsTable = new Table("generated_words_table", ["Flexions", "Étiquettes"], "wait_progress");
   837    837   const oLexiconTable = new Table("lexicon_table", ["Flexions", "Lemmes", "Étiquettes"], "wait_progress", "num_entries");
   838         -const oSearchTable = new Table("search_table", ["Flexions", "Lemmes", "Étiquettes"], "wait_progress", "search_num_entries", false);
          838  +const oSearchTable = new Table("search_table", ["Flexions", "Lemmes", "Étiquettes"], "wait_progress", "", false);
   839    839   const oTagsTable = new Table("tags_table", ["Étiquette", "Signification"], "wait_progress", "", false);
   840    840   
   841    841   
   842    842   oTagsInfo.load();
   843    843   oSearch.load();
   844    844   oDictHandler.loadDictionaries();
   845    845   oBinaryDict.listen();
   846    846   oGenerator.listen();
   847    847   oTabulations.listen();
   848    848   oSearch.listen();