From 3079614981a9ddbc4907f860b7d3a35155ce0aee Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 29 Jul 2022 23:13:26 +0400 Subject: [PATCH] Allow set up of search form via query params in web interface - Default search type to org, instead of images --- src/interface/web/index.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/interface/web/index.html b/src/interface/web/index.html index d6cce98c..362aa5d0 100644 --- a/src/interface/web/index.html +++ b/src/interface/web/index.html @@ -86,6 +86,11 @@ else if (type !== "image") { search(rerank=false); } + + // Fill search form with values passed in URL query parameters, if any. + window.onload = function () { + document.getElementById("type").value = new URLSearchParams(window.location.search).get("t") || "org"; + document.getElementById("query").value = new URLSearchParams(window.location.search).get("q") || "What is the meaning of life?"; } @@ -97,13 +102,13 @@ + Set Default type to org-->