Преглед изворни кода

Add an option to display a link to the privacy url

"privacyUrl":  "https://example.com/privacy-policy",
Amauri CHAMPEAUX пре 6 година
родитељ
комит
a31264e13d

+ 1 - 86
README.md

@@ -20,92 +20,6 @@ Bonus:
 - Load service when user click on Allow (without reload of the page),
 - Incorporate a fallback system (display a link instead of social button and a static banner instead of advertising).
 
-## Supported services
-* Advertising network
-  * Ad Up Technology (ads)
-  * Ad Up Technology (conversion)
-  * Ad Up Technology (retargeting)
-  * Amazon
-  * Clicmanager
-  * Criteo
-  * FERank (pub)
-  * Google Adsense
-  * Google Adsense Search (form)
-  * Google Adsense Search (result)
-  * Google Adwords (conversion)
-  * Google Adwords (remarketing)
-  * Pubdirecte
-  * Twenga
-  * vShop
-
-* APIs
-  * Google jsapi
-  * Google Maps
-  * Google Tag Manager
-  * Timeline JS
-  * Typekit (adobe)
-
-* Audience measurement
-  * Alexa
-  * Clicky
-  * Crazyegg
-  * FERank
-  * Get+
-  * Google Analytics (ga.js)
-  * Google Analytics (universal)
-  * StatCounter
-  * VisualRevenue
-  * Xiti
-
-* Comment
-  * Disqus
-  * Facebook (commentaire)
-  
-* Marketing Automation & CRM
-  * Mautic
-  * Webmecanik Automation
-  * Koban
-  
-* Social network
-  * AddThis
-  * AddToAny (feed)
-  * AddToAny (share)
-  * eKomi
-  * Facebook
-  * Facebook (like box)
-  * Google+
-  * Google+ (badge)
-  * Linkedin
-  * Pinterest
-  * Shareaholic
-  * ShareThis
-  * Twitter
-  * Twitter (cards)
-  * Twitter (timelines)
-
-* Support
-  * UserVoice
-  * Zopim
-
-* Video
-  * Calameo
-  * Dailymotion
-  * Prezi
-  * SlideShare
-  * Vimeo
-  * YouTube
-  * Issuu
-
-
-## Visitors outside the EU
-In PHP for example, you can bypass all the script by setting this var `tarteaucitron.user.bypass = true;` if the visitor is not in the EU.
-
-## Tested on
-- IE 6+
-- FF 3+
-- Safari 4+
-- Chrome 14+
-- Opera 10+
 
 # Installation guide
 [Visit opt-out.ferank.eu](https://opt-out.ferank.eu/)
@@ -129,6 +43,7 @@ tarteaucitron.init({
     "removeCredit": false, /* supprimer le lien vers la source ? */
     "handleBrowserDNTRequest": false, /* Répondre au DoNotTrack du navigateur ?*/
     "moreInfoLink": true,
+    "privacyUrl": "",
     //"cookieDomain": ".my-multisite-domaine.fr" /* Nom de domaine sur lequel sera posé le cookie - pour les multisites / sous-domaines - Facultatif */
 });
 </script>

+ 2 - 2
css/tarteaucitron.css

@@ -448,7 +448,7 @@ h2#tarteaucitronCookiesNumberBis {
     font-weight: 700;
 }
 
-#tarteaucitronAlertBig #tarteaucitronCloseAlert, #tarteaucitronAlertBig #tarteaucitronPersonalize {
+#tarteaucitronAlertBig #tarteaucitronCloseAlert, #tarteaucitronAlertBig #tarteaucitronPersonalize, #tarteaucitronAlertBig #tarteaucitronPrivacyUrl {
     background: #008300;
     color: #fff;
     cursor: pointer;
@@ -459,7 +459,7 @@ h2#tarteaucitronCookiesNumberBis {
     margin-left: 7px;
 }
 
-#tarteaucitronAlertBig #tarteaucitronCloseAlert {
+#tarteaucitronAlertBig #tarteaucitronCloseAlert, #tarteaucitronAlertBig #tarteaucitronPrivacyUrl {
     background: #fff;
     color: #333;
     font-size: 13px;

+ 2 - 0
lang/tarteaucitron.cs.js

@@ -13,6 +13,8 @@ tarteaucitron.lang = {
     "personalize": "Přizpůsobit",
     "acceptAll": "OK, přijmout vše",
     "close": "Zavřít",
+
+    "privacyUrl": "Zásady ochrany osobních údajů",
     
     "all": "Nastavení všech služeb",
 

+ 2 - 0
lang/tarteaucitron.de.js

@@ -13,6 +13,8 @@ tarteaucitron.lang = {
     "personalize": "Personalisieren",
     "acceptAll": "OK, akzeptiere alles",
     "close": "Beenden",
+
+    "privacyUrl": "Datenschutz-Bestimmungen",
     
     "all": "Präferenz für alle Dienste",
 

+ 2 - 0
lang/tarteaucitron.en.js

@@ -13,6 +13,8 @@ tarteaucitron.lang = {
     "personalize": "Personalize",
     "acceptAll": "OK, accept all",
     "close": "Close",
+
+    "privacyUrl": "Privacy policy",
     
     "all": "Preference for all services",
 

+ 2 - 0
lang/tarteaucitron.es.js

@@ -13,6 +13,8 @@ tarteaucitron.lang = {
     "personalize": "Personalizar",
     "acceptAll": "OK, aceptar todas",
     "close": "Cerrar",
+
+    "privacyUrl": "Política de privacidad",
     
     "all": "Ajustes para todos los servicios",
 

+ 2 - 0
lang/tarteaucitron.fr.js

@@ -14,6 +14,8 @@ tarteaucitron.lang = {
     "personalize": "Personnaliser",
     "close": "Fermer",
 
+    "privacyUrl": "Politique de confidentialité",
+
     "all": "Préférence pour tous les services",
 
     "info": "Protection de votre vie privée",

+ 2 - 0
lang/tarteaucitron.it.js

@@ -13,6 +13,8 @@ tarteaucitron.lang = {
     "acceptAll": "Ok, accetta tutto",
     "personalize": "Personalizza",
     "close": "Chiudi",
+
+    "privacyUrl": "Politica sulla riservatezza",
     
     "all": "Preferenze per tutti i servizi",
     

+ 3 - 1
lang/tarteaucitron.nl.js

@@ -13,7 +13,9 @@ tarteaucitron.lang = {
     "personalize": "Personaliseer",
     "acceptAll": "OK, accepteer alle",
     "close": "Sluit",
-    
+
+    "privacyUrl": "Privacybeleid",
+
     "all": "Voorkeur voor alle diensten",
 
     "info": "Bescherming van uw privacy",

+ 2 - 0
lang/tarteaucitron.pl.js

@@ -13,6 +13,8 @@ tarteaucitron.lang = {
     "personalize": "Personalizacja",
     "acceptAll": "OK, akceptuję wszystko",
     "close": "zamknij",
+
+    "privacyUrl": "Polityka prywatności",
     
     "all": "Preferencja dla wszystkich usług",
 

+ 3 - 0
lang/tarteaucitron.pt.js

@@ -13,6 +13,9 @@ tarteaucitron.lang = {
     "personalize": "Personalizar",
     "acceptAll": "OK, aceitar tudo",
     "close": "Fechar",
+
+    "privacyUrl": "Política de Privacidade",
+
     "all": "Definições dos serviços",
     "info": "Proteger sua privacidade",
     "disclaimer": "Ao aceitar os serviços terceiros, você aceita o uso de cookies em conjunto de tecnologias de rastreamento que lhe são necessárias para funcionar",

+ 2 - 0
lang/tarteaucitron.ru.js

@@ -13,6 +13,8 @@ tarteaucitron.lang = {
     "personalize": "Персонализировать",
     "acceptAll": "Ок, все активировать",
     "close": "Закрыть",
+
+    "privacyUrl": "Политика конфиденциальности",
     
     "all": "Преференция всем сервисам",
 

+ 18 - 3
tarteaucitron.js

@@ -16,7 +16,7 @@ var scripts = document.getElementsByTagName('script'),
 
 
 var tarteaucitron = {
-    "version": 20180828003,
+    "version": 20180829,
     "cdn": cdn,
     "user": {},
     "lang": {},
@@ -209,7 +209,8 @@ var tarteaucitron = {
                 "cookieslist": true,
                 "handleBrowserDNTRequest": false,
                 "AcceptAllCta" : false,
-                "moreInfoLink": true
+                "moreInfoLink": true,
+                "privacyUrl": ""
             },
             params = tarteaucitron.parameters;
 
@@ -314,6 +315,13 @@ var tarteaucitron = {
                     html += '   <button id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.openPanel();">';
                     html += '       ' + tarteaucitron.lang.personalize;
                     html += '   </button>';
+
+                    if (tarteaucitron.parameters.privacyUrl !== "") {
+                        html += '   <button id="tarteaucitronPrivacyUrl" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
+                        html += '       ' + tarteaucitron.lang.privacyUrl;
+                        html += '   </button>';
+                    }
+
                     html += '</div>';
                 } else {
                     html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
@@ -326,6 +334,13 @@ var tarteaucitron = {
                     html += '   <button id="tarteaucitronCloseAlert" onclick="tarteaucitron.userInterface.openPanel();">';
                     html += '       ' + tarteaucitron.lang.personalize;
                     html += '   </button>';
+
+                    if (tarteaucitron.parameters.privacyUrl !== "") {
+                        html += '   <button id="tarteaucitronPrivacyUrl" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
+                        html += '       ' + tarteaucitron.lang.privacyUrl;
+                        html += '   </button>';
+                    }
+
                     html += '</div>';
                     html += '<div id="tarteaucitronPercentage"></div>';
                 }
@@ -462,7 +477,7 @@ var tarteaucitron = {
             cookie = tarteaucitron.cookie.read(),
             hostname = document.location.hostname,
             hostRef = document.referrer.split('/')[2],
-            isNavigating = (hostRef === hostname) ? true : false,
+            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl) ? true : false,
             isAutostart = (!service.needConsent) ? true : false,
             isWaiting = (cookie.indexOf(service.key + '=wait') >= 0) ? true : false,
             isDenied = (cookie.indexOf(service.key + '=false') >= 0) ? true : false,