@ -17,7 +17,7 @@ var scripts = document.getElementsByTagName('script'),
var tarteaucitron = {
"version" : 20210422 ,
"version" : 20210509 ,
"cdn" : cdn ,
"user" : { } ,
"lang" : { } ,
@ -250,6 +250,7 @@ var tarteaucitron = {
tarteaucitron . hashtag = tarteaucitron . parameters . hashtag ;
tarteaucitron . highPrivacy = tarteaucitron . parameters . highPrivacy ;
tarteaucitron . handleBrowserDNTRequest = tarteaucitron . parameters . handleBrowserDNTRequest ;
tarteaucitron . customCloserId = tarteaucitron . parameters . customCloserId ;
// Step 1: load css
if ( ! tarteaucitron . parameters . useExternalCss ) {
@ -293,7 +294,7 @@ var tarteaucitron = {
}
document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( customThemePopup ) ;
}
var body = document . body ,
div = document . createElement ( 'div' ) ,
html = '' ,
@ -310,9 +311,17 @@ var tarteaucitron = {
// Step 3: prepare the html
html += '<div id="tarteaucitronPremium"></div>' ;
html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron . lang . close + '"></button>' ;
html += '<div id="tarteaucitron" role="dialog" aria-labelledby="dialogTitle">' ;
html += ' <button type="button" id="tarteaucitronClosePanel">' ;
if ( tarteaucitron . reloadThePage ) {
html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron . lang . close + ' (' + tarteaucitron . lang . reload + ')"></button>' ;
} else {
html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron . lang . close + '"></button>' ;
}
html += '<div id="tarteaucitron" role="dialog" aria-modal="true" aria-describedby="tarteaucitronInfo" aria-labelledby="dialogTitle" tabindex="-1">' ;
if ( tarteaucitron . reloadThePage ) {
html += ' <button type="button" id="tarteaucitronClosePanel" aria-label="' + tarteaucitron . lang . close + ' (' + tarteaucitron . lang . reload + ')">' ;
} else {
html += ' <button type="button" id="tarteaucitronClosePanel">' ;
}
html += ' ' + tarteaucitron . lang . close ;
html += ' </button>' ;
html += ' <div id="tarteaucitronServices">' ;
@ -322,7 +331,7 @@ var tarteaucitron = {
html += ' ' + tarteaucitron . lang . disclaimer ;
if ( tarteaucitron . parameters . privacyUrl !== "" ) {
html += ' <br/><br/>' ;
html += ' <button type="button" id="tarteaucitronPrivacyUrlDialog">' ;
html += ' <button type="button" id="tarteaucitronPrivacyUrlDialog" role="link" >' ;
html += ' ' + tarteaucitron . lang . privacyUrl ;
html += ' </button>' ;
}
@ -397,12 +406,12 @@ var tarteaucitron = {
html += ' ' + tarteaucitron . lang . alertBigPrivacy ;
html += ' </span>' ;
//html += ' <span class="tarteaucitronAlertBigBtnWrapper">';
html += ' <button type="button" id="tarteaucitronPersonalize">' ;
html += ' <button type="button" id="tarteaucitronPersonalize" aria-label="' + tarteaucitron . lang . personalize + ' ' + tarteaucitron . lang . modalWindow + '" >' ;
html += ' ' + tarteaucitron . lang . personalize ;
html += ' </button>' ;
if ( tarteaucitron . parameters . privacyUrl !== "" ) {
html += ' <button type="button" id="tarteaucitronPrivacyUrl">' ;
html += ' <button role="link" type="button" id="tarteaucitronPrivacyUrl">' ;
html += ' ' + tarteaucitron . lang . privacyUrl ;
html += ' </button>' ;
}
@ -429,18 +438,22 @@ var tarteaucitron = {
if ( tarteaucitron . parameters . DenyAllCta ) {
if ( tarteaucitron . reloadThePage ) {
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-label="' + tarteaucitron . lang . denyAll + ' (' + tarteaucitron . lang . reload + ')">' ;
} else {
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">' ;
}
html += ' <span class="tarteaucitronCross"></span> ' + tarteaucitron . lang . denyAll ;
html += ' </button>' ;
//html += ' <br/><br/>';
}
html += ' <button type="button" id="tarteaucitronCloseAlert">' ;
html += ' <button type="button" id="tarteaucitronCloseAlert" aria-label="' + tarteaucitron . lang . personalize + ' ' + tarteaucitron . lang . modalWindow + '" >' ;
html += ' ' + tarteaucitron . lang . personalize ;
html += ' </button>' ;
if ( tarteaucitron . parameters . privacyUrl !== "" ) {
html += ' <button type="button" id="tarteaucitronPrivacyUrl">' ;
html += ' <button type="button" id="tarteaucitronPrivacyUrl" role="link" >' ;
html += ' ' + tarteaucitron . lang . privacyUrl ;
html += ' </button>' ;
}
@ -454,14 +467,14 @@ 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="' + ( tarteaucitron . parameters . iconSrc ? tarteaucitron . parameters . iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwVGWIucuohsKynMS47fAQyls/BMSRmKJo3AFhG5wm2N1wF+Zs3zebbFfR0RxrXcJHQlgH+LMW616pR/WiIMEXfW3mtzXyeEGWsjKot8c4TOI98L+iKaR5PS6IUk88RLAO9F8UjrbYoYMOosNavpfmODIiwRXRR/G3ohaWVo1RU/c30jV8ab2mV8qVGzHWBOLyTLZiWs5Rolg/C3ySOi0tXP/k4aEwOwSBKPJs7Rp16ABJTe+p1xVX0It/owqqdDEMRoqd3RFxqDPh20Ig6VEPVC0i5RSCD+6wl6HlW7GksSlUMV11/GrUs5NasFLusDE9ELSVphXemtJwaT/8JyIRvxNNCfBmIiNdR04LII3DSrbe0yj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PgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC' ) + '" alt="' + tarteaucitron . lang . icon + '" title="' + tarteaucitron . lang . icon + '">' ;
html += ' <img src="' + ( tarteaucitron . parameters . iconSrc ? tarteaucitron . parameters . iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwVGWIucuohsKynMS47fAQyls/BMSRmKJo3AFhG5wm2N1wF+Zs3zebbFfR0RxrXcJHQlgH+LMW616pR/WiIMEXfW3mtzXyeEGWsjKot8c4TOI98L+iKaR5PS6IUk88RLAO9F8UjrbYoYMOosNavpfmODIiwRXRR/G3ohaWVo1RU/c30jV8ab2mV8qVGzHWBOLyTLZiWs5Rolg/C3ySOi0tXP/k4aEwOwSBKPJs7Rp16ABJTe+p1xVX0It/owqqdDEMRoqd3RFxqDPh20Ig6VEPVC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njg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC' ) + '" alt="' + tarteaucitron . lang . icon + ' ' + tarteaucitron . lang . modalWindow + ' " title="' + tarteaucitron . lang . icon + ' ' + tarteaucitron . lang . modalWindow + '">' ;
html += ' </button>' ;
html += '</div>' ;
}
if ( tarteaucitron . parameters . showAlertSmall === true ) {
html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">' ;
html += ' <button type="button" id="tarteaucitronManager">' ;
html += ' <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron . lang . alertSmall + ' ' + tarteaucitron . lang . modalWindow + '" >' ;
html += ' ' + tarteaucitron . lang . alertSmall ;
html += ' <span id="tarteaucitronDot">' ;
html += ' <span id="tarteaucitronDotGreen"></span>' ;
@ -472,7 +485,11 @@ var tarteaucitron = {
html += ' </button><!-- @whitespace' ;
html += ' --><button type="button" id="tarteaucitronCookiesNumber">0</button>' ;
html += ' <div id="tarteaucitronCookiesListContainer">' ;
html += ' <button type="button" id="tarteaucitronClosePanelCookie">' ;
if ( tarteaucitron . reloadThePage ) {
html += ' <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' + tarteaucitron . lang . close + ' (' + tarteaucitron . lang . reload + ')">' ;
} else {
html += ' <button type="button" id="tarteaucitronClosePanelCookie">' ;
}
html += ' ' + tarteaucitron . lang . close ;
html += ' </button>' ;
html += ' <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">' ;
@ -517,13 +534,13 @@ var tarteaucitron = {
var tacRootAvailableEvent ;
if ( typeof ( Event ) === 'function' ) {
tacRootAvailableEvent = new Event ( "tac.root_available" ) ;
} else {
} else if ( typeof ( document . createEvent ) === 'function' ) {
tacRootAvailableEvent = document . createEvent ( 'Event' ) ;
tacRootAvailableEvent . initEvent ( "tac.root_available" , true , true ) ;
}
//end ie compatibility
window . dispatchEvent ( tacRootAvailableEvent ) ;
if ( typeof ( window . dispatchEvent ) === 'function' ) { window . dispatchEvent ( tacRootAvailableEvent ) ; }
if ( tarteaucitron . job !== undefined ) {
tarteaucitron . job = tarteaucitron . cleanArray ( tarteaucitron . job ) ;
@ -622,15 +639,15 @@ var tarteaucitron = {
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 class="tarteaucitronH3" role="heading" aria-level="2 ">' + 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 += ' <button type="button" aria-expanded="false" 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 += ' <button type="button" aria-label="' + tarteaucitron . lang . allow + ' ' + tarteaucitron . lang [ cat ] . title + '" 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 += ' <button type="button" aria-label="' + tarteaucitron . lang . deny + ' ' + tarteaucitron . lang [ cat ] . title + '" class="tarteaucitronDeny" id="tarteaucitron-reject-group-' + cat + '">' ;
html += ' <span class="tarteaucitronCross"></span> ' + tarteaucitron . lang . deny ;
html += ' </button>' ;
html += ' </div>' ;
@ -643,8 +660,10 @@ var tarteaucitron = {
tarteaucitron . userInterface . toggle ( 'tarteaucitronServices_' + cat ) ;
if ( document . getElementById ( 'tarteaucitronServices_' + cat ) . style . display == 'block' ) {
tarteaucitron . userInterface . addClass ( 'tarteaucitronServicesTitle_' + cat , 'tarteaucitronIsExpanded' ) ;
document . getElementById ( 'tarteaucitron-toggle-group-' + cat ) . setAttribute ( 'aria-expanded' , 'true' ) ;
} else {
tarteaucitron . userInterface . removeClass ( 'tarteaucitronServicesTitle_' + cat , 'tarteaucitronIsExpanded' ) ;
document . getElementById ( 'tarteaucitron-toggle-group-' + cat ) . setAttribute ( 'aria-expanded' , 'false' ) ;
}
} ) ;
tarteaucitron . addClickEventToId ( "tarteaucitron-accept-group-" + cat , function ( ) {
@ -660,7 +679,7 @@ var tarteaucitron = {
// add a little timeout to be sure everything is accessible
setTimeout ( function ( ) {
// Setup events
tarteaucitron . addClickEventToId ( "tarteaucitronCloseCross" , function ( ) {
tarteaucitron . userInterface . closeAlert ( ) ;
@ -735,7 +754,7 @@ var tarteaucitron = {
tarteaucitron . events . load ( ) ;
}
} , 500 ) ;
} ) ;
} ) ;
} ,
@ -761,9 +780,10 @@ var tarteaucitron = {
html += '<li id="' + service . key + 'Line" class="tarteaucitronLine">' ;
html += ' <div class="tarteaucitronName">' ;
html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + service . name + ' (<span id="tacCurrentStatus' + service . key + '">' + currentStatus + '</span>)</span>' ;
html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + service . name + '</span>' ;
html += ' <span class="tacCurrentStatus" id="tacCurrentStatus' + service . key + '">' + currentStatus + '</span>' ;
html += ' <span class="tarteaucitronReadmoreSeparator"> - </span>' ;
html += ' <span id="tacCL' + service . key + '" class="tarteaucitronListCookies"></span><br/>' ;
if ( tarteaucitron . parameters . moreInfoLink == true ) {
var link = 'https://tarteaucitron.io/service/' + service . key + '/' ;
@ -777,17 +797,17 @@ var tarteaucitron = {
html += ' ' + tarteaucitron . lang . more ;
html += ' </a>' ;
html += ' <span class="tarteaucitronReadmoreSeparator"> - </span>' ;
html += ' <a href="' + service . uri + '" target="_blank" rel="noreferrer noopener" title="' + service . name + ' ' + tarteaucitron . lang . newWindow + '" class="tarteaucitronReadmoreOfficial">' ;
html += ' <a href="' + service . uri + '" target="_blank" rel="noreferrer noopener" title="' + tarteaucitron . lang . source + ' ' + service . name + ' ' + tarteaucitron . lang . newWindow + '" class="tarteaucitronReadmoreOfficial">' ;
html += ' ' + tarteaucitron . lang . source ;
html += ' </a>' ;
}
html += ' </div>' ;
html += ' <div class="tarteaucitronAsk">' ;
html += ' <button type="button" id="' + service . key + 'Allowed" class="tarteaucitronAllow">' ;
html += ' <button type="button" aria-label="' + tarteaucitron . lang . allow + ' ' + service . name + '" id="' + service . key + 'Allowed" class="tarteaucitronAllow">' ;
html += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron . lang . allow ;
html += ' </button> ' ;
html += ' <button type="button" id="' + service . key + 'Denied" class="tarteaucitronDeny">' ;
html += ' <button type="button" aria-label="' + tarteaucitron . lang . deny + ' ' + service . name + '" id="' + service . key + 'Denied" class="tarteaucitronDeny">' ;
html += ' <span class="tarteaucitronCross"></span> ' + tarteaucitron . lang . deny ;
html += ' </button>' ;
html += ' </div>' ;
@ -862,7 +882,7 @@ var tarteaucitron = {
var send _event _item ;
if ( typeof ( Event ) === 'function' ) {
send _event _item = new Event ( event _key ) ;
} else {
} else if ( typeof ( document . createEvent ) === 'function' ) {
send _event _item = document . createEvent ( 'Event' ) ;
send _event _item . initEvent ( event _key , true , true ) ;
}
@ -908,12 +928,12 @@ var tarteaucitron = {
} else {
document . getElementById ( id ) . style [ property ] = value ;
if ( property == "display" && value == "block" && ( id == "tarteaucitron" || id == "tarteaucitronAlertBig" ) ) {
document . getElementById ( id ) . style [ "opacity" ] = "0" ;
setTimeout ( function ( ) { document . getElementById ( id ) . style [ "opacity" ] = "1" ; } , 1 ) ;
}
if ( property == "display" && value == "block" && id == "tarteaucitronBack" ) {
document . getElementById ( id ) . style [ "opacity" ] = "0" ;
setTimeout ( function ( ) { document . getElementById ( id ) . style [ "opacity" ] = "0.7" ; } , 1 ) ;
@ -923,13 +943,13 @@ var tarteaucitron = {
} ,
"addClass" : function ( id , className ) {
"use strict" ;
if ( document . getElementById ( id ) !== null ) {
if ( document . getElementById ( id ) !== null && document . getElementById ( id ) . classList !== undefined ) {
document . getElementById ( id ) . classList . add ( className ) ;
}
} ,
"removeClass" : function ( id , className ) {
"use strict" ;
if ( document . getElementById ( id ) !== null ) {
if ( document . getElementById ( id ) !== null && document . getElementById ( id ) . classList !== undefined ) {
document . getElementById ( id ) . classList . remove ( className ) ;
}
} ,
@ -955,6 +975,10 @@ var tarteaucitron = {
if ( tarteaucitron . state [ key ] !== status ) {
if ( status === false && tarteaucitron . launch [ key ] === true ) {
tarteaucitron . reloadThePage = true ;
if ( tarteaucitron . checkIfExist ( 'tarteaucitronClosePanel' ) ) {
var ariaCloseValue = document . getElementById ( 'tarteaucitronClosePanel' ) . textContent . trim ( ) + ' (' + tarteaucitron . lang . reload + ')' ;
document . getElementById ( 'tarteaucitronClosePanel' ) . setAttribute ( "aria-label" , ariaCloseValue ) ;
}
}
if ( tarteaucitron . launch [ key ] !== true && status === true ) {
@ -992,6 +1016,10 @@ var tarteaucitron = {
if ( status === false && tarteaucitron . launch [ key ] === true ) {
tarteaucitron . reloadThePage = true ;
if ( tarteaucitron . checkIfExist ( 'tarteaucitronClosePanel' ) ) {
var ariaCloseValue = document . getElementById ( 'tarteaucitronClosePanel' ) . textContent . trim ( ) + ' (' + tarteaucitron . lang . reload + ')' ;
document . getElementById ( 'tarteaucitronClosePanel' ) . setAttribute ( "aria-label" , ariaCloseValue ) ;
}
}
// if not already launched... launch the service
@ -1001,8 +1029,8 @@ var tarteaucitron = {
tarteaucitron . pro ( '!' + key + '=engage' ) ;
tarteaucitron . launch [ key ] = true ;
tarteaucitron . sendEvent ( key + '_loaded' ) ;
if ( typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic . indexOf ( "_" + key + "_" ) < 0 ) { tarteaucitron . services [ key ] . js ( ) ; }
tarteaucitron . sendEvent ( key + '_loaded' ) ;
}
}
var itemStatusElem = document . getElementById ( 'tacCurrentStatus' + key ) ;
@ -1028,11 +1056,18 @@ var tarteaucitron = {
if ( key !== "" ) {
if ( status === true ) {
document . getElementById ( key + 'Line' ) . classList . add ( 'tarteaucitronIsAllowed' ) ;
document . getElementById ( key + 'Line' ) . classList . remove ( 'tarteaucitronIsDenied' ) ;
tarteaucitron . userInterface . addClass ( key + 'Line' , 'tarteaucitronIsAllowed' ) ;
tarteaucitron . userInterface . removeClass ( key + 'Line' , 'tarteaucitronIsDenied' ) ;
document . getElementById ( key + 'Allowed' ) . setAttribute ( 'aria-pressed' , 'true' ) ;
document . getElementById ( key + 'Denied' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
} else if ( status === false ) {
document . getElementById ( key + 'Line' ) . classList . remove ( 'tarteaucitronIsAllowed' ) ;
document . getElementById ( key + 'Line' ) . classList . add ( 'tarteaucitronIsDenied' ) ;
tarteaucitron . userInterface . removeClass ( key + 'Line' , 'tarteaucitronIsAllowed' ) ;
tarteaucitron . userInterface . addClass ( key + 'Line' , 'tarteaucitronIsDenied' ) ;
document . getElementById ( key + 'Allowed' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
document . getElementById ( key + 'Denied' ) . setAttribute ( 'aria-pressed' , 'true' ) ;
} else {
document . getElementById ( key + 'Allowed' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
document . getElementById ( key + 'Denied' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
}
// check if all services are allowed
@ -1064,18 +1099,29 @@ var tarteaucitron = {
tarteaucitron . userInterface . addClass ( c + 'MainLineOffset' , c + 'IsAllowed' ) ;
tarteaucitron . userInterface . removeClass ( c + 'MainLineOffset' , c + 'IsDenied' ) ;
document . getElementById ( c + 'AllDenied' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
document . getElementById ( c + 'AllAllowed' ) . setAttribute ( 'aria-pressed' , 'true' ) ;
} else if ( nbAllowed === 0 && nbPending === 0 ) {
tarteaucitron . userInterface . removeClass ( c + 'AllAllowed' , c + 'IsSelected' ) ;
tarteaucitron . userInterface . addClass ( c + 'AllDenied' , c + 'IsSelected' ) ;
tarteaucitron . userInterface . removeClass ( c + 'MainLineOffset' , c + 'IsAllowed' ) ;
tarteaucitron . userInterface . addClass ( c + 'MainLineOffset' , c + 'IsDenied' ) ;
document . getElementById ( c + 'AllDenied' ) . setAttribute ( 'aria-pressed' , 'true' ) ;
document . getElementById ( c + 'AllAllowed' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
} else {
tarteaucitron . userInterface . removeClass ( c + 'AllAllowed' , c + 'IsSelected' ) ;
tarteaucitron . userInterface . removeClass ( c + 'AllDenied' , c + 'IsSelected' ) ;
tarteaucitron . userInterface . removeClass ( c + 'MainLineOffset' , c + 'IsAllowed' ) ;
tarteaucitron . userInterface . removeClass ( c + 'MainLineOffset' , c + 'IsDenied' ) ;
document . getElementById ( c + 'AllDenied' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
document . getElementById ( c + 'AllAllowed' ) . setAttribute ( 'aria-pressed' , 'false' ) ;
}
// close the alert if all service have been reviewed
@ -1110,26 +1156,41 @@ var tarteaucitron = {
groupallowed = 0 ;
for ( var ii = 0 ; ii < doc . children . length ; ii ++ ) {
if ( doc . children [ ii ] . className == "tarteaucitronLine tarteaucitronIsDenied" ) {
groupdenied ++ ;
groupdenied ++ ;
}
if ( doc . children [ ii ] . className == "tarteaucitronLine tarteaucitronIsAllowed" ) {
groupallowed ++ ;
groupallowed ++ ;
}
}
if ( total === groupallowed ) {
tarteaucitron . userInterface . removeClass ( 'tarteaucitron-group-' + cat , 'tarteaucitronIsDenied' ) ;
tarteaucitron . userInterface . addClass ( 'tarteaucitron-group-' + cat , 'tarteaucitronIsAllowed' ) ;
if ( document . getElementById ( 'tarteaucitron-reject-group-' + cat ) ) {
document . getElementById ( 'tarteaucitron-reject-group-' + cat ) . setAttribute ( 'aria-pressed' , 'false' ) ;
document . getElementById ( 'tarteaucitron-accept-group-' + cat ) . setAttribute ( 'aria-pressed' , 'true' ) ;
}
}
if ( total === groupdenied ) {
tarteaucitron . userInterface . addClass ( 'tarteaucitron-group-' + cat , 'tarteaucitronIsDenied' ) ;
tarteaucitron . userInterface . removeClass ( 'tarteaucitron-group-' + cat , 'tarteaucitronIsAllowed' ) ;
if ( document . getElementById ( 'tarteaucitron-reject-group-' + cat ) ) {
document . getElementById ( 'tarteaucitron-reject-group-' + cat ) . setAttribute ( 'aria-pressed' , 'true' ) ;
document . getElementById ( 'tarteaucitron-accept-group-' + cat ) . setAttribute ( 'aria-pressed' , 'false' ) ;
}
}
if ( total !== groupdenied && total !== groupallowed ) {
tarteaucitron . userInterface . removeClass ( 'tarteaucitron-group-' + cat , 'tarteaucitronIsDenied' ) ;
tarteaucitron . userInterface . removeClass ( 'tarteaucitron-group-' + cat , 'tarteaucitronIsAllowed' ) ;
if ( document . getElementById ( 'tarteaucitron-reject-group-' + cat ) ) {
document . getElementById ( 'tarteaucitron-reject-group-' + cat ) . setAttribute ( 'aria-pressed' , 'false' ) ;
document . getElementById ( 'tarteaucitron-accept-group-' + cat ) . setAttribute ( 'aria-pressed' , 'false' ) ;
}
}
groupdenied = 0 ;
groupallowed = 0 ;
groupdenied = 0 ;
groupallowed = 0 ;
} ) ;
} ,
@ -1141,7 +1202,9 @@ var tarteaucitron = {
tarteaucitron . userInterface . css ( 'tarteaucitronCookiesListContainer' , 'display' , 'none' ) ;
document . getElementById ( 'tarteaucitronClosePanel' ) . focus ( ) ;
document . getElementsByTagName ( 'body' ) [ 0 ] . classList . add ( 'tarteaucitron-modal-open' ) ;
if ( document . getElementsByTagName ( 'body' ) [ 0 ] . classList !== undefined ) {
document . getElementsByTagName ( 'body' ) [ 0 ] . classList . add ( 'tarteaucitron-modal-open' ) ;
}
tarteaucitron . userInterface . focusTrap ( ) ;
tarteaucitron . userInterface . jsSizing ( 'main' ) ;
@ -1149,13 +1212,13 @@ var tarteaucitron = {
var tacOpenPanelEvent ;
if ( typeof ( Event ) === 'function' ) {
tacOpenPanelEvent = new Event ( "tac.open_panel" ) ;
} else {
} else if ( typeof ( document . createEvent ) === 'function' ) {
tacOpenPanelEvent = document . createEvent ( 'Event' ) ;
tacOpenPanelEvent . initEvent ( "tac.open_panel" , true , true ) ;
}
//end ie compatibility
window . dispatchEvent ( tacOpenPanelEvent ) ;
if ( typeof ( window . dispatchEvent ) === 'function' ) { window . dispatchEvent ( tacOpenPanelEvent ) ; }
} ,
"closePanel" : function ( ) {
"use strict" ;
@ -1179,22 +1242,28 @@ var tarteaucitron = {
} else {
tarteaucitron . userInterface . css ( 'tarteaucitronBack' , 'display' , 'none' ) ;
}
if ( document . getElementById ( 'tarteaucitronCloseAlert' ) !== null ) {
if ( tarteaucitron . checkIfExist ( 'tarteaucitronCloseAlert' ) ) {
document . getElementById ( 'tarteaucitronCloseAlert' ) . focus ( ) ;
} else if ( tarteaucitron . checkIfExist ( 'tarteaucitronManager' ) ) {
document . getElementById ( 'tarteaucitronManager' ) . focus ( ) ;
} else if ( tarteaucitron . customCloserId && tarteaucitron . checkIfExist ( tarteaucitron . customCloserId ) ) {
document . getElementById ( tarteaucitron . customCloserId ) . focus ( ) ;
}
if ( document . getElementsByTagName ( 'body' ) [ 0 ] . classList !== undefined ) {
document . getElementsByTagName ( 'body' ) [ 0 ] . classList . remove ( 'tarteaucitron-modal-open' ) ;
}
document . getElementsByTagName ( 'body' ) [ 0 ] . classList . remove ( 'tarteaucitron-modal-open' ) ;
//ie compatibility
var tacClosePanelEvent ;
if ( typeof ( Event ) === 'function' ) {
tacClosePanelEvent = new Event ( "tac.close_panel" ) ;
} else {
} else if ( typeof ( document . createEvent ) === 'function' ) {
tacClosePanelEvent = document . createEvent ( 'Event' ) ;
tacClosePanelEvent . initEvent ( "tac.close_panel" , true , true ) ;
}
//end ie compatibility
window . dispatchEvent ( tacClosePanelEvent ) ;
if ( typeof ( window . dispatchEvent ) === 'function' ) { window . dispatchEvent ( tacClosePanelEvent ) ; }
} ,
"focusTrap" : function ( ) {
"use strict" ;
@ -1249,7 +1318,7 @@ var tarteaucitron = {
var tacOpenAlertEvent ;
if ( typeof ( Event ) === 'function' ) {
tacOpenAlertEvent = new Event ( "tac.open_alert" ) ;
} else {
} else if ( typeof ( document . createEvent ) === 'function' ) {
tacOpenAlertEvent = document . createEvent ( 'Event' ) ;
tacOpenAlertEvent . initEvent ( "tac.open_alert" , true , true ) ;
}
@ -1259,7 +1328,7 @@ var tarteaucitron = {
document . getElementById ( 'tarteaucitronAlertBig' ) . focus ( ) ;
}
window . dispatchEvent ( tacOpenAlertEvent ) ;
if ( typeof ( window . dispatchEvent ) === 'function' ) { window . dispatchEvent ( tacOpenAlertEvent ) ; }
} ,
"closeAlert" : function ( ) {
"use strict" ;
@ -1275,13 +1344,13 @@ var tarteaucitron = {
var tacCloseAlertEvent ;
if ( typeof ( Event ) === 'function' ) {
tacCloseAlertEvent = new Event ( "tac.close_alert" ) ;
} else {
} else if ( typeof ( document . createEvent ) === 'function' ) {
tacCloseAlertEvent = document . createEvent ( 'Event' ) ;
tacCloseAlertEvent . initEvent ( "tac.close_alert" , true , true ) ;
}
//end ie compatibility
window . dispatchEvent ( tacCloseAlertEvent ) ;
if ( typeof ( window . dispatchEvent ) === 'function' ) { window . dispatchEvent ( tacCloseAlertEvent ) ; }
} ,
"toggleCookiesList" : function ( ) {
"use strict" ;
@ -1529,9 +1598,13 @@ var tarteaucitron = {
var i ;
for ( i = 0 ; i < arr . length ; i += 1 ) {
document . cookie = arr [ i ] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;' ;
document . cookie = arr [ i ] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location . hostname + ';' ;
document . cookie = arr [ i ] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location . hostname . split ( '.' ) . slice ( - 2 ) . join ( '.' ) + ';' ;
var rgxpCookie = new RegExp ( "^(.*;)?\\s*" + arr [ i ] + "\\s*=\\s*[^;]+(.*)?$" ) ;
if ( document . cookie . match ( rgxpCookie ) ) {
document . cookie = arr [ i ] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;' ;
document . cookie = arr [ i ] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location . hostname + ';' ;
document . cookie = arr [ i ] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location . hostname . split ( '.' ) . slice ( - 2 ) . join ( '.' ) + ';' ;
}
}
} ,
"checkCount" : function ( key ) {
@ -1685,7 +1758,7 @@ var tarteaucitron = {
"getLanguage" : function ( ) {
"use strict" ;
var availableLanguages = 'bg,ca,cn,cs,da,de,el,en,es,fi,fr,hu,it,ja,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,vi,zh' ,
var availableLanguages = 'bg,ca,cn,cs,da,de,el,en,es,fi,fr,hu,it,ja,lt,l v,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,vi,zh' ,
defaultLanguage = 'en' ;
if ( tarteaucitronForceLanguage !== '' ) {
@ -1774,6 +1847,10 @@ var tarteaucitron = {
"addInternalScript" : function ( url , id , callback , execute , attrName , attrVal ) {
tarteaucitron . addScript ( url , id , callback , execute , attrName , attrVal , true ) ;
} ,
"checkIfExist" : function ( elemId ) {
"use strict" ;
return document . getElementById ( elemId ) !== null && document . getElementById ( elemId ) . offsetWidth !== 0 && document . getElementById ( elemId ) . offsetHeight !== 0 ;
} ,
"makeAsync" : {
"antiGhost" : 0 ,
"buffer" : '' ,
@ -1906,7 +1983,7 @@ var tarteaucitron = {
} ,
"proPing" : function ( ) {
"use strict" ;
if ( tarteaucitron . uuid !== '' && tarteaucitron . uuid !== undefined && tarteaucitron . proTemp !== '' ) {
if ( tarteaucitron . uuid !== '' && tarteaucitron . uuid !== undefined && tarteaucitron . proTemp !== '' && tarteaucitronStatsEnabled ) {
var div = document . getElementById ( 'tarteaucitronPremium' ) ,
timestamp = new Date ( ) . getTime ( ) ,
url = 'https://tarteaucitron.io/log/?' ;
@ -1931,7 +2008,7 @@ var tarteaucitron = {
/ * *
Utility function to Add or update the fields of obj1 with the ones in obj2
* /
for ( key in custom ) {
for ( var key in custom ) {
if ( custom [ key ] instanceof Object ) {
source [ key ] = tarteaucitron . AddOrUpdate ( source [ key ] , custom [ key ] ) ;
} else {
@ -1946,6 +2023,9 @@ var tarteaucitron = {
"getElemHeight" : function ( elem ) {
return elem . getAttribute ( 'height' ) || elem . clientHeight ;
} ,
"getElemAttr" : function ( elem , attr ) {
return elem . getAttribute ( 'data-' + attr ) || elem . getAttribute ( attr ) ;
} ,
"addClickEventToId" : function ( elemId , func ) {
tarteaucitron . addClickEventToElement ( document . getElementById ( elemId ) , func ) ;
} ,