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
acee2828
Commit
acee2828
authored
5 months ago
by
Lucie Bader
Browse files
Options
Downloads
Patches
Plain Diff
Suppression user_id
parent
79b60efa
No related branches found
Branches containing commit
No related tags found
2 merge requests
!8
Test final
,
!6
Améliorations du menu de l'extension
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/background/background.js
+1
-3
1 addition, 3 deletions
src/background/background.js
src/utils/api.js
+2
-6
2 additions, 6 deletions
src/utils/api.js
src/utils/definitions.js
+1
-2
1 addition, 2 deletions
src/utils/definitions.js
with
4 additions
and
11 deletions
src/background/background.js
+
1
−
3
View file @
acee2828
...
...
@@ -119,7 +119,7 @@ browser.runtime.onMessage.addListener(async (message, sender, sendResponse) => {
worker
.
postMessage
({
command
:
"
pyodide-simplemma
"
});
}
return
true
;
// Permet une réponse asynchrone si nécessaire
return
true
;
});
// ─────────────────────────────────────────────────────────────────────────────
...
...
@@ -151,7 +151,6 @@ browser.runtime.onConnect.addListener((port) => {
if
(
isConnected
)
{
await
disconnectFromLexicalDB
();
}
else
{
// Ouvre directement la page de connexion
actuallyOpenLoginPage
();
}
}
...
...
@@ -159,7 +158,6 @@ browser.runtime.onConnect.addListener((port) => {
}
});
// Ouvre directement la page de connexion
async
function
actuallyOpenLoginPage
()
{
log
(
"
🔗 Ouverture de la page de connexion.
"
);
...
...
This diff is collapsed.
Click to expand it.
src/utils/api.js
+
2
−
6
View file @
acee2828
...
...
@@ -48,7 +48,6 @@ async function callApi(url, authToken = null, method = 'GET', data = null) {
}
}
// ─────────────────────────────────────────────────────────────────────────────
// ▌ Récupération des lexiques de l'utilisateur
// ─────────────────────────────────────────────────────────────────────────────
...
...
@@ -62,9 +61,8 @@ async function callApi(url, authToken = null, method = 'GET', data = null) {
* @returns {Promise<any[]>} - Liste des lexiques trouvés.
*/
async
function
getLexicons
(
authToken
,
language
=
'
fr
'
)
{
const
userId
=
4
;
const
baseUrl
=
"
https://babalex.lezinter.net/api/lexicon/search
"
;
const
url
=
`
${
baseUrl
}
?
user_id=
${
userId
}
&language=
${
encodeURIComponent
(
language
)}
`
;
const
url
=
`
${
baseUrl
}
?&language=
${
encodeURIComponent
(
language
)}
`
;
return
callApi
(
url
,
authToken
);
}
...
...
@@ -75,12 +73,11 @@ async function getLexicons(authToken, language = 'fr') {
async
function
getAllCategoriesLexicons
(
authToken
)
{
const
categories
=
[
"
User
"
,
"
Group
"
,
"
Zero
"
,
"
New words
"
];
const
userId
=
4
;
const
groupId
=
1
;
const
promises
=
categories
.
map
(
async
(
category
)
=>
{
const
baseUrl
=
"
https://babalex.lezinter.net/api/lexicon/search
"
;
const
url
=
`
${
baseUrl
}
?
user_id=
${
userId
}
&group_id=
${
groupId
}
&category=
${
encodeURIComponent
(
category
)}
&language=fr`
;
const
url
=
`
${
baseUrl
}
?&group_id=
${
groupId
}
&category=
${
encodeURIComponent
(
category
)}
&language=fr`
;
try
{
return
await
callApi
(
url
,
authToken
);
...
...
@@ -119,7 +116,6 @@ async function getLexiconEntries(authToken, lexiconId) {
*/
async
function
getAllLexiconWords
(
authToken
)
{
const
searchUrl
=
"
https://babalex.lezinter.net/api/lexicon/search
"
+
"
?user_id=4
"
+
"
&language=fr
"
;
try
{
...
...
This diff is collapsed.
Click to expand it.
src/utils/definitions.js
+
1
−
2
View file @
acee2828
...
...
@@ -24,8 +24,7 @@ async function fetchLexiconDefinitions(word) {
}
// 1) Récupérer la liste complète des lexiques de l'utilisateur
const
userId
=
4
;
const
lexUrl
=
`https://babalex.lezinter.net/api/lexicon/search?user_id=
${
userId
}
&language=fr`
;
const
lexUrl
=
`https://babalex.lezinter.net/api/lexicon/search?&language=fr`
;
const
lexResponse
=
await
fetch
(
lexUrl
,
{
headers
:
{
Authorization
:
`Bearer
${
authToken
}
`
}
});
...
...
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