2021-05-13 23:43:49 +00:00
|
|
|
function shouldShowPopup() {
|
|
|
|
dismissed = localStorage.getItem('popupDismissed');
|
|
|
|
|
|
|
|
banner = document.getElementsByClassName("cookie-banner")[0];
|
|
|
|
if (dismissed == null || dismissed === "no") {
|
|
|
|
banner.style.display = 'block';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function dismissPopup() {
|
|
|
|
localStorage.setItem('popupDismissed', 'yes');
|
|
|
|
banner = document.getElementsByClassName("cookie-banner")[0];
|
|
|
|
banner.style.display = 'none';
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateCookieConsent() {
|
2021-05-14 00:20:07 +00:00
|
|
|
t=Matomo.getAsyncTracker();
|
2021-05-13 23:43:49 +00:00
|
|
|
|
|
|
|
button = document.getElementById("cookiesaction");
|
|
|
|
text = button.parentNode.getElementsByTagName('span')[0]
|
2021-05-14 00:20:07 +00:00
|
|
|
if (!t.areCookiesEnabled()) {
|
2021-05-13 23:43:49 +00:00
|
|
|
text.innerHTML = "You haven't allowed cookies to be used"
|
|
|
|
button.innerHTML = "Allow"
|
|
|
|
button.style.visibility = ""
|
|
|
|
button.onclick = function() { startCookieConsent(); }
|
|
|
|
} else {
|
|
|
|
text.innerHTML = "Using cookies to track your usage of the site"
|
|
|
|
button.innerHTML = "Stop"
|
|
|
|
button.style.visibility = ""
|
|
|
|
button.onclick = function() { stopCookieConsent(); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function stopCookieConsent() {
|
2021-05-14 00:20:07 +00:00
|
|
|
t=Matomo.getAsyncTracker();
|
2021-05-13 23:43:49 +00:00
|
|
|
t.forgetCookieConsentGiven();
|
|
|
|
updateCookieConsent();
|
|
|
|
}
|
|
|
|
|
|
|
|
function startCookieConsent() {
|
2021-05-14 00:20:07 +00:00
|
|
|
t=Matomo.getAsyncTracker();
|
2021-05-13 23:43:49 +00:00
|
|
|
t.rememberCookieConsentGiven();
|
|
|
|
updateCookieConsent();
|
|
|
|
}
|