Ad editing: fix the link, image, text or name of a running ad; first edit free, then campaignEditFee credits
Orlando (#30) could only pause, resume or top up a banner or login ad with a wrong link. - POST /api/my/campaigns/<id>/edit (owner) and /api/admin/campaigns/<id>/edit (any ad, free, never uses the member's free edit). Banner: link, image, name. Text: link, headline, line, name. Login and the rest: link, name. Type, size, budget, geo, schedule, audience are refused. - Create and edit share one path: checkName/checkTarget/checkBannerImage/checkTextCopy in ads.js (validate() now calls them) and adChecks() in server.js (frame check + a new banner image check: loads, is a real PNG/JPG/GIF/WebP, up to 3 MB; own uploads read off the volume). - Fee: campaigns.edits counts member edits; the first is free, each later one costs the site setting campaignEditFee (default 100, admin Settings). Charged from the engine pool via spendEarned (earned first, then credited purchased); with neither, a burn row on the best-funded position (the normal burn queue). Guarded claim so two saves cannot both be free; a failed save refunds exactly what was taken. - History: campaigns.edit_log (ts, by, fields, old/new values, fee), last 50. - NAS: clicks already route through /api/ads/click/<id>, so a new link needs no write; a new image or text goes to the NAS row via nas.updateCreative. Failures never block the edit and retry on the next reconcile pass. Open ad-viewer tokens get the new link. - UI: Edit button on the Ads screen (CR.dialog editor, real-size preview, upload, free/fee note and confirm), /ads#edit=<id> deep link from the /tools list, admin Member content shows edit count + history with an Edit action. Chatbot canned answer + FACTS. - qa/adedit.mjs: 51 checks against a throwaway DATA_DIR, Playwright screenshots in D:/tmp/ad-edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -472,6 +472,6 @@
|
||||
</div>
|
||||
|
||||
<script src="/assets/common.js?v=20261018p25"></script>
|
||||
<script src="/assets/admin.js?v=20261018p25"></script>
|
||||
<script src="/assets/admin.js?v=20261018e1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -70,6 +70,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/cr-shell.js?v=20261018c"></script>
|
||||
<script src="/assets/ads-screen.js?v=20261018a"></script>
|
||||
<script src="/assets/ads-screen.js?v=20261018e1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+27
-1
@@ -545,6 +545,7 @@
|
||||
if (d.imageUrl) line(ctImg(d.imageUrl, true) + (d.width ? ' <span class="muted small">' + d.width + '×' + d.height + '</span>' : ''));
|
||||
if (d.title || d.body) line((d.title ? '<b>' + esc(ctCut(d.title, 100)) + '</b> ' : '') + esc(ctCut(d.body, 200)));
|
||||
line('Budget ' + ctN(d.budget) + ' · spent ' + ctN(d.spent) + ' · left ' + ctN(Math.max(0, (d.budget || 0) - (d.spent || 0))) + (d.dailyCap ? ' · cap ' + ctN(d.dailyCap) + '/day' : '') + (d.geo ? ' · tiers ' + esc(d.geo) : '') + (d.starts ? ' · starts ' + ctWhen(d.starts) : '') + (d.expires ? ' · ends ' + ctWhen(d.expires) : ''));
|
||||
if (d.edits || (d.editLog && d.editLog.length)) line('Edited by the member ' + ctN(d.edits) + ' time' + (d.edits === 1 ? '' : 's') + (d.edits ? ' (first free)' : '') + (d.editLog || []).slice().reverse().map(e => '<div class="small muted">' + ctWhen(e.ts) + ' · ' + esc(e.by === 'admin' ? 'admin' : 'member') + (e.fee ? ' · ' + ctN(e.fee) + ' cr' : ' · free') + ' · ' + (e.fields || []).map(k => esc(k) + ': <s>' + esc(ctCut((e.from || {})[k], 50)) + '</s> → ' + esc(ctCut((e.to || {})[k], 50))).join('; ') + '</div>').join(''));
|
||||
} else if (r.type === 'postback') {
|
||||
line('<span class="mono small">' + esc(ctCut(d.postbackUrl, 110)) + '</span>');
|
||||
line(esc(d.method) + ' · ' + esc((d.events || []).join(', ')) + (d.lastStatus ? ' · last ' + esc(d.lastStatus) + ' ' + ctWhen(d.lastAt) : ''));
|
||||
@@ -623,11 +624,36 @@
|
||||
const m = e.target.closest('[data-ctmember]'); if (m) { e.preventDefault(); setPane('members'); return openMember(m.dataset.ctmember); }
|
||||
const b = e.target.closest('[data-ctact]'); if (!b || b.disabled) return;
|
||||
const [i, j] = b.dataset.ctact.split(':').map(Number); const r = CT.data && CT.data.items[i]; const a = r && r.actions[j]; if (!a) return;
|
||||
if (a.edit) return ctEditAd(r, a);
|
||||
if (a.warn && !await IAP.confirmBox(a.warn, { title: a.label, ok: a.label, cancel: 'Cancel' })) return;
|
||||
b.disabled = true;
|
||||
try { await api(a.path, a.body || {}, 'POST'); IAP.status(a.label + ': done.', 'ok'); await loadContent(true); } catch (err) { IAP.status(err.message, 'bad'); b.disabled = false; }
|
||||
});
|
||||
|
||||
// admin edit of any member ad (2026-10-18): the same checks as a member edit, free, and the member keeps their free one
|
||||
function ctEditAd(r, a) {
|
||||
const d = r.detail || {}; const t = d.adType;
|
||||
const F = [['name', 'Name', d.name || r.title, 60], ['targetUrl', 'Where the click goes', r.url, 0]];
|
||||
if (t === 'banner') F.push(['imageUrl', 'Image URL (' + d.width + 'x' + d.height + ')', d.imageUrl, 0]);
|
||||
if (t === 'text') F.push(['title', 'Headline (60)', d.title, 60], ['body', 'One line (140)', d.body, 140]);
|
||||
const back = document.createElement('div'); back.className = 'modal-back'; back.style.zIndex = '200';
|
||||
back.innerHTML = '<div class="modal-card" role="dialog" aria-modal="true" style="max-width:780px"><h3 style="margin:0 0 8px">Edit ad #' + esc(r.id) + ' (' + esc(t) + ')</h3><p class="muted small" style="margin:0 0 8px">Free from admin; the member keeps their free correction. Type, size, budget, countries, schedule and audience stay a new campaign.</p>'
|
||||
+ F.map(f => '<label class="small" style="display:block;margin-top:8px">' + esc(f[1]) + '<input data-k="' + f[0] + '" value="' + esc(f[2] || '') + '"' + (f[3] ? ' maxlength="' + f[3] + '"' : '') + ' style="width:100%" autocomplete="off"></label>').join('')
|
||||
+ (t === 'banner' ? '<div id="aePrev" style="margin-top:8px;max-width:100%;overflow:auto"></div>' : '')
|
||||
+ '<div style="display:flex;gap:10px;justify-content:flex-end;margin-top:16px"><button type="button" class="btn sec small" data-x="no">Cancel</button><button type="button" class="btn small" data-x="ok">Save</button></div></div>';
|
||||
document.body.appendChild(back);
|
||||
const im = back.querySelector('[data-k="imageUrl"]'); const paint = () => { const p = back.querySelector('#aePrev'); if (p) p.innerHTML = ctSafe(im.value.trim()) ? '<img src="' + esc(im.value.trim()) + '" alt="" style="width:' + d.width + 'px;height:' + d.height + 'px;display:block" referrerpolicy="no-referrer">' : ''; };
|
||||
if (im) { im.addEventListener('input', paint); paint(); }
|
||||
back.addEventListener('click', async e => {
|
||||
const x = e.target.closest('[data-x]'); if (e.target === back || (x && x.dataset.x === 'no')) return back.remove(); if (!x) return;
|
||||
const body = {}; F.forEach(f => { const v = back.querySelector('[data-k="' + f[0] + '"]').value.trim(); if (v !== String(f[2] || '').trim()) body[f[0]] = v; });
|
||||
if (!Object.keys(body).length) return IAP.status('Nothing changed.', 'bad');
|
||||
x.disabled = true;
|
||||
try { const res = await api(a.path, body, 'POST'); back.remove(); IAP.status('Ad #' + r.id + ' saved' + (res.network === 'retrying' ? ' (the network copy retries on the next pass)' : '') + '.', 'ok'); await loadContent(true); }
|
||||
catch (err) { IAP.status(err.message, 'bad'); x.disabled = false; }
|
||||
});
|
||||
}
|
||||
|
||||
// ── link domains: channel per domain, last safety check, burned flag; check now / clear / pull (2026-10-10) ──
|
||||
async function loadDomains() {
|
||||
const d = await api('/api/admin/domains');
|
||||
@@ -976,7 +1002,7 @@
|
||||
}));
|
||||
|
||||
// site settings: key / value rows; booleans as checkboxes, numbers stay numbers
|
||||
const SITE_META = { noPayoutIds: 'No-payout positions (member #s, comma): linkage only, no buys from them, no joins routed under them', siteName: 'Site name', tagline: 'Tagline', rehearsal: 'Testnet rehearsal banner', defaultSponsorId: 'Fallback sponsor (member #)', walletConnectProjectId: 'WalletConnect project id', moonpayPublicKey: 'MoonPay public key', telegramBotToken: 'Telegram proof feed: bot token', telegramChatId: 'Telegram proof feed: chat id', telegramTopicId: 'Telegram proof feed: topic id (optional)', telegramEvents: 'Telegram proof feed: events (payouts | payouts+purchases | all)', telegramCtaUrl: 'Telegram proof feed: join link under each post', aiCreditsPerGen: 'AI Copy Engine: credits per generation after the free allowance', aiFreeSurge: 'AI Copy Engine: free generations a month at Surge', aiFreeCircuit: 'AI Copy Engine: free generations a month at Circuit', aiFreeNexus: 'AI Copy Engine: free generations a month at Nexus', snapshotEnabled: 'Daily growth snapshot to Telegram (1/0)', snapshotHourUtc: 'Daily growth snapshot: hour (UTC; 14 = 9 AM Central)', snapshotTargets: 'Daily growth snapshot: targets (feed = proof channel, echo = shared payments topic; comma list)', pipelineMode: 'Pipeline board: off (coming soon card) | preview (admin account only) | on (everyone)', pipelineEta: 'Pipeline: opening date shown on the coming-soon card (e.g. Sep 28)', memberWeeklyEmail: 'Weekly member email to everyone active (1) or only sponsors with a line (0)', leaderboardWeeklyPrize: 'Leaderboard: weekly prize text (optional; blank shows the credit ladder)', leaderboardMonthlyPrize: 'Leaderboard: monthly prize text (optional)', leaderboardWeeklyCredits: 'Leaderboard: weekly credits for 1st,2nd,3rd… (e.g. 1000,500,250; blank = none)', leaderboardMonthlyCredits: 'Leaderboard: monthly credits for 1st,2nd,3rd… (e.g. 5000,2500,1000)', leaderboardAnnounceGeneral: 'Leaderboard: announce winners in the main group too (1/0)', telegramEchoChatId: 'Telegram echo (shared payments topic): chat id', telegramEchoTopicId: 'Telegram echo: topic id', telegramEchoEvents: 'Telegram echo: events (payouts | payouts+purchases | all)', legacyCreditsAdvertiser: 'Legacy welcome credits: former advertisers', legacyCreditsEarner: 'Legacy welcome credits: former earners', pnlFixedMonthlyUsd: 'P&L: fixed monthly cost (USD)' };
|
||||
const SITE_META = { noPayoutIds: 'No-payout positions (member #s, comma): linkage only, no buys from them, no joins routed under them', siteName: 'Site name', tagline: 'Tagline', rehearsal: 'Testnet rehearsal banner', defaultSponsorId: 'Fallback sponsor (member #)', walletConnectProjectId: 'WalletConnect project id', moonpayPublicKey: 'MoonPay public key', telegramBotToken: 'Telegram proof feed: bot token', telegramChatId: 'Telegram proof feed: chat id', telegramTopicId: 'Telegram proof feed: topic id (optional)', telegramEvents: 'Telegram proof feed: events (payouts | payouts+purchases | all)', telegramCtaUrl: 'Telegram proof feed: join link under each post', aiCreditsPerGen: 'AI Copy Engine: credits per generation after the free allowance', aiFreeSurge: 'AI Copy Engine: free generations a month at Surge', aiFreeCircuit: 'AI Copy Engine: free generations a month at Circuit', aiFreeNexus: 'AI Copy Engine: free generations a month at Nexus', snapshotEnabled: 'Daily growth snapshot to Telegram (1/0)', snapshotHourUtc: 'Daily growth snapshot: hour (UTC; 14 = 9 AM Central)', snapshotTargets: 'Daily growth snapshot: targets (feed = proof channel, echo = shared payments topic; comma list)', pipelineMode: 'Pipeline board: off (coming soon card) | preview (admin account only) | on (everyone)', pipelineEta: 'Pipeline: opening date shown on the coming-soon card (e.g. Sep 28)', memberWeeklyEmail: 'Weekly member email to everyone active (1) or only sponsors with a line (0)', leaderboardWeeklyPrize: 'Leaderboard: weekly prize text (optional; blank shows the credit ladder)', leaderboardMonthlyPrize: 'Leaderboard: monthly prize text (optional)', leaderboardWeeklyCredits: 'Leaderboard: weekly credits for 1st,2nd,3rd… (e.g. 1000,500,250; blank = none)', leaderboardMonthlyCredits: 'Leaderboard: monthly credits for 1st,2nd,3rd… (e.g. 5000,2500,1000)', leaderboardAnnounceGeneral: 'Leaderboard: announce winners in the main group too (1/0)', telegramEchoChatId: 'Telegram echo (shared payments topic): chat id', telegramEchoTopicId: 'Telegram echo: topic id', telegramEchoEvents: 'Telegram echo: events (payouts | payouts+purchases | all)', legacyCreditsAdvertiser: 'Legacy welcome credits: former advertisers', legacyCreditsEarner: 'Legacy welcome credits: former earners', pnlFixedMonthlyUsd: 'P&L: fixed monthly cost (USD)', campaignEditFee: 'Ad edits: credits per edit after the first, free one on each ad (0 = always free)' };
|
||||
function drawSite() {
|
||||
const wrap = $('siteForm');
|
||||
wrap.innerHTML = Object.entries(siteObj).map(([k, v]) => '<div class="kv-row"><span class="k" title="' + esc(k) + '">' + esc(SITE_META[k] || humanize(k)) + '</span>'
|
||||
|
||||
@@ -34,15 +34,48 @@
|
||||
const cr = c => c.type === 'banner' ? (c.imageUrl ? '<img class="thumb" src="' + esc(c.imageUrl) + '" alt="">' : '') + '<span class="mono muted" style="font-size:11px">' + c.width + 'x' + c.height + '</span>' : c.type === 'text' ? '<b>' + esc(c.title) + '</b><br><span class="muted" style="font-size:12px">' + esc(c.body || '') + '</span>' : '<span class="muted">full page' + (c.type === 'login' && c.expires ? '<br><span style="font-size:12px">' + (c.expires > Date.now() ? 'slot ends ' : 'ended ') + new Date(c.expires).toLocaleDateString(undefined, { month: 'short', day: 'numeric' }) + '</span>' : '') + '</span>';
|
||||
$('rows').innerHTML = cs.length ? cs.map(c => '<div class="rw"><div><b>' + esc(c.name) + '</b> <span class="tag t">' + esc(c.type) + '</span>' + (c.audience ? ' <span class="tag plain" title="audience">' + esc((((D && D.audiences) || []).find(a => a.id === c.audience) || {}).name || 'audience') + (c.audienceMode === 'exclude' ? ' · excluded' : '') + '</span>' : '') + '<br><span class="mono muted" style="font-size:11px">#' + c.id + ' · ' + esc(host(c.targetUrl)) + (c.geo ? ' · tiers ' + esc(c.geo) : '') + (c.dailyCap ? ' · cap ' + c.dailyCap + '/day' : '') + '</span></div><div>' + cr(c) + '</div><div><span class="num">' + fmt(c.spent) + '</span><span class="muted"> / ' + fmt(c.budget) + '</span><div class="bar"><i style="width:' + Math.min(100, Math.round(100 * c.spent / Math.max(1, c.budget))) + '%"></i></div></div><span class="r num">' + fmt(c.imps) + (c.impsNas ? '<br><span class="muted" style="font-size:11px">+' + fmt(c.impsNas) + ' network</span>' : '') + '</span><span class="r num">' + fmt(c.clicks) + '</span><span>' + st(c) + '</span><span style="display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap">'
|
||||
+ (c.status === 'active' ? '<button class="btn sm" type="button" data-pause="' + c.id + '">Pause</button>' : c.status === 'paused' ? '<button class="btn sm" type="button" data-resume="' + c.id + '">Resume</button>' : '')
|
||||
+ (['active', 'paused', 'out'].includes(c.status) && c.type !== 'login' ? '<button class="btn sm" type="button" data-top="' + c.id + '">Top up</button>' : '') + '</span></div>').join('')
|
||||
+ (['active', 'paused', 'out'].includes(c.status) && c.type !== 'login' ? '<button class="btn sm" type="button" data-top="' + c.id + '">Top up</button>' : '')
|
||||
+ (c.status !== 'done' ? '<button class="btn sm" type="button" data-edit="' + c.id + '" title="' + (c.edits ? 'Edit the link, ' + (c.type === 'banner' ? 'image' : c.type === 'text' ? 'text' : 'name') + ' (' + fmt(D.editFee) + ' credits)' : 'Fix the link, ' + (c.type === 'banner' ? 'image' : c.type === 'text' ? 'text' : 'name') + ' (first edit free)') + '">Edit</button>' : '') + '</span></div>').join('')
|
||||
: '<div class="rw"><span class="muted">No ads yet. Launch one: a banner, a text ad or a login-ad slot.</span></div>';
|
||||
if (D.gauntletPending) $('earnNote').insertAdjacentHTML('afterend', '<div class="muted" style="margin-top:8px">Your welcome credits unlock after the short welcome tour on <a href="/tools">the classic dashboard</a>.</div>');
|
||||
$('foot').textContent = 'views = timed views in the ad viewer plus member zones; network = the partner ad network · a paused ad keeps its credits · unspent credits return when an ad ends';
|
||||
$('rows').querySelectorAll('[data-pause]').forEach(b => b.addEventListener('click', () => act('/api/my/campaigns/' + b.dataset.pause + '/pause')));
|
||||
$('rows').querySelectorAll('[data-resume]').forEach(b => b.addEventListener('click', () => act('/api/my/campaigns/' + b.dataset.resume + '/resume')));
|
||||
$('rows').querySelectorAll('[data-top]').forEach(b => b.addEventListener('click', async () => { const v = await dialog({ title: 'Top up #' + b.dataset.top, text: 'Add credits to this ad. You have ' + fmt(D.availableCredits) + ' available.', fields: [{ k: 'credits', label: 'Credits to add', value: '25', mono: true }], ok: 'Add' }); if (!v) return; try { await api('/api/my/campaigns/' + b.dataset.top + '/topup', { credits: Number(v.credits) }); toast('Topped up.'); load(); } catch (e) { toast(e.message, true); } }));
|
||||
$('rows').querySelectorAll('[data-edit]').forEach(b => b.addEventListener('click', () => openEdit(Number(b.dataset.edit))));
|
||||
slotChip(); if (!$('composer').hidden) setType(TYPE);
|
||||
earnPaint();
|
||||
{ const hm = /^#edit=(\d+)$/.exec(location.hash || ''); if (hm) { history.replaceState(null, '', location.pathname + location.search); openEdit(Number(hm[1])); } } // /tools campaign list links here
|
||||
}
|
||||
// -- edit an ad (2026-10-18): fix the link, the image or the text. The first edit of each ad is free, then D.editFee credits.
|
||||
// Type, size, budget, countries, schedule and audience are the buy itself and stay a new campaign.
|
||||
const feeNote = c => !c.edits ? 'This edit is free (your one free correction).' : (D.editFee ? 'This edit costs ' + fmt(D.editFee) + ' credits.' : 'Edits are free right now.');
|
||||
async function openEdit(id) {
|
||||
const c = ((D && D.campaigns) || []).find(x => x.id === id); if (!c) { toast('That ad is not in your list.', true); return; }
|
||||
const fields = [{ k: 'name', label: 'Name', value: c.name, max: 60 }, { k: 'targetUrl', label: 'Where the click goes', value: c.targetUrl, mono: true }];
|
||||
if (c.type === 'banner') fields.push({ k: 'imageUrl', label: 'Image URL (' + c.width + 'x' + c.height + ')', value: c.imageUrl || '', mono: true });
|
||||
if (c.type === 'text') fields.push({ k: 'title', label: 'Headline (60)', value: c.title || '', max: 60 }, { k: 'body', label: 'One line (140)', value: c.body || '', max: 140 });
|
||||
const last = (c.editLog || []).slice(-1)[0];
|
||||
const html = '<div class="muted" style="margin:8px 0" id="edFee"><b>' + esc(feeNote(c)) + '</b> ' + (c.edits ? 'Your free correction on this ad is used.' : 'After this one, each edit costs ' + fmt(D.editFee) + ' credits.') + '</div>'
|
||||
+ '<div class="muted" style="font-size:12px;margin-bottom:6px">The type, size, budget, countries, schedule and audience stay as they are. To change those, start a new ad.' + (last ? ' Last edited ' + new Date(last.ts).toLocaleString() + '.' : '') + '</div>'
|
||||
+ (c.type === 'banner' ? '<label class="lbl">Or upload a new image (PNG, JPG, WebP, GIF up to 3 MB)<input class="field" id="edFile" type="file" accept="image/png,image/jpeg,image/webp,image/gif"></label><div class="muted" style="margin:6px 0 4px">Preview at real size</div><div id="edPrev" style="max-width:100%;overflow:auto"></div>' : '')
|
||||
+ (c.type === 'login' ? '<div class="muted" style="font-size:12px">A login ad shows the page itself, full screen, so the link is the ad.</div>' : '');
|
||||
const wait = dialog({ title: 'Edit ad #' + c.id + ' (' + c.type + ')', html, fields, ok: 'Review changes' });
|
||||
if (c.type === 'banner') { // the dialog is in the page now: wire the preview and the uploader
|
||||
const host = $('crModalHost'), inp = host.querySelector('#dlg-imageUrl'), prev = host.querySelector('#edPrev');
|
||||
const paint = () => { const u = inp.value.trim(); prev.innerHTML = /^https?:\/\//i.test(u) ? '<img src="' + esc(u) + '" alt="" style="width:' + c.width + 'px;height:' + c.height + 'px;max-width:none;display:block;border:1px solid var(--chrome-line);background:var(--inset)">' : '<span class="muted">No image yet</span>'; };
|
||||
inp.addEventListener('input', paint); paint();
|
||||
host.querySelector('#edFile').addEventListener('change', async e => { const f = e.target.files[0]; if (!f) return; try { const r = await (await fetch('/api/my/upload', { method: 'POST', headers: { 'Content-Type': f.type }, body: f })).json(); if (r.error) throw new Error(r.error); inp.value = location.origin + r.url; paint(); toast('Uploaded.'); } catch (er) { toast(er.message, true); } });
|
||||
}
|
||||
const v = await wait; if (!v) return;
|
||||
const label = { name: 'name', targetUrl: 'link', imageUrl: 'image', title: 'headline', body: 'text line' };
|
||||
const changed = Object.keys(v).filter(k => String(v[k]).trim() !== String(c[k] || '').trim());
|
||||
if (!changed.length) { toast('Nothing changed.'); return; }
|
||||
const ok = await dialog({ title: 'Save the new ' + changed.map(k => label[k]).join(', ') + '?', text: feeNote(c) + (c.edits && D.editFee ? ' It comes out of your earned credits first, then purchased.' : ''), ok: c.edits && D.editFee ? 'Save and pay ' + fmt(D.editFee) : 'Save' });
|
||||
if (!ok) return;
|
||||
const body = {}; changed.forEach(k => { body[k] = v[k].trim(); });
|
||||
try { const r = await api('/api/my/campaigns/' + c.id + '/edit', body); toast('Saved.' + (r.fee ? ' ' + fmt(r.fee) + ' credits charged.' : '') + (r.warn ? ' ' + r.warn : '')); load(); }
|
||||
catch (e) { toast(e.message, true); }
|
||||
}
|
||||
async function act(path) { try { await api(path, {}); load(); } catch (e) { toast(e.message, true); } }
|
||||
// -- earn by viewing: the engine's fraud-guarded flow (server-timed dwell + a human check) runs inside /view/<token>
|
||||
|
||||
@@ -827,6 +827,7 @@
|
||||
+ '<td class="act">' + (c.status === 'active' ? '<button class="btn small sec" data-camp="' + c.id + '" data-act="pause">Pause</button>'
|
||||
: c.status === 'paused' ? '<button class="btn small sec" data-camp="' + c.id + '" data-act="resume">Resume</button>' : '')
|
||||
+ ' <button class="btn small sec" data-topup="' + c.id + '">Buy more views</button>'
|
||||
+ (c.status !== 'done' ? ' <a class="btn small sec" href="/ads#edit=' + c.id + '" title="Fix the link, image or text on the Ads screen (first edit free)">Edit</a>' : '')
|
||||
+ '</td></tr>').join('') + '</tbody></table>';
|
||||
el.appendChild(tbl);
|
||||
el.querySelectorAll('button[data-camp]').forEach(b => b.addEventListener('click', async () => {
|
||||
|
||||
+1
-1
@@ -1012,7 +1012,7 @@
|
||||
<script src="/assets/tools.js?v=20261011a"></script>
|
||||
<script src="/assets/wallet.js?v=20261018a"></script>
|
||||
<script src="/assets/promo.js?v=20261009b"></script>
|
||||
<script src="/assets/my.js?v=20261018pc"></script>
|
||||
<script src="/assets/my.js?v=20261018pe1"></script>
|
||||
<script src="/assets/chat.js?v=20261016a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user