初次提交项目

This commit is contained in:
2026-03-08 00:52:03 +08:00
parent 8241dbc861
commit fc38b1eb3d
9 changed files with 608 additions and 0 deletions

20
static/js/scanner.js Normal file
View File

@@ -0,0 +1,20 @@
(function () {
const input = document.getElementById("scan-input");
const form = document.getElementById("scan-search-form");
if (!input || !form) {
return;
}
// Keep focus for barcode scanners that type and send Enter immediately.
window.addEventListener("load", function () {
input.focus();
});
document.addEventListener("keydown", function (event) {
if (event.key === "Escape") {
input.value = "";
input.focus();
}
});
})();