From 8f7523b710136df270225a4316c3733efcac8229 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Mon, 16 Apr 2018 17:31:33 +0200 Subject: [PATCH] Add generic iframe service --- tarteaucitron.services.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 23141e1..39dbd96 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1,6 +1,35 @@ /*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google, Typekit, FB, ferankReady, IN, stButtons, twttr, PCWidget*/ /*jslint regexp: true, nomen: true*/ +// generic iframe +tarteaucitron.services.iframe = { + "key": "iframe", + "type": "other", + "name": "Web content", + "uri": "", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + tarteaucitron.fallback(['tac_iframe'], function (x) { + var width = x.getAttribute("width"), + height = x.getAttribute("height"), + url = x.getAttribute("url"); + + return ''; + }); + }, + "fallback": function () { + "use strict"; + var id = 'iframe'; + tarteaucitron.fallback(['tac_iframe'], function (elem) { + elem.style.width = elem.getAttribute('width') + 'px'; + elem.style.height = elem.getAttribute('height') + 'px'; + return tarteaucitron.engage(id); + }); + } +}; + // addthis tarteaucitron.services.addthis = { "key": "addthis",