Grammalecte  Check-in [898e9ae864]

Overview
Comment:[fx] WebExt: adaptation to Chrome: conj initialisation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: 898e9ae864b19aa8138d45d5dffcf455bccd850ed1e4be3c2f01e69986b1378c
User & Date: olr on 2017-09-27 11:21:59
Original Comment: [fx] WebExt: adaptation to Chrome: conj initialisation (again)
Other Links: manifest | tags
Context
2017-09-27
11:26
[fx] WebExt: adaptation to Chrome: conj initialisation (again) check-in: da4865ce6b user: olr tags: trunk, fx
11:21
[fx] WebExt: adaptation to Chrome: conj initialisation check-in: 898e9ae864 user: olr tags: trunk, fx
11:14
[fx] WebExt: create window: panel type is deprecated check-in: 39c185125f user: olr tags: trunk, fx
Changes

Modified gc_lang/fr/modules-js/conj.js from [fdb0ca6eac] to [cf19538b1a].

482
483
484
485
486
487
488
489

490
491
492
493
494
495

496
497
498
499
500
501
502
482
483
484
485
486
487
488

489
490
491
492
493
494

495
496
497
498
499
500
501
502







-
+





-
+







        }
        return (this.dConj.get(":PQ").get(":Q4")) ? this.dConj.get(":PQ").get(":Q4") : this.dConj.get(":PQ").get(":Q1");
    }
}


// Initialization
if (!conj.bInit && typeof(browser) !== 'undefined') {
if (!conj.bInit && (typeof(browser) !== 'undefined' || typeof(chrome) !== 'undefined')) {
    // WebExtension (but not in Worker)
    conj.init(helpers.loadFile(browser.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é");