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
2
3
4
5
6



7
8
9
10
11
12



13
14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
29
30

31
32
33
34

35
36
37
38
39
40
41
42
43
44
45







46
1
2
3



4
5
6
7
8
9



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

26
27
28
29

30
31
32
33

34
35
36
37
38







39
40
41
42
43
44
45
46



-
-
-
+
+
+



-
-
-
+
+
+













-
+



-
+



-
+




-
-
-
-
-
-
-
+
+
+
+
+
+
+

/* CSS */

#grouptitle {
	font-size: 16px;
	font-weight: bold;
	color: hsl(0, 50%, 50%);
    font-size: 16px;
    font-weight: bold;
    color: hsl(0, 50%, 50%);
}

.option {
	font-size: 16px;
	font-weight: bold;
	color: hsl(210, 50%, 50%);
    font-size: 16px;
    font-weight: bold;
    color: hsl(210, 50%, 50%);
}

.suboption {
    margin-left: 30px;
    font-size: 16px;
    font-weight: bold;
    color: hsl(210, 50%, 50%);
}
.suboption2 {
    margin-left: 30px;
}

description {
	width: 340px;
    width: 340px;
}

.dicdescr {
	margin-left: 27px;
      margin-left: 27px;
}

.disabled {
  opacity: .25;
    opacity: .25;
}


.dialogheader-title {
  margin: 5px;
  padding: 5px 8px;
  border: 1px solid hsl(210, 50%, 80%);
  background-color: hsl(210, 50%, 50%);
  color: hsl(210, 10%, 90%);
  font-size: larger;
  font-weight: bold;
    margin: 5px;
    padding: 5px 8px;
    border: 1px solid hsl(210, 50%, 80%);
    background-color: hsl(210, 50%, 50%);
    color: hsl(210, 10%, 90%);
    font-size: larger;
    font-weight: bold;
}

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

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

34
35
36
37
38
39
40
41
42
43














44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
14
15
16
17
18
19
20

21
22
23

24
25
26

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

60
61

62
63
64

65
66
67

68
69
70
71
72
73
74
75
76







-



-



-




+










+
+
+
+
+
+
+
+
+
+
+
+
+
+




-
+

-



-



-









        try {
            // center window
            document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();
            // main spelling dictionary
            let sMainDicName = prefs.getCharPref('sMainDicName');
            console.log("spelling dictionary:", sMainDicName);
            if (sMainDicName == "fr-classic.json") {
                console.log("classic");
                document.getElementById("classic").checked = true;
            }
            else if (sMainDicName == "fr-reform.json") {
                console.log("reform");
                document.getElementById("reform").checked = true;
            }
            else if (sMainDicName == "fr-allvars.json") {
                console.log("allvars");
                document.getElementById("allvars").checked = true;
            }
            // personal dictionary
            document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary');
            // listen
            this.listen();
        }
        catch (e) {
            console.error(e);
        }
    },
    listen: function () {
        document.addEventListener("dialogaccept", (event) => {
            oDialogControl.setDictionaries();
        });
        document.getElementById("classic").addEventListener("click", (event) => {
            oDialogControl.changeMainDicUI("classic");
        });
        document.getElementById("reform").addEventListener("click", (event) => {
            oDialogControl.changeMainDicUI("reform");
        });
        document.getElementById("allvars").addEventListener("click", (event) => {
            oDialogControl.changeMainDicUI("allvars");
        });
    },
    changeMainDicUI (sDic) {
        document.getElementById("classic").checked = ("classic" === sDic);
        document.getElementById("reform").checked = ("reform" === sDic);
        document.getElementById("allvars").checked = ("allvars" === sDic);
    },
    setDictionaries: function () {
        //oSpellControl.init();
        // main spelling dictionary
        let sMainDicName;
        let sMainDicName = "";
        if (document.getElementById("classic").checked) {
            console.log("classic");
            sMainDicName = "fr-classic.json";
        }
        else if (document.getElementById("reform").checked) {
            console.log("reform");
            sMainDicName = "fr-reform.json";
        }
        else if (document.getElementById("allvars").checked) {
            console.log("allvars");
            sMainDicName = "fr-allvars.json";
        }
        console.log("selected spelling dictionary:", sMainDicName);
        prefs.setCharPref("sMainDicName", sMainDicName);
        // personal dictionary
        let bActivate = document.getElementById('personal_dic').checked;
        prefs.setBoolPref("bPersonalDictionary", bActivate);
    }
};

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

38
39
40
41
42
43
44





45

46
47
48
49

50
51
52
53
54
55
56
57
58
59
60
61
62
38
39
40
41
42
43
44
45
46
47
48
49

50
51
52
53

54
55
56
57
58
59
60
61
62
63
64
65
66
67







+
+
+
+
+
-
+



-
+













    <groupbox with="380">
      <caption id="grouptitle" label="&grouptitle_graphspell;" />
      <description id="warning">&warning_graphspell;</description>

      <checkbox id="main_dic" class="option" label="&option.main_dic.label;" disabled="true" checked="true" />
      <description class="dicdescr">&option.main_dic.descr;</description>
      <label class="suboption" value="&option.main_dic.spelling;" />
      <hbox class="suboption2" >
        <checkbox id="classic" label="&option.main_dic.classic;" checked="false" />
        <checkbox id="reform" label="&option.main_dic.reform;" checked="false" />
        <checkbox id="allvars" label="&option.main_dic.allvars;" checked="false" />
      </hbox>
      <radiogroup id="main_dic_name" class="suboption2" orient="horizontal">
      <!--<radiogroup id="main_dic_name" class="suboption2" orient="horizontal">
        <radio id="classic" label="&option.main_dic.classic;" value="fr-classic.json" />
        <radio id="reform" label="&option.main_dic.reform;" value="fr-reform.json" />
        <radio id="allvars" label="&option.main_dic.allvars;" value="fr-allvars.json" />
      </radiogroup>
      </radiogroup>-->

      <checkbox id="community_dic" class="option disabled" label="&option.community_dic.label;" disabled="true" />
      <description class="dicdescr disabled">&option.community_dic.descr;</description>

      <checkbox id="personal_dic" class="option" label="&option.personal_dic.label;" />
      <description class="dicdescr">&option.personal_dic.descr;</description>
    </groupbox>
  </hbox>

  <script type="application/javascript" src="spell_options.js"/>
  <script type="application/javascript" src="spellchecker.js"/>

</dialog>