From 1b5f0cad472e3724eb63cb1b37a71002459eb3f6 Mon Sep 17 00:00:00 2001 From: Hugo Heneault Date: Fri, 14 Sep 2018 11:55:41 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20Add=20Google=20Maps=20Iframe=20?= =?UTF-8?q?embed=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tarteaucitron.js | 6 ++++++ tarteaucitron.services.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/tarteaucitron.js b/tarteaucitron.js index 8108076..36985f1 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1447,5 +1447,11 @@ var tarteaucitron = { } } return source; + }, + "getElemWidth": function(elem) { + return elem.getAttribute('width') || elem.clientWidth; + }, + "getElemHeight": function(elem) { + return elem.getAttribute('height') || elem.clientHeight; } }; diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index f5096b2..1c46b4f 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1191,6 +1191,35 @@ tarteaucitron.services.googlemapssearch = { } }; +// googlemaps embed iframe +tarteaucitron.services.googlemapsembed = { + "key": "googlemapsembed", + "type": "api", + "name": "Google Maps Embed", + "uri": "http://www.google.com/ads/preferences/", + "needConsent": true, + "cookies": ['apisid', 'hsid', 'nid', 'sapisid', 'sid', 'sidcc', 'ssid', '1p_jar'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['googlemapsembed'], function (x) { + var width = tarteaucitron.getElemWidth(x), + height = tarteaucitron.getElemHeight(x), + url = x.getAttribute("data-url"); + + return ''; + }); + }, + "fallback": function () { + "use strict"; + var id = 'googlemapsembed'; + tarteaucitron.fallback(['googlemapsembed'], function (elem) { + elem.style.width = tarteaucitron.getElemWidth(elem) + 'px'; + elem.style.height = tarteaucitron.getElemHeight(elem) + 'px'; + return tarteaucitron.engage(id); + }); + } +}; + // google tag manager tarteaucitron.services.googletagmanager = { "key": "googletagmanager", From 35945880892fbcb3e3802560278257d4b31e4f73 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Tue, 25 Sep 2018 14:21:20 +0200 Subject: [PATCH 2/2] Add parameters to Adform --- tarteaucitron.services.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 07392fe..d5a551f 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2349,14 +2349,14 @@ tarteaucitron.services.adform = { "cookies": [], "js": function () { "use strict"; - if (tarteaucitron.user.adformpm === undefined) { + if (tarteaucitron.user.adformpm === undefined || tarteaucitron.user.adformWebsiteName === undefined || tarteaucitron.user.adformSectionName === undefined || tarteaucitron.user.adformSubSection === undefined || tarteaucitron.user.adformPageName === undefined) { return; } window._adftrack = { pm: tarteaucitron.user.adformpm, divider: encodeURIComponent('|'), - pagename: encodeURIComponent('WebsiteName|SectionName|SubSection|PageName') + pagename: encodeURIComponent(tarteaucitron.user.adformWebsiteName+'|'+tarteaucitron.user.adformSectionName+'|'+tarteaucitron.user.adformSubSection+'|'+tarteaucitron.user.adformPageName) }; tarteaucitron.addScript("https://track.adform.net/serving/scripts/trackpoint/async/");