Banner Spin: the Add a banner frame follows the selected spin's size (Marty 2026-11-05: it always showed 728x90). select() never redrew the empty preview, so it kept the first spin's frame; it now redraws on every select, and a file or image address picked for another spin is dropped so it is never checked or uploaded at the wrong size. banner-spin.js?v=20261105sz

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-05 04:23:55 -06:00
parent bc4af45c01
commit 045f9522c4
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -65,6 +65,10 @@
$('bsHoursChip').textContent = LSHours.chip(s.hours, s.tz); $('bsHoursChip').classList.toggle('set', !!s.hours);
$('bsOffNote').hidden = !s.adminOff; if (s.adminOff) $('bsOffNote').textContent = 'LinkSpin took this Banner Spin offline' + (s.adminNote ? ' (' + s.adminNote + ')' : '') + '. Placements show a blank image and clicks go to the fallback. Ask on Help if you think this is a mistake.';
renderTiles(s, STATS[id]); renderBanners(s); renderSettings(s); renderCodes(s); renderAddLimit(s);
// the Add a banner frame follows the selected spin's size (Marty 11-05: it kept the first spin's 728x90); a pick made
// for another spin is dropped so it is never checked or uploaded against the wrong size
if (PEND && PEND.spin !== id) { PEND = null; $('bsFile').value = ''; $('bsImgUrl').value = ''; }
if (!PEND) preview($('bsPrev'), s, null);
if (!quiet) window.scrollTo({ top: 0 });
loadStats(id);
}
@@ -151,8 +155,8 @@
if (r.error) throw new Error(r.error); return r;
}
// add a banner: upload first when a file is chosen, then save
$('bsFile').addEventListener('change', () => { const s = cur(); if (!s) return; $('bsImgUrl').value = ''; PEND = PEND || {}; pickFile($('bsFile'), $('bsPrev'), s, PEND); });
$('bsImgUrl').addEventListener('change', async () => { const s = cur(); if (!s) return; $('bsFile').value = ''; PEND = { url: $('bsImgUrl').value.trim() }; PEND.d = await preview($('bsPrev'), s, PEND.url || null); PEND.ok = !!PEND.d; });
$('bsFile').addEventListener('change', () => { const s = cur(); if (!s) return; $('bsImgUrl').value = ''; PEND = PEND || {}; PEND.spin = s.id; pickFile($('bsFile'), $('bsPrev'), s, PEND); });
$('bsImgUrl').addEventListener('change', async () => { const s = cur(); if (!s) return; $('bsFile').value = ''; PEND = { url: $('bsImgUrl').value.trim(), spin: s.id }; PEND.d = await preview($('bsPrev'), s, PEND.url || null); PEND.ok = !!PEND.d; });
$('bsTgtKind').addEventListener('change', () => { $('bsTgtUrlWrap').hidden = $('bsTgtKind').value !== 'url'; });
$('bsAddBtn').addEventListener('click', async () => {
const s = cur(); if (!s) return; const P = PEND || {};
+1 -1
View File
@@ -272,6 +272,6 @@
</div>
<script src="/assets/cr-shell.js?v=20261102a"></script>
<script src="/assets/links.js?v=20261021t"></script>
<script src="/assets/banner-spin.js?v=20261020bs3"></script>
<script src="/assets/banner-spin.js?v=20261105sz"></script>
</body>
</html>