Grammalecte  Check-in [e2d390fd56]

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

Overview
Comment:[tb] ui options update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tb | tbme
Files: files | file ages | folders
SHA3-256:e2d390fd56cf0d6664b38df543fbf097b3424e883083c91252b7607821faa95a
User & Date: olr 2019-09-05 09:54:05
Context
2019-09-06
09:50
merge trunk check-in: 21c81683f4 user: olr tags: tbme
2019-09-05
09:54
[tb] ui options update check-in: e2d390fd56 user: olr tags: tb, tbme
06:57
[tb] gc options: ui update check-in: 780895ad13 user: olr tags: tb, tbme
Changes

Changes to gc_lang/fr/mailext/content/options.js.

13
14
15
16
17
18
19
20
21







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

    load: function () {
        try {
            document.getElementById('check_signature').checked = prefs.getBoolPref('bCheckSignature');
        }
        catch (e) {
            console.error(e);
            // Cu.reportError(e);
        }







    },

    save: function () {
        try {
            prefs.setBoolPref('bCheckSignature', document.getElementById('check_signature').checked);
        }
        catch (e) {
            console.error(e);
            // Cu.reportError(e);
        }
    }
}


oOptControl.load();







<

>
>
>
>
>
>
>








<




<

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

    load: function () {
        try {
            document.getElementById('check_signature').checked = prefs.getBoolPref('bCheckSignature');
        }
        catch (e) {
            console.error(e);

        }
        this.listen();
    },

    listen: function () {
        document.addEventListener("dialogaccept", (event) => {
            this.save();
        });
    },

    save: function () {
        try {
            prefs.setBoolPref('bCheckSignature', document.getElementById('check_signature').checked);
        }
        catch (e) {
            console.error(e);

        }
    }
}


oOptControl.load();

Changes to gc_lang/fr/mailext/content/options.xul.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE dialog SYSTEM "chrome://grammarchecker/locale/options.dtd">

<dialog
  id="grammalecte-options-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept, cancel"
  ondialogaccept="oOptControl.save();"
  ondialogcancel="return;"
  defaultButton="accept"
  width="400"
  onload="document.getElementById('grammalecte-options-window').centerWindowOnScreen();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->








<
<







5
6
7
8
9
10
11


12
13
14
15
16
17
18
<!DOCTYPE dialog SYSTEM "chrome://grammarchecker/locale/options.dtd">

<dialog
  id="grammalecte-options-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept, cancel"


  defaultButton="accept"
  width="400"
  onload="document.getElementById('grammalecte-options-window').centerWindowOnScreen();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->

Changes to gc_lang/fr/mailext/content/spell_options.js.

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
47
48
49
50
51
52
53
const Cc = Components.classes;
const Ci = Components.interfaces;
// const Cu = Components.utils;
const prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).getBranch("extensions.grammarchecker.");


var oDialogControl = {
	load: function () {
		try {
			// center window
			document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();
			// Graphspell dictionaries
			document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary');
			// Hunspell dictionaries
			//document.getElementById('fr-FR-modern').checked = prefs.getBoolPref('bDictModern');
			//document.getElementById('fr-FR-classic').checked = prefs.getBoolPref('bDictClassic');
			//document.getElementById('fr-FR-reform').checked = prefs.getBoolPref('bDictReform');
			//document.getElementById('fr-FR-classic-reform').checked = prefs.getBoolPref('bDictClassicReform');
		}
		catch (e) {
			console.error(e);
			// Cu.reportError(e);
		}
	},





	setDictionaries: function () {
		oSpellControl.init();
		this._setGraphspellDictionaries();
		this._setHunspellDictionary('fr-FR-modern', 'bDictModern');
		this._setHunspellDictionary('fr-FR-classic', 'bDictClassic');
		this._setHunspellDictionary('fr-FR-reform', 'bDictReform');
		this._setHunspellDictionary('fr-FR-classic-reform', 'bDictClassicReform');
	},
	_setHunspellDictionary: function (sDicName, sOptName) {
		try {
			let bActivate = document.getElementById(sDicName).checked;
			oSpellControl.setExtensionDictFolder(sDicName, bActivate);
			prefs.setBoolPref(sOptName, bActivate);
		}
		catch (e) {
			console.error(e);
			// Cu.reportError(e);
		}
	},
	_setGraphspellDictionaries: function () {
		let bActivate = document.getElementById('personal_dic').checked;
		prefs.setBoolPref("bPersonalDictionary", bActivate);
	}
};







|
|
|
|
|
|
|
<
<
<
<
|
|
|
<
|
|
>
>
>
>
>
|
|
|
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|

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
const Cc = Components.classes;
const Ci = Components.interfaces;
// const Cu = Components.utils;
const prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).getBranch("extensions.grammarchecker.");


var oDialogControl = {
    load: function () {
        try {
            // center window
            document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();
            // Graphspell dictionaries
            document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary');
            this.listen();




        }
        catch (e) {
            console.error(e);

        }
    },
    listen: function () {
        document.addEventListener("dialogaccept", (event) => {
            oDialogControl.setDictionaries();
        });
    },
    setDictionaries: function () {
        oSpellControl.init();
        this._setGraphspellDictionaries();




    },











    _setGraphspellDictionaries: function () {
        let bActivate = document.getElementById('personal_dic').checked;
        prefs.setBoolPref("bPersonalDictionary", bActivate);
    }
};

Changes to gc_lang/fr/mailext/content/spell_options.xul.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE dialog SYSTEM "chrome://grammarchecker/locale/spell_options.dtd">

<dialog
  id="grammalecte-spelloptions-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept,cancel"
  ondialogaccept="oDialogControl.setDictionaries();"
  ondialogcancel="return;"
  width="400"
  height="400"
  onload="oDialogControl.load();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->

  <div class="dialogheader-title">&dialogheader.label;</div>








<
<

|







5
6
7
8
9
10
11


12
13
14
15
16
17
18
19
20
<!DOCTYPE dialog SYSTEM "chrome://grammarchecker/locale/spell_options.dtd">

<dialog
  id="grammalecte-spelloptions-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept,cancel"


  width="400"
  height="300"
  onload="oDialogControl.load();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->

  <div class="dialogheader-title">&dialogheader.label;</div>