10
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user