Spaces:
Runtime error
Runtime error
Update templates/index.html
Browse files- templates/index.html +49 -26
templates/index.html
CHANGED
|
@@ -198,32 +198,55 @@
|
|
| 198 |
|
| 199 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
|
| 200 |
<script>
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
</script>
|
| 228 |
</body>
|
| 229 |
|
|
|
|
| 198 |
|
| 199 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
|
| 200 |
<script>
|
| 201 |
+
// Loader functionality
|
| 202 |
+
document.getElementById('fileUploadForm').onsubmit = function() {
|
| 203 |
+
document.getElementById('loader').style.display = 'block';
|
| 204 |
+
|
| 205 |
+
// Disable the tab buttons
|
| 206 |
+
const buttons = document.querySelectorAll('.tab button');
|
| 207 |
+
buttons.forEach(button => {
|
| 208 |
+
button.setAttribute('disabled', 'true');
|
| 209 |
+
});
|
| 210 |
+
|
| 211 |
+
// Show processing message
|
| 212 |
+
const processingMessage = document.createElement('p');
|
| 213 |
+
processingMessage.id = 'processing-message';
|
| 214 |
+
processingMessage.textContent = 'Processing, please wait...';
|
| 215 |
+
processingMessage.style.color = '#e68a00'; // Style as needed
|
| 216 |
+
document.querySelector('.file-upload-section').appendChild(processingMessage);
|
| 217 |
+
};
|
| 218 |
+
|
| 219 |
+
// Flash message auto-hide
|
| 220 |
+
setTimeout(function () {
|
| 221 |
+
let flashMessage = document.getElementById("flash-message");
|
| 222 |
+
if (flashMessage) {
|
| 223 |
+
flashMessage.style.transition = "opacity 1s ease";
|
| 224 |
+
flashMessage.style.opacity = 0;
|
| 225 |
+
setTimeout(() => flashMessage.remove(), 1000);
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
// After processing is complete (You can adjust this based on your logic)
|
| 229 |
+
const processingMessage = document.getElementById('processing-message');
|
| 230 |
+
if (processingMessage) {
|
| 231 |
+
processingMessage.remove(); // Remove the processing message
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
// Re-enable tab buttons
|
| 235 |
+
const buttons = document.querySelectorAll('.tab button');
|
| 236 |
+
buttons.forEach(button => {
|
| 237 |
+
button.removeAttribute('disabled');
|
| 238 |
+
});
|
| 239 |
+
}, 3000); // Adjust timing based on your upload duration
|
| 240 |
+
|
| 241 |
+
// Function to open links in the same tab
|
| 242 |
+
function openLink(url) {
|
| 243 |
+
window.location.href = url; // Redirects to the specified URL in the same tab
|
| 244 |
+
// Remove "active" class from all buttons
|
| 245 |
+
const buttons = document.querySelectorAll('.tab button');
|
| 246 |
+
buttons.forEach(button => button.classList.remove('active'));
|
| 247 |
+
// Add "active" class to the clicked button
|
| 248 |
+
element.classList.add('active');
|
| 249 |
+
}
|
| 250 |
</script>
|
| 251 |
</body>
|
| 252 |
|