From b25b4c67fe3fcc7be8beba9d6dfab8edeefd479f Mon Sep 17 00:00:00 2001 From: martbost Date: Sun, 6 Sep 2026 08:53:35 -0500 Subject: [PATCH] Buy more views: top up any campaign's budget, reactivates spent/paused ones (+NAS extend) Co-Authored-By: Claude Fable 5 --- ads.js | Bin 46228 -> 47850 bytes public/assets/my.js | 9 +++++++++ public/contract.html | 8 ++++---- public/index.html | 10 +++++----- public/ledger.html | 8 ++++---- public/my.html | 10 +++++----- public/tx.html | 6 +++--- public/view.html | 4 ++-- public/wall.html | 6 +++--- server.js | 9 +++++++++ 10 files changed, 44 insertions(+), 26 deletions(-) diff --git a/ads.js b/ads.js index 928ee09dd8916e20c35eed529064fc431321802d..9827cdaf9fc0d1d28382fdee9555c25c605f0f87 100644 GIT binary patch delta 1141 zcmZWp&ubGw6o!B(@lv&oKPvjF(Cns58h@aWxQ(?`tk5EA+e0aKvNLTKlG$ZuHZi2J zCoh61jCzR&#cM4E{|doBLN9`P?p1uVn>LYNlHtAYy*Js>;&X zu+HigCa{b&h+iX>8UrtZJ0MA&frv0fBu2LwQGUQ}2LvOY@*6}k@D=#$=C?|y=_eu% zL8KrM(8Q{cM3PYl2&cfFDu#bJ7-Wl6-@|$e3)7E)P}2kxNX(ZIaF$OK#CWhCahw!z zP(hel40WzMI&az?kg}nj2Jiwdm5G82^F&qi>$M;d)$p?_q~ zEKOq}QBY$9yId*kE0E7Z$3TtW5Z^Co5mP0mEzGXZ*tG6~IhF6*zK zPUt_;kY36S>F3>(=|t~23T6GSJ9Zk1Q0R|fL~xYE1^umi{bK);Fa=>GyedI0VFD7E zUds%pszkTnkGt04w2i>5{XYdkn%JCH@{F5JQ_IE~pg-^2)a92)axsx7td2%-%UK6j zdiwbkcOEBKZF{A#YNz$zovZq6?%Xk>;uyBo-=k5(@m3-MXU#i_4PCToGvD*%gjrFa z?tqPAm?p1>b>YK#J@xjue(@@^m6W++Jkp=;h^AgDNZC4QMmn4CAgoLq`@q^1fAZN3`DI;O|?R1L+n=vuAyn6gO6Hy zRj@GLHiJ89eLEVtf!!D_8f~54>o4|648B$b^)=TYpN)Lk+wLAc<(SvC7|!&*A;$Fo E0GsrIasU7T delta 23 fcmaF$m1)XLrVY>5OkQ5czu9K' + (c.status === 'out' ? 'budget spent' : c.status) + '' + '' + (c.status === 'active' ? '' : c.status === 'paused' ? '' : '') + + ' ' + '').join('') + ''; el.appendChild(tbl); el.querySelectorAll('button[data-camp]').forEach(b => b.addEventListener('click', async () => { try { await api('/api/my/campaigns/' + b.dataset.camp + '/' + b.dataset.act); await loadCampaigns(); } catch (e) { IAP.status(e.message, 'bad'); } })); + el.querySelectorAll('button[data-topup]').forEach(b => b.addEventListener('click', async () => { + const n = prompt('How many credits to add to this campaign? (buys more views)'); + if (!n) return; + try { const r = await api('/api/my/campaigns/' + b.dataset.topup + '/topup', { credits: Number(n) }); + IAP.status('Added ' + r.added + ' credits' + (r.reactivated ? ' — campaign is live again.' : '.'), 'ok'); + await loadCampaigns(); loadDashboard(); + } catch (e) { IAP.status(e.message, 'bad'); } + })); } catch (e) {} } let lastRates = null; diff --git a/public/contract.html b/public/contract.html index 409f488..d721155 100644 --- a/public/contract.html +++ b/public/contract.html @@ -5,7 +5,7 @@ The contract | InstantAdPay - +
@@ -129,8 +129,8 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.
- - - + + + diff --git a/public/index.html b/public/index.html index c3e3b25..99c1515 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ InstantAdPay: advertise and earn, locked in code - + @@ -410,9 +410,9 @@ - - - - + + + + diff --git a/public/ledger.html b/public/ledger.html index 038f034..74bd76e 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -5,7 +5,7 @@ Live ledger | InstantAdPay - +
@@ -25,8 +25,8 @@
- - - + + + diff --git a/public/my.html b/public/my.html index daee14a..2a2ce28 100644 --- a/public/my.html +++ b/public/my.html @@ -4,7 +4,7 @@ Member area | InstantAdPay - + @@ -545,9 +545,9 @@ - - - - + + + + diff --git a/public/tx.html b/public/tx.html index d7a7677..4d0e1c5 100644 --- a/public/tx.html +++ b/public/tx.html @@ -4,7 +4,7 @@ Transaction | InstantAdPay - + @@ -33,7 +33,7 @@

← Back to the live ledger · Read the contract review

- - + + diff --git a/public/view.html b/public/view.html index 7f791a8..a615915 100644 --- a/public/view.html +++ b/public/view.html @@ -4,7 +4,7 @@ Viewing ad — InstantAdPay - +