mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
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:
@@ -86,6 +86,11 @@
|
|||||||
else if (type !== "image") {
|
else if (type !== "image") {
|
||||||
search(rerank=false);
|
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>
|
</script>
|
||||||
|
|
||||||
@@ -97,13 +102,13 @@
|
|||||||
|
|
||||||
<!--Add Dropdown to Select Query Type.
|
<!--Add Dropdown to Select Query Type.
|
||||||
Query Types can be: org, ledger, image, music, markdown.
|
Query Types can be: org, ledger, image, music, markdown.
|
||||||
Set Default type to image-->
|
Set Default type to org-->
|
||||||
<select id="type">
|
<select id="type">
|
||||||
<option value="image">Image</option>
|
|
||||||
<option value="org">Org</option>
|
<option value="org">Org</option>
|
||||||
<option value="markdown">Markdown</option>
|
|
||||||
<option value="ledger">Ledger</option>
|
<option value="ledger">Ledger</option>
|
||||||
<option value="music">Music</option>
|
<option value="music">Music</option>
|
||||||
|
<option value="image">Image</option>
|
||||||
|
<option value="markdown">Markdown</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--Add Button To Regenerate -->
|
<!--Add Button To Regenerate -->
|
||||||
|
|||||||
Reference in New Issue
Block a user