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