diff options
author | metamuffin <metamuffin@disroot.org> | 2023-08-01 18:40:35 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-08-01 18:40:35 +0200 |
commit | ad2b4207d48fe19e501e0fac2c1139ce7ef4dea1 (patch) | |
tree | 0ce3271c6ca517fa81bdf6373c4515eeb5a53387 /frontend/search.ts | |
parent | 7b1cb4e58347758cab25b73dc6486f5f90efa6df (diff) | |
download | fastbangs-ad2b4207d48fe19e501e0fac2c1139ce7ef4dea1.tar fastbangs-ad2b4207d48fe19e501e0fac2c1139ce7ef4dea1.tar.bz2 fastbangs-ad2b4207d48fe19e501e0fac2c1139ce7ef4dea1.tar.zst |
submit ui
Diffstat (limited to 'frontend/search.ts')
-rw-r--r-- | frontend/search.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/search.ts b/frontend/search.ts index 0c808db..374cccf 100644 --- a/frontend/search.ts +++ b/frontend/search.ts @@ -1,5 +1,6 @@ import { e } from "./helper.ts"; import { bangs, process_query } from "./query.ts"; +import { status } from "./ui.ts" export function section_info_search() { return e("section", { class: "info" }, @@ -11,6 +12,13 @@ export function section_info_search() { export function section_search(engine: string) { link_engine(engine) + bangs.then(bangs => { + if (!bangs[engine.toLowerCase()]) { + status("error", "Engine does not exist") + window.location.hash = "#" + } + }) + const heading = document.createElement("h1") heading.textContent = engine bangs.then(bangs => heading.textContent = bangs[engine]?.name ?? engine) |