Merge pull request #372 from prudloff-insite/empty

Display a message when no services are enabled (fixes #368)
This commit is contained in:
Amauri CHAMPEAUX 2019-10-29 16:57:46 +01:00 committed by GitHub
commit 1dfda3889d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ tarteaucitron.lang = {
"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",
"noServices": "This website does not use any cookie requiring your consent.",
"toggleInfoBox": "Show/hide informations about cookie storage", "toggleInfoBox": "Show/hide informations about cookie storage",
"title": "Cookies management panel", "title": "Cookies management panel",

View File

@ -29,6 +29,7 @@ tarteaucitron.lang = {
"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",
"noServices": "Ce site n'utilise aucun cookie nécessitant votre consentement.",
"toggleInfoBox": "Afficher/masquer les informations sur le stockage des cookies", "toggleInfoBox": "Afficher/masquer les informations sur le stockage des cookies",
"title": "Panneau de gestion des cookies", "title": "Panneau de gestion des cookies",

View File

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