Index: gc_lang/fr/webext/background.js ================================================================== --- gc_lang/fr/webext/background.js +++ gc_lang/fr/webext/background.js @@ -222,10 +222,12 @@ openConjugueurTab(); break; case "openLexiconEditor": openLexiconEditor(dParam["dictionary"]); break; + case "openDictionaries": + openDictionaries(); default: console.log("[background] Unknown command: " + sCommand); console.log(oRequest); } //sendResponse({response: "response from background script"}); @@ -363,17 +365,21 @@ } }); /* - Lexicon editor tab + Tabs */ let nTabLexiconEditor = null; +let nTabDictionaries = null; browser.tabs.onRemoved.addListener(function (nTabId, xRemoveInfo) { if (nTabId === nTabLexiconEditor) { nTabLexiconEditor = null; + } + else if (nTabId === nTabDictionaries) { + nTabDictionaries = null; } }); /* @@ -409,10 +415,30 @@ function onLexiconEditorOpened (xTab) { //console.log(xTab); nTabLexiconEditor = xTab.id; } + +function openDictionaries () { + if (nTabDictionaries === null) { + if (bChrome) { + browser.tabs.create({ + url: browser.extension.getURL("panel/dictionaries.html") + }, onDictionariesOpened); + return; + } + let xLexEditor = browser.tabs.create({ + url: browser.extension.getURL("panel/dictionaries.html") + }); + xLexEditor.then(onDictionariesOpened, onError); + } +} + +function onDictionariesOpened (xTab) { + //console.log(xTab); + nTabDictionaries = xTab.id; +} function openConjugueurTab () { if (bChrome) { browser.tabs.create({ url: browser.extension.getURL("panel/conjugueur.html") ADDED gc_lang/fr/webext/panel/dictionaries.css Index: gc_lang/fr/webext/panel/dictionaries.css ================================================================== --- /dev/null +++ gc_lang/fr/webext/panel/dictionaries.css @@ -0,0 +1,3 @@ +/* + CSS +*/ ADDED gc_lang/fr/webext/panel/dictionaries.html Index: gc_lang/fr/webext/panel/dictionaries.html ================================================================== --- /dev/null +++ gc_lang/fr/webext/panel/dictionaries.html @@ -0,0 +1,45 @@ + + +
+ +Nombre d’entrées : 0.
+
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.
-
Ce dictionnaire est créé et édité via l’éditeur lexical et est sauvegardé sur un serveur en ligne accessible à tous les membres.
+-
Ce dictionnaire est créé et édité via l’éditeur lexical et n’est pas partagé.
+