Browse Source

✨ Add Facil'ITI service

nstCactus 5 years ago
parent
commit
9aa2531700
1 changed files with 26 additions and 2 deletions
  1. 26 2
      tarteaucitron.services.js

+ 26 - 2
tarteaucitron.services.js

@@ -1699,7 +1699,7 @@ tarteaucitron.services.rumbletalk = {
             var width = tarteaucitron.getElemWidth(x),
                 height = tarteaucitron.getElemHeight(x),
                 id = x.getAttribute("data-id");
-          
+
                 return '<div style="height: ' + height + 'px; width: ' + width + 'px;"><div id="' + id + '"></div></div>';
       });
     },
@@ -1709,7 +1709,7 @@ tarteaucitron.services.rumbletalk = {
             tarteaucitron.fallback(['rumbletalk'], function (elem) {
                 elem.style.width = tarteaucitron.getElemWidth(elem) + 'px';
                 elem.style.height = tarteaucitron.getElemHeight(elem) + 'px';
-                
+
                 return tarteaucitron.engage(id);
             });
     }
@@ -3004,3 +3004,27 @@ tarteaucitron.services.youtubeapi = {
         tarteaucitron.addScript('https://www.youtube.com/player_api');
     }
 };
+
+// Facil'ITI
+tarteaucitron.services.faciliti = {
+    "key": "faciliti",
+    "type": "other",
+    "name": "Facil'ITI",
+    "uri": "https://ws.facil-iti.com/mentions-legales.html",
+    "needConsent": true,
+    "cookies": ['FACIL_ITI_LS'],
+    "js": function () {
+        "use strict";
+        if (tarteaucitron.user.facilitiID === undefined) {
+            return;
+        }
+
+        (function(w, d, s, f) {
+            w[f] = w[f] || {conf: function () { (w[f].data = w[f].data || []).push(arguments);}};
+            var l = d.createElement(s), e = d.getElementsByTagName(s)[0];
+            l.async = 1; l.src = 'https://ws.facil-iti.com/tag/faciliti-tag.min.js'; e.parentNode.insertBefore(l, e);
+        }(window, document, 'script', 'FACIL_ITI'));
+        FACIL_ITI.conf('userId', tarteaucitron.user.facilitiID);
+    }
+};
+