diff options
author | Lia Lenckowski <lialenck@protonmail.com> | 2023-08-08 15:16:51 +0200 |
---|---|---|
committer | Lia Lenckowski <lialenck@protonmail.com> | 2023-08-08 15:16:51 +0200 |
commit | a6a8ad317d42ad29f0902f9ae1f820d92f9bf737 (patch) | |
tree | b6064712824d7fd6576d83228005db1a27d76300 /frontend/search.ts | |
parent | 48370ac6ea08c09327e4ce457474df721fe5b3fd (diff) | |
download | fastbangs-a6a8ad317d42ad29f0902f9ae1f820d92f9bf737.tar fastbangs-a6a8ad317d42ad29f0902f9ae1f820d92f9bf737.tar.bz2 fastbangs-a6a8ad317d42ad29f0902f9ae1f820d92f9bf737.tar.zst |
small html/css fixes/simplifications
Diffstat (limited to 'frontend/search.ts')
-rw-r--r-- | frontend/search.ts | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/frontend/search.ts b/frontend/search.ts index 374cccf..1d28f58 100644 --- a/frontend/search.ts +++ b/frontend/search.ts @@ -19,18 +19,15 @@ export function section_search(engine: string) { } }) - const heading = document.createElement("h1") - heading.textContent = engine + const heading = e("h1", {}, engine) bangs.then(bangs => heading.textContent = bangs[engine]?.name ?? engine) - const input = document.createElement("input") - input.type = "input" + const input = e("input", {type: "text"}) input.addEventListener("keydown", ev => { if (ev.code == "Enter") process_query(engine, input.value ?? "") }) - const submit = document.createElement("button") - submit.textContent = "Search" + const submit = e("button", {}, "Search") submit.addEventListener("click", () => { process_query(engine, input.value ?? "") }) @@ -49,11 +46,11 @@ function link_engine(engine: string) { // <link /> is already present, we need reload because browser wont notice otherwise window.location.reload() } - const link = document.createElement("link") - link.rel = "search" - link.id = "search-link" - link.type = "application/opensearchdescription+xml" - link.href = `/search.xml?default=${encodeURIComponent(engine)}` - link.title = `Fastbangs (default engine: ${engine})` + const link = e("link", { + rel: "search", + id: "search-link", + type: "application/opensearchdescription+xml", + href: `/search.xml?default=${encodeURIComponent(engine)}`, + title: `Fastbangs (default engine: ${engine})`}) document.head.append(link) -}
\ No newline at end of file +} |