From 082a97cbf04b6ae5e469f30eec1b7c6f3b53b114 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 1 May 2019 23:33:27 +0200 Subject: [PATCH] Update carbon --- demo-mjml.html | 5 ++--- demo-newsletter-editor.html | 5 ++--- demo.html | 4 ++-- index.html | 2 +- js/carbon.js | 22 ++++++++++++++++++---- stylesheets/demos.css | 1 + 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/demo-mjml.html b/demo-mjml.html index e0930d31b..5d36b1524 100644 --- a/demo-mjml.html +++ b/demo-mjml.html @@ -9,7 +9,7 @@ - + @@ -144,9 +144,8 @@
-
- +
diff --git a/demo-newsletter-editor.html b/demo-newsletter-editor.html index 5f1623d5d..71f8a9de8 100644 --- a/demo-newsletter-editor.html +++ b/demo-newsletter-editor.html @@ -9,7 +9,7 @@ - + @@ -527,9 +527,8 @@
-
- +
diff --git a/demo.html b/demo.html index 0f685e48b..93e2aa34f 100644 --- a/demo.html +++ b/demo.html @@ -9,7 +9,7 @@ - + @@ -145,7 +145,7 @@
- +
diff --git a/index.html b/index.html index 593f630c9..eb37a5945 100644 --- a/index.html +++ b/index.html @@ -100,7 +100,7 @@
- +
diff --git a/js/carbon.js b/js/carbon.js index 91cffac57..eb7edef3c 100644 --- a/js/carbon.js +++ b/js/carbon.js @@ -19,9 +19,23 @@ var loadAd = function() { } }; -(function(){ +var loadScript = function(src, clb) { var scr = document.createElement('script'); - scr.src = '//m.servedby-buysellads.com/monetization.js'; - scr.onload = loadAd; + scr.src = src; + clb && (scr.onload = clb); document.head.appendChild(scr); -})(); + return scr; +}; + +function BSANativeCallback (a) { + var total = a.ads.length; + if (!total) { + var script = loadScript('//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=grapesjscom'); + script.setAttribute('id', '_carbonads_js'); + var adCont = document.getElementById('native-carbon'); + adCont && adCont.appendChild(script); + console.log({ script }); + } +} + +loadScript('//m.servedby-buysellads.com/monetization.js', loadAd); diff --git a/stylesheets/demos.css b/stylesheets/demos.css index 2811d01e8..1e5cdd1ac 100644 --- a/stylesheets/demos.css +++ b/stylesheets/demos.css @@ -94,6 +94,7 @@ html { } #carbonads { + font: caption; padding: 20px 10px; }