Promo tools: pill menu (Social posts / Email swipes / Banners / Banner wall / Videos)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -1011,6 +1011,20 @@
|
||||
}
|
||||
document.querySelectorAll('.subtabs [data-earn]').forEach(b =>
|
||||
b.addEventListener('click', () => setEarnSub(b.dataset.earn)));
|
||||
// promo tools: pill menu switches between posts / swipes / banners / wall / videos
|
||||
function setPromoSub(name) {
|
||||
const ids = ['posts', 'swipe', 'banners', 'wall', 'videos'];
|
||||
if (!ids.includes(name)) name = 'posts';
|
||||
ids.forEach(id => { const el = $('promo-' + id); if (el) el.hidden = id !== name; });
|
||||
document.querySelectorAll('.promo-pills [data-promo]').forEach(b => {
|
||||
b.classList.toggle('on', b.dataset.promo === name);
|
||||
b.setAttribute('aria-selected', b.dataset.promo === name ? 'true' : 'false');
|
||||
});
|
||||
try { localStorage.setItem('iap.promoSub', name); } catch (e) {}
|
||||
}
|
||||
document.querySelectorAll('.promo-pills [data-promo]').forEach(b =>
|
||||
b.addEventListener('click', () => setPromoSub(b.dataset.promo)));
|
||||
try { setPromoSub(localStorage.getItem('iap.promoSub') || 'posts'); } catch (e) { setPromoSub('posts'); }
|
||||
async function loadInbox() {
|
||||
try {
|
||||
const r = await (await fetch('/api/my/inbox')).json();
|
||||
|
||||
Reference in New Issue
Block a user