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 ================================================================== --- gc_lang/fr/webext/panel/dictionaries.css +++ 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 ================================================================== --- gc_lang/fr/webext/panel/dictionaries.html +++ gc_lang/fr/webext/panel/dictionaries.html @@ -0,0 +1,45 @@ + + + + + Grammalecte · Dictionnaires communautaires + + + + + +
+ +

Dictionnaires communautaires

+ +
+

Votre lexique

+
+
+ Enregistrer +
+

Nombre d’entrées : 0.

+
+ + + +
+
+ + +
+ + + + + + + + + + + + + + + ADDED gc_lang/fr/webext/panel/dictionaries.js Index: gc_lang/fr/webext/panel/dictionaries.js ================================================================== --- gc_lang/fr/webext/panel/dictionaries.js +++ gc_lang/fr/webext/panel/dictionaries.js @@ -0,0 +1,4 @@ +// JavaScript + +"use strict"; + Index: gc_lang/fr/webext/panel/main.css ================================================================== --- gc_lang/fr/webext/panel/main.css +++ gc_lang/fr/webext/panel/main.css @@ -284,12 +284,17 @@ #sc_options_page h2 { margin-top: 20px; font: normal 22px 'Yanone Kaffeesatz', "Oswald", "Liberation Sans Narrow", sans-serif; color: hsl(210, 50%, 50%); } +.button_row { + display: flex; + flex-direction: row-reverse; + padding: 5px 0 0 0; +} .dic_button { - float: right; + margin-left: 10px; padding: 2px 10px; background-color: hsl(210, 50%, 50%); color: hsl(210, 10%, 96%); cursor: pointer; font-size: 14px; Index: gc_lang/fr/webext/panel/main.html ================================================================== --- gc_lang/fr/webext/panel/main.html +++ gc_lang/fr/webext/panel/main.html @@ -112,17 +112,22 @@

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.

-
Éditer

Ce dictionnaire est créé et édité via l’éditeur lexical et est sauvegardé sur un serveur en ligne accessible à tous les membres.

+
+
Dictionnaires en ligne
+
Éditer
+

-
Éditer

Ce dictionnaire est créé et édité via l’éditeur lexical et n’est pas partagé.

+
+
Éditer
+