ajout modification jaquette

This commit is contained in:
LAINEY Grégory committed 2026-09-29 13:17:15 +02:00
1 parent 3235bc50c7
commit 36efa036a5
6 files changed
+309 -14

No files matched your search

+58
View File
@@ -5,12 +5,69 @@ document.addEventListener("DOMContentLoaded", () =>
const zoneResultats = document.getElementById("resultatsApi");
const formAppliquer = document.getElementById("formAppliquerApi");
const champRawgId = document.getElementById("rawgId");
const formJeu = document.getElementById("formJeu");
if (!boutonRecherche || !champRecherche || !zoneResultats)
{
return;
}
const collecterChampsFormulaire = () =>
{
if (!formJeu || !formAppliquer)
{
return;
}
formAppliquer.querySelectorAll("[data-from-form]").forEach((element) =>
{
element.remove();
});
const noms = [
"titre",
"description",
"dateSortie",
"genres",
"editeur",
"developpeur",
"jaquette",
"consoleId",
"etat",
"notes",
"sourceEnrichissement"
];
noms.forEach((nom) =>
{
const champ = formJeu.elements.namedItem(nom);
if (!champ || typeof champ.value !== "string")
{
return;
}
const cache = document.createElement("input");
cache.type = "hidden";
cache.name = nom;
cache.value = champ.value;
cache.setAttribute("data-from-form", "1");
formAppliquer.appendChild(cache);
});
const formats = formJeu.querySelectorAll('input[name="formats[]"]:checked');
formats.forEach((caseCochee) =>
{
const cache = document.createElement("input");
cache.type = "hidden";
cache.name = "formats[]";
cache.value = caseCochee.value;
cache.setAttribute("data-from-form", "1");
formAppliquer.appendChild(cache);
});
};
const lancerRecherche = async () =>
{
const terme = champRecherche.value.trim();
@@ -84,6 +141,7 @@ document.addEventListener("DOMContentLoaded", () =>
return;
}
collecterChampsFormulaire();
champRawgId.value = String(jeu.rawgId);
formAppliquer.submit();
});
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.