summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/gui/client/static/js')
-rw-r--r--g4f/gui/client/static/js/chat.v1.js11
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;