diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-09 19:19:33 +0200 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-09 19:19:33 +0200 |
commit | 90715e702bbebcf2c3cfd39628c931bbadda28b0 (patch) | |
tree | f574bae75b22ee59e5c60e2f6f4017338614fd8c /g4f/gui/client | |
parent | Add async client docs (diff) | |
download | gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.gz gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.bz2 gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.lz gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.xz gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.zst gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.zip |
Diffstat (limited to 'g4f/gui/client')
-rw-r--r-- | g4f/gui/client/index.html | 4 | ||||
-rw-r--r-- | g4f/gui/client/static/js/chat.v1.js | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/g4f/gui/client/index.html b/g4f/gui/client/index.html index b3cadd19..d6ad5241 100644 --- a/g4f/gui/client/index.html +++ b/g4f/gui/client/index.html @@ -125,8 +125,8 @@ <textarea id="Openai-api_key" name="Openai[api_key]" placeholder="..."></textarea> </div> <div class="field box"> - <label for="Openai-api_key" class="label" title="">Groq: api_key</label> - <textarea id="Openai-api_key" name="Groq[api_key]" placeholder="..."></textarea> + <label for="Groq-api_key" class="label" title="">Groq: api_key</label> + <textarea id="Groq-api_key" name="Groq[api_key]" placeholder="..."></textarea> </div> <div class="field box"> <label for="GeminiPro-api_key" class="label" title="">GeminiPro: api_key</label> diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js index 0aa601e8..02437bf7 100644 --- a/g4f/gui/client/static/js/chat.v1.js +++ b/g4f/gui/client/static/js/chat.v1.js @@ -95,10 +95,14 @@ const register_message_buttons = async () => { if (!("click" in el.dataset)) { el.dataset.click = "true"; el.addEventListener("click", async () => { - if ("active" in el.classList || window.doSpeech || stopped) { + if ("active" in el.classList || window.doSpeech) { stopped = true; return; } + if (stopped) { + stopped = false; + return; + } el.classList.add("blink") el.classList.add("active") const message_el = el.parentElement.parentElement.parentElement; @@ -106,7 +110,6 @@ const register_message_buttons = async () => { let speechText = await get_message(window.conversation_id, message_el.dataset.index); speechText = speechText.replaceAll(/\[(.+)\]\(.+\)/gm, "($1)"); - speechText = speechText.replaceAll(/\(http.+\)/gm, ""); speechText = speechText.replaceAll("`", "").replaceAll("#", "") speechText = speechText.replaceAll( /<!-- generated images start -->[\s\S]+<!-- generated images end -->/gm, @@ -116,6 +119,7 @@ const register_message_buttons = async () => { const lines = speechText.trim().split(/\n|\.|;/); let ended = true; window.onSpeechResponse = (url) => { + el.classList.remove("blink") if (url) { var sound = document.createElement('audio'); sound.controls = 'controls'; @@ -136,7 +140,6 @@ const register_message_buttons = async () => { content_el.appendChild(container); } if (lines.length < 1 || stopped) { - el.classList.remove("blink"); el.classList.remove("active"); return; } @@ -148,7 +151,6 @@ const register_message_buttons = async () => { } } if (!line) { - el.classList.remove("blink") el.classList.remove("active") } } |