WebashalarForML commited on
Commit
48cba38
·
verified ·
1 Parent(s): 37b7add

Update templates/index.html

Browse files
Files changed (1) hide show
  1. 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
- // Loader functionality
210
- document.getElementById('fileUploadForm').onsubmit = function() {
211
- document.getElementById('loader').style.display = 'block';
212
- // Disable the tab buttons
213
- const buttons = document.querySelectorAll('.tab button');
214
- buttons.forEach(button => {
215
- button.setAttribute('disabled', 'true');
216
- });
217
- // Show processing message
218
- const processingMessage = document.createElement('p');
219
- processingMessage.id = 'processing-message';
220
- processingMessage.textContent = 'Processing, please wait...';
221
- processingMessage.style.color = '#e68a00'; // Style as needed
222
- document.querySelector('.file-upload-section').appendChild(processingMessage);
223
- };
 
 
 
 
 
224
 
225
- // Flash message auto-hide
226
- setTimeout(function () {
227
- let flashMessage = document.getElementById("flash-message");
228
- if (flashMessage) {
229
- flashMessage.style.transition = "opacity 1s ease";
230
- flashMessage.style.opacity = 0;
231
- setTimeout(() => flashMessage.remove(), 1000);
232
- }
233
- // After processing is complete (You can adjust this based on your logic)
234
- const processingMessage = document.getElementById('processing-message');
235
- if (processingMessage) {
236
- processingMessage.remove(); // Remove the processing message
237
- }
238
- // Re-enable tab buttons
239
- const buttons = document.querySelectorAll('.tab button');
240
- buttons.forEach(button => {
241
- button.removeAttribute('disabled');
242
- });
243
- }, 3000); // Adjust timing based on your upload duration
 
 
 
 
 
244
 
245
- // Function to open links in the same tab
246
- function openLink(url) {
247
- window.location.href = url; // Redirects to the specified URL in the same tab
248
- // Remove "active" class from all buttons
249
- const buttons = document.querySelectorAll('.tab button');
250
- buttons.forEach(button => button.classList.remove('active'));
251
- // Add "active" class to the clicked button
252
- element.classList.add('active');
253
- }
254
- </script>
 
 
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>