Lorenzo DellacĂ
d8b54a00d9
The responsive theme is almost ready; most pages and elements now render correctly on the vast majority of screens. There are some known issues which are in the works. Also, a <h4> "Paragraphs" title has been aded on the left navbar.
39 lines
1.2 KiB
JavaScript
Executable File
39 lines
1.2 KiB
JavaScript
Executable File
function openPolicyPopup() {
|
|
if(getCookie("consentGiven") === "true") return;
|
|
|
|
$("#mind-policy-popup").fadeIn(300); // Enable the div
|
|
}
|
|
|
|
function agreePolicyPopup() {
|
|
const _paq = window._paq || [];
|
|
_paq.push(['rememberConsentGiven', 43800]);
|
|
$("#mind-policy-popup").fadeOut(300); // Disable the div
|
|
setCookie("consentGiven", "true", 1825) // todo: check if already present? also, firefox was throwing a warning...
|
|
}
|
|
|
|
function getCookie(cname) {
|
|
const name = cname + "=";
|
|
const decodedCookie = decodeURIComponent(document.cookie);
|
|
const ca = decodedCookie.split(';');
|
|
for(let i = 0; i <ca.length; i++) {
|
|
let c = ca[i];
|
|
while (c.charAt(0) === ' ') {
|
|
c = c.substring(1);
|
|
}
|
|
if (c.indexOf(name) === 0) {
|
|
return c.substring(name.length, c.length);
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
function setCookie(name, value, days) {
|
|
let expires = "";
|
|
if (days) {
|
|
const date = new Date();
|
|
date.setTime(date.getTime() + (days*24*60*60*1000));
|
|
expires = "; expires=" + date.toUTCString();
|
|
}
|
|
document.cookie = name + "=" + (value || "") + expires + "; path=/;SameSite=Lax";
|
|
}
|