Skip to content

Commit

Permalink
Up layout carbon
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Aug 30, 2023
1 parent 72a051f commit 9b66a16
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions docs/.vuepress/theme/layouts/CarbonAds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ export default {
return h('div', { class: 'carbon-ads', attrs: { id: 'native-carbon' }})
},
mounted () {
window.BSANativeCallback = (a) => {
const total = a.ads.length;
if (!total) {
const src = document.createElement('script');
src.src = `//cdn.carbonads.com/carbon.js?serve=CEAIVK77&placement=grapesjscom`;
src.setAttribute('id', '_carbonads_js');
const adCont = document.getElementById('native-carbon');
adCont && adCont.appendChild(src);
}
};
// window.BSANativeCallback = (a) => {
// const total = a.ads.length;
//
// if (!total) {
// const src = document.createElement('script');
// src.src = `//cdn.carbonads.com/carbon.js?serve=CEAIVK77&placement=grapesjscom`;
// src.setAttribute('id', '_carbonads_js');
// const adCont = document.getElementById('native-carbon');
// adCont && adCont.appendChild(src);
// }
// };
this.load();
},
watch: {
Expand All @@ -38,10 +38,16 @@ export default {
}
},
load () {
const s = document.createElement('script');
s.src = `//m.servedby-buysellads.com/monetization.js`;
s.onload = () => this.initCarbon();
this.$el.appendChild(s);
// const s = document.createElement('script');
// s.src = `//m.servedby-buysellads.com/monetization.js`;
// s.onload = () => this.initCarbon();
// this.$el.appendChild(s);
const src = document.createElement('script');
src.src = `//cdn.carbonads.com/carbon.js?serve=CEAIVK77&placement=grapesjscom`;
src.setAttribute('id', '_carbonads_js');
const adCont = document.getElementById('native-carbon');
adCont && adCont.appendChild(src);
}
}
}
Expand Down

0 comments on commit 9b66a16

Please sign in to comment.