Browse Source

Add a feature to display the 'Accept All' CTA when 'hightPrivacy : true'

Romain Baudot 7 years ago
parent
commit
1a4967acae
2 changed files with 4 additions and 2 deletions
  1. 1 0
      README.md
  2. 3 2
      tarteaucitron.js

+ 1 - 0
README.md

@@ -118,6 +118,7 @@ In PHP for example, you can bypass all the script by setting this var `tarteauci
 tarteaucitron.init({
     "hashtag": "#tarteaucitron", /* Ouverture automatique du panel avec le hashtag */
     "highPrivacy": false, /* désactiver le consentement implicite (en naviguant) ? */
+    "AcceptAllCta" : false, /* Afficher le CTA "Tout accepter" si "hightPrivacy : true" */
     "orientation": "top", /* le bandeau doit être en haut (top) ou en bas (bottom) ? */
     "adblocker": false, /* Afficher un message si un adblocker est détecté */
     "showAlertSmall": true, /* afficher le petit bandeau en bas à droite ? */

+ 3 - 2
tarteaucitron.js

@@ -186,7 +186,8 @@ var tarteaucitron = {
                 "removeCredit": false,
                 "showAlertSmall": true,
                 "cookieslist": true,
-                "handleBrowserDNTRequest": false
+                "handleBrowserDNTRequest": false,
+                "AcceptAllCta" : false
             },
             params = tarteaucitron.parameters;
         
@@ -275,7 +276,7 @@ var tarteaucitron = {
                     orientation = 'Bottom';
                 }
                 
-                if (defaults.highPrivacy) {
+                if (defaults.highPrivacy && !defaults.AcceptAllCta) {
                     html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
                     html += '   <span id="tarteaucitronDisclaimerAlert">';
                     html += '       ' + tarteaucitron.lang.alertBigPrivacy;