1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
+
+
-
-
+
+
+
+
-
+
|
// Grammalecte - Conjugueur
// License: GPL 3
/* jshint esversion:6, -W097 */
/*jslint esversion: 6*/
/*global console,require,exports,self,browser*/
/* jslint esversion:6 */
/* global require, exports, console, self, browser, chrome, __dirname */
"use strict";
${map}
if(typeof(process) !== 'undefined') {
var helpers = require("../graphspell/helpers.js");
if (typeof(require) !== 'undefined') {
} else if (typeof(require) !== 'undefined') {
var helpers = require("resource://grammalecte/graphspell/helpers.js");
}
var conj = {
_lVtyp: [],
_lTags: [],
_dPatternConj: {},
|
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
|
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
|
+
+
+
-
+
-
+
-
+
|
}
return (this.dConj.get(":Q").get(":Q4")) ? this.dConj.get(":Q").get(":Q4") : this.dConj.get(":Q").get(":Q1");
}
}
// Initialization
if(!conj.bInit && typeof(process) !== 'undefined') {
// Work with nodejs
conj.init(helpers.loadFile(__dirname+"/conj_data.json"));
if (!conj.bInit && typeof(browser) !== 'undefined') {
} else if (!conj.bInit && typeof(browser) !== 'undefined') {
// WebExtension Standard (but not in Worker)
conj.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/conj_data.json")));
} else if (!conj.bInit && typeof(chrome) !== 'undefined') {
// WebExtension Chrome (but not in Worker)
conj.init(helpers.loadFile(chrome.extension.getURL("grammalecte/fr/conj_data.json")));
} else if (!conj.bInit && typeof(require) !== 'undefined') {
// Add-on SDK and Thunderbird
conj.init(helpers.loadFile("resource://grammalecte/fr/conj_data.json"));
} else if (!conj.bInit && typeof(self) !== 'undefined' && typeof(self.port) !== 'undefined' && typeof(self.port.on) !== "undefined") {
} else if (!conj.bInit && typeof(self) !== 'undefined' && typeof(self.port) !== 'undefined' && typeof(self.port.on) !== 'undefined') {
// used within Firefox content script (conjugation panel).
// can’t load JSON from here, so we do it in ui.js and send it here.
self.port.on("provideConjData", function (sJSONData) {
conj.init(sJSONData);
});
});
} else if (conj.bInit){
console.log("Module conj déjà initialisé");
} else {
//console.log("Module conj non initialisé");
}
|