Spaces:
Sleeping
Sleeping
Add clear button and clearChat function
Browse filesAdded a clear button to the header and implemented the clearChat function to reset the chat.
- static/index.html +9 -0
static/index.html
CHANGED
|
@@ -547,6 +547,7 @@
|
|
| 547 |
<div class="logo-icon">β‘</div>
|
| 548 |
<div class="logo-text">Query<span>Mind</span></div>
|
| 549 |
<div class="header-badge">
|
|
|
|
| 550 |
<span id="status-dot" class="status-dot"></span>
|
| 551 |
<span id="status-label" class="badge">INITIALIZING</span>
|
| 552 |
</div>
|
|
@@ -865,6 +866,14 @@
|
|
| 865 |
if (el) el.remove();
|
| 866 |
}
|
| 867 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 868 |
// ββ Escape HTML βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 869 |
function escapeHtml(str) {
|
| 870 |
return String(str).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|
|
|
|
| 547 |
<div class="logo-icon">β‘</div>
|
| 548 |
<div class="logo-text">Query<span>Mind</span></div>
|
| 549 |
<div class="header-badge">
|
| 550 |
+
<button id="clear-btn" onclick="clearChat()" style="background:none;border:1px solid var(--border2);color:var(--muted);font-size:11px;padding:4px 10px;border-radius:5px;cursor:pointer;font-family:var(--mono);letter-spacing:0.5px;transition:all 0.15s;" onmouseover="this.style.borderColor='var(--danger)';this.style.color='#ff8fa3'" onmouseout="this.style.borderColor='var(--border2)';this.style.color='var(--muted)'">CLEAR</button>
|
| 551 |
<span id="status-dot" class="status-dot"></span>
|
| 552 |
<span id="status-label" class="badge">INITIALIZING</span>
|
| 553 |
</div>
|
|
|
|
| 866 |
if (el) el.remove();
|
| 867 |
}
|
| 868 |
|
| 869 |
+
// ββ Clear Chat
|
| 870 |
+
function clearChat() {
|
| 871 |
+
chat.innerHTML = '';
|
| 872 |
+
emptyState.style.display = '';
|
| 873 |
+
chat.appendChild(emptyState);
|
| 874 |
+
showToast('Chat cleared', 'success');
|
| 875 |
+
}
|
| 876 |
+
|
| 877 |
// ββ Escape HTML βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 878 |
function escapeHtml(str) {
|
| 879 |
return String(str).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|