Jelajahi Sumber

Display a message when no services are enabled (fixes #368)

Pierre Rudloff 5 tahun lalu
induk
melakukan
3c3654750c
3 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 1 0
      lang/tarteaucitron.en.js
  2. 1 0
      lang/tarteaucitron.fr.js
  3. 3 0
      tarteaucitron.js

+ 1 - 0
lang/tarteaucitron.en.js

@@ -29,6 +29,7 @@ tarteaucitron.lang = {
     "more": "Read more",
     "source": "View the official website",
     "credit": "Cookies manager by tarteaucitron.js",
+    "noServices": "This website does not use any cookie requiring your consent.",
 
     "toggleInfoBox": "Show/hide informations about cookie storage",
     "title": "Cookies management panel",

+ 1 - 0
lang/tarteaucitron.fr.js

@@ -29,6 +29,7 @@ tarteaucitron.lang = {
     "more": "En savoir plus",
     "source": "Voir le site officiel",
     "credit": "Gestion des cookies par tarteaucitron.js",
+    "noServices": "Ce site n'utilise aucun cookie nécessitant votre consentement.",
 
     "toggleInfoBox": "Afficher/masquer les informations sur le stockage des cookies",
     "title": "Panneau de gestion des cookies",

+ 3 - 0
tarteaucitron.js

@@ -314,6 +314,7 @@ var tarteaucitron = {
                     html += '            </div>';
                     html += '         <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>';
                 }
+                html += '             <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>';
                 html += '         </ul>';
                 html += '         <div class="tarteaucitronHidden" id="tarteaucitronScrollbarChild" style="height:20px;display:block"></div>';
                 if (tarteaucitron.parameters.removeCredit === false) {
@@ -576,6 +577,8 @@ var tarteaucitron = {
                 document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
             }
 
+            tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
+
             tarteaucitron.userInterface.order(service.type);
         }