Network Weekend (Marty 2026-11-17): ribbon, WEEKEND500 start gate, date-gated chatbot fact
- netdeals.js + /api/network-deals (hub /v1/network-deals) and /assets/netweekend.js loaded from common.js and netline.js: the ribbon shows only Fri 11-27 00:00 CT to Tue 12-01 00:00 CT by the page's own clock (common/netline ?v=20261117nw) - promos: optional starts (MySQL promo_codes.starts) so a code can be created dormant and open by itself; setClock for tests - weekendfact.js: chatbot FACTS for the event (live deal lines from the hub) Fri to Mon, the WEEKEND500 line to Tue 12-08 00:00 CT - qa/networkweekend.test.cjs: 8 pass (test clocks only) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -548,7 +548,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/admin-kb.js?v=20261020kb"></script>
|
||||
<script src="/assets/admin.js?v=20261115la"></script><script src="/assets/admin-sponsorcheck.js?v=20261107tg"></script><script src="/assets/admin-refill.js?v=20261024rf"></script><script src="/assets/admin-kits.js?v=20261024kit"></script><script src="/assets/admin-launchweek.js?v=20261105lw"></script>
|
||||
</body>
|
||||
|
||||
@@ -313,3 +313,6 @@ window.IAP = (function () {
|
||||
a.href = '/go/iap?to=' + encodeURIComponent(u.pathname + u.search + u.hash);
|
||||
}, true);
|
||||
})();
|
||||
|
||||
// Network Weekend ribbon (Marty 2026-11-17): netweekend.js paints it only while a network event is live (dates from the hub)
|
||||
(function () { try { if (window.__nwRibbon || document.querySelector('script[src^="/assets/netweekend.js"]')) return; var s = document.createElement('script'); s.src = '/assets/netweekend.js?v=20261117a'; s.defer = true; s.setAttribute('data-site', 'linkspin'); (document.head || document.documentElement).appendChild(s); } catch (e) {} })();
|
||||
|
||||
@@ -36,3 +36,6 @@
|
||||
}
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
|
||||
})();
|
||||
|
||||
// Network Weekend ribbon (Marty 2026-11-17): netweekend.js paints it only while a network event is live (dates from the hub)
|
||||
(function () { try { if (window.__nwRibbon || document.querySelector('script[src^="/assets/netweekend.js"]')) return; var s = document.createElement('script'); s.src = '/assets/netweekend.js?v=20261117a'; s.defer = true; s.setAttribute('data-site', 'linkspin'); (document.head || document.documentElement).appendChild(s); } catch (e) {} })();
|
||||
|
||||
@@ -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
|
||||
})();
|
||||
@@ -149,6 +149,6 @@
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/contract.js?v=20261023ov"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -284,6 +284,6 @@
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/conversion-guide.js?v=20261024ct"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/wallet.js?v=20261021a"></script>
|
||||
<script src="/assets/cr-shell.js?v=20261115hub"></script>
|
||||
<script src="/assets/credits-screen.js?v=20261107tg"></script>
|
||||
|
||||
@@ -47,6 +47,6 @@
|
||||
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@
|
||||
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -225,6 +225,6 @@
|
||||
</footer>
|
||||
|
||||
<script src="/assets/home.js?v=20261113me"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -106,8 +106,8 @@ body.squeeze .card{position:sticky;top:16px}
|
||||
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/join.js?v=20261111b4h"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@
|
||||
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/launch.js?v=20261105po"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@
|
||||
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/ledger.js?v=20261007a"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -1015,7 +1015,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/cr-shell.js?v=20261115hub"></script>
|
||||
<script src="/assets/tools.js?v=20261011a"></script>
|
||||
<script src="/assets/wallet.js?v=20261021a"></script>
|
||||
|
||||
@@ -131,8 +131,8 @@
|
||||
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford to lose.</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/partners.js?v=20261010a"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@
|
||||
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/plays.js?v=20260910b"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -56,6 +56,6 @@
|
||||
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -289,6 +289,6 @@
|
||||
</footer>
|
||||
|
||||
<script src="/assets/publishers.js?v=20261010a"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -281,6 +281,6 @@
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/refuel-guide.js?v=20261024rg"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -67,8 +67,8 @@
|
||||
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/support.js?v=20261016a"></script>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -62,6 +62,6 @@
|
||||
<span class="mono" style="font-size:11px">a Crypto Team Build Network property</span>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/assets/netline.js?v=20261116ad" data-site="linkspin"></script>
|
||||
<script src="/assets/netline.js?v=20261117nw" data-site="linkspin"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
<p><a href="/ledger">← Back to the live ledger</a> · <a href="/contract">Read the contract review</a></p>
|
||||
</div>
|
||||
</section>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/tx.js?v=20260906m"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/wall.js?v=20261030pp"></script>
|
||||
<script src="/assets/wall-founder.js?v=20261105fd"></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@
|
||||
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never share your recovery phrase.</div>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261116ad"></script>
|
||||
<script src="/assets/common.js?v=20261117nw"></script>
|
||||
<script src="/assets/wallets.js?v=20261026a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user