mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +00:00
Show filtered list of commands available with the currently input text
This commit is contained in:
@@ -168,12 +168,15 @@
|
|||||||
|
|
||||||
function onChatInput() {
|
function onChatInput() {
|
||||||
let chatInput = document.getElementById("chat-input");
|
let chatInput = document.getElementById("chat-input");
|
||||||
if (chatInput.value === "/") {
|
if (chatInput.value.startsWith("/") && chatInput.value.split(" ").length === 1) {
|
||||||
let chatTooltip = document.getElementById("chat-tooltip");
|
let chatTooltip = document.getElementById("chat-tooltip");
|
||||||
chatTooltip.style.display = "block";
|
chatTooltip.style.display = "block";
|
||||||
let helpText = "<div>";
|
let helpText = "<div>";
|
||||||
|
const command = chatInput.value.split(" ")[0].substring(1);
|
||||||
for (let key in chatOptions) {
|
for (let key in chatOptions) {
|
||||||
helpText += "<b>/" + key + "</b>: " + chatOptions[key] + "<br>";
|
if (!!!command || key.startsWith(command)) {
|
||||||
|
helpText += "<b>/" + key + "</b>: " + chatOptions[key] + "<br>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
chatTooltip.innerHTML = helpText;
|
chatTooltip.innerHTML = helpText;
|
||||||
} else if (chatInput.value.startsWith("/")) {
|
} else if (chatInput.value.startsWith("/")) {
|
||||||
@@ -514,6 +517,7 @@
|
|||||||
|
|
||||||
div#chat-tooltip {
|
div#chat-tooltip {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
font-size: medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes gradient {
|
@keyframes gradient {
|
||||||
|
|||||||
Reference in New Issue
Block a user