add bookmarks section and fix group cover lightbox
- add bookmarks table, API, admin page and public launcher - persist bookmarks in backup/restore and orphan sweep - fix group cover lightbox via shared image modal - add optional idle unload and trim-after-each to photo-ai - document bookmarks in AGENTS.md
This commit is contained in:
+4
-2
@@ -37,7 +37,7 @@ async function loadGroups() {
|
||||
return `
|
||||
<div class="group-card" data-group-id="${g.id}">
|
||||
${g.cover_path
|
||||
? `<img class="group-cover" src="${thumbSrc(g.cover_path)}" loading="lazy" decoding="async" alt="">`
|
||||
? `<img class="group-cover" src="${thumbSrc(g.cover_path)}" data-img="${API}${g.cover_path}" loading="lazy" decoding="async" alt="">`
|
||||
: `<div class="group-cover empty-cover">📷</div>`}
|
||||
<div class="group-head">
|
||||
<input class="name-input" id="name-${g.id}" value="${esc(g.name)}">
|
||||
@@ -435,10 +435,11 @@ function updateGroupCoverUI(coverPath) {
|
||||
if (!card) return;
|
||||
const g = allGroups.find(x => String(x.id) === String(currentGroupId));
|
||||
const existing = card.querySelector('.group-cover');
|
||||
if (existing && existing.tagName === 'IMG') { existing.src = API + coverPath; return; }
|
||||
if (existing && existing.tagName === 'IMG') { existing.src = API + coverPath; existing.dataset.img = API + coverPath; return; }
|
||||
const el = document.createElement('img');
|
||||
el.className = 'group-cover';
|
||||
el.src = API + coverPath;
|
||||
el.dataset.img = API + coverPath;
|
||||
el.alt = '';
|
||||
if (existing) existing.replaceWith(el);
|
||||
else card.insertBefore(el, card.firstChild);
|
||||
@@ -1239,6 +1240,7 @@ document.getElementById('photoHistoryCloseBtn')?.addEventListener('click', () =>
|
||||
document.getElementById('photoHistoryModal')?.addEventListener('click', e => {
|
||||
if (e.target === e.currentTarget) e.currentTarget.classList.remove('open');
|
||||
});
|
||||
document.getElementById('imgModal')?.addEventListener('click', e => e.currentTarget.classList.remove('open'));
|
||||
document.getElementById('photoHistoryList')?.addEventListener('click', e => {
|
||||
const rollbackBtn = e.target.closest('[data-job-rollback]');
|
||||
if (rollbackBtn) { rollbackPhotoJob(parseInt(rollbackBtn.dataset.jobRollback, 10)); return; }
|
||||
|
||||
Reference in New Issue
Block a user