Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 36ccee38cb | |||
| 9255c87f57 |
@@ -1067,6 +1067,24 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
function handleIsbnLookupFromScanner() {
|
||||
const isbnField = document.getElementById('isbn');
|
||||
if (!isbnField) return false;
|
||||
|
||||
const normalizedIsbn = typeof normalizeIsbnClient === 'function' ? normalizeIsbnClient(isbnField.value) : isbnField.value.trim();
|
||||
if (!normalizedIsbn) return false;
|
||||
|
||||
if (typeof updateIsbnLiveValidation === 'function') {
|
||||
updateIsbnLiveValidation();
|
||||
}
|
||||
|
||||
if (typeof fetchBookInfo === 'function') {
|
||||
fetchBookInfo('upload');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.querySelectorAll('form').forEach(function (form) {
|
||||
form.addEventListener('keydown', function (event) {
|
||||
@@ -1079,6 +1097,12 @@
|
||||
if (['button', 'submit', 'reset', 'file', 'checkbox', 'radio', 'hidden'].includes(type)) return;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if (target.id === 'isbn' || target.name === 'isbn') {
|
||||
handleIsbnLookupFromScanner();
|
||||
return;
|
||||
}
|
||||
|
||||
focusNextFormField(target);
|
||||
});
|
||||
});
|
||||
@@ -1445,10 +1469,32 @@
|
||||
scanModeSelect.addEventListener('change', toggleScanMode);
|
||||
}
|
||||
|
||||
// 4. ISBN Live-Validierung
|
||||
// 4. ISBN Live-Validierung und automatische Abfrage nach Scan/Enter
|
||||
const isbnInput = document.getElementById('isbn');
|
||||
if (isbnInput && typeof updateIsbnLiveValidation === 'function') {
|
||||
isbnInput.addEventListener('input', updateIsbnLiveValidation);
|
||||
if (isbnInput) {
|
||||
if (typeof updateIsbnLiveValidation === 'function') {
|
||||
isbnInput.addEventListener('input', updateIsbnLiveValidation);
|
||||
}
|
||||
|
||||
let isbnLookupTimer = null;
|
||||
isbnInput.addEventListener('input', function () {
|
||||
clearTimeout(isbnLookupTimer);
|
||||
const normalizedIsbn = typeof normalizeIsbnClient === 'function' ? normalizeIsbnClient(isbnInput.value) : isbnInput.value.trim();
|
||||
if (normalizedIsbn) {
|
||||
isbnLookupTimer = setTimeout(function () {
|
||||
handleIsbnLookupFromScanner();
|
||||
}, 250);
|
||||
}
|
||||
});
|
||||
|
||||
isbnInput.addEventListener('change', function () {
|
||||
if (typeof normalizeIsbnClient === 'function') {
|
||||
const normalizedIsbn = normalizeIsbnClient(isbnInput.value);
|
||||
if (normalizedIsbn) {
|
||||
handleIsbnLookupFromScanner();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// Load predefined filter values for dropdowns
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
<div class="user-management-container">
|
||||
<h2>Benutzer</h2>
|
||||
|
||||
<div class="mb-3">
|
||||
<a href="{{ url_for('register') }}" class="btn btn-success">
|
||||
Neuen Benutzer registrieren
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{ url_for('admin_anonymize_names') }}" class="mb-3">
|
||||
<button
|
||||
type="submit"
|
||||
|
||||
Reference in New Issue
Block a user