summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g4f/gui/client/html/index.html3
-rw-r--r--g4f/gui/client/js/chat.v1.js11
2 files changed, 5 insertions, 9 deletions
diff --git a/g4f/gui/client/html/index.html b/g4f/gui/client/html/index.html
index e0091c8c..eeebce80 100644
--- a/g4f/gui/client/html/index.html
+++ b/g4f/gui/client/html/index.html
@@ -161,10 +161,7 @@
<option value="gemini-pro">gemini-pro</option>
<option value="">----</option>
</select>
- </div>
- <div class="field">
<select name="model2" id="model2" class="hidden">
- </select>
</div>
<div class="field">
<select name="jailbreak" id="jailbreak" style="display: none;">
diff --git a/g4f/gui/client/js/chat.v1.js b/g4f/gui/client/js/chat.v1.js
index 4e01593d..c90a594d 100644
--- a/g4f/gui/client/js/chat.v1.js
+++ b/g4f/gui/client/js/chat.v1.js
@@ -16,9 +16,12 @@ const providerSelect = document.getElementById("provider");
const modelSelect = document.getElementById("model");
const modelProvider = document.getElementById("model2");
const systemPrompt = document.getElementById("systemPrompt")
+const jailbreak = document.getElementById("jailbreak");
let prompt_lock = false;
+const options = ["switch", "model", "model2", "jailbreak", "patch", "provider", "history"];
+
hljs.addPlugin(new CopyButtonPlugin());
messageInput.addEventListener("blur", () => {
@@ -207,9 +210,7 @@ const ask_gpt = async () => {
window.scrollTo(0, 0);
window.controller = new AbortController();
-
- jailbreak = document.getElementById("jailbreak");
- window.text = '';
+ window.text = "";
stop_generating.classList.remove(`stop_generating-hidden`);
@@ -246,7 +247,7 @@ const ask_gpt = async () => {
id: window.token,
conversation_id: window.conversation_id,
model: get_selected_model(),
- jailbreak: jailbreak.options[jailbreak.selectedIndex].value,
+ jailbreak: jailbreak?.options[jailbreak.selectedIndex].value,
web_search: document.getElementById(`switch`).checked,
provider: providerSelect.options[providerSelect.selectedIndex].value,
patch_provider: document.getElementById('patch')?.checked,
@@ -670,8 +671,6 @@ sidebar_button.addEventListener("click", (event) => {
window.scrollTo(0, 0);
});
-const options = ["switch", "model", "model2", "jailbreak", "patch", "provider", "history"];
-
const register_settings_localstorage = async () => {
options.forEach((id) => {
element = document.getElementById(id);