Created
August 2, 2019 15:02
-
-
Save iliakan/d3610889a50a51b33fcde26874a7e9a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.initSponsorBar = function() { | |
let sponsorBar = document.getElementById('sponsorBar'); | |
if (Math.random() < 0.5) { | |
initCarbon(); | |
} else { | |
initCodeFund(); | |
} | |
function initCarbon(){ | |
let elem = document.createElement('div'); | |
elem.id = 'carbon'; | |
sponsorBar.append(elem); | |
let script = document.createElement('script'); | |
script.src = "//m.servedby-buysellads.com/monetization.js"; | |
script.onload = () => setTimeout(() => { | |
_bsa.init('custom', 'CKYDEK3U', 'placement:javascriptinfo', | |
{ | |
target: '#carbon', | |
template: ` | |
<a href="##statlink##" target="_blank" rel="nofollow noopener" class="carbon-cpc"> | |
<div class="carbon-description"><strong>##company##</strong> — ##description##</div> | |
</a> | |
<a href="https://www.carbonads.net/?utm_source=javascript-info-custom&utm_medium=ad_via_link&utm_campaign=in_unit&utm_term=custom" target="_blank" rel="nofollow noopener" class="carbon-sponsor">Ads via Carbon</a> | |
` | |
} | |
); | |
}, 100); | |
sponsorBar.append(script); | |
} | |
function initCodeFund() { | |
let elem = document.createElement('div'); | |
elem.id = 'codefund'; | |
sponsorBar.append(elem); | |
let script = document.createElement('script'); | |
script.src = "https://codefund.io/properties/339/funder.js"; | |
sponsorBar.append(script); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment