This commit is contained in:
SBD
2024-02-20 18:57:17 +03:00
parent 98665abf4d
commit c146bd6155
6 changed files with 31 additions and 13 deletions

View File

@@ -217,6 +217,15 @@ function checkStateCookie () {
if (!window.document.cookie.includes("allow_cookie=true")){
document.querySelector(".cookie_block").classList.add("show")
}
if (window.document.cookie.includes("twb_new_messages=true")){
if (getInfoAboutUser('screen_width') < 800) {
let marker_new_messages = document.querySelector(".marker_messages_mobile");
if (marker_new_messages.classList.contains('hide')) {
marker_new_messages.classList.remove('hide')
marker_new_messages.classList.add('show')
}
}
}
}
function getCsrfCookie () {
@@ -231,11 +240,15 @@ function getCsrfCookie () {
return csrf
}
function setCokie () {
function setCokie (days,name,val) {
let date = new Date();
let days = 182;
// let days = 182;
date.setTime(+ date + (days * 86400000));
window.document.cookie = "allow_cookie=true" + "; expires=" + date.toGMTString() + "; path=/";
window.document.cookie = `${name}=${val}` + "; expires=" + date.toGMTString() + "; path=/";
document.querySelector(".cookie_block").classList.remove("show")
return value;
}
function getInCookieTime (time) {
return time * 24 * 60 * 60
}