Environ 83 000 entrées, 500 000 flexions.
Ni éditable, ni désactivable.
Ce dictionnaire est créé à partir du dictionnaire orthographique pour Firefox et LibreOffice, conçu sur le site de Grammalecte.
Orthographe
++
ClassiqueIndex: gc_lang/fr/webext/background.js ================================================================== --- gc_lang/fr/webext/background.js +++ gc_lang/fr/webext/background.js @@ -131,17 +131,19 @@ }, 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); }, @@ -183,10 +185,13 @@ 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: {} }); Index: gc_lang/fr/webext/gce_worker.js ================================================================== --- gc_lang/fr/webext/gce_worker.js +++ gc_lang/fr/webext/gce_worker.js @@ -353,11 +353,11 @@ return; } //console.log("setDictionary", sDictionary); switch (sDictionary) { case "main": - oSpellChecker.setMainDictionary(oDict); + oSpellChecker.setMainDictionary(oDict, dInfo["sExtPath"]+"/grammalecte/graphspell/_dictionaries"); break; case "community": oSpellChecker.setCommunityDictionary(oDict); break; case "personal": Index: gc_lang/fr/webext/panel/main.css ================================================================== --- gc_lang/fr/webext/panel/main.css +++ gc_lang/fr/webext/panel/main.css @@ -245,11 +245,10 @@ font-size: 16px; text-align: center; cursor: pointer; } - .option_section { padding: 10px; margin-top: 10px; border-radius: 5px; background-color: hsl(210, 20%, 96%); @@ -263,10 +262,39 @@ .option_description { padding: 0 0 0 20px; color: hsl(0, 0%, 0%); font-size: 12px; } + + +#spelling_section { + padding: 5px 0 0 20px; +} +#spelling_section .subheader { + font-size: 14px; + font-weight: bold; + color: hsl(210, 20%, 50%); +} +#spelling_section .radiolike { + display: inline-block; + padding: 3px 5px; + font-size: 11px; + color: hsl(210, 10%, 96%); + background-color: hsl(210, 10%, 80%); + border-radius: 3px; + cursor: pointer; +} +#spelling_section .radiolike:hover { + color: hsl(210, 10%, 100%); + background-color: hsl(210, 10%, 50%); + box-shadow: 0 0 3px 3px hsl(210, 30%, 85%); +} +#spelling_section .selected { + color: hsl(210, 10%, 100%); + background-color: hsl(210, 50%, 50%); +} + /* Spell checking options */ Index: gc_lang/fr/webext/panel/main.html ================================================================== --- gc_lang/fr/webext/panel/main.html +++ gc_lang/fr/webext/panel/main.html @@ -110,10 +110,18 @@
Environ 83 000 entrées, 500 000 flexions.
Ni éditable, ni désactivable.
Ce dictionnaire est créé à partir du dictionnaire orthographique pour Firefox et LibreOffice, conçu sur le site de Grammalecte.
Orthographe
++
Classique
Ce dictionnaire est composé à partir de dictionnaires communautaires disponibles en ligne aux membres.
Non disponible. Fonctionnalité à venir.
Index: gc_lang/fr/webext/panel/main.js ================================================================== --- gc_lang/fr/webext/panel/main.js +++ gc_lang/fr/webext/panel/main.js @@ -22,10 +22,11 @@ window.addEventListener( "click", function (xEvent) { let xElem = xEvent.target; if (xElem.id) { + // tests if (xElem.id === "text_to_test_button") { browser.runtime.sendMessage({ sCommand: "textToTest", dParam: {sText: document.getElementById("text_to_test").value, sCountry: "FR", bDebug: true, bContext: false}, dInfo: {} @@ -37,10 +38,18 @@ sCommand: "fullTests", dParam: {}, dInfo: {} }); } + else if (xElem.id == "restart_worker") { + browser.runtime.sendMessage({ + sCommand: "restartWorker", + dParam: { "nDelayLimit": 3 }, + dInfo: {} + }); + } + // grammar options else if (xElem.id === "default_options_button") { browser.runtime.sendMessage({ sCommand: "resetOptions", dParam: {}, dInfo: {} @@ -53,10 +62,11 @@ dParam: {sOptName: xElem.dataset.option, bValue: xElem.checked}, dInfo: {} }); } } + // dictionaries options else if (xElem.id.endsWith("_dic")) { if (xElem.dataset.dictionary) { storeSCOptions(); browser.runtime.sendMessage({ sCommand: "setDictionaryOnOff", @@ -63,13 +73,25 @@ dParam: {sDictionary: xElem.dataset.dictionary, bActivate: xElem.checked}, dInfo: {} }); } } + else if (xElem.id.startsWith("spelling_")) { + updateSpellingChoiceUI(xElem.id); + let sMainDicName = document.getElementById(xElem.id).dataset.dicname; + browser.storage.local.set({"main_dic_name": sMainDicName}); + browser.runtime.sendMessage({ + sCommand: "setDictionary", + dParam: { sDictionary: "main", oDict: sMainDicName }, + dInfo: { sExtPath: browser.extension.getURL("") } + }); + } + // UI options else if (xElem.id.startsWith("ui_option_")) { storeUIOptions(); } + // else if (xElem.id.startsWith("link_")) { browser.tabs.create({url: xElem.dataset.url}); } else if (xElem.id == "conj_button") { browser.runtime.sendMessage({ @@ -97,17 +119,11 @@ sCommand: "openLexiconEditor", dParam: { "dictionary": "__personal__"}, dInfo: {} }); } - else if (xElem.id == "restart_worker") { - browser.runtime.sendMessage({ - sCommand: "restartWorker", - dParam: { "nDelayLimit": 3 }, - dInfo: {} - }); - } + // change UI page } else if (xElem.className.startsWith("select")) { showPage(xElem.dataset.page); }/* else if (xElem.tagName === "A") { openURL(xElem.getAttribute("href")); }*/ @@ -228,34 +244,46 @@ SC Options */ function displaySCOptionsLoadedFromStorage () { if (bChrome) { browser.storage.local.get("sc_options", displaySCOptions); + browser.storage.local.get("main_dic_name", displaySCOptions); return; } - let xPromise = browser.storage.local.get("sc_options"); - xPromise.then(displaySCOptions, showError); + browser.storage.local.get("sc_options").then(displaySCOptions, showError); + browser.storage.local.get("main_dic_name").then(displaySCOptions, showError); } function displaySCOptions (dOptions) { - if (!dOptions.hasOwnProperty("sc_options")) { - console.log("no sc options found"); - return; - } - dOptions = dOptions.sc_options; - //document.getElementById("extended_dic").checked = dOptions.extended; - document.getElementById("community_dic").checked = dOptions.community; - document.getElementById("personal_dic").checked = dOptions.personal; + if (dOptions.hasOwnProperty("sc_options")) { + document.getElementById("community_dic").checked = dOptions.sc_options.community; + document.getElementById("personal_dic").checked = dOptions.sc_options.personal; + } + if (dOptions.hasOwnProperty("main_dic_name")) { + switch (dOptions.main_dic_name) { + case "fr-classic.json": updateSpellingChoiceUI("spelling_classic"); break; + case "fr-reform.json": updateSpellingChoiceUI("spelling_reform"); break; + case "fr-allvars.json": updateSpellingChoiceUI("spelling_allvars"); break; + default: + console.log("Unknown dictionary name:", dOptions.main_dic_name); + } + } } function storeSCOptions () { browser.storage.local.set({"sc_options": { extended: false, community: document.getElementById("community_dic").checked, personal: document.getElementById("personal_dic").checked }}); } + +function updateSpellingChoiceUI (sSpellingChoice) { + document.getElementById("spelling_classic").className = (sSpellingChoice == "spelling_classic") ? "radiolike selected" : "radiolike"; + document.getElementById("spelling_reform").className = (sSpellingChoice == "spelling_reform") ? "radiolike selected" : "radiolike"; + document.getElementById("spelling_allvars").className = (sSpellingChoice == "spelling_allvars") ? "radiolike selected" : "radiolike"; +} /* GC options */ Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -96,31 +96,31 @@ class IBDAWG { // INDEXABLE BINARY DIRECT ACYCLIC WORD GRAPH - constructor (param1, sPath="") { - // param1 can be a filename or a object with all the necessary data. + constructor (source, sPath="") { + //