diff --git a/frontend/app.js b/frontend/app.js index e200c1d..5319dfa 100755 --- a/frontend/app.js +++ b/frontend/app.js @@ -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 = '›'; + 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); diff --git a/frontend/index.html b/frontend/index.html index d02674d..7821ef8 100755 --- a/frontend/index.html +++ b/frontend/index.html @@ -236,12 +236,15 @@