新增搜尋框,放兩個開源連結
This commit is contained in:
1 parent
61e8580c72
commit
695e29324e
11 files changed
+82
-11
No files matched your search
+12
@@ -1209,6 +1209,17 @@ function setPreview(on) {
|
||||
$("preview-toggle").textContent = on ? t("profile.edit_back") : t("profile.preview");
|
||||
}
|
||||
|
||||
// ---------- UID 搜尋 ----------
|
||||
|
||||
function bindSearch() {
|
||||
$("uid-search").addEventListener("submit", (ev) => {
|
||||
ev.preventDefault();
|
||||
const n = $("uid-input").value.trim();
|
||||
if (!/^\d{1,8}$/.test(n)) return toast(t("search.invalid"));
|
||||
location.href = `/u/${n.padStart(8, "0")}`;
|
||||
});
|
||||
}
|
||||
|
||||
// ---------- 手機選單 ----------
|
||||
|
||||
function openMenu() { $("sidebar").classList.add("open"); }
|
||||
@@ -1245,6 +1256,7 @@ async function init() {
|
||||
bindUpload();
|
||||
bindReview();
|
||||
bindNotices();
|
||||
bindSearch();
|
||||
|
||||
$("menu-toggle").addEventListener("click", () => $("sidebar").classList.toggle("open"));
|
||||
|
||||
|
||||
Reference in new issue
Block a user