Spaces:
Sleeping
Sleeping
WebashalarForML
commited on
Commit
•
0e20594
1
Parent(s):
ce4634a
Update templates/index.html
Browse files- templates/index.html +44 -61
templates/index.html
CHANGED
@@ -146,7 +146,6 @@
|
|
146 |
}
|
147 |
.disabled {
|
148 |
cursor: not-allowed !important; /* Set cursor to not-allowed */
|
149 |
-
opacity: 0.6;
|
150 |
}
|
151 |
|
152 |
/* Responsive design */
|
@@ -205,72 +204,56 @@
|
|
205 |
<script>
|
206 |
// Loader functionality
|
207 |
document.getElementById('fileUploadForm').onsubmit = function() {
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
uploadButton.classList.add('disabled');
|
224 |
-
|
225 |
-
// Show processing message
|
226 |
-
const processingMessage = document.createElement('p');
|
227 |
-
processingMessage.id = 'processing-message';
|
228 |
-
processingMessage.textContent = 'Processing, please wait...';
|
229 |
-
processingMessage.style.color = '#e68a10'; // Style as needed
|
230 |
-
document.querySelector('.file-upload-section').appendChild(processingMessage);
|
231 |
};
|
232 |
-
|
233 |
// Flash message auto-hide
|
234 |
setTimeout(function () {
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
// Re-enable the file input and submit button
|
256 |
-
const fileInput = document.querySelector('input[type="file"]');
|
257 |
-
const uploadButton = document.querySelector('input[type="submit"]');
|
258 |
-
fileInput.removeAttribute('disabled');
|
259 |
-
uploadButton.removeAttribute('disabled');
|
260 |
-
fileInput.classList.remove('disabled');
|
261 |
-
uploadButton.classList.remove('disabled');
|
262 |
}, 3000); // Adjust timing based on your upload duration
|
263 |
-
|
264 |
// Function to open links in the same tab
|
265 |
function openLink(url, element) {
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
}
|
275 |
</script>
|
276 |
</body>
|
|
|
146 |
}
|
147 |
.disabled {
|
148 |
cursor: not-allowed !important; /* Set cursor to not-allowed */
|
|
|
149 |
}
|
150 |
|
151 |
/* Responsive design */
|
|
|
204 |
<script>
|
205 |
// Loader functionality
|
206 |
document.getElementById('fileUploadForm').onsubmit = function() {
|
207 |
+
document.getElementById('loader').style.display = 'block';
|
208 |
+
|
209 |
+
// Disable the tab buttons and apply disabled class
|
210 |
+
const buttons = document.querySelectorAll('.tab button');
|
211 |
+
buttons.forEach(button => {
|
212 |
+
button.setAttribute('disabled', 'true');
|
213 |
+
button.classList.add('disabled'); // Add disabled class
|
214 |
+
});
|
215 |
+
|
216 |
+
// Show processing message
|
217 |
+
const processingMessage = document.createElement('p');
|
218 |
+
processingMessage.id = 'processing-message';
|
219 |
+
processingMessage.textContent = 'Processing, please wait...';
|
220 |
+
processingMessage.style.color = '#e68a10'; // Style as needed
|
221 |
+
document.querySelector('.file-upload-section').appendChild(processingMessage);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
};
|
223 |
+
|
224 |
// Flash message auto-hide
|
225 |
setTimeout(function () {
|
226 |
+
let flashMessage = document.getElementById("flash-message");
|
227 |
+
if (flashMessage) {
|
228 |
+
flashMessage.style.transition = "opacity 1s ease";
|
229 |
+
flashMessage.style.opacity = 0;
|
230 |
+
setTimeout(() => flashMessage.remove(), 1000);
|
231 |
+
}
|
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 |
+
|
239 |
+
// Re-enable tab buttons and remove disabled class
|
240 |
+
const buttons = document.querySelectorAll('.tab button');
|
241 |
+
buttons.forEach(button => {
|
242 |
+
button.removeAttribute('disabled');
|
243 |
+
button.classList.remove('disabled'); // Remove disabled class
|
244 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
}, 3000); // Adjust timing based on your upload duration
|
246 |
+
|
247 |
// Function to open links in the same tab
|
248 |
function openLink(url, element) {
|
249 |
+
window.location.href = url; // Redirects to the specified URL in the same tab
|
250 |
+
|
251 |
+
// Remove "active" class from all buttons
|
252 |
+
const buttons = document.querySelectorAll('.tab button');
|
253 |
+
buttons.forEach(button => button.classList.remove('active'));
|
254 |
+
|
255 |
+
// Add "active" class to the clicked button
|
256 |
+
element.classList.add('active');
|
257 |
}
|
258 |
</script>
|
259 |
</body>
|