45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
xGCEWorker: null,
bDictActive: null,
loadGC: function () {
if (this.xGCEWorker === null) {
// Grammar checker
echo('Loading Grammalecte');
this.xGCEWorker = new BasePromiseWorker('chrome://promiseworker/content/gce_worker.js');
let xPromise = this.xGCEWorker.post('loadGrammarChecker', [prefs.getCharPref("sGCOptions"), "Thunderbird"]);
xPromise.then(
function (aVal) {
echo(aVal);
prefs.setCharPref("sGCOptions", aVal);
},
function (aReason) { echo('Promise rejected - ', aReason); }
).catch(
function (aCaught) { echo('Promise Error - ', aCaught); }
);
}
},
fullTests: function () {
echo('Performing tests... Wait...');
let xPromise = this.xGCEWorker.post('fullTests', ['{"nbsp":true, "esp":true, "unit":true, "num":true}']);
xPromise.then(
function (aVal) {
|
>
>
>
>
>
>
>
>
|
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
|
xGCEWorker: null,
bDictActive: null,
loadGC: function () {
if (this.xGCEWorker === null) {
// Grammar checker
echo('Loading Grammalecte');
this.xGCEWorker = new BasePromiseWorker('chrome://promiseworker/content/gce_worker.js');
let that = this;
let xPromise = this.xGCEWorker.post('loadGrammarChecker', [prefs.getCharPref("sGCOptions"), "Thunderbird"]);
xPromise.then(
function (aVal) {
echo(aVal);
prefs.setCharPref("sGCOptions", aVal);
if (prefs.getBoolPref("bPersonalDictionary")) {
let sDicJSON = oFileHandler.loadFile("fr.personal.json");
if (sDicJSON) {
that.xGCEWorker.post('setDictionary', ["personal", sDicJSON]);
}
}
},
function (aReason) { echo('Promise rejected - ', aReason); }
).catch(
function (aCaught) { echo('Promise Error - ', aCaught); }
);
}
},
fullTests: function () {
echo('Performing tests... Wait...');
let xPromise = this.xGCEWorker.post('fullTests', ['{"nbsp":true, "esp":true, "unit":true, "num":true}']);
xPromise.then(
function (aVal) {
|
498
499
500
501
502
503
504
505
506
507
508
509
510
511
|
},
onOpenTextFormatter: function (e) {
oTextFormatter.openPanel();
},
onOpenConjugueur: function (e) {
this.openDialog("chrome://grammarchecker/content/conjugueur.xul", "", "chrome, resizable=no");
},
onAbout: function (e) {
this.openDialog("chrome://grammarchecker/content/about.xul", "", "chrome, dialog, modal, resizable=no");
}
};
var oDictIgniter = {
|
>
>
>
|
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
|
},
onOpenTextFormatter: function (e) {
oTextFormatter.openPanel();
},
onOpenConjugueur: function (e) {
this.openDialog("chrome://grammarchecker/content/conjugueur.xul", "", "chrome, resizable=no");
},
onOpenLexiconEditor: function (e) {
this.openDialog("chrome://grammarchecker/content/lex_editor.xul", "", "chrome, resizable=no");
},
onAbout: function (e) {
this.openDialog("chrome://grammarchecker/content/about.xul", "", "chrome, dialog, modal, resizable=no");
}
};
var oDictIgniter = {
|