Campaigns: /my#campaigns?video=... opens the video ad form filled in (Video App Income's "Run this on InstantAdPay" button)

Fields only (video link, target, name, title, button words, watch length); https .mp4/.webm links only; nothing is submitted for the member
and the server validates as before. Chatbot: new answer vai-video-ad + prompt line, KNOWLEDGE_DATE 2026-11-22 (Marty 2026-11-22).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-22 10:08:27 -06:00
parent 8ae98be870
commit 543bdefda2
2 changed files with 22 additions and 1 deletions
+17
View File
@@ -938,6 +938,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (name === 'profile') loadLineBanner();
if (name === 'line') { buildLineJump(); loadLineage(); loadUplineMessages(); loadCoach(); loadLinkStats(); loadProspects(); }
if (name === 'campaigns') ['cTarget', 'cImage', 'cVideoUrl'].forEach(id => { if ($(id)) $(id).value = ''; }); // no residual URL between visits
if (name === 'campaigns' && /(^|&)video=/.test(paneQ)) prefillVideoAd(paneQ); // /my#campaigns?video=...: the video ad form filled in (Video App Income's "Run this on InstantAdPay", 2026-11-22)
if (name === 'training') { if (/(^|&)g=leader/.test(paneQ)) loadTraining.filter = 'Leader tools'; loadTraining(); }
if (name === 'pipeline') loadPipeline();
if (name === 'promo') { const ps = /(^|&)s=([a-z]+)/.exec(paneQ || ''); if (ps) setPromoSub(ps[2]); }
@@ -1809,6 +1810,22 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
v.onerror = () => fin(null); setTimeout(() => fin(null), 8000); v.src = url;
});
}
// /my#campaigns?video=<https .mp4>&to=<https page>&title=&cta=&secs= (2026-11-22): a partner site's button opens the watch-to-earn video form
// with the member's own video filled in. Fields only: the member still sets the budget and presses the button, and the server validates as usual.
function prefillVideoAd(q) {
let p; try { p = new URLSearchParams(q); } catch (e) { return; }
const video = String(p.get('video') || '');
if (!/^https:\/\/[^\s"'<>]{4,300}\.(mp4|webm)$/i.test(video)) return;
const ct = $('cType'); if (!ct || !$('cVideoUrl')) return;
ct.value = 'video'; ct.dispatchEvent(new Event('change'));
const put = (id, v, max) => { v = String(v || '').replace(/[\u0000-\u001f]/g, ' ').trim().slice(0, max); if ($(id) && v) $(id).value = v; };
const to = String(p.get('to') || ''); if (/^https:\/\/[^\s"'<>]{4,300}$/i.test(to)) put('cTarget', to, 300);
put('cName', p.get('title'), 60); put('cVideoTitle', p.get('title'), 80); put('cCtaLabel', p.get('cta'), 30);
$('cVideoUrl').value = video; $('cVideoUrl').dispatchEvent(new Event('change')); // reads the size, so portrait goes to Shorts
const want = Number(p.get('secs')), pick = () => { videoHint(); const s = $('cWatchSecs'); if (s && [].some.call(s.options, o => Number(o.value) === want)) { s.value = String(want); videoHint(); } };
pick(); setTimeout(pick, 1500); setTimeout(pick, 4000); // the rates may still be loading on a fresh page
setTimeout(() => { try { $('cVideoUrl').scrollIntoView({ block: 'center' }); if ($('cBudget')) $('cBudget').focus({ preventScroll: true }); } catch (e) {} }, 300);
}
function showVidOrient() {
const el = $('cVideoInfo'); if (!el) return;
if (!cVidDims) return;