From ad2b4207d48fe19e501e0fac2c1139ce7ef4dea1 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 1 Aug 2023 18:40:35 +0200 Subject: submit ui --- frontend/search.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'frontend/search.ts') 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) -- cgit v1.2.3-70-g09d2