Update static/script.js
Browse files- static/script.js +20 -6
static/script.js
CHANGED
|
@@ -79,9 +79,23 @@ themeToggle.addEventListener("click", () => {
|
|
| 79 |
themeToggle.textContent = isDark ? "🌙" : "☀️";
|
| 80 |
});
|
| 81 |
|
| 82 |
-
// === Config Panel Behavior ===
|
| 83 |
toggleConfig.addEventListener("click", () => {
|
| 84 |
-
configPanel.classList.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
});
|
| 86 |
|
| 87 |
// === Show/Hide Loaders ===
|
|
@@ -134,9 +148,9 @@ chatForm.addEventListener("submit", async (e) => {
|
|
| 134 |
appendMessage("user", prompt);
|
| 135 |
userInput.value = "";
|
| 136 |
|
| 137 |
-
configPanel.classList.remove("expanded");
|
| 138 |
-
configPanel.classList.add("minimal");
|
| 139 |
-
showLoaders();
|
| 140 |
|
| 141 |
const settings = {
|
| 142 |
models: {
|
|
@@ -153,7 +167,7 @@ chatForm.addEventListener("submit", async (e) => {
|
|
| 153 |
body: JSON.stringify({ prompt, settings })
|
| 154 |
});
|
| 155 |
|
| 156 |
-
hideLoaders();
|
| 157 |
|
| 158 |
if (response.ok) {
|
| 159 |
const data = await response.json();
|
|
|
|
| 79 |
themeToggle.textContent = isDark ? "🌙" : "☀️";
|
| 80 |
});
|
| 81 |
|
| 82 |
+
// === Config Panel Toggle Behavior ===
|
| 83 |
toggleConfig.addEventListener("click", () => {
|
| 84 |
+
if (configPanel.classList.contains("minimal")) {
|
| 85 |
+
configPanel.classList.remove("minimal");
|
| 86 |
+
configPanel.classList.add("expanded");
|
| 87 |
+
} else if (configPanel.classList.contains("expanded")) {
|
| 88 |
+
configPanel.classList.remove("expanded");
|
| 89 |
+
configPanel.classList.add("minimal");
|
| 90 |
+
} else {
|
| 91 |
+
configPanel.classList.add("expanded");
|
| 92 |
+
configPanel.classList.remove("hidden");
|
| 93 |
+
}
|
| 94 |
+
});
|
| 95 |
+
|
| 96 |
+
// === Docs Button Redirect ===
|
| 97 |
+
docsButton.addEventListener("click", () => {
|
| 98 |
+
window.location.href = "/docs";
|
| 99 |
});
|
| 100 |
|
| 101 |
// === Show/Hide Loaders ===
|
|
|
|
| 148 |
appendMessage("user", prompt);
|
| 149 |
userInput.value = "";
|
| 150 |
|
| 151 |
+
configPanel.classList.remove("expanded");
|
| 152 |
+
configPanel.classList.add("minimal");
|
| 153 |
+
showLoaders();
|
| 154 |
|
| 155 |
const settings = {
|
| 156 |
models: {
|
|
|
|
| 167 |
body: JSON.stringify({ prompt, settings })
|
| 168 |
});
|
| 169 |
|
| 170 |
+
hideLoaders();
|
| 171 |
|
| 172 |
if (response.ok) {
|
| 173 |
const data = await response.json();
|