diff --git a/ads.js b/ads.js index f552251..0d14ba5 100644 Binary files a/ads.js and b/ads.js differ diff --git a/public/assets/common.js b/public/assets/common.js index 2348d5d..42cd5ee 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -111,9 +111,10 @@ window.IAP = (function () { const rl = el.querySelector('.ad-report'); if (rl) rl.addEventListener('click', e => { e.preventDefault(); reportAd(Number(rl.dataset.cid)); }); } - async function adSlot(type, elId) { + async function adSlot(type, elId, opts) { try { - const { ad } = await (await fetch('/api/ads/slot?type=' + type)).json(); + const q = '/api/ads/slot?type=' + type + (opts && opts.width ? '&w=' + opts.width + '&h=' + opts.height : ''); + const { ad } = await (await fetch(q)).json(); const el = $(elId); if (!ad || !el) return; if (ad.imageUrl) { diff --git a/public/assets/my.js b/public/assets/my.js index 29a911f..4d61a5f 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -1714,7 +1714,7 @@ // banner + text placements inside the back office (they ARE the audience) IAP.adSlot('banner', 'adSlotLogin'); IAP.adSlot('banner', 'adSlotOverview'); - IAP.adSlot('text', 'adSlotSide'); + IAP.adSlot('banner', 'adSlotSide', { width: 125, height: 125 }); // square button ad in the sidebar render(); })(); diff --git a/public/assets/shorts.js b/public/assets/shorts.js index 4f5b4c8..5c085ac 100644 --- a/public/assets/shorts.js +++ b/public/assets/shorts.js @@ -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; diff --git a/public/assets/site.css b/public/assets/site.css index d12d343..c96e249 100644 --- a/public/assets/site.css +++ b/public/assets/site.css @@ -574,3 +574,6 @@ img{max-width:100%} .lt-node.deep{color:var(--muted)} .lt-node.qualified{border-color:#ffb238;color:#ffd15c;box-shadow:0 0 0 1px rgba(255,177,56,.35)} .lt-node.open{border-style:dashed;color:var(--muted);background:transparent} + +.sh-report{display:block;text-align:center;margin-top:10px;color:rgba(255,255,255,.45);font-size:12px} +.sh-report:hover{color:rgba(255,255,255,.8)} diff --git a/public/contract.html b/public/contract.html index 62fb2ec..ec6f406 100644 --- a/public/contract.html +++ b/public/contract.html @@ -16,7 +16,7 @@ - +