jerrrycans commited on
Commit
0a3a494
·
verified ·
1 Parent(s): 18df184

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -2
app.py CHANGED
@@ -445,7 +445,7 @@ HTML_CONTENT = """
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%;
@@ -552,6 +552,7 @@ HTML_CONTENT = """
552
  </div>
553
  <div class="history-btn-container">
554
  <button id="historyBtn" class="history-btn">View Upload History</button>
 
555
  <button id="clearHistoryBtn" class="clear-history-btn">Clear History</button>
556
  </div>
557
  </div>
@@ -598,6 +599,7 @@ HTML_CONTENT = """
598
  const embedLinkInput = document.getElementById('embedLink');
599
  const uploadBtn = document.getElementById('uploadBtn');
600
  const historyBtn = document.getElementById('historyBtn');
 
601
  const clearHistoryBtn = document.getElementById('clearHistoryBtn');
602
  const historyList = document.getElementById('historyList');
603
  const quickOpenContent = document.getElementById('quickOpenContent');
@@ -665,6 +667,23 @@ HTML_CONTENT = """
665
  showHistory();
666
  }
667
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  clearHistoryBtn.onclick = function() {
669
  if (confirm('Are you sure you want to clear your upload history?')) {
670
  localStorage.removeItem('uploadHistory');
@@ -889,7 +908,7 @@ HTML_CONTENT = """
889
  historyModal.style.display = "block";
890
  }
891
 
892
- function quickOpen(url, fileName, originalExtension) {
893
  quickOpenContent.innerHTML = '';
894
  const fullUrl = window.location.origin + url;
895
 
 
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%;
 
552
  </div>
553
  <div class="history-btn-container">
554
  <button id="historyBtn" class="history-btn">View Upload History</button>
555
+ <button id="copyAllBtn" class="small-btn">Copy All Links</button>
556
  <button id="clearHistoryBtn" class="clear-history-btn">Clear History</button>
557
  </div>
558
  </div>
 
599
  const embedLinkInput = document.getElementById('embedLink');
600
  const uploadBtn = document.getElementById('uploadBtn');
601
  const historyBtn = document.getElementById('historyBtn');
602
+ const copyAllBtn = document.getElementById('copyAllBtn');
603
  const clearHistoryBtn = document.getElementById('clearHistoryBtn');
604
  const historyList = document.getElementById('historyList');
605
  const quickOpenContent = document.getElementById('quickOpenContent');
 
667
  showHistory();
668
  }
669
 
670
+ copyAllBtn.onclick = function() {
671
+ const history = JSON.parse(localStorage.getItem('uploadHistory')) || [];
672
+ let allLinks = '';
673
+ history.forEach(item => {
674
+ allLinks += window.location.origin + item.url + '\n';
675
+ });
676
+ if (allLinks !== '') {
677
+ navigator.clipboard.writeText(allLinks).then(() => {
678
+ alert('All links have been copied to the clipboard!');
679
+ }).catch(err => {
680
+ alert('Failed to copy links: ' + err);
681
+ });
682
+ } else {
683
+ alert('No links to copy.');
684
+ }
685
+ }
686
+
687
  clearHistoryBtn.onclick = function() {
688
  if (confirm('Are you sure you want to clear your upload history?')) {
689
  localStorage.removeItem('uploadHistory');
 
908
  historyModal.style.display = "block";
909
  }
910
 
911
+ function quickOpen(url, fileName, originalExtension) {
912
  quickOpenContent.innerHTML = '';
913
  const fullUrl = window.location.origin + url;
914