Grammalecte  Diff

Differences From Artifact [80c174197e]:

To Artifact [abadc3982d]:


129
130
131
132
133
134
135

136
137
138
139
140
141
142

143
144
145
146
147
148
149
        browser.storage.local.get("ui_options").then(this._initUIOptions, showError);
        browser.storage.local.get("autorefresh_option").then(this._initUIOptions, showError);
    },

    initGrammarChecker: function () {
        if (bChrome) {
            browser.storage.local.get("gc_options", this._initGrammarChecker);

            browser.storage.local.get("personal_dictionary", this._setSpellingDictionaries);
            browser.storage.local.get("community_dictionary", this._setSpellingDictionaries);
            browser.storage.local.get("oPersonalDictionary", this._setSpellingDictionaries); // deprecated
            browser.storage.local.get("sc_options", this._initSCOptions);
            return;
        }
        browser.storage.local.get("gc_options").then(this._initGrammarChecker, showError);

        browser.storage.local.get("personal_dictionary").then(this._setSpellingDictionaries, showError);
        browser.storage.local.get("community_dictionary").then(this._setSpellingDictionaries, showError);
        browser.storage.local.get("oPersonalDictionary").then(this._setSpellingDictionaries, showError); // deprecated
        browser.storage.local.get("sc_options").then(this._initSCOptions, showError);
    },

    _initUIOptions: function (oSavedOptions) {







>







>







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
        browser.storage.local.get("ui_options").then(this._initUIOptions, showError);
        browser.storage.local.get("autorefresh_option").then(this._initUIOptions, showError);
    },

    initGrammarChecker: function () {
        if (bChrome) {
            browser.storage.local.get("gc_options", this._initGrammarChecker);
            browser.storage.local.get("main_dic_name", this._setSpellingDictionaries);
            browser.storage.local.get("personal_dictionary", this._setSpellingDictionaries);
            browser.storage.local.get("community_dictionary", this._setSpellingDictionaries);
            browser.storage.local.get("oPersonalDictionary", this._setSpellingDictionaries); // deprecated
            browser.storage.local.get("sc_options", this._initSCOptions);
            return;
        }
        browser.storage.local.get("gc_options").then(this._initGrammarChecker, showError);
        browser.storage.local.get("main_dic_name", this._setSpellingDictionaries);
        browser.storage.local.get("personal_dictionary").then(this._setSpellingDictionaries, showError);
        browser.storage.local.get("community_dictionary").then(this._setSpellingDictionaries, showError);
        browser.storage.local.get("oPersonalDictionary").then(this._setSpellingDictionaries, showError); // deprecated
        browser.storage.local.get("sc_options").then(this._initSCOptions, showError);
    },

    _initUIOptions: function (oSavedOptions) {
181
182
183
184
185
186
187



188
189
190
191
192
193
194
        if (oData.hasOwnProperty("oPersonalDictionary")) {
            // deprecated (to be removed in 2020)
            console.log("personal dictionary migration");
            browser.storage.local.set({ "personal_dictionary": oData["oPersonalDictionary"] });
            oWorkerHandler.xGCEWorker.postMessage({ sCommand: "setDictionary", dParam: { sDictionary: "personal", oDict: oData["oPersonalDictionary"] }, dInfo: {} });
            browser.storage.local.remove("oPersonalDictionary");
        }



        if (oData.hasOwnProperty("community_dictionary")) {
            oWorkerHandler.xGCEWorker.postMessage({ sCommand: "setDictionary", dParam: { sDictionary: "community", oDict: oData["community_dictionary"] }, dInfo: {} });
        }
        if (oData.hasOwnProperty("personal_dictionary")) {
            oWorkerHandler.xGCEWorker.postMessage({ sCommand: "setDictionary", dParam: { sDictionary: "personal", oDict: oData["personal_dictionary"] }, dInfo: {} });
        }
    },







>
>
>







183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
        if (oData.hasOwnProperty("oPersonalDictionary")) {
            // deprecated (to be removed in 2020)
            console.log("personal dictionary migration");
            browser.storage.local.set({ "personal_dictionary": oData["oPersonalDictionary"] });
            oWorkerHandler.xGCEWorker.postMessage({ sCommand: "setDictionary", dParam: { sDictionary: "personal", oDict: oData["oPersonalDictionary"] }, dInfo: {} });
            browser.storage.local.remove("oPersonalDictionary");
        }
        if (oData.hasOwnProperty("main_dic_name")) {
            oWorkerHandler.xGCEWorker.postMessage({ sCommand: "setDictionary", dParam: { sDictionary: "main", oDict: oData["main_dic_name"] }, dInfo: {sExtPath: browser.extension.getURL("")} });
        }
        if (oData.hasOwnProperty("community_dictionary")) {
            oWorkerHandler.xGCEWorker.postMessage({ sCommand: "setDictionary", dParam: { sDictionary: "community", oDict: oData["community_dictionary"] }, dInfo: {} });
        }
        if (oData.hasOwnProperty("personal_dictionary")) {
            oWorkerHandler.xGCEWorker.postMessage({ sCommand: "setDictionary", dParam: { sDictionary: "personal", oDict: oData["personal_dictionary"] }, dInfo: {} });
        }
    },