Auto-Commit: 2026-10-28 21:52:10

This commit is contained in:
Jannik committed 2026-10-28 21:52:10 +01:00
1 parent 2e288c7473
commit 4e2ec629de
1 file changed
+21 -4
+21 -4
View File
@@ -1608,12 +1608,29 @@ function openCharEditModal(char, onSave) {
reader.readAsDataURL(file);
});
// Avatar URL
// Avatar URL (inline form, no browser prompt)
$('#m-url-avatar-btn')?.addEventListener('click', () => {
const u = prompt(state.lang === 'de' ? 'Bild-URL eingeben:' : 'Enter image URL:', currentAvatarKey?.startsWith('http') ? currentAvatarKey : '');
if (u && u.trim()) {
currentAvatarKey = u.trim();
const form = $('#m-url-avatar-form');
if (!form) return;
const showing = form.style.display !== 'none';
form.style.display = showing ? 'none' : 'block';
if (!showing) {
const inp = $('#m-url-avatar-input');
if (inp) {
inp.value = currentAvatarKey?.startsWith('http') ? currentAvatarKey : '';
inp.focus();
}
}
});
$('#m-url-avatar-cancel')?.addEventListener('click', () => {
$('#m-url-avatar-form').style.display = 'none';
});
$('#m-url-avatar-apply')?.addEventListener('click', () => {
const u = $('#m-url-avatar-input')?.value.trim();
if (u) {
currentAvatarKey = u;
updateAvatarPreview();
$('#m-url-avatar-form').style.display = 'none';
toast(t('avatar_updated'));
}
});