XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update chat.v1.js

eefbdb6d
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +7 -5
Modified g4f/gui/client/static/js/chat.v1.js +7 -5
@@ -1249,8 +1249,7 @@ function save_storage() {
1249 1249 }
1250 1250 }
1251 1251
1252 const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
1253 if (SpeechRecognition) {
1252 if (window.SpeechRecognition) {
1254 1253 const mircoIcon = microLabel.querySelector("i");
1255 1254 mircoIcon.classList.add("fa-microphone");
1256 1255 mircoIcon.classList.remove("fa-microphone-slash");
@@ -1272,12 +1271,15 @@ if (SpeechRecognition) {
1272 1271 recognition.onstart = function() {
1273 1272 microLabel.classList.add("recognition");
1274 1273 startValue = messageInput.value;
1274 messageInput.placeholder = "";
1275 1275 lastDebounceTranscript = "";
1276 1276 timeoutHandle = window.setTimeout(may_stop, 10000);
1277 1277 };
1278 1278 recognition.onend = function() {
1279 1279 microLabel.classList.remove("recognition");
1280 messageInput.focus();
1280 messageInput.value = messageInput.placeholder;
1281 messageInput.placeholder = "Ask a question";
1282 //messageInput.focus();
1281 1283 };
1282 1284 recognition.onresult = function(event) {
1283 1285 if (!event.results) {
@@ -1295,9 +1297,9 @@ if (SpeechRecognition) {
1295 1297 lastDebounceTranscript = transcript;
1296 1298 }
1297 1299 if (transcript) {
1298 messageInput.value = `${startValue ? startValue+"\n" : ""}${transcript.trim()}`;
1300 messageInput.placeholder = `${startValue ? startValue+"\n" : ""}${transcript.trim()}`;
1299 1301 if (isFinal) {
1300 startValue = messageInput.value;
1302 startValue = messageInput.placeholder;
1301 1303 }
1302 1304 messageInput.style.height = messageInput.scrollHeight + "px";
1303 1305 messageInput.scrollTop = messageInput.scrollHeight;