19 lines
949 B
JavaScript
19 lines
949 B
JavaScript
(async function(){
|
||
try{
|
||
const r=await fetch('/api/public/config');
|
||
if(!r.ok)return;
|
||
const c=await r.json();
|
||
if(c.siteName){document.title=`Training | ${c.siteName}`;const bn=document.getElementById('brandName');if(bn)bn.textContent=c.siteName}
|
||
}catch(e){}
|
||
})();
|
||
|
||
// live dollar note in the card-buy callout — computed, never hand-written
|
||
fetch('/api/public/config').then(function(r){return r.json()}).then(function(c){
|
||
var el=document.getElementById('fundUsdNote');
|
||
if(el&&c.polUsd>0){var pol=(c.premiumEntryPol||362)+23;el.textContent=' — about $'+Math.round(pol*c.polUsd)+' at today’s price';}
|
||
}).catch(function(){});
|
||
|
||
// carry the member's saved id onto tools links so promo assets arrive personalized
|
||
try{var tid=localStorage.getItem('rmc.toolsId')||localStorage.getItem('ctb.myId');
|
||
if(tid&&/^\d+$/.test(tid))document.querySelectorAll('a[href="/tools"]').forEach(function(a){a.href='/tools?id='+tid;});}catch(e){}
|