From 616f328db5b93ab0547cd3f4c2294ed1acd8b577 Mon Sep 17 00:00:00 2001 From: martbost Date: Wed, 16 Sep 2026 10:21:53 -0500 Subject: [PATCH] Report-an-ad dialog: site dialog with no default reason (was a native prompt pre-filled with "broken") Campaign #27 (house AdRevSplit text ad) was reported "broken" with no note while the target framed and loaded fine; the report dialog was prompt() with 'broken' as the default value, so one stray OK filed it. Now IAP.ask with an explicit, validated reason and an optional note; common.js tag bumped on all pages. Co-Authored-By: Claude Fable 5.1 --- public/admin.html | 2 +- public/assets/common.js | 16 +++++++++++----- public/contract.html | 2 +- public/disclaimer.html | 2 +- public/earning.html | 2 +- public/index.html | 2 +- public/join.html | 2 +- public/launch.html | 2 +- public/ledger.html | 2 +- public/my.html | 2 +- public/partners.html | 2 +- public/plays.html | 2 +- public/privacy.html | 2 +- public/terms.html | 2 +- public/tx.html | 2 +- public/wall.html | 2 +- public/wallets.html | 2 +- 17 files changed, 27 insertions(+), 21 deletions(-) diff --git a/public/admin.html b/public/admin.html index bed9c54..39c59ed 100644 --- a/public/admin.html +++ b/public/admin.html @@ -486,7 +486,7 @@ - + diff --git a/public/assets/common.js b/public/assets/common.js index 6e44096..e76fdbf 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -110,12 +110,18 @@ window.IAP = (function () { } // Render one served ad into #. Silent if no inventory. // report an ad (auto-approved ads need a member-facing flag → admin notified) - function reportAd(campaignId) { + // 2026-09-16: was a native prompt() with 'broken' pre-filled, so a stray tap on OK filed a + // "broken" report with no note (campaign #27). Now the site dialog, no default, reason validated. + const REPORT_REASONS = ['broken', 'inappropriate', 'spam', 'scam', 'other']; + async function reportAd(campaignId) { if (!campaignId) return; - const reason = (prompt('Report this ad. Reason: broken, inappropriate, spam, scam, or other', 'broken') || '').trim().toLowerCase(); - if (!reason) return; - const note = prompt('Anything to add? (optional)') || ''; - fetch('/api/report-ad', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ campaignId, reason, note }) }) + const raw = await ask({ title: 'Report this ad', text: 'What is wrong with it? Type one: broken, inappropriate, spam, scam, or other.', placeholder: 'e.g. broken', ok: 'Next' }); + if (raw === null) return; + const reason = String(raw || '').trim().toLowerCase(); + if (!REPORT_REASONS.includes(reason)) { status('Pick one of: broken, inappropriate, spam, scam, or other.', 'bad'); return; } + const note = await ask({ title: 'Report: ' + reason, text: 'Tell the admin what you saw, so it can be fixed. Optional, but it helps.', type: 'textarea', ok: 'Send report' }); + if (note === null) return; + fetch('/api/report-ad', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ campaignId, reason, note: String(note || '').slice(0, 500) }) }) .then(() => status('Thanks — this ad was reported to the admin for review.', 'ok')) .catch(() => status('Could not send the report. Try again.', 'bad')); } diff --git a/public/contract.html b/public/contract.html index 3dbcfd8..523f5fb 100644 --- a/public/contract.html +++ b/public/contract.html @@ -141,7 +141,7 @@
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/disclaimer.html b/public/disclaimer.html index d4757aa..306b097 100644 --- a/public/disclaimer.html +++ b/public/disclaimer.html @@ -26,7 +26,7 @@

You decide whether, and how much, to spend. Never spend more than you can afford to lose.

- + diff --git a/public/earning.html b/public/earning.html index fe20316..d060379 100644 --- a/public/earning.html +++ b/public/earning.html @@ -68,6 +68,6 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/index.html b/public/index.html index 305d5bc..3854ef6 100644 --- a/public/index.html +++ b/public/index.html @@ -481,7 +481,7 @@ - + diff --git a/public/join.html b/public/join.html index 3757d0d..26c1b14 100644 --- a/public/join.html +++ b/public/join.html @@ -157,7 +157,7 @@ InstantAdPay · Contract · Terms · Privacy · Disclaimer - + diff --git a/public/launch.html b/public/launch.html index 8d8f453..66a34b0 100644 --- a/public/launch.html +++ b/public/launch.html @@ -104,7 +104,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/ledger.html b/public/ledger.html index 092c977..d751a07 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -37,7 +37,7 @@
InstantAdPay · how it works · contract source ↗
- + diff --git a/public/my.html b/public/my.html index 3adbecb..8d76d41 100644 --- a/public/my.html +++ b/public/my.html @@ -1019,7 +1019,7 @@ - + diff --git a/public/partners.html b/public/partners.html index b723bed..30458e2 100644 --- a/public/partners.html +++ b/public/partners.html @@ -128,7 +128,7 @@
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.
- + diff --git a/public/plays.html b/public/plays.html index 6740a32..4fef21a 100644 --- a/public/plays.html +++ b/public/plays.html @@ -192,7 +192,7 @@
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/privacy.html b/public/privacy.html index cc97271..20384a8 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -28,7 +28,7 @@

We use reasonable safeguards, but no system is perfectly secure. Protect your email and your wallet.

- + diff --git a/public/terms.html b/public/terms.html index 5dc7cc4..75b8dfd 100644 --- a/public/terms.html +++ b/public/terms.html @@ -36,7 +36,7 @@

See also the Disclaimer and Privacy Policy.

- + diff --git a/public/tx.html b/public/tx.html index 0af497c..a3b0003 100644 --- a/public/tx.html +++ b/public/tx.html @@ -34,7 +34,7 @@

← Back to the live ledger · Read the contract review

- + diff --git a/public/wall.html b/public/wall.html index f43e89a..be248be 100644 --- a/public/wall.html +++ b/public/wall.html @@ -47,7 +47,7 @@ - + diff --git a/public/wallets.html b/public/wallets.html index 5d3cc44..f9fe701 100644 --- a/public/wallets.html +++ b/public/wallets.html @@ -121,7 +121,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never share your recovery phrase.
- +