diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-04-12 18:01:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 18:01:54 +0200 |
commit | 0b712c2bde77fe7e3e347d71d5de3c9e62f26738 (patch) | |
tree | bd93b8b64705c74be6feff9cc2f7cba7837c8da8 /g4f/gui/client | |
parent | Merge pull request #1825 from hlohaus/ws (diff) | |
download | gpt4free-0.2.9.5.tar gpt4free-0.2.9.5.tar.gz gpt4free-0.2.9.5.tar.bz2 gpt4free-0.2.9.5.tar.lz gpt4free-0.2.9.5.tar.xz gpt4free-0.2.9.5.tar.zst gpt4free-0.2.9.5.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/gui/client/static/js/chat.v1.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js index a875761c..46f7e808 100644 --- a/g4f/gui/client/static/js/chat.v1.js +++ b/g4f/gui/client/static/js/chat.v1.js @@ -1262,7 +1262,7 @@ if (SpeechRecognition) { function may_stop() { if (microLabel.classList.contains("recognition")) { - //recognition.stop(); + recognition.stop(); } } @@ -1272,15 +1272,12 @@ if (SpeechRecognition) { recognition.onstart = function() { microLabel.classList.add("recognition"); startValue = messageInput.value; - messageInput.placeholder = ""; lastDebounceTranscript = ""; timeoutHandle = window.setTimeout(may_stop, 10000); }; recognition.onend = function() { microLabel.classList.remove("recognition"); - messageInput.value = messageInput.placeholder; - messageInput.placeholder = "Ask a question"; - //messageInput.focus(); + messageInput.focus(); }; recognition.onresult = function(event) { if (!event.results) { @@ -1298,9 +1295,9 @@ if (SpeechRecognition) { lastDebounceTranscript = transcript; } if (transcript) { - messageInput.placeholder = `${startValue ? startValue+"\n" : ""}${transcript.trim()}`; + messageInput.value = `${startValue ? startValue+"\n" : ""}${transcript.trim()}`; if (isFinal) { - startValue = messageInput.placeholder; + startValue = messageInput.value; } messageInput.style.height = messageInput.scrollHeight + "px"; messageInput.scrollTop = messageInput.scrollHeight; |