Spaces:
Running
Running
Update static/application.js
Browse files- static/application.js +10 -12
static/application.js
CHANGED
@@ -57,18 +57,16 @@ document.addEventListener("DOMContentLoaded", function () {
|
|
57 |
return bubble;
|
58 |
}
|
59 |
|
60 |
-
|
61 |
-
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
scrollToBottom();
|
71 |
-
}
|
72 |
|
73 |
sendBtn.addEventListener("click", async () => {
|
74 |
const question = userInput.value.trim();
|
@@ -114,7 +112,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|
114 |
} catch (err) {
|
115 |
thinkingBubble.querySelector(".text").innerText = "⚠️ Chris had trouble connecting.";
|
116 |
}
|
117 |
-
|
118 |
userInput.value = "";
|
119 |
selectedFile = null;
|
120 |
});
|
|
|
57 |
return bubble;
|
58 |
}
|
59 |
|
60 |
+
function showFilePreview(filename, icon = "📎") {
|
61 |
+
if (filePreviewDiv) filePreviewDiv.remove();
|
62 |
|
63 |
+
filePreviewDiv = document.createElement("div");
|
64 |
+
filePreviewDiv.className = "file-preview";
|
65 |
+
filePreviewDiv.innerHTML = `${icon} <strong>Selected:</strong> ${filename}`;
|
66 |
+
|
67 |
+
const qtContainer = document.querySelector(".qt");
|
68 |
+
qtContainer.parentElement.insertBefore(filePreviewDiv, qtContainer);
|
69 |
+
}
|
|
|
|
|
70 |
|
71 |
sendBtn.addEventListener("click", async () => {
|
72 |
const question = userInput.value.trim();
|
|
|
112 |
} catch (err) {
|
113 |
thinkingBubble.querySelector(".text").innerText = "⚠️ Chris had trouble connecting.";
|
114 |
}
|
115 |
+
scrollToBottom();
|
116 |
userInput.value = "";
|
117 |
selectedFile = null;
|
118 |
});
|