reduce a.php and c.php

change structure
This commit is contained in:
2025-01-26 13:47:33 +01:00
parent 68c5fa5b86
commit 61269d6ce3
15 changed files with 1317 additions and 348 deletions

View File

@@ -0,0 +1,41 @@
const toggleTheme = document.getElementById('toggle-theme');
const body = document.body;
toggleTheme.addEventListener('change', () => {
if (toggleTheme.checked) {
body.classList.remove('light-theme');
body.classList.add('dark-theme');
} else {
body.classList.remove('dark-theme');
body.classList.add('light-theme');
}
document.cookie = "theme=" + (toggleTheme.checked ? "dark-theme" : "light-theme") + "; path=/; max-age=" + (60 * 60 * 24 * 30);
});
function forwardQuerry (form, query) {
try {
var urlBase = new URL (form ["url"].value);
// XXX test host non vide
url = urlBase+query;
var link = document.createElement ('a');
link.href = url;
document.body.appendChild (link);
link.click ();
} catch (_) {
alert ("url incorrecte");
return false;
}
}
function actionUrl (button, check, name, value) {
if (check && ! confirm("Êtes-vous sûr de vouloir supprimer ?"))
return;
form = button.parentElement;
input = document.createElement ('input');
input.setAttribute ('name', name);
input.setAttribute ('value', value);
input.setAttribute ('type', 'hidden');
form.appendChild(input);
form.submit ();
}