Allow set up of search form via query params in web interface

- Default search type to org, instead of images
This commit is contained in:
Debanjum Singh Solanky 2022-07-29 23:13:26 +04:00
parent 02ca2c05a1
commit 3079614981

View file

@ -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?";
}
</script>
@ -97,13 +102,13 @@
<!--Add Dropdown to Select Query Type.
Query Types can be: org, ledger, image, music, markdown.
Set Default type to image-->
Set Default type to org-->
<select id="type">
<option value="image">Image</option>
<option value="org">Org</option>
<option value="markdown">Markdown</option>
<option value="ledger">Ledger</option>
<option value="music">Music</option>
<option value="image">Image</option>
<option value="markdown">Markdown</option>
</select>
<!--Add Button To Regenerate -->