125x125 sidebar banner (sized ad serving) + shorts report link

- New 125x125 "square button" banner size; ad serve now filters by width/height,
  and the sidebar slot serves a 125x125 banner (empty until such inventory exists).
- Shorts reel gets a "report this short" link (posts to /api/report-ad).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-07 08:47:17 -05:00
parent 31a6560e9e
commit ae580b966c
14 changed files with 33 additions and 21 deletions
+8 -1
View File
@@ -21,7 +21,7 @@
$('shMsg').textContent = r.status.left <= 0 ? 'That\'s today\'s shorts. Come back tomorrow.' : 'No shorts in rotation right now. Check back soon.';
return;
}
st.token = r.token; st.secs = r.ad.watchSecs;
st.token = r.token; st.secs = r.ad.watchSecs; st.adId = r.ad.id;
const v = $('shVideo');
$('shMsg').hidden = true; v.hidden = false;
v.src = r.ad.videoUrl; v.currentTime = 0;
@@ -53,6 +53,13 @@
$('shNext').hidden = false;
}
$('shNext').addEventListener('click', load);
$('shReport').addEventListener('click', e => {
e.preventDefault(); if (!st.adId) return;
const reason = (prompt('Report this short: broken, inappropriate, spam, scam, or other', 'inappropriate') || '').trim().toLowerCase();
if (!reason) return;
fetch('/api/report-ad', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ campaignId: st.adId, reason }) })
.then(() => { $('shReport').textContent = '✓ reported — thanks'; }).catch(() => {});
});
// presence enforcement: pause when the tab/window loses focus, resume on return
document.addEventListener('visibilitychange', () => {
const v = $('shVideo'); if (!v || !v.src) return;