Rail shows Training, Pipeline, Profile; profile carry-over from InstantAdPay; hero frame + relative page images; the "how is this different from InstantAdPay" answer
- Control Room rail: Training, Pipeline and Profile are first-class entries (phone bar keeps them behind More)
- /api/partner/registry: rows may carry profile {avatarUrl, bio, socials}; fills only empty fields on this side, member edits win after that
- Pages: uploaded images are stored as /u/pages/... paths (any host, local recordings included); the split hero frame keeps a 3:2 shape with a tinted ground when an image fails to load (was a thin white bar)
- Home page section + chatbot canned answer + FACTS: InstantAdPay = marketplace, LinkSpin = tool side, same line and wallet
- asset tags bumped to 20261011a
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -16,11 +16,14 @@ window.CR = (function () {
|
||||
['team', 'Team', '/team', '<circle cx="9" cy="8" r="3"/><circle cx="17" cy="9" r="2.5"/><path d="M3 19c0-3 3-5 6-5s6 2 6 5M15 15c3 0 6 1.5 6 4"/>'],
|
||||
['wallet', 'Wallet', '/wallet', '<rect x="3" y="6" width="18" height="12" rx="2"/><path d="M16 12h3"/>'],
|
||||
['promo', 'Promo tools', '/tools#promo', '<path d="M7 10s5-1 9-5v14c-4-4-9-5-9-5H5a2 2 0 0 1-2-2v0a2 2 0 0 1 2-2h2z"/><path d="M8 15l1 5h2l-1-5"/>'],
|
||||
['training', 'Training', '/tools#training', '<rect x="3" y="5" width="18" height="13" rx="2"/><path d="M10 9l5 2.5-5 2.5z"/>', 1],
|
||||
['pipeline', 'Pipeline', '/tools#pipeline', '<rect x="3" y="5" width="5" height="14" rx="1"/><rect x="9.5" y="5" width="5" height="10" rx="1"/><rect x="16" y="5" width="5" height="7" rx="1"/>', 1],
|
||||
['profile', 'Profile', '/tools#profile', '<circle cx="12" cy="8" r="3.5"/><path d="M5 20c0-4 3-6 7-6s7 2 7 6"/>', 1],
|
||||
['tools', 'More', '/tools', '<circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/>'],
|
||||
];
|
||||
// screens not built yet fall back to the classic dashboard pane so nothing is a dead end
|
||||
const FALLBACK = {}; // the classic /my dashboard is retired (2026-10-08); its leftover panes live at /tools
|
||||
const BUILT = new Set(['links', 'pages', 'zones', 'ads', 'credits', 'reports', 'team', 'wallet', 'tools', 'promo']);
|
||||
const BUILT = new Set(['links', 'pages', 'zones', 'ads', 'credits', 'reports', 'team', 'wallet', 'tools', 'promo', 'training', 'pipeline', 'profile']); // Training, Pipeline and Profile on the rail, not behind More (Marty 2026-10-11)
|
||||
let ME = null, toastT;
|
||||
function toast(msg, bad) { let t = $('crToast'); if (!t) { t = document.createElement('div'); t.id = 'crToast'; t.className = 'toast'; t.setAttribute('role', 'status'); document.body.appendChild(t); } t.textContent = msg; t.classList.toggle('bad', !!bad); t.classList.add('on'); clearTimeout(toastT); toastT = setTimeout(() => t.classList.remove('on'), 2000); }
|
||||
async function api(path, body) { const r = await (await fetch(path, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body || {}) })).json(); if (r.error) throw new Error(r.error); return r; }
|
||||
@@ -47,7 +50,7 @@ window.CR = (function () {
|
||||
const page = $('page'); if (!page) return;
|
||||
const app = document.createElement('div'); app.className = 'app'; let railWide = true; try { railWide = localStorage.getItem('cr.rail') !== 'narrow'; } catch (e) {} if (railWide) app.classList.add('wide'); // expanded by default (Marty 2026-10-08), the choice remembered per browser
|
||||
app.innerHTML = '<nav class="rail" aria-label="LinkSpin"><a class="mark" href="/" aria-label="LinkSpin home" title="LinkSpin"></a>'
|
||||
+ NAV.map(([k, label, href, svg]) => '<a href="' + (BUILT.has(k) ? href : FALLBACK[k]) + '"' + (k === o.active ? ' class="on" aria-current="page"' : '') + ' title="' + label + '" aria-label="' + label + '"><svg viewBox="0 0 24 24">' + svg + '</svg><span class="lbl">' + label + '</span></a>').join('')
|
||||
+ NAV.map(([k, label, href, svg, sec]) => '<a href="' + (BUILT.has(k) ? href : FALLBACK[k]) + '"' + (k === o.active ? ' class="on' + (sec ? ' sec' : '') + '" aria-current="page"' : (sec ? ' class="sec"' : '')) + ' title="' + label + '" aria-label="' + label + '"><svg viewBox="0 0 24 24">' + svg + '</svg><span class="lbl">' + label + '</span></a>').join('')
|
||||
+ '<span class="sp"></span><button class="railtog" type="button" id="crRailTog" title="Collapse or expand the menu" aria-label="Collapse or expand the menu"><svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span class="lbl">Collapse</span></button></nav>'
|
||||
+ '<div class="main"><div class="topbar"><div><div class="crumb">' + esc(o.crumb || 'Control room') + '</div><h1>' + esc(o.title || '') + '</h1></div><span class="readout" id="crSub">' + esc(o.sub || '') + '</span><span class="grow"></span><span id="crActions">' + (o.actions || '') + '</span><button class="who" type="button" id="crUserBtn" title="Account"><i id="crAv"></i><span id="crWho">Sign in</span></button></div><div id="crBody"></div>'
|
||||
+ '<div class="strip" id="crStrip"><span><span class="dot off" id="stDot"></span>rotator <b id="stHealth">checking</b></span><span>served today <b id="stServed">·</b></span><span>zones live <b id="stZones">·</b></span><span>network <b id="stNet">·</b></span><span class="grow"></span><span id="stClock"></span></div></div>';
|
||||
|
||||
@@ -174,7 +174,7 @@ label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.
|
||||
@media (max-width:760px){
|
||||
.app{grid-template-columns:1fr}
|
||||
.rail{position:fixed;top:auto;bottom:0;left:0;right:0;height:auto;flex-direction:row;justify-content:space-around;padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px));border-right:0;border-top:1px solid var(--chrome-line);z-index:30}
|
||||
.rail .mark,.rail .sp,.railtog,.rail .lbl{display:none} .rail a.on::before{display:none}
|
||||
.rail .mark,.rail .sp,.railtog,.rail .lbl,.rail a.sec{display:none} .rail a.on::before{display:none}
|
||||
.app.wide{grid-template-columns:1fr} .app.wide .rail{align-items:center;padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px))} .app.wide .rail a{width:40px;justify-content:center;padding:0}
|
||||
.main{padding-bottom:64px;min-height:auto}
|
||||
.topbar{padding:10px 16px;flex-wrap:wrap;gap:10px 14px} .topbar .readout{display:none}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// the member's hosted images: a strip of thumbnails under the image field, click to use, x to delete
|
||||
function drawImages() {
|
||||
const box = $('imgStrip'); if (!box) return;
|
||||
box.innerHTML = (IMAGES.length ? IMAGES.map(i => '<span class="im" data-url="' + esc(i.url) + '" title="Use this image"><img src="' + esc(i.url) + '" alt="" loading="lazy"><button type="button" class="x" data-del="' + i.id + '" title="Delete this image">×</button></span>').join('') : '<span class="muted" style="font-size:11px">No uploads yet. PNG, JPG or WebP up to 2 MB, ' + IMG_MAX + ' per account.</span>')
|
||||
box.innerHTML = (IMAGES.length ? IMAGES.map(i => '<span class="im" data-url="' + esc(i.path || i.url) + '" title="Use this image"><img src="' + esc(i.url) + '" alt="" loading="lazy"><button type="button" class="x" data-del="' + i.id + '" title="Delete this image">×</button></span>').join('') : '<span class="muted" style="font-size:11px">No uploads yet. PNG, JPG or WebP up to 2 MB, ' + IMG_MAX + ' per account.</span>')
|
||||
+ (IMAGES.length ? '<span class="muted mono" style="font-size:11px;align-self:center">' + IMAGES.length + '/' + IMG_MAX + '</span>' : '');
|
||||
box.querySelectorAll('.im').forEach(s => s.addEventListener('click', e => { if (e.target.closest('[data-del]')) return; const f = $('f-image'); if (f) { f.value = s.dataset.url; f.dispatchEvent(new Event('input')); toast('Image URL filled in. Save to keep it.'); } }));
|
||||
box.querySelectorAll('[data-del]').forEach(b => b.addEventListener('click', async e => { e.stopPropagation(); if (!await dialog({ title: 'Delete this image?', text: 'Pages that still point at it will show no image.', ok: 'Delete', danger: true })) return; try { const r = await api('/api/my/pages/images/' + b.dataset.del, { remove: true }); IMAGES = r.images || []; drawImages(); } catch (er) { toast(er.message, true); } }));
|
||||
@@ -35,7 +35,7 @@
|
||||
const btn = $('imgUpload'); if (btn) { btn.disabled = true; btn.textContent = 'Uploading…'; }
|
||||
try {
|
||||
const r = await (await fetch('/api/my/pages/upload', { method: 'POST', headers: { 'Content-Type': file.type }, body: file })).json(); if (r.error) throw new Error(r.error);
|
||||
IMAGES.unshift(r.image); drawImages(); const f = $('f-image'); if (f) { f.value = r.image.url; f.dispatchEvent(new Event('input')); } toast('Uploaded. Save to keep it on the page.');
|
||||
IMAGES.unshift(r.image); drawImages(); const f = $('f-image'); if (f) { f.value = r.image.path || r.image.url; f.dispatchEvent(new Event('input')); } toast('Uploaded. Save to keep it on the page.');
|
||||
} catch (e) { toast(e.message, true); }
|
||||
if (btn) { btn.disabled = false; btn.textContent = 'Upload image'; }
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
(function () {
|
||||
const TITLES = { overview: 'Start', promo: 'Promo tools', training: 'Training', pipeline: 'Pipeline', line: 'My line', profile: 'Profile' };
|
||||
const pane = () => { const h = (location.hash || '').slice(1); return TITLES[h] ? h : 'overview'; };
|
||||
const railKey = p => p === 'promo' ? 'promo' : 'tools';
|
||||
const railKey = p => ({ promo: 'promo', training: 'training', pipeline: 'pipeline', profile: 'profile' })[p] || 'tools';
|
||||
CR.mount({ active: railKey(pane()), title: TITLES[pane()], crumb: 'Control room', sub: '' });
|
||||
function sync() {
|
||||
const p = pane(); const h1 = document.querySelector('.topbar h1'); if (h1) h1.textContent = TITLES[p];
|
||||
document.title = TITLES[p] + ' · LinkSpin';
|
||||
const want = railKey(p) === 'promo' ? '/tools#promo' : '/tools';
|
||||
const want = railKey(p) === 'tools' ? '/tools' : '/tools#' + p;
|
||||
document.querySelectorAll('.rail a').forEach(a => { const href = a.getAttribute('href') || ''; if (href.startsWith('/tools')) a.classList.toggle('on', href === want); });
|
||||
}
|
||||
window.addEventListener('hashchange', sync); sync();
|
||||
|
||||
Reference in New Issue
Block a user