79fff10b48
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
40 lines
1.5 KiB
HTML
40 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>⚡ Récupération Directe</title>
|
|
</head>
|
|
<body>
|
|
<h3>Catégories récupérées depuis la mémoire :</h3>
|
|
<select id="dynamic-select" style="width:100%; padding:10px;"></select>
|
|
|
|
<script>
|
|
// On crée une balise script qui pointe vers le fichier source d'EverShelf
|
|
const script = document.createElement('script');
|
|
script.src = '/assets/js/app.js';
|
|
|
|
script.onload = () => {
|
|
// Une fois le script chargé, la variable CATEGORY_LABELS est maintenant disponible dans la mémoire de cette page
|
|
const cats = window.CATEGORY_LABELS;
|
|
|
|
if (cats) {
|
|
const select = document.getElementById('dynamic-select');
|
|
|
|
// On itère sur les clés de l'objet
|
|
Object.keys(cats).forEach(key => {
|
|
const opt = document.createElement('option');
|
|
opt.value = key;
|
|
// On affiche le texte brut (en ignorant le résultat de la fonction t())
|
|
opt.textContent = key;
|
|
select.appendChild(opt);
|
|
});
|
|
console.log("Données récupérées :", cats);
|
|
} else {
|
|
console.error("Variable CATEGORY_LABELS non trouvée après chargement.");
|
|
}
|
|
};
|
|
|
|
document.head.appendChild(script);
|
|
</script>
|
|
</body>
|
|
</html> |