Login ad on a clock, hop back to the asking site, 5xYourTeam in the wallets map, signed-out login slot refused (Marty 2026-11-15)
Login ad: every Control Room page asks (cr-shell.js loginAd, the per-tab sessionStorage guard is gone); the server answers with an ad only when the member's last finished view on LinkSpin is older than loginAdEveryHours (site setting, default 3). loginadclock.js (the same file as InstantAdPay), MySQL table login_ad_views through DOCSTORE_URL. POST /api/ads/login/seen at the end of the countdown restarts the clock only if the serve was dwell-2 s earlier. Member erase forgets the row. Admin site setting label.
Signed out: /api/ads/slot?type=login draws nothing and counts no view (bots, probes, previews cannot run up an advertiser's numbers).
Hop: a member who signed in here because another network site asked ("Sign in with LinkSpin", nsso.back) goes back there after the login ad (/sso/resume), from every Control Room screen, not only the retired /my.
networksso.js: the network-wide copy (loop guard 120 s, fivex, unknown r refused); fivex added to the wallets map (FIVEX_URL, default https://5xyourteam.com).
Tests: qa/networksso-partner.e2e.mjs (same file as InstantAdPay, in run.sh): partner via LinkSpin, LinkSpin clock, signed-out slot; networksso e2e retries a keep-alive ECONNRESET. qa sso: ALL PASSED; qa member: ALL PASSED (2 known warnings; networksso e2e flaked on ECONNRESET once, passes with the retry).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -195,9 +195,11 @@ window.CR = (function () {
|
||||
go.addEventListener('click', step);
|
||||
host.querySelector('.modal').addEventListener('keydown', e => { if (e.key === 'Enter') step(); });
|
||||
}
|
||||
// login ad on the member's clock (Marty 2026-11-15): every Control Room page asks; the server answers with an ad only when the
|
||||
// last finished view is older than loginAdEveryHours (loginadclock.js), and the end of the countdown restarts that clock
|
||||
let laAsked = false;
|
||||
async function loginAd() {
|
||||
let seen = false; try { seen = !!sessionStorage.getItem('ls.la'); } catch (e) {}
|
||||
if (seen) return; try { sessionStorage.setItem('ls.la', '1'); } catch (e) {}
|
||||
if (laAsked) return; laAsked = true;
|
||||
let ad = null; try { ad = (await get('/api/ads/slot?type=login')).ad; } catch (e) { return; }
|
||||
if (!ad || !ad.targetUrl) return;
|
||||
await new Promise(done => {
|
||||
@@ -210,7 +212,7 @@ window.CR = (function () {
|
||||
back.querySelector('#laOpen').addEventListener('click', () => {
|
||||
window.open(ad.targetUrl, '_blank'); back.querySelector('#laOpen').disabled = true;
|
||||
let left = ad.dwell || 10; const t = back.querySelector('#laTimer'); t.hidden = false; t.textContent = left + ' s';
|
||||
const iv = setInterval(() => { left -= 1; if (left > 0) { t.textContent = left + ' s'; return; } clearInterval(iv); t.textContent = 'done'; back.querySelector('#laStatus').textContent = 'Thanks for the look.'; back.querySelector('#laGo').hidden = false; }, 1000);
|
||||
const iv = setInterval(() => { left -= 1; if (left > 0) { t.textContent = left + ' s'; return; } clearInterval(iv); t.textContent = 'done'; fetch('/api/ads/login/seen', { method: 'POST' }).catch(() => {}); back.querySelector('#laStatus').textContent = 'Thanks for the look.'; back.querySelector('#laGo').hidden = false; }, 1000);
|
||||
});
|
||||
back.querySelector('#laGo').addEventListener('click', () => { back.remove(); done(); });
|
||||
});
|
||||
@@ -283,7 +285,10 @@ window.CR = (function () {
|
||||
const small = () => { box.innerHTML = '<span class="ink2">Remembered who invited you? <a href="#" id="inviteBack">Tell us</a></span>'; $('inviteBack').addEventListener('click', e => { e.preventDefault(); full(); $('inviteWho').focus(); }); };
|
||||
if (ask.dismissed) small(); else full();
|
||||
}
|
||||
async function requireSession(onReady) { let m = await me(); whoPaint(m); themeSync(m); if (m && m.signedIn) { strip(); helpBadge(); tankItem(); m = await ensureUsername(m); await loginAd(); inviteCard(m); return onReady(m); } signInFlow(async r => { whoPaint(r); themeSync(r); strip(); helpBadge(); await loginAd(); me(true).then(inviteCard); onReady(r); }); }
|
||||
// a network sign-in hop waiting on this sign-in (another site asked "Sign in with LinkSpin" while signed out here): finish it
|
||||
// after the login ad, back to the site and page it came from, never left on the Control Room (2026-11-15)
|
||||
const hopBack = m => { if (m && m.signedIn && m.nssoBack && m.username) { location.href = '/sso/resume'; return true; } return false; };
|
||||
async function requireSession(onReady) { let m = await me(); whoPaint(m); themeSync(m); if (m && m.signedIn) { strip(); helpBadge(); tankItem(); m = await ensureUsername(m); await loginAd(); if (hopBack(m)) return; inviteCard(m); return onReady(m); } signInFlow(async r => { whoPaint(r); themeSync(r); strip(); helpBadge(); let m2 = await me(true); m2 = await ensureUsername(m2); await loginAd(); if (hopBack(m2)) return; inviteCard(m2); onReady(m2 && m2.signedIn ? m2 : r); }); }
|
||||
// tiles with a sparkline and a delta chip (Instrument scheme, 2026-09-29): series = numbers oldest first
|
||||
function sparkline(series) {
|
||||
const s = (series || []).map(Number); if (s.length < 2 || !s.some(Boolean)) return '';
|
||||
|
||||
Reference in New Issue
Block a user