Spaces:
Running
Running
Update static/application.js
Browse files- static/application.js +19 -3
static/application.js
CHANGED
@@ -304,7 +304,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
304 |
filePreviewBubble.style.flexDirection = "column";
|
305 |
filePreviewBubble.style.maxWidth = "50%";
|
306 |
|
307 |
-
const userQuestion = input.value.trim()
|
308 |
|
309 |
if (file.type.startsWith('image/')) {
|
310 |
const reader = new FileReader();
|
@@ -318,9 +318,17 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
318 |
img.style.marginBottom = "8px";
|
319 |
|
320 |
const text = document.createElement("span");
|
321 |
-
text.textContent = `π Selected image: ${file.name}
|
322 |
text.style.fontSize = "13px";
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
filePreviewBubble.appendChild(img);
|
325 |
filePreviewBubble.appendChild(text);
|
326 |
convo.appendChild(filePreviewBubble);
|
@@ -329,9 +337,17 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
329 |
reader.readAsDataURL(file);
|
330 |
} else {
|
331 |
const text = document.createElement("span");
|
332 |
-
text.textContent = `π Selected file: ${file.name}
|
333 |
text.style.fontSize = "13px";
|
334 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
filePreviewBubble.appendChild(text);
|
336 |
convo.appendChild(filePreviewBubble);
|
337 |
convo.scrollTop = convo.scrollHeight;
|
|
|
304 |
filePreviewBubble.style.flexDirection = "column";
|
305 |
filePreviewBubble.style.maxWidth = "50%";
|
306 |
|
307 |
+
const userQuestion = input.value.trim(); // Only include the question if it was entered
|
308 |
|
309 |
if (file.type.startsWith('image/')) {
|
310 |
const reader = new FileReader();
|
|
|
318 |
img.style.marginBottom = "8px";
|
319 |
|
320 |
const text = document.createElement("span");
|
321 |
+
text.textContent = `π Selected image: ${file.name}`;
|
322 |
text.style.fontSize = "13px";
|
323 |
|
324 |
+
// If there's a user question, add the β
|
325 |
+
if (userQuestion) {
|
326 |
+
const question = document.createElement("span");
|
327 |
+
question.textContent = `\nβ ${userQuestion}`;
|
328 |
+
question.style.fontSize = "13px";
|
329 |
+
filePreviewBubble.appendChild(question);
|
330 |
+
}
|
331 |
+
|
332 |
filePreviewBubble.appendChild(img);
|
333 |
filePreviewBubble.appendChild(text);
|
334 |
convo.appendChild(filePreviewBubble);
|
|
|
337 |
reader.readAsDataURL(file);
|
338 |
} else {
|
339 |
const text = document.createElement("span");
|
340 |
+
text.textContent = `π Selected file: ${file.name}`;
|
341 |
text.style.fontSize = "13px";
|
342 |
|
343 |
+
// If there's a user question, add the β
|
344 |
+
if (userQuestion) {
|
345 |
+
const question = document.createElement("span");
|
346 |
+
question.textContent = `\nβ ${userQuestion}`;
|
347 |
+
question.style.fontSize = "13px";
|
348 |
+
filePreviewBubble.appendChild(question);
|
349 |
+
}
|
350 |
+
|
351 |
filePreviewBubble.appendChild(text);
|
352 |
convo.appendChild(filePreviewBubble);
|
353 |
convo.scrollTop = convo.scrollHeight;
|