Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ff2balex
Manage
Activity
Members
Labels
Plan
Issues
9
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lex gaMe
ff2balex
Commits
43cbd2be
Commit
43cbd2be
authored
4 months ago
by
Lucie Bader
Browse files
Options
Downloads
Patches
Plain Diff
Tentative correction beug affichage lexiques en double
parent
01323777
No related branches found
No related tags found
1 merge request
!8
Test final
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/popup/popup.js
+4
-1
4 additions, 1 deletion
src/popup/popup.js
src/sidebar/sidebar.js
+16
-1
16 additions, 1 deletion
src/sidebar/sidebar.js
with
20 additions
and
2 deletions
src/popup/popup.js
+
4
−
1
View file @
43cbd2be
...
...
@@ -283,7 +283,10 @@ document.getElementById("toggleStatsBtn")?.addEventListener("click", async () =>
if
(
newState
)
{
browser
.
runtime
.
sendMessage
({
command
:
"
pyodide-simplemma
"
});
}
if
(
isUpdatingLexicons
)
return
;
isUpdatingLexicons
=
true
;
await
updateLexiconsDisplay
();
isUpdatingLexicons
=
false
;
await
updateExtension
();
});
...
...
This diff is collapsed.
Click to expand it.
src/sidebar/sidebar.js
+
16
−
1
View file @
43cbd2be
...
...
@@ -10,6 +10,7 @@ log(
// ─────────────────────────────────────────────────────────────────────────────
let
authToken
=
window
.
authToken
;
window
.
authToken
=
authToken
;
let
isUpdatingLexicons
=
false
;
// ─────────────────────────────────────────────────────────────────────────────
// ▌ Fonctions liées au token
...
...
@@ -259,6 +260,10 @@ async function displayLexiconsWithCheckbox(lexicons) {
}
for
(
const
{
lexiconName
,
lexiconId
,
active
}
of
lexicons
)
{
if
(
lexiquesContainer
.
querySelector
(
`div[data-lexicon-id="
${
lexiconId
}
"]`
))
{
continue
;
// Si oui, passez à l'itération suivante
}
const
lexiqueDiv
=
document
.
createElement
(
"
div
"
);
lexiqueDiv
.
className
=
"
lexique-item
"
;
...
...
@@ -326,7 +331,6 @@ async function displayLexiconsWithCheckbox(lexicons) {
lexiqueDiv
.
appendChild
(
labelSpan
);
lexiqueDiv
.
appendChild
(
checkboxContainer
);
lexiqueDiv
.
appendChild
(
highlightButton
);
lexiquesContainer
.
appendChild
(
lexiqueDiv
);
}
...
...
@@ -354,6 +358,17 @@ async function displayLexiconsWithCheckbox(lexicons) {
},
100
);
}
async
function
updateLexiconsDisplay
()
{
const
token
=
await
getAuthTokenFromStorage
();
// Récupérer le token d'authentification
if
(
!
token
)
{
console
.
warn
(
"
⚠️ Aucun token d'authentification disponible.
"
);
return
;
}
const
lexicons
=
await
getLexicons
(
token
);
// Récupérer les lexiques
await
displayLexiconsWithCheckbox
(
lexicons
);
// Mettre à jour l'affichage des lexiques
}
// Ajouter une fonction pour restaurer l'état des boutons au chargement
async
function
restoreHighlightingState
()
{
try
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment