// Ads v.1.7.3 // Mini banner system // print ads from json var list: fuAds('', 'ads2 - id where print', ''); function fuAds(none, idAds, com){ // none - Reserved variable // idAds - id for print //var adsStatus = localStorage.getItem("confAdsStatus"); var adsStatus = conf["confAdsStatus"]; if (com == "force"){ adsStatus = "on"; } if (adsStatus != "off"){ //var cookieStatus = localStorage.getItem("confDataCollection"); var cookieStatus = conf["confDataCollection"]; switch (adsStatus){ case 'off': adsStatus = 'off'; break; case 'random': var items = ['on', 'off']; item = items[Math.floor(Math.random() * items.length)]; adsStatus = item; break; default: adsStatus = 'on'; } if(document.getElementById(idAds) != null){ let ads = []; var adsPrint = ''; //ads = JSON.parse(adsJson); //if (typeof linksListJsonVar != 'undefined') { ads = ads.concat(linksListJsonVar); } if (typeof adsJsonVar != 'undefined') { ads = ads.concat(adsJsonVar); } //ads = JSON.parse(adsJson); let adsUrlPage = fuMHideFileNameExt("/ads.html"); if (ads != null&&ads != ''){ // single if (adsStatus != 'off'){ var random = Math.floor(Math.random() * ads.length); //console.log(ads[random]['text']); // single adsText = ads[random]['text']; if (adsText == null) { adsText = ''; } adsURL = ads[random]['url']; if (adsURL == null){ adsURL = ''; } if (adsText.search("src=") != -1&&cookieStatus != 'on'){ // found adsText = fuMHideFileNameExt(`Cookie setting: ${cookieStatus}.`); } if (adsText.search("src=") == -1){ // not found code adsPrint = `
ads, links
${adsText} ${adsURL}
`; // print document.getElementById(idAds).innerHTML = `
${adsPrint}
`; } else { adsPrint = `
ads, links
${adsText} ${adsURL}
`; // print document.getElementById(idAds).innerHTML = `
${adsPrint}
`; } } // single // all if (com == 'all'){ var adsPrintAll = ''; ads.forEach((item, index) => { // multi // single adsText = ads[index]['text']; if (adsText == null) { adsText = ''; } adsURL = ads[index]['url']; if (adsURL == null){ adsURL = ''; } if (adsText.search("src=") != -1&&cookieStatus != 'on'){ // found adsText = fuMHideFileNameExt(`Cookie setting: ${cookieStatus}.`); } if (adsText.search("src=") == -1){ // not found code adsPrint = `
ads, links
${adsText} ${adsURL}
`; adsPrint = '
'+adsPrint+'
'; } else { adsPrint = `
ads, links
${adsText} ${adsURL}
`; adsPrint = '
' + adsPrint + '
'; } adsPrintAll += adsPrint; adsPrint = ''; // end single // end multi }); document.getElementById(idAds).innerHTML = '
' + adsPrintAll + '
'; } // all } } } }