a413062c5c
New shared wallet-notice.js on join-now, my, training: if config.walletNotice is set, shows an admin-authored heads-up right above every connect/unlock button; empty string hides it everywhere (one PATCH, no deploy). Placed at the friction point only, not a sitewide banner, so unaffected wallets/Mini App users are not told about a warning they will never see. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
23 lines
1.1 KiB
JavaScript
23 lines
1.1 KiB
JavaScript
// Temporary, admin-controlled heads-up shown right above any wallet-connect
|
||
// button while a scanner false-positive is being cleared. Driven by
|
||
// config.walletNotice (admin PATCH): non-empty string = show it, ""/unset =
|
||
// nothing renders. One config flip removes it everywhere, no deploy.
|
||
(function () {
|
||
'use strict';
|
||
fetch('/api/public/config').then(function (r) { return r.json(); }).then(function (c) {
|
||
var msg = (c && c.walletNotice || '').trim();
|
||
if (!msg) return;
|
||
var btns = [].slice.call(document.querySelectorAll('button, a.btn'));
|
||
var targets = btns.filter(function (b) { return /connect|unlock/i.test(b.textContent || ''); });
|
||
if (!targets.length) return;
|
||
targets.forEach(function (btn) {
|
||
if (btn.dataset.wnDone) return; btn.dataset.wnDone = '1';
|
||
var n = document.createElement('div');
|
||
n.className = 'callout';
|
||
n.style.cssText = 'margin:0 0 12px;font-size:13px;line-height:1.5;border-color:rgba(243,190,67,.5)';
|
||
n.innerHTML = 'ℹ️ ' + msg; // admin-authored, same trust level as other config-injected copy
|
||
btn.parentNode.insertBefore(n, btn);
|
||
});
|
||
}).catch(function () {});
|
||
})();
|