|
|
|
@ -17,7 +17,7 @@ var scripts = document.getElementsByTagName('script'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tarteaucitron = {
|
|
|
|
|
"version": 20201110,
|
|
|
|
|
"version": 20210422,
|
|
|
|
|
"cdn": cdn,
|
|
|
|
|
"user": {},
|
|
|
|
|
"lang": {},
|
|
|
|
@ -196,7 +196,7 @@ var tarteaucitron = {
|
|
|
|
|
"use strict";
|
|
|
|
|
var cdn = tarteaucitron.cdn,
|
|
|
|
|
language = tarteaucitron.getLanguage(),
|
|
|
|
|
useJSDelivrMinifiedJS = cdn.includes("cdn.jsdelivr.net"),
|
|
|
|
|
useJSDelivrMinifiedJS = (cdn.indexOf('cdn.jsdelivr.net') >= 0),
|
|
|
|
|
pathToLang = cdn + 'lang/tarteaucitron.' + language + (useJSDelivrMinifiedJS ? '.min' : '') + '.js?v=' + tarteaucitron.version,
|
|
|
|
|
pathToServices = cdn + 'tarteaucitron.services' + (useJSDelivrMinifiedJS ? '.min' : '') + '.js?v=' + tarteaucitron.version,
|
|
|
|
|
linkElement = document.createElement('link'),
|
|
|
|
@ -220,7 +220,8 @@ var tarteaucitron = {
|
|
|
|
|
"useExternalCss": false,
|
|
|
|
|
"useExternalJs": false,
|
|
|
|
|
"mandatory": true,
|
|
|
|
|
"closePopup": false
|
|
|
|
|
"closePopup": false,
|
|
|
|
|
"groupServices": false
|
|
|
|
|
},
|
|
|
|
|
params = tarteaucitron.parameters;
|
|
|
|
|
|
|
|
|
@ -265,8 +266,7 @@ var tarteaucitron = {
|
|
|
|
|
}
|
|
|
|
|
tarteaucitron.addInternalScript(pathToServices, '', function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// css for new middle bar
|
|
|
|
|
// css for the middle bar TODO: add it on the css file
|
|
|
|
|
if (tarteaucitron.orientation === 'middle') {
|
|
|
|
|
var customThemeMiddle = document.createElement('style'),
|
|
|
|
|
cssRuleMiddle = 'div#tarteaucitronRoot.tarteaucitronBeforeVisible:before {content: \'\';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 999;opacity: 0.5;}div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 35px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: auto;margin: auto;left: 50%;top: 50%;transform: translate(-50%, -50%);box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 35px 25px;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}@media screen and (max-width: 900px) {div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;}}';
|
|
|
|
@ -279,6 +279,21 @@ var tarteaucitron = {
|
|
|
|
|
}
|
|
|
|
|
document.getElementsByTagName('head')[0].appendChild(customThemeMiddle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// css for the popup bar TODO: add it on the css file
|
|
|
|
|
if (tarteaucitron.orientation === 'popup') {
|
|
|
|
|
var customThemePopup = document.createElement('style'),
|
|
|
|
|
cssRulePopup = 'div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 22px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {bottom: 0;top: auto!important;left: 8px!important;right: auto!important;transform: initial!important;border-radius: 5px 5px 0 0!important;max-width: 250px!important;width: Calc(100% - 16px)!important;min-width: 0!important;padding: 25px 0;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;font-size: 15px!important;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;width: Calc(100% - 60px);box-sizing: border-box;}';
|
|
|
|
|
|
|
|
|
|
customThemePopup.type = 'text/css';
|
|
|
|
|
if (customThemePopup.styleSheet) {
|
|
|
|
|
customThemePopup.styleSheet.cssText = cssRulePopup;
|
|
|
|
|
} else {
|
|
|
|
|
customThemePopup.appendChild(document.createTextNode(cssRulePopup));
|
|
|
|
|
}
|
|
|
|
|
document.getElementsByTagName('head')[0].appendChild(customThemePopup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var body = document.body,
|
|
|
|
|
div = document.createElement('div'),
|
|
|
|
|
html = '',
|
|
|
|
@ -331,7 +346,7 @@ var tarteaucitron = {
|
|
|
|
|
if (tarteaucitron.parameters.mandatory == true) {
|
|
|
|
|
html += '<li id="tarteaucitronServicesTitle_mandatory">';
|
|
|
|
|
html += '<div class="tarteaucitronTitle">';
|
|
|
|
|
html += ' <button type="button" tabindex="-1"> ' + tarteaucitron.lang.mandatoryTitle + '</button>';
|
|
|
|
|
html += ' <button type="button" tabindex="-1"><span class="tarteaucitronPlus"></span> ' + tarteaucitron.lang.mandatoryTitle + '</button>';
|
|
|
|
|
html += '</div>';
|
|
|
|
|
html += '<ul id="tarteaucitronServices_mandatory">';
|
|
|
|
|
html += '<li class="tarteaucitronLine">';
|
|
|
|
@ -340,7 +355,7 @@ var tarteaucitron = {
|
|
|
|
|
html += ' <span class="tarteaucitronListCookies"></span><br/>';
|
|
|
|
|
html += ' </div>';
|
|
|
|
|
html += ' <div class="tarteaucitronAsk">';
|
|
|
|
|
html += ' <button type="button" class="tarteaucitronAllow" tabindex="-1">';
|
|
|
|
|
html += ' <button type="button" class="tarteaucitronAllow" tabindex="-1" disabled>';
|
|
|
|
|
html += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow;
|
|
|
|
|
html += ' </button> ';
|
|
|
|
|
html += ' <button type="button" class="tarteaucitronDeny" style="visibility:hidden" tabindex="-1">';
|
|
|
|
@ -376,7 +391,7 @@ var tarteaucitron = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
|
|
|
|
|
html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
|
|
|
|
|
html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
|
|
|
|
|
//html += '<div class="tarteaucitronAlertBigWrapper">';
|
|
|
|
|
html += ' <span id="tarteaucitronDisclaimerAlert">';
|
|
|
|
|
html += ' ' + tarteaucitron.lang.alertBigPrivacy;
|
|
|
|
@ -396,7 +411,7 @@ var tarteaucitron = {
|
|
|
|
|
//html += '</div>';
|
|
|
|
|
html += '</div>';
|
|
|
|
|
} else {
|
|
|
|
|
html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
|
|
|
|
|
html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
|
|
|
|
|
//html += '<div class="tarteaucitronAlertBigWrapper">';
|
|
|
|
|
html += ' <span id="tarteaucitronDisclaimerAlert">';
|
|
|
|
|
|
|
|
|
@ -439,7 +454,7 @@ var tarteaucitron = {
|
|
|
|
|
if (tarteaucitron.parameters.showIcon === true) {
|
|
|
|
|
html += '<div id="tarteaucitronIcon" class="tarteaucitronIcon' + tarteaucitron.parameters.iconPosition + '">';
|
|
|
|
|
html += ' <button type="button" id="tarteaucitronManager">';
|
|
|
|
|
html += ' <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwV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71irJmGX1px0JYE26uNErawr2zfIcP4OHEKXm66PA3wjpCNEfpJunI4muifPjKvsFCkGjExTq63yxMJsZNMYF/J4HmDC5A3Yq36jy0ClePHVhwuu/b1HSFlEfHD5ZtD1bEK44Qu1mWys6tbWmZyPWckzlPTGiRw/XHCuk+q4Rek+mVrVL/UppwrdDEGNV2kpyuhccgc5Oxm9vWnn+19vJrVpLor0kTUrGacMplb1CfOFyTD4o9uNrHqr2Z+ZMSp1c2XcVSORnh9Q81q3k599ETgkNnjg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC" alt="Cookies">';
|
|
|
|
|
html += ' <img src="' + (tarteaucitron.parameters.iconSrc ? tarteaucitron.parameters.iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/GeE185wYJ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XW1j7oBErB0d9xM2WEd5J9ZKYtuR4WKwwBSoORbpGrJ5ZI9lt71irJmGX1px0JYE26uNErawr2zfIcP4OHEKXm66PA3wjpCNEfpJunI4muifPjKvsFCkGjExTq63yxMJsZNMYF/J4HmDC5A3Yq36jy0ClePHVhwuu/b1HSFlEfHD5ZtD1bEK44Qu1mWys6tbWmZyPWckzlPTGiRw/XHCuk+q4Rek+mVrVL/UppwrdDEGNV2kpyuhccgc5Oxm9vWnn+19vJrVpLor0kTUrGacMplb1CfOFyTD4o9uNrHqr2Z+ZMSp1c2XcVSORnh9Q81q3k599ETgkNnjg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC') + '" alt="' + tarteaucitron.lang.icon + '" title="' + tarteaucitron.lang.icon + '">';
|
|
|
|
|
html += ' </button>';
|
|
|
|
|
html += '</div>';
|
|
|
|
|
}
|
|
|
|
@ -516,7 +531,11 @@ var tarteaucitron = {
|
|
|
|
|
tarteaucitron.addService(tarteaucitron.job[index]);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
tarteaucitron.job = []
|
|
|
|
|
tarteaucitron.job = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tarteaucitron.job.length === 0) {
|
|
|
|
|
tarteaucitron.userInterface.closeAlert();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tarteaucitron.isAjax = true;
|
|
|
|
@ -580,14 +599,64 @@ var tarteaucitron = {
|
|
|
|
|
}, 1500);
|
|
|
|
|
}
|
|
|
|
|
if(tarteaucitron.parameters.closePopup === true){
|
|
|
|
|
let element = document.getElementById('tarteaucitronAlertBig');
|
|
|
|
|
let span = document.createElement('span')
|
|
|
|
|
span.textContent = 'X';
|
|
|
|
|
span.setAttribute('id', "tarteaucitronCloseCross")
|
|
|
|
|
element.insertBefore(span, element.firstElementChild)
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
var closeElement = document.getElementById('tarteaucitronAlertBig'),
|
|
|
|
|
closeSpan = document.createElement('span');
|
|
|
|
|
if (closeElement) {
|
|
|
|
|
closeSpan.textContent = 'X';
|
|
|
|
|
closeSpan.setAttribute('id', "tarteaucitronCloseCross");
|
|
|
|
|
closeElement.insertBefore(closeSpan, closeElement.firstElementChild);
|
|
|
|
|
}
|
|
|
|
|
}, 100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(tarteaucitron.parameters.groupServices === true) {
|
|
|
|
|
var tac_group_style = document.createElement('style');
|
|
|
|
|
tac_group_style.innerHTML = '.tarteaucitronTitle{display:none}';
|
|
|
|
|
document.head.appendChild(tac_group_style);
|
|
|
|
|
var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
|
|
|
|
|
Array.prototype.forEach.call(cats, function(item) {
|
|
|
|
|
var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, "");
|
|
|
|
|
if (cat !== "mandatory") {
|
|
|
|
|
var html = '';
|
|
|
|
|
html += '<li class="tarteaucitronLine">';
|
|
|
|
|
html += ' <div class="tarteaucitronName">';
|
|
|
|
|
html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">'+tarteaucitron.lang[cat].title+'</span>';
|
|
|
|
|
html += ' <span>'+tarteaucitron.lang[cat].details+'</span>';
|
|
|
|
|
html += ' <button type="button" class="tarteaucitron-toggle-group" id="tarteaucitron-toggle-group-'+cat+'">'+tarteaucitron.lang.alertSmall+' ('+document.getElementById("tarteaucitronServices_"+cat).childElementCount+')</button>';
|
|
|
|
|
html += ' </div>';
|
|
|
|
|
html += ' <div class="tarteaucitronAsk" id="tarteaucitron-group-'+cat+'">';
|
|
|
|
|
html += ' <button type="button" class="tarteaucitronAllow" id="tarteaucitron-accept-group-'+cat+'">';
|
|
|
|
|
html += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow;
|
|
|
|
|
html += ' </button> ';
|
|
|
|
|
html += ' <button type="button" class="tarteaucitronDeny" id="tarteaucitron-reject-group-'+cat+'">';
|
|
|
|
|
html += ' <span class="tarteaucitronCross"></span> ' + tarteaucitron.lang.deny;
|
|
|
|
|
html += ' </button>';
|
|
|
|
|
html += ' </div>';
|
|
|
|
|
html += '</li>';
|
|
|
|
|
var ul = document.createElement('ul');
|
|
|
|
|
ul.innerHTML = html;
|
|
|
|
|
item.insertBefore(ul, item.querySelector('#tarteaucitronServices_'+cat+''));
|
|
|
|
|
document.querySelector('#tarteaucitronServices_' + cat).style.display = 'none';
|
|
|
|
|
tarteaucitron.addClickEventToId("tarteaucitron-toggle-group-" + cat, function () {
|
|
|
|
|
tarteaucitron.userInterface.toggle('tarteaucitronServices_' + cat);
|
|
|
|
|
if (document.getElementById('tarteaucitronServices_' + cat).style.display == 'block') {
|
|
|
|
|
tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
|
|
|
|
|
} else {
|
|
|
|
|
tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
tarteaucitron.addClickEventToId("tarteaucitron-accept-group-" + cat, function () {
|
|
|
|
|
tarteaucitron.userInterface.respondAll(true, cat);
|
|
|
|
|
});
|
|
|
|
|
tarteaucitron.addClickEventToId("tarteaucitron-reject-group-" + cat, function () {
|
|
|
|
|
tarteaucitron.userInterface.respondAll(false, cat);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
tarteaucitron.userInterface.color("", true);
|
|
|
|
|
|
|
|
|
|
// add a little timeout to be sure everything is accessible
|
|
|
|
|
setTimeout(function () {
|
|
|
|
@ -627,7 +696,7 @@ var tarteaucitron = {
|
|
|
|
|
tarteaucitron.userInterface.respondAll(true);
|
|
|
|
|
});
|
|
|
|
|
tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () {
|
|
|
|
|
tarteaucitron.userInterface.respondAll(false, '', true);
|
|
|
|
|
tarteaucitron.userInterface.respondAll(false);
|
|
|
|
|
});
|
|
|
|
|
tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () {
|
|
|
|
|
tarteaucitron.userInterface.respondAll(false, '', true);
|
|
|
|
@ -662,14 +731,13 @@ var tarteaucitron = {
|
|
|
|
|
tarteaucitron.userInterface.respond(this, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if(tarteaucitron.events.load) {
|
|
|
|
|
tarteaucitron.events.load();
|
|
|
|
|
}
|
|
|
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(tarteaucitron.events.load) {
|
|
|
|
|
tarteaucitron.events.load();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"addService": function (serviceId) {
|
|
|
|
|
"use strict";
|
|
|
|
@ -685,14 +753,15 @@ var tarteaucitron = {
|
|
|
|
|
isDenied = (cookie.indexOf(service.key + '=false') >= 0),
|
|
|
|
|
isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)),
|
|
|
|
|
isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
|
|
|
|
|
isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1");
|
|
|
|
|
isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"),
|
|
|
|
|
currentStatus = (isAllowed) ? tarteaucitron.lang.allowed : tarteaucitron.lang.disallowed;
|
|
|
|
|
|
|
|
|
|
if (tarteaucitron.added[service.key] !== true) {
|
|
|
|
|
tarteaucitron.added[service.key] = true;
|
|
|
|
|
|
|
|
|
|
html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
|
|
|
|
|
html += ' <div class="tarteaucitronName">';
|
|
|
|
|
html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>';
|
|
|
|
|
html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + ' (<span id="tacCurrentStatus' + service.key + '">'+currentStatus+'</span>)</span>';
|
|
|
|
|
html += ' <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
|
|
|
|
|
|
|
|
|
|
if (tarteaucitron.parameters.moreInfoLink == true) {
|
|
|
|
@ -704,11 +773,11 @@ var tarteaucitron = {
|
|
|
|
|
if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
|
|
|
|
|
link = tarteaucitron.parameters.readmoreLink;
|
|
|
|
|
}
|
|
|
|
|
html += ' <a href="' + link + '" target="_blank" rel="noreferrer noopener nofollow" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'">';
|
|
|
|
|
html += ' <a href="' + link + '" target="_blank" rel="noreferrer noopener nofollow" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'" class="tarteaucitronReadmoreInfo">';
|
|
|
|
|
html += ' ' + tarteaucitron.lang.more;
|
|
|
|
|
html += ' </a>';
|
|
|
|
|
html += ' - ';
|
|
|
|
|
html += ' <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + service.name + ' ' + tarteaucitron.lang.newWindow + '">';
|
|
|
|
|
html += ' <span class="tarteaucitronReadmoreSeparator"> - </span>';
|
|
|
|
|
html += ' <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + service.name + ' ' + tarteaucitron.lang.newWindow + '" class="tarteaucitronReadmoreOfficial">';
|
|
|
|
|
html += ' ' + tarteaucitron.lang.source;
|
|
|
|
|
html += ' </a>';
|
|
|
|
|
}
|
|
|
|
@ -895,6 +964,12 @@ var tarteaucitron = {
|
|
|
|
|
if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
|
|
|
|
|
tarteaucitron.sendEvent(key + '_loaded');
|
|
|
|
|
}
|
|
|
|
|
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
|
|
|
|
|
if(status == true){
|
|
|
|
|
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
|
|
|
|
|
}else{
|
|
|
|
|
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
|
|
|
|
|
}
|
|
|
|
|
tarteaucitron.state[key] = status;
|
|
|
|
|
tarteaucitron.cookie.create(key, status);
|
|
|
|
|
tarteaucitron.userInterface.color(key, status);
|
|
|
|
@ -930,6 +1005,12 @@ var tarteaucitron = {
|
|
|
|
|
if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
|
|
|
|
|
if(status == true){
|
|
|
|
|
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
|
|
|
|
|
}else{
|
|
|
|
|
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
|
|
|
|
|
}
|
|
|
|
|
tarteaucitron.state[key] = status;
|
|
|
|
|
tarteaucitron.cookie.create(key, status);
|
|
|
|
|
tarteaucitron.userInterface.color(key, status);
|
|
|
|
@ -944,6 +1025,8 @@ var tarteaucitron = {
|
|
|
|
|
index,
|
|
|
|
|
s = tarteaucitron.services;
|
|
|
|
|
|
|
|
|
|
if (key !== "") {
|
|
|
|
|
|
|
|
|
|
if (status === true) {
|
|
|
|
|
document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed');
|
|
|
|
|
document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied');
|
|
|
|
@ -953,10 +1036,11 @@ var tarteaucitron = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check if all services are allowed
|
|
|
|
|
var sumToRemove = 0;
|
|
|
|
|
for (index = 0; index < sum; index += 1) {
|
|
|
|
|
|
|
|
|
|
if (typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) {
|
|
|
|
|
sum -= 1;
|
|
|
|
|
sumToRemove += 1;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -968,6 +1052,7 @@ var tarteaucitron = {
|
|
|
|
|
nbAllowed += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sum -= sumToRemove;
|
|
|
|
|
|
|
|
|
|
tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
|
|
|
|
|
tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
|
|
|
|
@ -1012,6 +1097,41 @@ var tarteaucitron = {
|
|
|
|
|
} else {
|
|
|
|
|
tarteaucitron.cookie.checkCount(key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// groups
|
|
|
|
|
var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
|
|
|
|
|
Array.prototype.forEach.call(cats, function(item) {
|
|
|
|
|
var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""),
|
|
|
|
|
total = document.getElementById("tarteaucitronServices_"+cat).childElementCount;
|
|
|
|
|
var doc = document.getElementById("tarteaucitronServices_"+cat),
|
|
|
|
|
groupdenied = 0,
|
|
|
|
|
groupallowed = 0;
|
|
|
|
|
for (var ii = 0; ii < doc.children.length; ii++) {
|
|
|
|
|
if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") {
|
|
|
|
|
groupdenied++;
|
|
|
|
|
}
|
|
|
|
|
if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") {
|
|
|
|
|
groupallowed++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (total === groupallowed) {
|
|
|
|
|
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
|
|
|
|
|
tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
|
|
|
|
|
}
|
|
|
|
|
if (total === groupdenied) {
|
|
|
|
|
tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
|
|
|
|
|
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
|
|
|
|
|
}
|
|
|
|
|
if (total !== groupdenied && total !== groupallowed) {
|
|
|
|
|
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
|
|
|
|
|
tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
|
|
|
|
|
}
|
|
|
|
|
groupdenied = 0;
|
|
|
|
|
groupallowed = 0;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
"openPanel": function () {
|
|
|
|
|
"use strict";
|
|
|
|
@ -1135,6 +1255,10 @@ var tarteaucitron = {
|
|
|
|
|
}
|
|
|
|
|
//end ie compatibility
|
|
|
|
|
|
|
|
|
|
if (document.getElementById('tarteaucitronAlertBig') !== null) {
|
|
|
|
|
document.getElementById('tarteaucitronAlertBig').focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.dispatchEvent(tacOpenAlertEvent);
|
|
|
|
|
},
|
|
|
|
|
"closeAlert": function () {
|
|
|
|
@ -1556,8 +1680,7 @@ var tarteaucitron = {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"fixSelfXSS": function(html) {
|
|
|
|
|
fixed = html.toString().replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
|
|
|
return fixed;
|
|
|
|
|
return html.toString().replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
|
|
|
},
|
|
|
|
|
"getLanguage": function () {
|
|
|
|
|
"use strict";
|
|
|
|
@ -1834,5 +1957,21 @@ var tarteaucitron = {
|
|
|
|
|
e.attachEvent("onclick", func);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"triggerJobsAfterAjaxCall": function() {
|
|
|
|
|
tarteaucitron.job.forEach(function(e) { tarteaucitron.job.push(e) });
|
|
|
|
|
var i;
|
|
|
|
|
var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
|
|
|
|
|
for (i = 0; i < allowBtns.length; i++) {
|
|
|
|
|
tarteaucitron.addClickEventToElement(allowBtns[i], function () {
|
|
|
|
|
tarteaucitron.userInterface.respond(this, true);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
|
|
|
|
|
for (i = 0; i < denyBtns.length; i++) {
|
|
|
|
|
tarteaucitron.addClickEventToElement(denyBtns[i], function () {
|
|
|
|
|
tarteaucitron.userInterface.respond(this, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|