Index: gc_core/js/lang_core/gc_engine.js ================================================================== --- gc_core/js/lang_core/gc_engine.js +++ gc_core/js/lang_core/gc_engine.js @@ -4,27 +4,27 @@ /* jslint esversion:6 */ /* global require, exports, console */ "use strict"; -//${string} -//${regex} -//${map} +${string} +${regex} +${map} -if(typeof process !== 'undefined') { - var gc_options = require('./gc_options.js'); - var gc_rules = require('./gc_rules.js'); - var gc_rules_graph = require('./gc_rules_graph.js'); - var cregex = require('./cregex.js'); - var text = require('../text.js'); +if(typeof(process) !== 'undefined') { + var gc_options = require("./gc_options.js"); + var gc_rules = require("./gc_rules.js"); + var gc_rules_graph = require("./gc_rules_graph.js"); + var cregex = require("./cregex.js"); + var text = require("../text.js"); } else if (typeof(require) !== 'undefined') { - var gc_options = require('resource://grammalecte/${lang}/gc_options.js'); - var gc_rules = require('resource://grammalecte/${lang}/gc_rules.js'); - var gc_rules_graph = require('resource://grammalecte/${lang}/gc_rules_graph.js'); - var cregex = require('resource://grammalecte/${lang}/cregex.js'); - var text = require('resource://grammalecte/text.js'); + var gc_options = require("resource://grammalecte/${lang}/gc_options.js"); + var gc_rules = require("resource://grammalecte/${lang}/gc_rules.js"); + var gc_rules_graph = require("resource://grammalecte/${lang}/gc_rules_graph.js"); + var cregex = require("resource://grammalecte/${lang}/cregex.js"); + var text = require("resource://grammalecte/text.js"); } function capitalizeArray (aArray) { // can’t map on user defined function?? @@ -59,15 +59,15 @@ //// Initialization load: function (sContext="JavaScript", sColorType="aRGB", sPath="") { try { - if(typeof process !== 'undefined') { - var spellchecker = require('../graphspell/spellchecker.js'); + if(typeof(process) !== 'undefined') { + var spellchecker = require("../graphspell/spellchecker.js"); _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}"); - } else if (typeof require !== 'undefined') { - var spellchecker = require('resource://grammalecte/graphspell/spellchecker.js'); + } else if (typeof(require) !== 'undefined') { + var spellchecker = require("resource://grammalecte/graphspell/spellchecker.js"); _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}"); } else { _oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}"); } _sAppContext = sContext; @@ -1398,11 +1398,11 @@ // callables for graph rules ${graph_callablesJS} } -if (typeof exports !== 'undefined') { +if (typeof(exports) !== 'undefined') { exports.lang = gc_engine.lang; exports.locales = gc_engine.locales; exports.pkg = gc_engine.pkg; exports.name = gc_engine.name; exports.version = gc_engine.version; Index: gc_core/js/lang_core/gc_rules_graph.js ================================================================== --- gc_core/js/lang_core/gc_rules_graph.js +++ gc_core/js/lang_core/gc_rules_graph.js @@ -1,10 +1,10 @@ // Grammar checker graph rules /* jshint esversion:6, -W097 */ /* jslint esversion:6 */ -/*global exports*/ +/* global exports */ "use strict"; ${string} Index: gc_core/js/tests.js ================================================================== --- gc_core/js/tests.js +++ gc_core/js/tests.js @@ -5,14 +5,14 @@ /* global require, exports, console */ "use strict"; -if(typeof process !== 'undefined') { - var helpers = require('./graphspell/helpers.js'); -} else if (typeof require !== 'undefined') { - var helpers = require('resource://grammalecte/graphspell/helpers.js'); +if(typeof(process) !== 'undefined') { + var helpers = require("./graphspell/helpers.js"); +} else if (typeof(require) !== 'undefined') { + var helpers = require("resource://grammalecte/graphspell/helpers.js"); } class TestGrammarChecking { @@ -23,11 +23,11 @@ } * testParse (bDebug=false) { const t0 = Date.now(); let sURL; - if(typeof process !== 'undefined') { + if(typeof(process) !== 'undefined') { sURL = (this.spfTests !== "") ? this.spfTests : "./"+this.gce.lang+"/tests_data.json"; } else { sURL = (this.spfTests !== "") ? this.spfTests : "resource://grammalecte/"+this.gce.lang+"/tests_data.json"; } const aData = JSON.parse(helpers.loadFile(sURL)).aData; @@ -160,8 +160,8 @@ } } -if (typeof exports !== 'undefined') { +if (typeof(exports) !== 'undefined') { exports.TestGrammarChecking = TestGrammarChecking; } Index: gc_core/js/text.js ================================================================== --- gc_core/js/text.js +++ gc_core/js/text.js @@ -59,10 +59,10 @@ } } }; -if (typeof exports !== 'undefined') { +if (typeof(exports) !== 'undefined') { exports.getParagraph = text.getParagraph; exports.wrap = text.wrap; exports.getReadableError = text.getReadableError; } Index: gc_lang/fr/modules-js/conj.js ================================================================== --- gc_lang/fr/modules-js/conj.js +++ gc_lang/fr/modules-js/conj.js @@ -1,11 +1,11 @@ // Grammalecte - Conjugueur // License: GPL 3 /* jshint esversion:6, -W097 */ /* jslint esversion:6 */ -/*global require, exports, console, self, browser, chrome, __dirname */ +/* global require, exports, console, self, browser, chrome, __dirname */ "use strict"; ${map} @@ -513,15 +513,15 @@ // 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') { // 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) { + self.port.on("provideConjData", function (sJSONData) { conj.init(sJSONData); }); } else if (conj.bInit){ - console.log('Module conj déjà initialisé'); + console.log("Module conj déjà initialisé"); } else { //console.log("Module conj non initialisé"); } Index: gc_lang/fr/modules-js/mfsp.js ================================================================== --- gc_lang/fr/modules-js/mfsp.js +++ gc_lang/fr/modules-js/mfsp.js @@ -108,21 +108,21 @@ // Initialization if(!mfsp.bInit && typeof(process) !== 'undefined') { //Nodejs - mfsp.init(helpers.loadFile(__dirname+'/mfsp_data.json')); + mfsp.init(helpers.loadFile(__dirname+"/mfsp_data.json")); } else if (!mfsp.bInit && typeof(browser) !== 'undefined') { // WebExtension - mfsp.init(helpers.loadFile(browser.extension.getURL('grammalecte/fr/mfsp_data.json'))); + mfsp.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/mfsp_data.json"))); } else if (!mfsp.bInit && typeof(require) !== 'undefined') { // Add-on SDK and Thunderbird - mfsp.init(helpers.loadFile('resource://grammalecte/fr/mfsp_data.json')); + mfsp.init(helpers.loadFile("resource://grammalecte/fr/mfsp_data.json")); } else if (mfsp.bInit){ - console.log('Module mfsp déjà initialisé'); + console.log("Module mfsp déjà initialisé"); } else { - //console.log('Module mfsp non initialisé'); + //console.log("Module mfsp non initialisé"); } if (typeof(exports) !== 'undefined') { exports._lTagMiscPlur = mfsp._lTagMiscPlur; Index: gc_lang/fr/modules-js/phonet.js ================================================================== --- gc_lang/fr/modules-js/phonet.js +++ gc_lang/fr/modules-js/phonet.js @@ -99,11 +99,11 @@ // Add-on SDK and Thunderbird phonet.init(helpers.loadFile("resource://grammalecte/fr/phonet_data.json")); } else if (phonet.bInit){ console.log("Module phonet déjà initialisé"); } else { - //console.log('Module phonet non initialisé'); + //console.log("Module phonet non initialisé"); } if (typeof(exports) !== 'undefined') { exports._dWord = phonet._dWord; Index: gc_lang/fr/modules-js/textformatter.js ================================================================== --- gc_lang/fr/modules-js/textformatter.js +++ gc_lang/fr/modules-js/textformatter.js @@ -287,9 +287,9 @@ return dTFDefaultOptions; } } -if (typeof(exports) !== "undefined") { +if (typeof(exports) !== 'undefined') { exports.TextFormatter = TextFormatter; exports.oReplTable = oReplTable; } Index: graphspell-js/helpers.js ================================================================== --- graphspell-js/helpers.js +++ graphspell-js/helpers.js @@ -26,11 +26,11 @@ if(typeof(process) !== 'undefined') { //console.log('loadFile(disque): ' + spf); let fs = require("fs"); return fs.readFileSync(spf, "utf8"); } else { - //console.log('loadFile: ' + spf); + console.log("loadFile: " + spf); let xRequest; xRequest = new XMLHttpRequest(); xRequest.open('GET', spf, false); // 3rd arg is false for synchronous, sync is acceptable in workers xRequest.overrideMimeType('text/json'); xRequest.send(); Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -100,11 +100,11 @@ // param1 can be a filename or a object with all the necessary data. try { let oData = null; if (typeof(param1) == "string") { let sURL; - if(typeof process !== 'undefined') { + if(typeof(process) !== 'undefined') { sURL = (sPath !== "") ? sPath + "/" + param1 : __dirname + "/_dictionaries/"+param1; } else { sURL = (sPath !== "") ? sPath + "/" + param1 : "resource://grammalecte/graphspell/_dictionaries/"+param1; } oData = JSON.parse(helpers.loadFile(sURL));