diff options
| author | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-01 21:41:29 +0200 |
|---|---|---|
| committer | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-01 21:41:29 +0200 |
| commit | 8e750f282a5eb05a7ff68670f9177d24ff9f584f (patch) | |
| tree | a0b6899735e4d3a37145c67f1c7d5c27070f49cd /views/mods/mod_revocation/wp_footer.phtml | |
| parent | ebd9a2944c1a1c1f3cb73c0ff7ea293f93b9b36a (diff) | |
Widerruf: Fehlermeldungen als Text mit Ansage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'views/mods/mod_revocation/wp_footer.phtml')
| -rw-r--r-- | views/mods/mod_revocation/wp_footer.phtml | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/views/mods/mod_revocation/wp_footer.phtml b/views/mods/mod_revocation/wp_footer.phtml index bec1b82..891c959 100644 --- a/views/mods/mod_revocation/wp_footer.phtml +++ b/views/mods/mod_revocation/wp_footer.phtml @@ -85,6 +85,19 @@ }); + // Meldungen des Servers als Text, Screenreader sagen sie an + const error_list = (arError) => { + + const list = document.createElement('ul'); + list.id = 'wpsg_error'; + list.className = 'wpsg_error'; + list.setAttribute('role', 'alert'); + (arError??[]).forEach(error => { const li = document.createElement('li'); li.textContent = error; list.appendChild(li); }); + + return list; + + }; + const show_error = () => { const target = el_dialog_content.querySelector('#msg_target') || el_dialog_content; @@ -151,15 +164,9 @@ }) } ]).then(res => { if (!res.ok) throw new Error(res.status); return res.json(); }).then(res => { - let html = ''; - if ((res.success??false) === false) { - html += '<ul id="wpsg_error" class="wpsg_error">'; - (res.arError??[]).forEach(error => { html += `<li>${error}</li>`; }); - html += '</ul>'; - - el_dialog_content.querySelector('#msg_target').innerHTML = html; + el_dialog_content.querySelector('#msg_target').replaceChildren(error_list(res.arError)); el_dialog.classList.remove('loading'); |
