Network Weekend (Marty 2026-11-17): +3 board days per Boost bought Fri 11-27 00:00 CT to Tue 12-01 00:00 CT, ribbon, chatbot facts

weekend.js (WEEKEND_BOOST_DAYS=0 off, WEEKEND_NOW test clock); wire.js stacks SKU days + the bonus by the purchase's chain time,
so it needs no contract change (the SKU holds 7 board days; a Boost is days, not views). /api/config, quote, order show the
weekend days. netdeals.js + /assets/netweekend.js ribbon via common.js (not admin, never framed), common.js?v=3. Chatbot FACTS line
and chatcore finish hook while live. qa/weekend.test.cjs; e2e 63/63.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-17 07:30:55 -06:00
parent def20f8ffe
commit 325d2273de
23 changed files with 200 additions and 22 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
</div>
<section id="featured" hidden style="margin-top:32px"><h2 style="font-size:24px">Featured with credits</h2><div class="ads"></div></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/adpage.js?v=2"></script>
</body>
+1 -1
View File
@@ -26,7 +26,7 @@
<section class="panel" style="margin-top:18px" id="testBox"><h2 style="font-size:22px">Staging: mark a test member</h2><p class="muted">Staging only. Lets a wallet post and reshare without a real network account.</p>
<div class="row"><input type="text" id="tAddr" placeholder="0x wallet" style="max-width:420px"><input type="text" id="tName" placeholder="username" style="max-width:200px"><button class="btn sm" id="tGo" type="button">Mark</button></div><p id="status" class="note" hidden></p></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/admin.js?v=20261117a"></script>
</body>
+7
View File
@@ -122,3 +122,10 @@ window.VAS = (function () {
};
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot); else boot();
})();
// Network Weekend ribbon (Marty 2026-11-17): netweekend.js paints it only while a network event is live (dates from the hub through
// /api/network-deals). Not on the admin page, never inside a frame.
(function () {
if (/^\/admin/.test(location.pathname)) return;
try { if (window.top !== window) return; } catch (e) { return; }
var s = document.createElement('script'); s.src = '/assets/netweekend.js?v=20261117'; s.defer = true; s.setAttribute('data-site', 'viraladsource'); document.head.appendChild(s);
})();
+67
View File
@@ -0,0 +1,67 @@
// "Network Weekend" ribbon (Marty 2026-11-17): a thin bar at the top of every network site page while a network event is live.
// Data: /api/network-deals (netdeals.js, from the hub). Switches on and off by this page's own clock at the event's exact
// startsAt / endsAt (US Central midnights), so a cached feed never shows it early or late, and it takes itself down at endsAt on
// a page left open. Shows this site's own deal for today (byDay, Central date) and links to the full deals page.
// The same file lives in every network site. Never RM Circle, never the games. No inline styles (CSP): styles go through CSSOM.
// Test clock: window.__NW_NOW (ms) before this script runs; nothing else.
(function () {
if (window.__nwRibbon) return; window.__nwRibbon = 1;
var tag = document.currentScript;
var meAttr = (tag && tag.getAttribute('data-site')) || '';
function now() { return typeof window.__NW_NOW === 'number' ? window.__NW_NOW : Date.now(); }
// late November is CST (UTC-6) for every date this ribbon covers
function ctDay(ms) { return new Date(ms - 6 * 3600 * 1000).toISOString().slice(0, 10); }
function closedKey(id, day) { return 'nw.closed.' + id + '.' + day; }
function isClosed(id, day) { try { return window.localStorage.getItem(closedKey(id, day)) === '1'; } catch (e) { return false; } }
function setClosed(id, day) { try { window.localStorage.setItem(closedKey(id, day), '1'); } catch (e) {} }
var bar = null;
function remove() { if (bar && bar.parentNode) bar.parentNode.removeChild(bar); bar = null; }
function paint(body) {
var me = meAttr || (body && body.self) || '';
var t = now();
var ev = ((body && body.events) || []).filter(function (e) { return t >= Date.parse(e.startsAt) && t < Date.parse(e.endsAt); })[0];
if (!ev) { remove(); return false; }
var day = ctDay(t);
if (isClosed(ev.id, day)) { remove(); return true; }
var mine = (ev.deals || []).filter(function (d) { return d.site === me && t < Date.parse(d.endsAt || ev.endsAt); })[0];
var line = mine ? ((mine.byDay && mine.byDay[day]) || mine.text) : '';
var label = (ev.days && ev.days[day]) || '';
var onDealsPage = ev.url && (location.origin + location.pathname) === ev.url;
remove();
bar = document.createElement('div');
bar.className = 'nw-ribbon'; bar.setAttribute('role', 'region'); bar.setAttribute('aria-label', ev.name);
bar.style.cssText = 'position:relative;z-index:50;display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;justify-content:center;padding:8px 40px 8px 16px;'
+ 'background:#14161b;color:#f4f1e8;font:600 13.5px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-align:center;border-bottom:2px solid #f2c94c';
// built node by node with CSSOM styles: no style attributes, so a strict CSP (style-src 'self') has nothing to block
function el(tagName, css, text) { var n = document.createElement(tagName); if (css) n.style.cssText = css; if (text) n.textContent = text; return n; }
var head = el('span'); head.appendChild(el('b', 'color:#f2c94c', ev.name)); if (label) head.appendChild(document.createTextNode(' · ' + label));
bar.appendChild(head);
var body2 = el('span', 'font-weight:500', line || ev.tagline);
if (line && mine && mine.note) { body2.appendChild(document.createTextNode(' ')); body2.appendChild(el('span', 'opacity:.75', mine.note)); }
bar.appendChild(body2);
if (ev.url && !onDealsPage) { var a = el('a', 'color:#f2c94c;text-decoration:underline', 'See every deal'); a.href = ev.url; a.target = '_blank'; a.rel = 'noopener'; bar.appendChild(a); }
var x = el('button', 'position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:0;color:#f4f1e8;font-size:18px;line-height:1;cursor:pointer;padding:4px 8px', '×');
x.type = 'button'; x.setAttribute('aria-label', 'Hide for today'); bar.appendChild(x);
bar.querySelector('button').addEventListener('click', function () { setClosed(ev.id, day); remove(); });
document.body.insertBefore(bar, document.body.firstChild);
return true;
}
var feed = null, timer = null;
function schedule() {
clearTimeout(timer); if (!feed) return;
// wake at the next switch moment (start, end, a deal ending, the next Central midnight), at least once a minute
var t = now(), next = t + 60 * 1000;
(feed.events || []).forEach(function (e) {
[e.startsAt, e.endsAt].concat((e.deals || []).map(function (d) { return d.endsAt; })).forEach(function (s) { var x = Date.parse(s); if (x > t && x < next) next = x; });
});
timer = setTimeout(function () { if (typeof window.__NW_NOW === 'number') window.__NW_NOW += next - t; paint(feed); schedule(); }, Math.max(250, next - t));
}
function run() {
fetch('/api/network-deals', { credentials: 'omit' }).then(function (r) { return r.ok ? r.json() : null; }).then(function (b) {
if (!b || !Array.isArray(b.events) || !b.events.length) return;
feed = b; paint(b); schedule();
}).catch(function () {});
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
window.__nwPaint = function (b) { feed = b; return paint(b); }; // tests
})();
+1 -1
View File
@@ -36,7 +36,7 @@
</div>
</div></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/wallet.js?v=2"></script>
<script src="/assets/buy.js?v=2"></script>
+1 -1
View File
@@ -22,7 +22,7 @@
<p id="status" class="note">One moment...</p>
<div class="row" style="margin-top:16px"><a class="btn ink" href="/my">Sign in</a><a class="btn" href="/">Front page</a></div>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/join.js?v=2"></script>
</body>
+1 -1
View File
@@ -27,7 +27,7 @@
<li>A sign-up reward needs a keeper-signed voucher, used once, under the per-reward cap and the per-wallet daily cap, and never more than the pot holds.</li>
<li>No proxy, no owner withdrawal of the pot, no self-destruct. The owner is Marty's Tangem hardware wallet.</li></ul></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/contract.js?v=2"></script>
</body>
+1 -1
View File
@@ -23,7 +23,7 @@
<p>Crypto prices change. A reward or payment priced in dollars is paid in POL at the price when it is paid; its value can go down afterwards. Network fees apply to every transaction.</p>
<p>Any example on this site is an illustration of how the contract splits a payment, not a prediction of what you will receive.</p>
<p>TrustClickz. Questions: <a href="https://instantadpay.com/support?from=viraladsource">network support</a>.</p></main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/static.js?v=2"></script>
</body>
+1 -1
View File
@@ -108,7 +108,7 @@
<div class="panel" id="hunt"><h3 style="margin:0 0 6px;font-size:19px">Hunt it on PolHunter</h3><p style="margin:0;color:var(--ink3)">A find code hides in one of the three "How an ad spreads" steps.</p></div>
</div></div></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/front.js?v=2"></script>
</body>
+1 -1
View File
@@ -28,7 +28,7 @@
</form>
<p id="status" class="note" hidden></p>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/join.js?v=2"></script>
</body>
+1 -1
View File
@@ -25,7 +25,7 @@
<section class="panel" style="margin-top:22px"><h2 style="font-size:26px">Sign-up rewards</h2><p class="muted" id="payNote" style="margin:6px 0 0"></p>
<div class="tbl"><table><thead><tr><th>When</th><th>Resharer</th><th>Kind</th><th>Amount</th><th>Status</th><th>Proof</th></tr></thead><tbody id="rrows"><tr><td colspan="6" class="muted">No rewards yet.</td></tr></tbody></table></div></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/ledger.js?v=2"></script>
</body>
+1 -1
View File
@@ -65,7 +65,7 @@
<div class="row" style="margin-top:22px"><button class="btn sm" id="logout" type="button">Sign out</button><button class="btn sm" id="logoutAll" type="button">Sign out everywhere</button></div>
</div>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/wallet.js?v=2"></script>
<script src="/assets/my.js?v=20261117a"></script>
+1 -1
View File
@@ -23,7 +23,7 @@
<h2>Sharing</h2><p>Your account is part of the network: your username, wallet and sponsor are shared with the network hub so one account works on every network site. We do not sell personal data. Blockchain transactions are public by nature.</p>
<h2>Your choices</h2><p>Ask network support to delete your data; the network hub removes it from every network site, except what the blockchain or the law keeps.</p>
<p>TrustClickz. Questions: <a href="https://instantadpay.com/support?from=viraladsource">network support</a>.</p></main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/static.js?v=2"></script>
</body>
+1 -1
View File
@@ -23,7 +23,7 @@
<label class="f" style="max-width:360px;margin-top:18px">Your network username<input type="text" id="kitUser" placeholder="username"></label>
<div id="kit" style="margin-top:22px"></div>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/promote.js?v=2"></script>
</body>
+1 -1
View File
@@ -50,7 +50,7 @@
<div class="panel"><h2 style="font-size:26px">Where to see it</h2><p class="muted">Your rewards and credits are on <a href="/my">My ad tree</a>. Every paid reward and every Boost split is on the <a href="/ledger">public ledger</a> with its Polygon transaction.</p></div>
</div></section>
</main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/static.js?v=2"></script>
</body>
+1 -1
View File
@@ -27,7 +27,7 @@
<h2>No promise of income</h2><p>What you buy is advertising. We do not promise any income, views, sign-ups or results. See the Earnings Disclaimer.</p>
<h2>Changes</h2><p>We can change these terms and the program's numbers going forward; a change never alters a payment already made on chain.</p>
<p>TrustClickz. Questions: <a href="https://instantadpay.com/support?from=viraladsource">network support</a>.</p></main>
<script src="/assets/common.js?v=2"></script>
<script src="/assets/common.js?v=3"></script>
<script src="/assets/chat.js?v=1" defer></script>
<script src="/assets/static.js?v=2"></script>
</body>