This commit is contained in:
728
2023-10-15 01:18:19 +08:00
parent a99b4ba334
commit 06816b838b
3 changed files with 32 additions and 4 deletions

View File

@ -9,6 +9,6 @@ export function usr(
_id, utc: Date.now(), nam: "用户名", adm1: "四川", adm2: "成都",
msg: "用户介绍\n联系方式\n\n测试"
}
t.append(id(u), id(u))
t.append(id(u))
return t
}

View File

@ -1,4 +1,3 @@
import { usr } from "./article.ts"
import { main } from "./template.ts"
import { load } from "./nav.ts"
main.append(usr(1), usr(2), usr(728))
load()

29
ismism.ts/ui/bind/nav.ts Normal file
View File

@ -0,0 +1,29 @@
// deno-lint-ignore-file no-window-prefix
import { usr } from "./article.ts"
import { main } from "./template.ts"
export const nav: {
hash: string,
} = {
hash: "",
}
window.addEventListener("hashchange", () => {
main.innerHTML = ""
const h = nav.hash = decodeURI(location.hash).substring(1)
if (h == "") main.append(usr(728))
else if (/^\d+$/.test(h)) main.append(usr(parseInt(h)))
else if (h == "soc") main.append(usr(0))
else if (/^s\d+$/.test(h)) main.append(usr(parseInt(h.substring(1))))
else if (h == "agd") main.append(usr(1))
else if (/^a\d+$/.test(h)) main.append(usr(parseInt(h.substring(1))))
else alert(`无效 id ${h}`)
})
export function load(
) {
console.log("ismism-20231015")
console.log(`\n主义主义开发组成员招募中\n\n发送自我介绍至 万大可\n \n`)
window.dispatchEvent(new Event("hashchange"))
}