Grammalecte  Check-in [97d7e3a4f3]

Overview
Comment:[tb] dictionaries: spelling option
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tb | tbso
Files: files | file ages | folders
SHA3-256: 97d7e3a4f3c90b26ebf5106139a11b3521600111b4fb8da728a437e87dff4229
User & Date: olr on 2020-01-20 12:20:28
Other Links: branch diff | manifest | tags
Context
2020-01-20
23:35
[tb] text formatter: progressbar Closed-Leaf check-in: ee415784e6 user: olr tags: tb, tbso
12:20
[tb] dictionaries: spelling option check-in: 97d7e3a4f3 user: olr tags: tb, tbso
10:16
merge trunk check-in: afed5163f0 user: olr tags: tbso
Changes

Modified gc_lang/fr/mailext/content/spell_options.css from [618db9d4d2] to [377d800f5a].

     1      1   /* CSS */
     2      2   
     3      3   #grouptitle {
     4         -	font-size: 16px;
     5         -	font-weight: bold;
     6         -	color: hsl(0, 50%, 50%);
            4  +    font-size: 16px;
            5  +    font-weight: bold;
            6  +    color: hsl(0, 50%, 50%);
     7      7   }
     8      8   
     9      9   .option {
    10         -	font-size: 16px;
    11         -	font-weight: bold;
    12         -	color: hsl(210, 50%, 50%);
           10  +    font-size: 16px;
           11  +    font-weight: bold;
           12  +    color: hsl(210, 50%, 50%);
    13     13   }
    14     14   
    15     15   .suboption {
    16     16       margin-left: 30px;
    17     17       font-size: 16px;
    18     18       font-weight: bold;
    19     19       color: hsl(210, 50%, 50%);
    20     20   }
    21     21   .suboption2 {
    22     22       margin-left: 30px;
    23     23   }
    24     24   
    25     25   description {
    26         -	width: 340px;
           26  +    width: 340px;
    27     27   }
    28     28   
    29     29   .dicdescr {
    30         -	margin-left: 27px;
           30  +      margin-left: 27px;
    31     31   }
    32     32   
    33     33   .disabled {
    34         -  opacity: .25;
           34  +    opacity: .25;
    35     35   }
    36     36   
    37     37   
    38     38   .dialogheader-title {
    39         -  margin: 5px;
    40         -  padding: 5px 8px;
    41         -  border: 1px solid hsl(210, 50%, 80%);
    42         -  background-color: hsl(210, 50%, 50%);
    43         -  color: hsl(210, 10%, 90%);
    44         -  font-size: larger;
    45         -  font-weight: bold;
           39  +    margin: 5px;
           40  +    padding: 5px 8px;
           41  +    border: 1px solid hsl(210, 50%, 80%);
           42  +    background-color: hsl(210, 50%, 50%);
           43  +    color: hsl(210, 10%, 90%);
           44  +    font-size: larger;
           45  +    font-weight: bold;
    46     46   }

Modified gc_lang/fr/mailext/content/spell_options.js from [c1f1aaa1bd] to [d5cdd1e710].

    14     14           try {
    15     15               // center window
    16     16               document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();
    17     17               // main spelling dictionary
    18     18               let sMainDicName = prefs.getCharPref('sMainDicName');
    19     19               console.log("spelling dictionary:", sMainDicName);
    20     20               if (sMainDicName == "fr-classic.json") {
    21         -                console.log("classic");
    22     21                   document.getElementById("classic").checked = true;
    23     22               }
    24     23               else if (sMainDicName == "fr-reform.json") {
    25         -                console.log("reform");
    26     24                   document.getElementById("reform").checked = true;
    27     25               }
    28     26               else if (sMainDicName == "fr-allvars.json") {
    29         -                console.log("allvars");
    30     27                   document.getElementById("allvars").checked = true;
    31     28               }
    32     29               // personal dictionary
    33     30               document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary');
           31  +            // listen
    34     32               this.listen();
    35     33           }
    36     34           catch (e) {
    37     35               console.error(e);
    38     36           }
    39     37       },
    40     38       listen: function () {
    41     39           document.addEventListener("dialogaccept", (event) => {
    42     40               oDialogControl.setDictionaries();
    43     41           });
           42  +        document.getElementById("classic").addEventListener("click", (event) => {
           43  +            oDialogControl.changeMainDicUI("classic");
           44  +        });
           45  +        document.getElementById("reform").addEventListener("click", (event) => {
           46  +            oDialogControl.changeMainDicUI("reform");
           47  +        });
           48  +        document.getElementById("allvars").addEventListener("click", (event) => {
           49  +            oDialogControl.changeMainDicUI("allvars");
           50  +        });
           51  +    },
           52  +    changeMainDicUI (sDic) {
           53  +        document.getElementById("classic").checked = ("classic" === sDic);
           54  +        document.getElementById("reform").checked = ("reform" === sDic);
           55  +        document.getElementById("allvars").checked = ("allvars" === sDic);
    44     56       },
    45     57       setDictionaries: function () {
    46     58           //oSpellControl.init();
    47     59           // main spelling dictionary
    48         -        let sMainDicName;
           60  +        let sMainDicName = "";
    49     61           if (document.getElementById("classic").checked) {
    50         -            console.log("classic");
    51     62               sMainDicName = "fr-classic.json";
    52     63           }
    53     64           else if (document.getElementById("reform").checked) {
    54         -            console.log("reform");
    55     65               sMainDicName = "fr-reform.json";
    56     66           }
    57     67           else if (document.getElementById("allvars").checked) {
    58         -            console.log("allvars");
    59     68               sMainDicName = "fr-allvars.json";
    60     69           }
    61     70           console.log("selected spelling dictionary:", sMainDicName);
    62     71           prefs.setCharPref("sMainDicName", sMainDicName);
    63     72           // personal dictionary
    64     73           let bActivate = document.getElementById('personal_dic').checked;
    65     74           prefs.setBoolPref("bPersonalDictionary", bActivate);
    66     75       }
    67     76   };

Modified gc_lang/fr/mailext/content/spell_options.xul from [fb5553f523] to [abb535b915].

    38     38       <groupbox with="380">
    39     39         <caption id="grouptitle" label="&grouptitle_graphspell;" />
    40     40         <description id="warning">&warning_graphspell;</description>
    41     41   
    42     42         <checkbox id="main_dic" class="option" label="&option.main_dic.label;" disabled="true" checked="true" />
    43     43         <description class="dicdescr">&option.main_dic.descr;</description>
    44     44         <label class="suboption" value="&option.main_dic.spelling;" />
    45         -      <radiogroup id="main_dic_name" class="suboption2" orient="horizontal">
           45  +      <hbox class="suboption2" >
           46  +        <checkbox id="classic" label="&option.main_dic.classic;" checked="false" />
           47  +        <checkbox id="reform" label="&option.main_dic.reform;" checked="false" />
           48  +        <checkbox id="allvars" label="&option.main_dic.allvars;" checked="false" />
           49  +      </hbox>
           50  +      <!--<radiogroup id="main_dic_name" class="suboption2" orient="horizontal">
    46     51           <radio id="classic" label="&option.main_dic.classic;" value="fr-classic.json" />
    47     52           <radio id="reform" label="&option.main_dic.reform;" value="fr-reform.json" />
    48     53           <radio id="allvars" label="&option.main_dic.allvars;" value="fr-allvars.json" />
    49         -      </radiogroup>
           54  +      </radiogroup>-->
    50     55   
    51     56         <checkbox id="community_dic" class="option disabled" label="&option.community_dic.label;" disabled="true" />
    52     57         <description class="dicdescr disabled">&option.community_dic.descr;</description>
    53     58   
    54     59         <checkbox id="personal_dic" class="option" label="&option.personal_dic.label;" />
    55     60         <description class="dicdescr">&option.personal_dic.descr;</description>
    56     61       </groupbox>
    57     62     </hbox>
    58     63   
    59     64     <script type="application/javascript" src="spell_options.js"/>
    60     65     <script type="application/javascript" src="spellchecker.js"/>
    61     66   
    62     67   </dialog>