Accept all with one-click feature

This commit is contained in:
Amauri CHAMPEAUX 2014-10-25 20:58:11 +02:00
parent 3e3da04bc6
commit ed13808eb5
4 changed files with 58 additions and 28 deletions

View File

@ -68,8 +68,8 @@
}
#tarteaucitron b {
font-size: 18px;
font-weight: 700;
font-size: 22px;
font-weight: 500;
}
/***
@ -107,7 +107,6 @@
#tarteaucitron {
background: #fff;
border: 4px solid #fff;
box-shadow: 0 0 15px #4a4a4a;
display: none;
left: 0;
@ -123,7 +122,7 @@
}
#tarteaucitron #tarteaucitronClosePanel {
background: #C63535;
background: #6f6f6f;
border: 4px solid #fff;
border-right: 0;
color: #fff;
@ -139,13 +138,20 @@
}
#tarteaucitron #tarteaucitronInfo {
background: url('//opt-out.ferank.eu/css/img/m.gif') no-repeat scroll left center / contain #CB3333;
background: #eee;
border-bottom: 4px solid #fff;
clear: both;
color: #fff;
font-size: 18px;
padding: 20px 20px 18px 0;
text-align: right;
color: #333;
font-size: 24px;
padding: 20px 20px 18px 20px;
text-align: center;
}
#tarteaucitron #tarteaucitronDisclaimer {
color: #555;
font-size: 12px;
margin: 15px auto 0;
width: 80%;
}
#tarteaucitron #tarteaucitronServices {
@ -155,13 +161,14 @@
}
#tarteaucitron #tarteaucitronServices .tarteaucitronTitle {
background: #d7d7d7;
color: #2d2d2d;
background: #f2f2f2;
color: #333;
font-size: 20px;
padding: 18px 22px;
}
#tarteaucitron #tarteaucitronServices .tarteaucitronTitle .tarteaucitronDetails {
color: #777;
font-size: 13px;
}
@ -176,7 +183,7 @@
margin: 1px 0;
min-height: 100%;
overflow: hidden;
padding: 5px;
padding: 15px 5px;
}
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName {
@ -198,29 +205,26 @@
#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk .tarteaucitronDeny,
.tac_activate .tarteaucitronAllow {
background: gray;
border-radius: 4px;
color: #fff;
cursor: pointer;
display: inline-block;
padding: 5px 10px;
padding: 6px 10px;
text-align: center;
text-decoration: none;
width: auto;
}
#tarteaucitron #tarteaucitronDisclaimer {
background: #fff;
#tarteaucitron #tarteaucitronFooter {
background: #f2f2f2;
border-top: 1px solid #eee;
color: #333;
font-size: 10px;
line-height: 1.5;
margin-top: 10px;
padding: 14px 10px 12px 10px;
margin: 20px auto 0px;
padding: 15px 0 15px;
text-align: center;
}
#tarteaucitron #tarteaucitronDisclaimer a {
#tarteaucitron #tarteaucitronFooter a {
color: #333;
font-size: 10px;
font-style: normal;
text-decoration: underline;
}

View File

@ -3,6 +3,7 @@ tarteaucitron.lang = {
"alertBig": "If you continue to browse this website, you are allowing all third-party services",
"alertSmall": "Manage Cookies",
"personalize": "Personalize",
"acceptAll": "OK, accept all",
"close": "Close",
"info": "Transparency about cookies",

View File

@ -2,6 +2,7 @@
tarteaucitron.lang = {
"alertBig": "En poursuivant votre navigation, vous acceptez l'utilisation de services tiers pouvant installer des cookies",
"alertSmall": "Gestion des cookies",
"acceptAll": "OK, tout accepter",
"personalize": "Personnaliser",
"close": "Fermer",

View File

@ -92,6 +92,9 @@ var tarteaucitron = {
html += ' </div>';
html += ' <div id="tarteaucitronInfo">';
html += ' ' + tarteaucitron.lang.info;
html += ' <div id="tarteaucitronDisclaimer">';
html += ' ' + tarteaucitron.lang.disclaimer;
html += ' </div>';
html += ' </div>';
html += ' <div id="tarteaucitronServices">';
@ -129,19 +132,19 @@ var tarteaucitron = {
}
html += ' </div>';
html += ' <div id="tarteaucitronDisclaimer">';
html += ' ' + tarteaucitron.lang.disclaimer + '<br/><a href="https://opt-out.ferank.eu/" rel="nofollow" target="_blank">' + tarteaucitron.lang.credit + '</a>';
html += ' <div id="tarteaucitronFooter">';
html += ' <a href="https://opt-out.ferank.eu/" rel="nofollow" target="_blank">' + tarteaucitron.lang.credit + '</a>';
html += ' </div>';
html += '</div>';
html += '<div id="tarteaucitronAlertBig">';
html += ' <span id="tarteaucitronDisclaimerAlert">';
html += ' ' + tarteaucitron.lang.alertBig;
html += ' </span>';
html += ' <span id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.openPanel();">';
html += ' ' + tarteaucitron.lang.personalize;
html += ' <span id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.acceptAll();">';
html += ' ' + tarteaucitron.lang.acceptAll;
html += ' </span>';
html += ' <span id="tarteaucitronCloseAlert" onclick="tarteaucitron.userInterface.closeAlert();">';
html += ' ' + tarteaucitron.lang.close;
html += ' <span id="tarteaucitronCloseAlert" onclick="tarteaucitron.userInterface.openPanel();">';
html += ' ' + tarteaucitron.lang.personalize;
html += ' </span>';
html += '</div>';
@ -208,6 +211,27 @@ var tarteaucitron = {
"use strict";
document.getElementById(id).style[property] = value;
},
"acceptAll": function () {
"use strict";
var s = tarteaucitron.services,
service,
key,
index = 0;
for (index = 0; index < tarteaucitron.job.length; index += 1) {
service = s[tarteaucitron.job[index]];
key = service.key;
if (tarteaucitron.launch[key] !== true) {
tarteaucitron.launch[key] = true;
tarteaucitron.services[key].js();
}
tarteaucitron.state[key] = true;
tarteaucitron.cookie.create(key, true);
tarteaucitron.userInterface.color(key, true);
tarteaucitron.userInterface.closeAlert();
}
},
"respond": function (el, status) {
"use strict";
var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');