36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
|
|
<!--[header/scripts]-->
|
||
|
|
|
||
|
|
<script defer src="https://setka.media/scr/versioned/1/bundle.1-1-0.js"></script>
|
||
|
|
|
||
|
|
<link href="https://setka.media/scr/versioned/1/bundle.1-1-0.css" rel="stylesheet">
|
||
|
|
|
||
|
|
<script>
|
||
|
|
function getCookie(name) {
|
||
|
|
let matches = document.cookie.match(new RegExp(
|
||
|
|
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
||
|
|
));
|
||
|
|
return matches ? decodeURIComponent(matches[1]) : undefined;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function setCookie(name, value, options = {}) {
|
||
|
|
options = {
|
||
|
|
path: '/',
|
||
|
|
expires: 0
|
||
|
|
};
|
||
|
|
if (options.expires.toUTCString) {
|
||
|
|
options.expires = options.expires.toUTCString();
|
||
|
|
}
|
||
|
|
let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
|
||
|
|
for (let optionKey in options) {
|
||
|
|
updatedCookie += "; " + optionKey;
|
||
|
|
let optionValue = options[optionKey];
|
||
|
|
if (optionValue !== true) {
|
||
|
|
updatedCookie += "=" + optionValue;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
document.cookie = updatedCookie;
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<!--[/header/scripts]-->
|