Sfoglia il codice sorgente

Add an option to show a message about mandatory cookies

Amauri CHAMPEAUX 5 anni fa
parent
commit
e88aa28701

BIN
.DS_Store


+ 3 - 1
README.md

@@ -51,7 +51,9 @@ tarteaucitron.init({
 
     //"cookieDomain": ".my-multisite-domaine.fr", /* Shared cookie for subdomain website */
 
-    "readmoreLink": "/cookiespolicy" /* Change the default readmore link pointing to tarteaucitron.io */
+    "readmoreLink": "/cookiespolicy", /* Change the default readmore link pointing to tarteaucitron.io */
+    
+    "mandatory": false /* Show a message about mandatory cookies */
 });
 </script>
 ```

+ 4 - 1
lang/tarteaucitron.bg.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Други",
         "details": "Services to display web content."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.cn.js

@@ -70,5 +70,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "其他",
         "details": "旨在显示网页内容的服务。"
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.cs.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Jiný",
         "details": "Služby pro zobrazení webového obsahu."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.da.js

@@ -73,5 +73,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Andet",
         "details": "Tjenester til visning af webindhold."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.de.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Andere",
         "details": "Dienste zum Anzeigen von Web-Inhalten."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.el.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Λοιπές υπηρεσίες",
         "details": "Υπηρεσίες που παρουσιάζουν άλλο περιεχόμενο."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.en.js

@@ -73,5 +73,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Other",
         "details": "Services to display web content."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.es.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Otro",
         "details": "Servicios para mostrar contenido web."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.fi.js

@@ -76,5 +76,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Muut",
         "details": "Palvelut web-sisältöjen näyttämiseen."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.fr.js

@@ -74,5 +74,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Autre",
         "details": "Services visant à afficher du contenu web."
-    }
+    },
+    
+    "mandatoryTitle": "Cookies obligatoires",
+    "mandatoryText": "Ce site utilise des cookies nécessaires à son bon fonctionnement qui ne peuvent pas être désactivés."
 };

+ 4 - 1
lang/tarteaucitron.hu.js

@@ -73,5 +73,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Ostatné",
         "details": "Služby na zobrazovanie webového obsahu."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.it.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Altro",
         "details": "Servizi per visualizzare contenuti web."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.ja.js

@@ -73,5 +73,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Other",
         "details": "Services to display web content."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.nl.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Overig",
         "details": "Diensten om webinhoud weer te geven."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.oc.js

@@ -74,5 +74,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Autre",
         "details": "Servicis que cèrcan a afichar de contengut web."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.pl.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Inne",
         "details": "Usługi do wyświetlania treści internetowych."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.pt.js

@@ -70,5 +70,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "De outros",
         "details": "Serviços para exibir conteúdo da web."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.ro.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Alte",
         "details": "Servicii pentru afișarea conținutului web."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.ru.js

@@ -72,5 +72,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Другие",
         "details": "Службы для отображения веб-контента."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 5 - 2
lang/tarteaucitron.se.js

@@ -73,5 +73,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Övrig",
         "details": "Tjänster för att visa webbinnehåll."
-    }
-};
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
+};

+ 4 - 1
lang/tarteaucitron.sk.js

@@ -148,6 +148,9 @@ tarteaucitron.lang = {
 
         "details": "Služby na zobrazovanie webového obsahu."
 
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 
 };

+ 4 - 1
lang/tarteaucitron.tr.js

@@ -76,5 +76,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "diğer\n",
         "details": "Web içeriğini görüntüleme hizmetleri."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 4 - 1
lang/tarteaucitron.vi.js

@@ -73,5 +73,8 @@ tarteaucitron.lang = {
     "other": {
         "title": "Dịch vụ khác",
         "details": "Dịch vụ hiển thị nội dung web."
-    }
+    },
+    
+    "mandatoryTitle": "Mandatory cookies",
+    "mandatoryText": "This site uses cookies necessary for its proper functioning which cannot be deactivated."
 };

+ 25 - 4
tarteaucitron.js

@@ -17,7 +17,7 @@ var scripts = document.getElementsByTagName('script'),
 
 
 var tarteaucitron = {
-    "version": 20200501,
+    "version": 20200521,
     "cdn": cdn,
     "user": {},
     "lang": {},
@@ -214,7 +214,8 @@ var tarteaucitron = {
                 "moreInfoLink": true,
                 "privacyUrl": "",
                 "useExternalCss": false,
-                "useExternalJs": false
+                "useExternalJs": false,
+                "mandatory": false
             },
             params = tarteaucitron.parameters;
 
@@ -321,6 +322,28 @@ var tarteaucitron = {
                 html += '      </div>';
                 html += '      <div class="tarteaucitronBorder">';
                 html += '         <div class="clear"></div><ul>';
+                                            
+                                            
+                if (tarteaucitron.parameters.mandatory == true) {
+                   html += '<li id="tarteaucitronServicesTitle_mandatory">';
+                   html += '<div class="tarteaucitronTitle">';
+                   html += '   <button type="button">&nbsp; ' + tarteaucitron.lang.mandatoryTitle + '</button>';
+                   html += '</div>';
+                   html += '<ul id="tarteaucitronServices_mandatory">';
+                   html += '<li class="tarteaucitronLine">';
+                   html += '   <div class="tarteaucitronName">';
+                   html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>';
+                   html += '       <span class="tarteaucitronListCookies"></span><br/>';
+                   html += '   </div>';
+                   html += '   <div class="tarteaucitronAsk">';
+                   html += '       <button type="button" class="tarteaucitronAllow">';
+                   html += '           &#10003; ' + tarteaucitron.lang.allow;
+                   html += '       </button> ';
+                   html += '   </div>';
+                   html += '</li>';
+                   html += '</ul></li>';
+                }
+
                 for (i = 0; i < cat.length; i += 1) {
                     html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
                     html += '            <div class="tarteaucitronTitle">';
@@ -1412,8 +1435,6 @@ var tarteaucitron = {
             return 'es_ES';
         } else if (userLanguage === 'it') {
             return 'it_IT';
-        } else if (userLanguage === 'oc') {
-            return 'oc_FR';            
         } else if (userLanguage === 'pt') {
             return 'pt_PT';
         } else if (userLanguage === 'nl') {