feat: add search and user data routes, services, and tests
This commit is contained in:
+18
-1
@@ -1 +1,18 @@
|
||||
/* app.js — 基础前端交互(HTMX 后续增强) */
|
||||
/* app.js — 基础前端交互 */
|
||||
|
||||
// Ctrl+K 或 / 聚焦搜索框
|
||||
document.addEventListener("keydown", function (e) {
|
||||
var input = document.querySelector(".nav-search-input");
|
||||
if (!input) return;
|
||||
|
||||
// 忽略在输入框内的按键
|
||||
if (e.target.tagName === "INPUT" || e.target.tagName === "TEXTAREA") return;
|
||||
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === "k") {
|
||||
e.preventDefault();
|
||||
input.focus();
|
||||
} else if (e.key === "/") {
|
||||
e.preventDefault();
|
||||
input.focus();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user