diff options
-rw-r--r-- | frontend/main.ts | 2 | ||||
-rw-r--r-- | frontend/query.ts | 2 | ||||
-rw-r--r-- | frontend/ui.ts | 4 | ||||
-rw-r--r-- | makefile | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/frontend/main.ts b/frontend/main.ts index 85de64e..e14ccac 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -20,7 +20,7 @@ function process_url() { bangs.then(bangs => { console.log("bop"); - if (!bangs[engine]) { + if (!bangs[engine.toLowerCase()]) { status("error", "Engine does not exist") window.location.hash = "#" } diff --git a/frontend/query.ts b/frontend/query.ts index a608c57..7fa83e3 100644 --- a/frontend/query.ts +++ b/frontend/query.ts @@ -39,5 +39,5 @@ export async function process_query(default_engine: string, query: string) { } async function search_url(engine: string, query: string) { - return (await bangs)[engine]?.url.replace("{{{s}}}", encodeURIComponent(query).replaceAll("%20", "+")) + return (await bangs)[engine.toLowerCase()]?.url.replace("{{{s}}}", encodeURIComponent(query).replaceAll("%20", "+")) } diff --git a/frontend/ui.ts b/frontend/ui.ts index 22f9d71..8ce34a4 100644 --- a/frontend/ui.ts +++ b/frontend/ui.ts @@ -11,6 +11,7 @@ export function add_page_content(engine?: string) { } function section_search(engine: string) { + engine = engine.toLowerCase(); const section = document.createElement("section") section.classList.add("search") @@ -55,7 +56,8 @@ function section_engine_select() { section.classList.add("engine-select") const select = async (e: string) => { - if (!(await bangs)[e]) return status("error", `Engine ${JSON.stringify(e)} does not exist.`) + const engine = e.toLowerCase(); + if (!(await bangs)[engine]) return status("error", `Engine ${JSON.stringify(e)} does not exist.`) window.location.hash = `#${e}` } @@ -10,7 +10,7 @@ watch-style: clean: stack clean --full - rm -f deploy/{bundle.js,index.html,fastbangs} + rm -f deploy/{bundle.js,index.html,fastbangs,style.css} rm -f deploy.zip # This may fail if the server was run, due to bangs.json and banger.db. # This is intentional, as we don't want to delete some users' data |