Files
pydantic/docs/extra/ad.js
T
Samuel Colvin f10680dd75 add buy-sell-ads advert to docs (#978)
* add buy-sell-ads advert to docs

* hide ad box on mobile
2019-11-08 17:16:46 +00:00

25 lines
658 B
JavaScript

function main () {
const ad_el = document.getElementById('bsa-cpc')
if (!ad_el || innerWidth < 800) {
// if no ad element or element hidden, don't load buysellads
return
}
const script = document.createElement('script')
script.onload = () => {
if (_bsa.isMobile()) {
// bsa doesn't show ads on mobile, hide th box
ad_el.remove()
return
}
_bsa.init('default', 'CKYDVKJJ', 'placement:helpmanualio', {
target: '#bsa-cpc',
align: 'horizontal',
})
ad_el.classList.add('loaded')
}
script.src = 'https://m.servedby-buysellads.com/monetization.js'
document.head.appendChild(script)
}
main()