Grammalecte  Check-in [46191a94a9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[fx] lexicon editor: ui rework -> save button always visible
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | comdic
Files: files | file ages | folders
SHA3-256:46191a94a9fdc177727a846932db23d9d1c9a19c419f40a555e65df08a996fef
User & Date: olr 2018-12-12 11:02:44
Context
2018-12-13
10:41
[fx] update: community dictionaries (draft) check-in: 92e25df2da user: olr tags: comdic, fx
2018-12-12
11:02
[fx] lexicon editor: ui rework -> save button always visible check-in: 46191a94a9 user: olr tags: comdic, fx
2018-12-11
18:50
[fx] page for dictionaries (draft) check-in: 09a2b4f200 user: olr tags: comdic, fx
Changes

Changes to gc_lang/fr/webext/panel/lex_editor.css.

    80     80   */
    81     81   #buttons {
    82     82       padding: 10px 0;
    83     83       justify-content: center;
    84     84   }
    85     85   .main_button {
    86     86       margin: 0 5px;
    87         -    width: 100px;
           87  +    min-width: 100px;
    88     88       padding: 10px 20px;
    89     89       background-color: hsl(210, 10%, 95%);
    90     90       border-radius: 5px;
    91     91       text-align: center;
    92     92       cursor: pointer;
    93     93   }
    94     94   #lexicon_button {
................................................................................
   298    298       width: 500px;
   299    299   }
   300    300   
   301    301   
   302    302   /*
   303    303       Dictionary
   304    304   */
   305         -#save_button, #export_button, #import_button {
          305  +#save_button {
   306    306       display: none;
   307         -    float: right;
   308         -    padding: 2px 10px;
          307  +    margin-left: 5px;
          308  +    padding: 1px 5px;
   309    309       background-color: hsl(150, 50%, 50%);
   310    310       color: hsl(150, 0%, 100%);
   311    311       border-radius: 3px;
   312    312       cursor: pointer;
   313    313   }
   314    314   #export_button, #import_button {
   315    315       display: block;
   316    316       margin-left: 5px;
          317  +    float: right;
          318  +    padding: 2px 10px;
   317    319       background-color: hsl(210, 50%, 50%);
   318    320       color: hsl(210, 0%, 100%);
          321  +    border-radius: 3px;
          322  +    cursor: pointer;
   319    323   }
          324  +
   320    325   #wait_progress {
   321    326       width: 100%;
   322    327       height: 4px;
   323    328   }
   324    329   
   325    330   
   326    331   /*

Changes to gc_lang/fr/webext/panel/lex_editor.html.

    32     32           <div class="dic_container">
    33     33   
    34     34           </div>
    35     35           <progress id="wait_progress" value="0"></progress>
    36     36         </div>
    37     37   
    38     38         <div id="buttons" class="container">
    39         -        <div id="lexicon_button" class="main_button">Lexique</div>
           39  +        <div id="lexicon_button" class="main_button">
           40  +          Lexique · <span id="num_entries">0</span> entrées <span id="save_button">Enregistrer</span>
           41  +        </div>
    40     42           <div id="add_button" class="main_button">Ajout</div>
    41     43           <div id="search_button" class="main_button">Recherche</div>
    42     44           <div id="info_button" class="main_button">Informations</div>
    43     45         </div>
    44     46   
    45     47         <div id="add_page">
    46     48           <div class="columns">
................................................................................
   250    252             </div> <!-- #generated_words -->
   251    253           </div> <!-- .columns -->
   252    254         </div> <!-- #add_page -->
   253    255   
   254    256   
   255    257         <div id="lexicon_page">
   256    258           <h2>Votre lexique</h2>
   257         -        <div class="big_block">
   258         -          <div id="save_button" class="fright">
   259         -            Enregistrer
   260         -          </div>
   261         -          <p>Nombre d’entrées : <span id="num_entries">0</span>.</p>
   262         -        </div>
   263         -
   264    259           <table id="lexicon_table">
   265    260   
   266    261           </table>
   267    262         </div> <!-- #lexicon_page -->
   268    263   
   269    264   
   270    265         <div id="search_page">

Changes to gc_lang/fr/webext/panel/lex_editor.js.

    29     29           return xNode;
    30     30       }
    31     31       catch (e) {
    32     32           showError(e);
    33     33       }
    34     34   }
    35     35   
    36         -function showElement (sElemId) {
           36  +function showElement (sElemId, sDisplay="block") {
    37     37       if (document.getElementById(sElemId)) {
    38         -        document.getElementById(sElemId).style.display = "block";
           38  +        document.getElementById(sElemId).style.display = sDisplay;
    39     39       } else {
    40     40           console.log("HTML node named <" + sElemId + "> not found.")
    41     41       }
    42     42   }
    43     43   
    44     44   function hideElement (sElemId) {
    45     45       if (document.getElementById(sElemId)) {
................................................................................
   201    201           this.lEntry[parseInt(iEntry)] = null;
   202    202           if (document.getElementById(this.sNodeId + "_row_" + iEntry)) {
   203    203               document.getElementById(this.sNodeId + "_row_" + iEntry).style.display = "none";
   204    204           }
   205    205           this.nEntry -= 1;
   206    206           this.showEntryNumber();
   207    207           if (this.sNodeId == "lexicon_table") {
   208         -            showElement("save_button");
          208  +            showElement("save_button", "inline-block");
   209    209           }
   210    210       }
   211    211   
   212    212       getEntries () {
   213    213           return this.lEntry.filter((e) => e !== null);
   214    214       }
   215    215   }
................................................................................
   481    481           try {
   482    482               oLexiconTable.addEntries(this.createFlexLemmaTagArray());
   483    483               oGenWordsTable.clear();
   484    484               document.getElementById("lemma").value = "";
   485    485               document.getElementById("lemma").focus();
   486    486               this.hideAllSections();
   487    487               hideElement("editor");
   488         -            showElement("save_button");
          488  +            showElement("save_button", "inline-block");
   489    489               this.clear();
   490    490               this.cMainTag = "";
   491    491           }
   492    492           catch (e) {
   493    493               showError(e);
   494    494           }
   495    495       }