1.1.43 add popup display functionality with cookie-based visibility control
This commit is contained in:
@@ -20,6 +20,7 @@ function SendLoginForm(el){
|
||||
data: formData,
|
||||
success: function(data){
|
||||
|
||||
|
||||
location.href = data.redirect_url//`/profile/page/dashboard/`
|
||||
window.sessionStorage.removeItem('mailingSubscribeRequired')
|
||||
window.sessionStorage.removeItem('email')
|
||||
@@ -29,6 +30,8 @@ function SendLoginForm(el){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
error: function (data, exception){
|
||||
document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||
|
||||
@@ -227,6 +227,12 @@ function checkStateCookie () {
|
||||
if (!window.document.cookie.includes("allow_cookie=true")){
|
||||
document.querySelector(".cookie_block").classList.add("show")
|
||||
}
|
||||
if (!window.document.cookie.includes("popup_show=false")){
|
||||
document.querySelector(".popup_wrapper").classList.add("show")
|
||||
}
|
||||
if(!window.document.cookie.includes("first_authorization=true") && window.document.getElementById('authenticated_img')){
|
||||
document.querySelector(".popup_wrapper").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");
|
||||
@@ -258,12 +264,22 @@ function getCsrfCookie () {
|
||||
return csrf
|
||||
}
|
||||
|
||||
function setCokie (days,name,val) {
|
||||
function setCokie (days,name,val, url = null) {
|
||||
let date = new Date();
|
||||
// let days = 182;
|
||||
date.setTime(+ date + (days * 86400000));
|
||||
window.document.cookie = `${name}=${val}` + "; expires=" + date.toGMTString() + "; path=/";
|
||||
document.querySelector(".cookie_block").classList.remove("show")
|
||||
|
||||
if(name === 'allow_cookie' ){
|
||||
document.querySelector(".cookie_block").classList.remove("show")
|
||||
} else if(name === 'popup_show'){
|
||||
document.querySelector(".popup_wrapper").classList.remove("show")
|
||||
if(url){
|
||||
window.location.href = url}
|
||||
} else if (name === 'first_authorization'){
|
||||
document.querySelector(".popup_wrapper").classList.remove("show")
|
||||
}
|
||||
|
||||
// return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user