Spaces:
Sleeping
Sleeping
Update static/script.js
Browse files- static/script.js +1 -5
static/script.js
CHANGED
@@ -28,7 +28,7 @@ function sendMessage() {
|
|
28 |
if (message) {
|
29 |
addMessage('user', message);
|
30 |
conversation.push({ role: 'user', message: message });
|
31 |
-
selectionBoxVisible = true;
|
32 |
setTimeout(() => handleResponse(message), 500);
|
33 |
} else {
|
34 |
addMessage('bot', 'Hey, don’t be shy! Type something or add some items to get started! 😄');
|
@@ -49,7 +49,6 @@ function updateSelectionBox() {
|
|
49 |
const selectionBox = document.createElement('div');
|
50 |
selectionBox.className = 'selection-box';
|
51 |
|
52 |
-
// Add dietary preference buttons
|
53 |
const vegButton = document.createElement('button');
|
54 |
vegButton.textContent = 'Vegetarian';
|
55 |
vegButton.className = 'dietary-button green';
|
@@ -68,7 +67,6 @@ function updateSelectionBox() {
|
|
68 |
bothButton.onclick = () => fetchMenuItems('both');
|
69 |
selectionBox.appendChild(bothButton);
|
70 |
|
71 |
-
// Add selected items
|
72 |
const label = document.createElement('span');
|
73 |
label.textContent = 'Selected Items:';
|
74 |
selectionBox.appendChild(label);
|
@@ -79,7 +77,6 @@ function updateSelectionBox() {
|
|
79 |
selectionBox.appendChild(itemSpan);
|
80 |
});
|
81 |
|
82 |
-
// Add manual input
|
83 |
const textInput = document.createElement('input');
|
84 |
textInput.type = 'text';
|
85 |
textInput.placeholder = 'Add item manually...';
|
@@ -101,7 +98,6 @@ function updateSelectionBox() {
|
|
101 |
});
|
102 |
selectionBox.appendChild(textInput);
|
103 |
|
104 |
-
// Add Submit button if items exist
|
105 |
if (selectedItems.length > 0) {
|
106 |
const submitButton = document.createElement('button');
|
107 |
submitButton.textContent = 'Submit to Salesforce';
|
|
|
28 |
if (message) {
|
29 |
addMessage('user', message);
|
30 |
conversation.push({ role: 'user', message: message });
|
31 |
+
selectionBoxVisible = true;
|
32 |
setTimeout(() => handleResponse(message), 500);
|
33 |
} else {
|
34 |
addMessage('bot', 'Hey, don’t be shy! Type something or add some items to get started! 😄');
|
|
|
49 |
const selectionBox = document.createElement('div');
|
50 |
selectionBox.className = 'selection-box';
|
51 |
|
|
|
52 |
const vegButton = document.createElement('button');
|
53 |
vegButton.textContent = 'Vegetarian';
|
54 |
vegButton.className = 'dietary-button green';
|
|
|
67 |
bothButton.onclick = () => fetchMenuItems('both');
|
68 |
selectionBox.appendChild(bothButton);
|
69 |
|
|
|
70 |
const label = document.createElement('span');
|
71 |
label.textContent = 'Selected Items:';
|
72 |
selectionBox.appendChild(label);
|
|
|
77 |
selectionBox.appendChild(itemSpan);
|
78 |
});
|
79 |
|
|
|
80 |
const textInput = document.createElement('input');
|
81 |
textInput.type = 'text';
|
82 |
textInput.placeholder = 'Add item manually...';
|
|
|
98 |
});
|
99 |
selectionBox.appendChild(textInput);
|
100 |
|
|
|
101 |
if (selectedItems.length > 0) {
|
102 |
const submitButton = document.createElement('button');
|
103 |
submitButton.textContent = 'Submit to Salesforce';
|