Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -264,7 +264,6 @@ HTML_CONTENT = """
|
|
264 |
margin-top: 10px;
|
265 |
}
|
266 |
|
267 |
-
/* File Types */
|
268 |
.file-types {
|
269 |
margin-top: 2rem;
|
270 |
font-size: 0.8rem;
|
@@ -336,18 +335,27 @@ HTML_CONTENT = """
|
|
336 |
font-size: 0.9rem;
|
337 |
}
|
338 |
|
339 |
-
.history-btn {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
display: inline-block;
|
341 |
padding: 8px 16px;
|
342 |
font-size: 0.9rem;
|
343 |
font-weight: 500;
|
344 |
color: #ffffff;
|
345 |
-
background-color: #2a2a2a;
|
346 |
border: none;
|
347 |
border-radius: 3px;
|
348 |
cursor: pointer;
|
349 |
transition: background-color 0.3s ease, box-shadow 0.3s ease;
|
350 |
-
|
|
|
|
|
|
|
351 |
}
|
352 |
|
353 |
.history-btn:hover {
|
@@ -355,6 +363,15 @@ HTML_CONTENT = """
|
|
355 |
box-shadow: 0 0 10px rgba(200, 200, 200, 0.3);
|
356 |
}
|
357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
.history-modal {
|
359 |
display: none;
|
360 |
position: fixed;
|
@@ -406,7 +423,7 @@ HTML_CONTENT = """
|
|
406 |
gap: 5px;
|
407 |
}
|
408 |
|
409 |
-
|
410 |
display: none;
|
411 |
position: fixed;
|
412 |
z-index: 4;
|
@@ -440,7 +457,7 @@ HTML_CONTENT = """
|
|
440 |
border: none;
|
441 |
}
|
442 |
|
443 |
-
|
444 |
.container {
|
445 |
padding: 1.5rem;
|
446 |
}
|
@@ -531,7 +548,10 @@ HTML_CONTENT = """
|
|
531 |
<div class="file-types">
|
532 |
Allowed file types: .zip, .mp4, .txt, .mp3, all image types, .pdf
|
533 |
</div>
|
534 |
-
<
|
|
|
|
|
|
|
535 |
</div>
|
536 |
|
537 |
<div id="embedModal" class="modal">
|
@@ -576,6 +596,7 @@ HTML_CONTENT = """
|
|
576 |
const embedLinkInput = document.getElementById('embedLink');
|
577 |
const uploadBtn = document.getElementById('uploadBtn');
|
578 |
const historyBtn = document.getElementById('historyBtn');
|
|
|
579 |
const historyList = document.getElementById('historyList');
|
580 |
const quickOpenContent = document.getElementById('quickOpenContent');
|
581 |
|
@@ -642,6 +663,13 @@ HTML_CONTENT = """
|
|
642 |
showHistory();
|
643 |
}
|
644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
645 |
function handleFileSelect(e) {
|
646 |
if (e.target.files && e.target.files.length > 0) {
|
647 |
const file = e.target.files[0];
|
@@ -825,7 +853,7 @@ HTML_CONTENT = """
|
|
825 |
};
|
826 |
actionsContainer.appendChild(copyBtn);
|
827 |
|
828 |
-
|
829 |
openBtn.textContent = 'Open';
|
830 |
openBtn.className = 'small-btn';
|
831 |
openBtn.onclick = () => {
|
@@ -858,7 +886,7 @@ HTML_CONTENT = """
|
|
858 |
historyModal.style.display = "block";
|
859 |
}
|
860 |
|
861 |
-
|
862 |
quickOpenContent.innerHTML = '';
|
863 |
const fullUrl = window.location.origin + url;
|
864 |
|
|
|
264 |
margin-top: 10px;
|
265 |
}
|
266 |
|
|
|
267 |
.file-types {
|
268 |
margin-top: 2rem;
|
269 |
font-size: 0.8rem;
|
|
|
335 |
font-size: 0.9rem;
|
336 |
}
|
337 |
|
338 |
+
.history-btn-container {
|
339 |
+
display: flex;
|
340 |
+
justify-content: center;
|
341 |
+
gap: 10px;
|
342 |
+
margin-top: 1rem;
|
343 |
+
}
|
344 |
+
|
345 |
+
.history-btn, .clear-history-btn {
|
346 |
display: inline-block;
|
347 |
padding: 8px 16px;
|
348 |
font-size: 0.9rem;
|
349 |
font-weight: 500;
|
350 |
color: #ffffff;
|
|
|
351 |
border: none;
|
352 |
border-radius: 3px;
|
353 |
cursor: pointer;
|
354 |
transition: background-color 0.3s ease, box-shadow 0.3s ease;
|
355 |
+
}
|
356 |
+
|
357 |
+
.history-btn {
|
358 |
+
background-color: #2a2a2a;
|
359 |
}
|
360 |
|
361 |
.history-btn:hover {
|
|
|
363 |
box-shadow: 0 0 10px rgba(200, 200, 200, 0.3);
|
364 |
}
|
365 |
|
366 |
+
.clear-history-btn {
|
367 |
+
background-color: #1a0505;
|
368 |
+
}
|
369 |
+
|
370 |
+
.clear-history-btn:hover {
|
371 |
+
background-color: #2a0a0a;
|
372 |
+
box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
|
373 |
+
}
|
374 |
+
|
375 |
.history-modal {
|
376 |
display: none;
|
377 |
position: fixed;
|
|
|
423 |
gap: 5px;
|
424 |
}
|
425 |
|
426 |
+
.quick-open-modal {
|
427 |
display: none;
|
428 |
position: fixed;
|
429 |
z-index: 4;
|
|
|
457 |
border: none;
|
458 |
}
|
459 |
|
460 |
+
@media (max-width: 480px) {
|
461 |
.container {
|
462 |
padding: 1.5rem;
|
463 |
}
|
|
|
548 |
<div class="file-types">
|
549 |
Allowed file types: .zip, .mp4, .txt, .mp3, all image types, .pdf
|
550 |
</div>
|
551 |
+
<div class="history-btn-container">
|
552 |
+
<button id="historyBtn" class="history-btn">View Upload History</button>
|
553 |
+
<button id="clearHistoryBtn" class="clear-history-btn">Clear History</button>
|
554 |
+
</div>
|
555 |
</div>
|
556 |
|
557 |
<div id="embedModal" class="modal">
|
|
|
596 |
const embedLinkInput = document.getElementById('embedLink');
|
597 |
const uploadBtn = document.getElementById('uploadBtn');
|
598 |
const historyBtn = document.getElementById('historyBtn');
|
599 |
+
const clearHistoryBtn = document.getElementById('clearHistoryBtn');
|
600 |
const historyList = document.getElementById('historyList');
|
601 |
const quickOpenContent = document.getElementById('quickOpenContent');
|
602 |
|
|
|
663 |
showHistory();
|
664 |
}
|
665 |
|
666 |
+
clearHistoryBtn.onclick = function() {
|
667 |
+
if (confirm('Are you sure you want to clear your upload history?')) {
|
668 |
+
localStorage.removeItem('uploadHistory');
|
669 |
+
alert('Upload history has been cleared.');
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
function handleFileSelect(e) {
|
674 |
if (e.target.files && e.target.files.length > 0) {
|
675 |
const file = e.target.files[0];
|
|
|
853 |
};
|
854 |
actionsContainer.appendChild(copyBtn);
|
855 |
|
856 |
+
const openBtn = document.createElement('button');
|
857 |
openBtn.textContent = 'Open';
|
858 |
openBtn.className = 'small-btn';
|
859 |
openBtn.onclick = () => {
|
|
|
886 |
historyModal.style.display = "block";
|
887 |
}
|
888 |
|
889 |
+
function quickOpen(url, fileName) {
|
890 |
quickOpenContent.innerHTML = '';
|
891 |
const fullUrl = window.location.origin + url;
|
892 |
|