Merge Queue and Playlist into one Add button and put Service mode in the common actions

This commit is contained in:
Claude
2026-10-01 21:17:37 +00:00
parent 859ecd2255
commit 36fc5ff9e4
3 changed files with 38 additions and 4 deletions

View File

@@ -2602,6 +2602,29 @@ function openMoreControls() {
showModal('More controls', list, [{ label: 'Done', onClick: closeModal }]);
}
// "+ Add": one button, then a small choice between the queue and a playlist.
function openAddChoice() {
if (!current || !current.meta) return;
const video = current.meta;
const list = document.createElement('div');
list.className = 'more-list';
const row = (icon, title, sub, fn) => {
const r = document.createElement('button');
r.type = 'button';
r.className = 'more-row';
r.innerHTML = '<span class="more-ico"></span><span class="more-txt"><b></b><small></small></span><span class="more-go">›</span>';
r.querySelector('.more-ico').textContent = icon;
r.querySelector('b').textContent = title;
r.querySelector('small').textContent = sub;
r.onclick = () => { closeModal(); setTimeout(fn, 0); };
list.appendChild(r);
};
row('▶', 'Add to queue', 'Play it next in this session', () => addToQueue(video));
row('☰', 'Add to playlist', 'Save it to one of your playlists', () => openCardMenu(video));
showModal('Add “' + (video.title || 'video').slice(0, 40) + '”', list, [{ label: 'Cancel', onClick: closeModal }]);
}
// "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.
@@ -9484,6 +9507,8 @@ document.querySelectorAll('.chip').forEach((c) => {
}
});
if ($('moreBtn')) $('moreBtn').addEventListener('click', openMoreActions);
if ($('addBtn')) $('addBtn').addEventListener('click', openAddChoice);
if ($('serviceBtn')) $('serviceBtn').addEventListener('click', () => enterServiceMode());
if ($('ctlMoreBtn')) $('ctlMoreBtn').addEventListener('click', openMoreControls);
if ($('exportBtn')) $('exportBtn').addEventListener('click', () => { if (current && current.meta) exportToDevice(current.meta); });
els.addPlaylistBtn.addEventListener('click', () => {