Grammalecte  Diff

Differences From Artifact [5529c5faca]:

To Artifact [9a4c845c84]:


577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
        let lEntry = oLexiconTable.getEntries();
        if (lEntry.length > 0) {
            let oDAWG = new DAWG(lEntry, "S", "fr", "Français", "Dictionnaire personnel", xProgressNode);
            let oJSON = oDAWG.createBinaryJSON(1);
            browser.storage.local.set({ "oPersonalDictionary": oJSON });
            this.oIBDAWG = new IBDAWG(oJSON);
            this.setDictData(this.oIBDAWG.nEntry, this.oIBDAWG.sDate);
            browser.runtime.sendMessage({ sCommand: "setDictionary", dParam: {sType: "personal", oDict: oJSON}, dInfo: {} });
        } else {
            this.setDictData(0, "[néant]");
            browser.storage.local.set({ "oPersonalDictionary": "" });
            browser.runtime.sendMessage({ sCommand: "setDictionary", dParam: {sType: "personal", oDict: null}, dInfo: {} });
        }
    },

    export: function () {
        let xBlob = new Blob([ JSON.stringify(this.oIBDAWG.getJSON()) ], {type: 'application/json'}); 
        let sURL = URL.createObjectURL(xBlob);
        browser.downloads.download({ filename: "fr.personal.json", url: sURL, saveAs: true });







|



|







577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
        let lEntry = oLexiconTable.getEntries();
        if (lEntry.length > 0) {
            let oDAWG = new DAWG(lEntry, "S", "fr", "Français", "Dictionnaire personnel", xProgressNode);
            let oJSON = oDAWG.createBinaryJSON(1);
            browser.storage.local.set({ "oPersonalDictionary": oJSON });
            this.oIBDAWG = new IBDAWG(oJSON);
            this.setDictData(this.oIBDAWG.nEntry, this.oIBDAWG.sDate);
            browser.runtime.sendMessage({ sCommand: "setDictionary", dParam: {sDictionary: "personal", oDict: oJSON}, dInfo: {} });
        } else {
            this.setDictData(0, "[néant]");
            browser.storage.local.set({ "oPersonalDictionary": "" });
            browser.runtime.sendMessage({ sCommand: "setDictionary", dParam: {sDictionary: "personal", oDict: null}, dInfo: {} });
        }
    },

    export: function () {
        let xBlob = new Blob([ JSON.stringify(this.oIBDAWG.getJSON()) ], {type: 'application/json'}); 
        let sURL = URL.createObjectURL(xBlob);
        browser.downloads.download({ filename: "fr.personal.json", url: sURL, saveAs: true });