Browse Source

More informations about installed cookies

1002Studio 10 years ago
parent
commit
f8e806cd2c
4 changed files with 24 additions and 14 deletions
  1. 4 4
      css/tarteaucitron.css
  2. 3 0
      lang/tarteaucitron.en.js
  3. 3 0
      lang/tarteaucitron.fr.js
  4. 14 10
      tarteaucitron.js

+ 4 - 4
css/tarteaucitron.css

@@ -57,7 +57,7 @@
 
 
 #tarteaucitron a {
 #tarteaucitron a {
     color: rgb(66, 66, 66);
     color: rgb(66, 66, 66);
-    font-size: 12px;
+    font-size: 11px;
     font-style: italic;
     font-style: italic;
     text-decoration: none;
     text-decoration: none;
 }
 }
@@ -235,17 +235,17 @@
 
 
 #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies {
 #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies {
     color: #333;
     color: #333;
-    font-size: 11px;
+    font-size: 12px;
 }
 }
 
 
 #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies b {
 #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies b {
     color: darkgreen;
     color: darkgreen;
-    font-size: 11px;
+    font-size: 12px;
 }
 }
 
 
 #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies s {
 #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies s {
     color: gray;
     color: gray;
-    font-size: 11px;
+    font-size: 12px;
 }
 }
 
 
 #tarteaucitron #tarteaucitronFooter {
 #tarteaucitron #tarteaucitronFooter {

+ 3 - 0
lang/tarteaucitron.en.js

@@ -13,6 +13,9 @@ tarteaucitron.lang = {
     "disclaimer": "By allowing these third party services, you accept theirs cookies and the use of tracking technologies necessary for their proper functioning.",
     "disclaimer": "By allowing these third party services, you accept theirs cookies and the use of tracking technologies necessary for their proper functioning.",
     "allow": "Allow",
     "allow": "Allow",
     "deny": "Deny",
     "deny": "Deny",
+    "noCookie": "This service does not use cookie to work.",
+    "useCookie": "This service can install",
+    "useCookieCurrent": "on this browser",
     "more": "Read more",
     "more": "Read more",
     "source": "View the official website",
     "source": "View the official website",
     "credit": "Cookies manager by tarteaucitron.js",
     "credit": "Cookies manager by tarteaucitron.js",

+ 3 - 0
lang/tarteaucitron.fr.js

@@ -13,6 +13,9 @@ tarteaucitron.lang = {
     "disclaimer": "En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.",
     "disclaimer": "En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.",
     "allow": "Autoriser",
     "allow": "Autoriser",
     "deny": "Interdire",
     "deny": "Interdire",
+    "noCookie": "Ce service ne dépose aucun cookie pour fonctionner.",
+    "useCookie": "Ce service peut déposer",
+    "useCookieCurrent": "sur ce navigateur",
     "more": "En savoir plus",
     "more": "En savoir plus",
     "source": "Voir le site officiel",
     "source": "Voir le site officiel",
     "credit": "Gestion des cookies par tarteaucitron.js",
     "credit": "Gestion des cookies par tarteaucitron.js",

+ 14 - 10
tarteaucitron.js

@@ -461,27 +461,31 @@ var tarteaucitron = {
             "use strict";
             "use strict";
             var arr = tarteaucitron.services[key].cookies,
             var arr = tarteaucitron.services[key].cookies,
                 nb = arr.length,
                 nb = arr.length,
-                html = nb + ' cookie',
+                nbCurrent = 0,
+                html = '',
+                htmlPlus = '',
                 i;
                 i;
             
             
-            if (nb > 1) {
-                html += 's';
-            }
-            
             if (nb > 0) {
             if (nb > 0) {
-                html += ' [';
+                html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
+                if (nb > 1) {
+                    html += 's';
+                }
                 
                 
                 for (i = 0; i < nb; i += 1) {
                 for (i = 0; i < nb; i += 1) {
                     if (document.cookie.indexOf(arr[i] + '=') !== -1) {
                     if (document.cookie.indexOf(arr[i] + '=') !== -1) {
-                        html += '<b>' + arr[i] + '</b> ';
+                        htmlPlus += '<b>' + arr[i] + '</b> ';
+                        nbCurrent += 1;
                     } else {
                     } else {
-                        html += '<s>' + arr[i] + '</s> ';
+                        htmlPlus += '<s>' + arr[i] + '</s> ';
                     }
                     }
                 }
                 }
                 
                 
-                html += ']';
+                html += ' (' + nbCurrent + ' ' + tarteaucitron.lang.useCookieCurrent + ')<br/>' + htmlPlus;
+            } else {
+                html += tarteaucitron.lang.noCookie;
             }
             }
-                        
+            
             document.getElementById('tacCL' + key).innerHTML = html;
             document.getElementById('tacCL' + key).innerHTML = html;
         }
         }
     },
     },