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