Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -437,7 +437,7 @@ HTML_CONTENT = """
|
|
437 |
overflow: auto;
|
438 |
}
|
439 |
|
440 |
-
|
441 |
margin: 5% auto;
|
442 |
padding: 20px;
|
443 |
width: 90%;
|
@@ -445,7 +445,7 @@ HTML_CONTENT = """
|
|
445 |
text-align: center;
|
446 |
}
|
447 |
|
448 |
-
|
449 |
.quick-open-content video,
|
450 |
.quick-open-content audio {
|
451 |
max-width: 100%;
|
@@ -796,6 +796,14 @@ HTML_CONTENT = """
|
|
796 |
};
|
797 |
buttonsContainer.appendChild(copyBtn);
|
798 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
799 |
if (originalExtension.toLowerCase() === 'mp4') {
|
800 |
const embedBtn = document.createElement('button');
|
801 |
embedBtn.textContent = 'Embed Video for Discord';
|
@@ -813,7 +821,7 @@ HTML_CONTENT = """
|
|
813 |
}
|
814 |
|
815 |
function showEmbedModal(url) {
|
816 |
-
const embedUrl =
|
817 |
embedLinkInput.value = embedUrl;
|
818 |
modal.style.display = "block";
|
819 |
}
|
@@ -860,19 +868,11 @@ HTML_CONTENT = """
|
|
860 |
openBtn.textContent = 'Open';
|
861 |
openBtn.className = 'small-btn';
|
862 |
openBtn.onclick = () => {
|
863 |
-
window.open(window.location.origin + item.url, '_blank');
|
864 |
-
};
|
865 |
-
actionsContainer.appendChild(openBtn);
|
866 |
-
|
867 |
-
const quickOpenBtn = document.createElement('button');
|
868 |
-
quickOpenBtn.textContent = 'Quick Open';
|
869 |
-
quickOpenBtn.className = 'small-btn';
|
870 |
-
quickOpenBtn.onclick = () => {
|
871 |
quickOpen(item.url, item.fileName, item.originalExtension);
|
872 |
};
|
873 |
-
actionsContainer.appendChild(
|
874 |
|
875 |
-
|
876 |
const embedBtn = document.createElement('button');
|
877 |
embedBtn.textContent = 'Embed';
|
878 |
embedBtn.className = 'small-btn';
|
@@ -889,7 +889,7 @@ HTML_CONTENT = """
|
|
889 |
historyModal.style.display = "block";
|
890 |
}
|
891 |
|
892 |
-
|
893 |
quickOpenContent.innerHTML = '';
|
894 |
const fullUrl = window.location.origin + url;
|
895 |
|
|
|
437 |
overflow: auto;
|
438 |
}
|
439 |
|
440 |
+
.quick-open-content {
|
441 |
margin: 5% auto;
|
442 |
padding: 20px;
|
443 |
width: 90%;
|
|
|
445 |
text-align: center;
|
446 |
}
|
447 |
|
448 |
+
.quick-open-content img,
|
449 |
.quick-open-content video,
|
450 |
.quick-open-content audio {
|
451 |
max-width: 100%;
|
|
|
796 |
};
|
797 |
buttonsContainer.appendChild(copyBtn);
|
798 |
|
799 |
+
const openBtn = document.createElement('button');
|
800 |
+
openBtn.textContent = 'Open';
|
801 |
+
openBtn.className = 'small-btn';
|
802 |
+
openBtn.onclick = () => {
|
803 |
+
quickOpen(url, fileName, originalExtension);
|
804 |
+
};
|
805 |
+
buttonsContainer.appendChild(openBtn);
|
806 |
+
|
807 |
if (originalExtension.toLowerCase() === 'mp4') {
|
808 |
const embedBtn = document.createElement('button');
|
809 |
embedBtn.textContent = 'Embed Video for Discord';
|
|
|
821 |
}
|
822 |
|
823 |
function showEmbedModal(url) {
|
824 |
+
const embedUrl = `https://x266.mov/e/${encodeURIComponent(window.location.origin + url)}`;
|
825 |
embedLinkInput.value = embedUrl;
|
826 |
modal.style.display = "block";
|
827 |
}
|
|
|
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';
|
|
|
889 |
historyModal.style.display = "block";
|
890 |
}
|
891 |
|
892 |
+
function quickOpen(url, fileName, originalExtension) {
|
893 |
quickOpenContent.innerHTML = '';
|
894 |
const fullUrl = window.location.origin + url;
|
895 |
|