Verified Commit 17f2aa22 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

change text for result of banner selection

parent 8dc05bea
<p>
<a href="privacyPolicy">Privacy Policy</a>
(<span id="gdpr-result-text"></span> <a href="javascript: showCookieBanner();">change</a>)
</p>
......@@ -38,6 +38,15 @@ function loadMatomo() {
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g,s);
setResultText(true);
}
}
function setResultText(acceptCookies){
if (acceptCookies == true) {
$('#gdpr-result-text').html('All cookies are accepted');
} else {
$('#gdpr-result-text').html('Only necessary cookies are accepted');
}
}
......@@ -63,6 +72,7 @@ function clearCookies() {
Cookies.set(name, 0, { expires: -1, path: '/' });
}
}
setResultText(false);
}
$( document ).ready(function() {
......@@ -74,7 +84,13 @@ $( document ).ready(function() {
jQuery('.lap-cookies-accept').addClass('disabled');
jQuery('.lap-cookies-refuse').removeClass('disabled');
jQuery(this).blur();
loadMatomo();
// if the lap_cookie_agree is already set to one, do not load matomo again
lapCookieAgree = getCookie('lap_cookie_agree');
if (lapCookieAgree != '1'){
loadMatomo();
}
setResultText(true);
});
/* refuse */
......@@ -86,6 +102,7 @@ $( document ).ready(function() {
jQuery('.lap-cookies-refuse').addClass('disabled');
jQuery('.lap-cookies-accept').removeClass('disabled');
jQuery(this).blur();
setResultText(false);
});
/* default mechanism */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment