My Spots: 'Use a LinkSpin Banner Spin' (two taps: pick a 468x60 spin, image + tracking link fill and save). Refuel spots: /api/partner/refuel-spot (signed) queues one buyFor per $50+ counted refuel tx, bought from the engine wallet with a 3 POL reserve, every cost recorded (refuelspots.js); never sends at the same time as the keeper. my.js?v=5, line.css?v=4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+26
-1
@@ -42,9 +42,34 @@
|
||||
el.innerHTML = head + '<div class="lots" style="align-items:flex-start"></div>'
|
||||
+ '<div class="field"><label class="small muted">Target link (https)</label><input data-k="link" placeholder="https://your-site.com/page" value="' + esc(s.link || '') + '"><span class="small muted">Tracking: {clickid}, {spot} and {type} in your link are filled on every click (LinkSpin has a Downline Banners source ready for this).</span></div>'
|
||||
+ '<div class="field"><label class="small muted">Image address (https), or upload below</label><input data-k="img" placeholder="https://your-site.com/image.png" value="' + esc(String(s.img || '').startsWith('/art/u/') ? '' : s.img || '') + '"></div>'
|
||||
+ '<div class="row"><button class="btn small" data-a="save">Save</button><label class="btn sec small">Upload image<input type="file" accept="image/png,image/jpeg,image/gif" hidden></label></div>';
|
||||
+ '<div class="row"><button class="btn small" data-a="save">Save</button><label class="btn sec small">Upload image<input type="file" accept="image/png,image/jpeg,image/gif" hidden></label>'
|
||||
+ '<button class="btn sec small" data-a="ls">Use a LinkSpin Banner Spin</button></div><div class="ls-pick" hidden></div>';
|
||||
const prev = el.querySelector('.lots'); prev.appendChild(BL.tile({ t: 'x', img: (s.showing && s.showing.img) || '/art/house-line.svg', href: s.link || '#' }));
|
||||
const url = kind === 'spot' ? '/api/my/spot/' + s.id : '/api/my/default';
|
||||
// LinkSpin Banner Spin (2026-11-13): pick one of your 468x60 spins; the image and the tracking link fill in and save
|
||||
const pick = el.querySelector('.ls-pick');
|
||||
el.querySelector('[data-a=ls]').onclick = async () => {
|
||||
pick.hidden = false; pick.innerHTML = '<p class="small muted">Looking up your LinkSpin Banner Spins...</p>';
|
||||
const d = await BL.getJSON('/api/my/lsspins');
|
||||
if (d.error) { pick.innerHTML = '<p class="note err small">' + esc(d.error) + '</p>'; return; }
|
||||
const make = '<a href="https://linkspin.app/links#b" target="_blank" rel="noopener">make one on LinkSpin</a>';
|
||||
if (!d.account) { pick.innerHTML = '<p class="small">No LinkSpin account holds this wallet yet. Join LinkSpin (free) with the same email as InstantAdPay, link this wallet there, then ' + make + '.</p>'; return; }
|
||||
if (!d.spins.length) { pick.innerHTML = '<p class="small">You have no 468x60 Banner Spin yet: ' + make + ', then come back and tap the button again.</p>'; return; }
|
||||
pick.innerHTML = '<p class="small muted">Pick a 468x60 Banner Spin. Its rotating image and tracking link go on this spot, and LinkSpin reports clicks under your Downline Banners source.</p><div class="row"></div>';
|
||||
const row = pick.querySelector('.row');
|
||||
for (const sp of d.spins) {
|
||||
const bt = document.createElement('button'); bt.className = 'btn sec small'; bt.textContent = sp.name + ' (' + sp.banners + ' banners' + (sp.paused ? ', paused' : '') + ')';
|
||||
bt.onclick = async () => {
|
||||
BL.status('Connecting your Banner Spin...');
|
||||
const u = await BL.post('/api/my/lsspins/use', { spinId: sp.id });
|
||||
if (u.error || !u.use) return BL.status(u.error || 'Could not use that Banner Spin.', 'err');
|
||||
el.querySelector('[data-k=link]').value = u.use.link; el.querySelector('[data-k=img]').value = u.use.img;
|
||||
el.querySelector('[data-a=save]').click();
|
||||
if (u.use.otherSource) BL.status('Saved. This Banner Spin already reports under another LinkSpin source, so clicks stay there.', 'ok');
|
||||
};
|
||||
row.appendChild(bt);
|
||||
}
|
||||
};
|
||||
el.querySelector('[data-a=save]').onclick = async () => {
|
||||
const link = el.querySelector('[data-k=link]').value.trim(), img = el.querySelector('[data-k=img]').value.trim();
|
||||
const body = { link }; if (img || !String(s.img || '').startsWith('/art/u/')) body.img = img;
|
||||
|
||||
Reference in New Issue
Block a user