From ba8bb5cdbf37c9c4430108545e648625c310d806 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 12 Sep 2018 12:57:21 +0200 Subject: [PATCH] Added matterport service --- tarteaucitron.services.js | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index f5096b2..230ef20 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2326,3 +2326,63 @@ tarteaucitron.services.bingads = { } }; +//Matterport +/* +SERVICE INIT + (tarteaucitron.job = tarteaucitron.job || []).push('matterport'); + +HTML TAG +
+ +DELETE IFRAME + ' + */ +tarteaucitron.services.matterport = { + "key": "matterport", + "type": "other", + "name": "Matterport", + "uri": "https://matterport.com/es/legal/privacy-policy/", + "needConsent": true, + "cookies": ['__cfduid', 'ajs_anonymous_id', 'ajs_group_id', 'ajs_user_id'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['matterport'], function (x) { + var matterport_id = x.getAttribute("matterportID"), + matterport_width = x.getAttribute("width"), + frame_width = 'width=', + matterport_height = x.getAttribute("height"), + frame_height = 'height=', + matterport_parameters = x.getAttribute("parameters"), + matterport_frame; + + if (matterport_id === undefined) { + return ""; + } + if (matterport_width !== undefined) { + frame_width += '"' + matterport_width + '" '; + } else { + frame_width += '"" '; + } + if (matterport_height !== undefined) { + frame_height += '"' + matterport_height + '" '; + } else { + frame_height += '"" '; + } + if (matterport_parameters === undefined) { + return ""; + } + + matterport_frame = ''; + return matterport_frame; + }); + }, + "fallback": function () { + "use strict"; + var id = 'matterport'; + tarteaucitron.fallback(['matterport'], function (elem) { + elem.style.width = elem.getAttribute('width') + 'px'; + elem.style.height = elem.getAttribute('height') + 'px'; + return tarteaucitron.engage(id); + }); + } +}; \ No newline at end of file