Move rarely used video actions into a More actions sheet

This commit is contained in:
Claude
2026-10-01 20:55:04 +00:00
parent 47826536a6
commit 88f878b8eb
3 changed files with 64 additions and 4 deletions

View File

@@ -2525,6 +2525,37 @@ async function offerPeerDownload(videoObj) {
els.playerPane.appendChild(btn);
}
// "More actions" sheet: the everyday four stay on the page, the rest live here.
// Each row drives the original (hidden) button, so handlers and the hidden /
// disabled state those buttons already manage keep working.
function openMoreActions() {
const defs = [
['editBtn', '✂', 'Edit and download', 'Trim a clip, adjust quality and export'],
['shareMomentBtn', '🔗', 'Share moment', 'Link, GIF or soundbite of this exact second'],
['externalBtn', '📺', 'Open in…', 'VLC, MX Player or another app'],
['brokenBtn', '⚠', 'Report broken video', 'Won’t play, out of sync or glitchy — re-download it', true],
];
const list = document.createElement('div');
list.className = 'more-list';
for (const [id, icon, title, sub, danger] of defs) {
const src = $(id);
if (!src || src.hidden) continue;
const row = document.createElement('button');
row.type = 'button';
row.className = 'more-row' + (danger ? ' danger' : '');
row.disabled = !!src.disabled;
row.innerHTML = '<span class="more-ico"></span><span class="more-txt"><b></b><small></small></span><span class="more-go">›</span>';
row.querySelector('.more-ico').textContent = icon;
row.querySelector('b').textContent = title;
row.querySelector('small').textContent = sub;
row.onclick = () => { closeModal(); setTimeout(() => src.click(), 0); };
list.appendChild(row);
}
if (!list.children.length) { toast('No more actions for this video'); return; }
showModal('More actions', list, [{ label: 'Close', onClick: closeModal }]);
}
// Reflect cache state on the now-playing Save button.
function updateNowPlayingActions() {
if (!current || !current.meta) return;
@@ -9350,6 +9381,7 @@ document.querySelectorAll('.chip').forEach((c) => {
await preload(current.meta);
}
});
if ($('moreBtn')) $('moreBtn').addEventListener('click', openMoreActions);
if ($('exportBtn')) $('exportBtn').addEventListener('click', () => { if (current && current.meta) exportToDevice(current.meta); });
els.addPlaylistBtn.addEventListener('click', () => {
if (current && current.meta) openCardMenu(current.meta);