From e7ee7d0614b68f8376b978ef0852938be3d6adb4 Mon Sep 17 00:00:00 2001 From: martbost Date: Wed, 9 Sep 2026 05:34:45 -0500 Subject: [PATCH] Promo tools: pill menu (Social posts / Email swipes / Banners / Banner wall / Videos) Co-Authored-By: Claude Fable 5.1 --- public/assets/my.js | 14 ++++++++++++++ public/my.html | 23 ++++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/public/assets/my.js b/public/assets/my.js index 123ef64..1c27ae8 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -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(); diff --git a/public/my.html b/public/my.html index 34ebe2d..1e4e311 100644 --- a/public/my.html +++ b/public/my.html @@ -534,17 +534,24 @@