Browse Source

Add PureChat

Amauri CHAMPEAUX 10 years ago
parent
commit
fadcbfd56d
2 changed files with 24 additions and 2 deletions
  1. 1 1
      tarteaucitron.js
  2. 23 1
      tarteaucitron.services.js

+ 1 - 1
tarteaucitron.js

@@ -10,7 +10,7 @@ var scripts = document.getElementsByTagName('script'),
     tarteaucitronNoAdBlocker = false;
 
 var tarteaucitron = {
-    "version": 301,
+    "version": 302,
     "cdn": cdn,
     "user": {},
     "lang": {},

+ 23 - 1
tarteaucitron.services.js

@@ -1,4 +1,4 @@
-/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google, Typekit, FB, ferankReady, IN, stButtons, twttr*/
+/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google, Typekit, FB, ferankReady, IN, stButtons, twttr, PCWidget*/
 /*jslint regexp: true, nomen: true*/
 
 // addthis
@@ -889,6 +889,28 @@ tarteaucitron.services.pubdirecte = {
     }
 };
 
+// purechat
+tarteaucitron.services.purechat = {
+    "key": "purechat",
+    "type": "support",
+    "name": "PureChat",
+    "uri": "https://www.purechat.com/privacy",
+    "needConsent": true,
+    "cookies": [],
+    "js": function () {
+        "use strict";
+        if (tarteaucitron.user.purechatId === undefined) {
+            return;
+        }
+        
+        tarteaucitron.addScript('//app.purechat.com/VisitorWidget/WidgetScript', '', function () {
+            try {
+                window.w = new PCWidget({ c: tarteaucitron.user.purechatId, f: true });
+            } catch (e) {}
+        });
+    }
+};
+
 // shareaholic
 tarteaucitron.services.shareaholic = {
     "key": "shareaholic",