summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client/static/js
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-05-19 03:13:54 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-05-19 03:13:54 +0200
commit3703e72073f17faf200545202d9f68f768857951 (patch)
tree2199dba514c4c6fea04006387b2ea998090013a8 /g4f/gui/client/static/js
parentFix js error in gui, Revert to_image in gui (diff)
downloadgpt4free-3703e72073f17faf200545202d9f68f768857951.tar
gpt4free-3703e72073f17faf200545202d9f68f768857951.tar.gz
gpt4free-3703e72073f17faf200545202d9f68f768857951.tar.bz2
gpt4free-3703e72073f17faf200545202d9f68f768857951.tar.lz
gpt4free-3703e72073f17faf200545202d9f68f768857951.tar.xz
gpt4free-3703e72073f17faf200545202d9f68f768857951.tar.zst
gpt4free-3703e72073f17faf200545202d9f68f768857951.zip
Diffstat (limited to '')
-rw-r--r--g4f/gui/client/static/js/chat.v1.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js
index 1d0b0dce..47bfdd3b 100644
--- a/g4f/gui/client/static/js/chat.v1.js
+++ b/g4f/gui/client/static/js/chat.v1.js
@@ -1108,8 +1108,11 @@ async function on_api() {
await load_settings_storage()
const hide_systemPrompt = document.getElementById("hide-systemPrompt")
+ const slide_systemPrompt_icon = document.querySelector(".slide-systemPrompt i");
if (hide_systemPrompt.checked) {
systemPrompt.classList.add("hidden");
+ slide_systemPrompt_icon.classList.remove("fa-angles-up");
+ slide_systemPrompt_icon.classList.add("fa-angles-down");
}
hide_systemPrompt.addEventListener('change', async (event) => {
if (event.target.checked) {
@@ -1118,6 +1121,13 @@ async function on_api() {
systemPrompt.classList.remove("hidden");
}
});
+ document.querySelector(".slide-systemPrompt")?.addEventListener("click", () => {
+ hide_systemPrompt.click();
+ let checked = hide_systemPrompt.checked;
+ systemPrompt.classList[checked ? "add": "remove"]("hidden");
+ slide_systemPrompt_icon.classList[checked ? "remove": "add"]("fa-angles-up");
+ slide_systemPrompt_icon.classList[checked ? "add": "remove"]("fa-angles-down");
+ });
const messageInputHeight = document.getElementById("message-input-height");
if (messageInputHeight) {
if (messageInputHeight.value) {
@@ -1127,6 +1137,19 @@ async function on_api() {
messageInput.style.maxHeight = `${messageInputHeight.value}px`;
});
}
+ const darkMode = document.getElementById("darkMode");
+ if (darkMode) {
+ if (!darkMode.checked) {
+ document.body.classList.add("white");
+ }
+ darkMode.addEventListener('change', async (event) => {
+ if (event.target.checked) {
+ document.body.classList.remove("white");
+ } else {
+ document.body.classList.add("white");
+ }
+ });
+ }
}
async function load_version() {