Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -840,72 +840,55 @@ HTML_CONTENT = """
|
|
840 |
}
|
841 |
|
842 |
function showHistory() {
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
880 |
});
|
881 |
-
|
882 |
-
actionsContainer.appendChild(copyBtn);
|
883 |
-
|
884 |
-
const openBtn = document.createElement('button');
|
885 |
-
openBtn.textContent = 'Open';
|
886 |
-
openBtn.className = 'small-btn';
|
887 |
-
openBtn.onclick = () => {
|
888 |
-
quickOpen(item.url, item.fileName, item.originalExtension);
|
889 |
-
};
|
890 |
-
actionsContainer.appendChild(openBtn);
|
891 |
-
|
892 |
-
if (item.originalExtension.toLowerCase() === 'mp4') {
|
893 |
-
const embedBtn = document.createElement('button');
|
894 |
-
embedBtn.textContent = 'Embed';
|
895 |
-
embedBtn.className = 'small-btn';
|
896 |
-
embedBtn.onclick = () => {
|
897 |
-
showEmbedModal(item.url);
|
898 |
-
historyModal.style.display = "none";
|
899 |
-
};
|
900 |
-
actionsContainer.appendChild(embedBtn);
|
901 |
}
|
902 |
|
903 |
-
historyItem.appendChild(actionsContainer);
|
904 |
-
historyList.appendChild(historyItem);
|
905 |
-
});
|
906 |
-
historyModal.style.display = "block";
|
907 |
-
}
|
908 |
-
|
909 |
function quickOpen(url, fileName, originalExtension) {
|
910 |
quickOpenContent.innerHTML = '';
|
911 |
const fullUrl = window.location.origin + url;
|
@@ -1116,4 +1099,4 @@ async def retry_upload(upload_url: str, file_content: bytes, content_type: str,
|
|
1116 |
await asyncio.sleep(delay)
|
1117 |
delay = min(delay * 2, 60)
|
1118 |
|
1119 |
-
return False
|
|
|
840 |
}
|
841 |
|
842 |
function showHistory() {
|
843 |
+
const history = JSON.parse(localStorage.getItem('uploadHistory')) || [];
|
844 |
+
historyList.innerHTML = '';
|
845 |
+
history.forEach(item => {
|
846 |
+
const historyItem = document.createElement('div');
|
847 |
+
historyItem.className = 'history-item';
|
848 |
+
|
849 |
+
const itemName = document.createElement('span');
|
850 |
+
itemName.className = 'history-item-name';
|
851 |
+
itemName.textContent = item.fileName;
|
852 |
+
historyItem.appendChild(itemName);
|
853 |
+
|
854 |
+
const actionsContainer = document.createElement('div');
|
855 |
+
actionsContainer.className = 'history-item-actions';
|
856 |
+
|
857 |
+
const copyBtn = document.createElement('button');
|
858 |
+
copyBtn.textContent = 'Copy Link';
|
859 |
+
copyBtn.className = 'small-btn';
|
860 |
+
copyBtn.onclick = () => {
|
861 |
+
navigator.clipboard.writeText(window.location.origin + item.url).then(() => {
|
862 |
+
alert('Link copied to clipboard!');
|
863 |
+
});
|
864 |
+
};
|
865 |
+
actionsContainer.appendChild(copyBtn);
|
866 |
+
|
867 |
+
const openBtn = document.createElement('button');
|
868 |
+
openBtn.textContent = 'Open';
|
869 |
+
openBtn.className = 'small-btn';
|
870 |
+
openBtn.onclick = () => {
|
871 |
+
quickOpen(item.url, item.fileName, item.originalExtension);
|
872 |
+
};
|
873 |
+
actionsContainer.appendChild(openBtn);
|
874 |
+
|
875 |
+
if (item.originalExtension.toLowerCase() === 'mp4') {
|
876 |
+
const embedBtn = document.createElement('button');
|
877 |
+
embedBtn.textContent = 'Embed';
|
878 |
+
embedBtn.className = 'small-btn';
|
879 |
+
embedBtn.onclick = () => {
|
880 |
+
showEmbedModal(item.url);
|
881 |
+
historyModal.style.display = "none";
|
882 |
+
};
|
883 |
+
actionsContainer.appendChild(embedBtn);
|
884 |
+
}
|
885 |
+
|
886 |
+
historyItem.appendChild(actionsContainer);
|
887 |
+
historyList.appendChild(historyItem);
|
888 |
});
|
889 |
+
historyModal.style.display = "block";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
890 |
}
|
891 |
|
|
|
|
|
|
|
|
|
|
|
|
|
892 |
function quickOpen(url, fileName, originalExtension) {
|
893 |
quickOpenContent.innerHTML = '';
|
894 |
const fullUrl = window.location.origin + url;
|
|
|
1099 |
await asyncio.sleep(delay)
|
1100 |
delay = min(delay * 2, 60)
|
1101 |
|
1102 |
+
return False
|