feat: section Profil (langue) + ghost text lie a la langue
CI / lint (push) Failing after 10s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Failing after -4s

- Section Profil dans Configuration: langue (fr/en/es/de), nom
- Persistance localStorage (obsigate-lang, obsigate-name)
- Ghost text adapte le prompt a la langue du profil
- CSS profile-form, config-select stylise
This commit is contained in:
2026-06-16 12:14:05 -04:00
parent 2d03586ae0
commit 0a0cecf178
4 changed files with 86 additions and 4 deletions
+29
View File
@@ -644,6 +644,9 @@ function initConfigModal() {
// Init theme picker
initThemePicker();
// Init profile
initProfile();
}
function closeConfigModal() {
@@ -1387,6 +1390,7 @@ export {
loadHiddenFilesSettings as initHiddenFilesConfig,
initThemePicker,
initAboutModal,
initProfile,
switchSidebarTab,
};
@@ -1508,3 +1512,28 @@ function initAboutModal() {
if (jokeEl) jokeEl.textContent = '« ' + jokes[Math.floor(Math.random() * jokes.length)] + ' »';
}
}
// ── Profile ──────────────────────────────────────────────────────────
function initProfile() {
var langSel = document.getElementById('profile-lang');
var nameInp = document.getElementById('profile-name');
var saveBtn = document.getElementById('profile-save');
var savedEl = document.getElementById('profile-saved');
if (!langSel || !saveBtn) return;
// Load saved profile
try {
var lang = localStorage.getItem('obsigate-lang') || 'fr';
var name = localStorage.getItem('obsigate-name') || '';
if (langSel) langSel.value = lang;
if (nameInp) nameInp.value = name;
} catch(e) {}
saveBtn.addEventListener('click', function() {
try {
localStorage.setItem('obsigate-lang', langSel.value);
if (nameInp) localStorage.setItem('obsigate-name', nameInp.value.trim());
if (savedEl) { savedEl.style.display = 'inline'; setTimeout(function() { savedEl.style.display = 'none'; }, 2000); }
} catch(e) {}
});
}