10
This commit is contained in:
@@ -5,7 +5,7 @@ function inital_old_tab (){
|
||||
if (el_tab !== null){
|
||||
let dataset = el_tab.dataset;
|
||||
old_item_tab_user = dataset['curReceiverItem'];
|
||||
let old_item_tab_user_list = [el_tab,old_item_tab_user]
|
||||
return old_item_tab_user_list
|
||||
}
|
||||
let old_item_tab_user_list = [el_tab,old_item_tab_user]
|
||||
return old_item_tab_user_list
|
||||
}
|
||||
@@ -116,6 +116,7 @@ function wsReceiveData (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
setCokie(365,'twb_new_messages',true)
|
||||
update_count_unread_messages(data)
|
||||
}
|
||||
if (data.required_beep === true) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -83,16 +83,19 @@ function select_tab_profile (el,url,owner_type=null) {
|
||||
if (window.location.href.includes("profile")){
|
||||
selectTabProfileIfHisNotSelected(url)
|
||||
}
|
||||
if (getInfoAboutUser('screen_width') < 800){
|
||||
let marker_new_messages = document.querySelector(".marker_messages_mobile");
|
||||
if (marker_new_messages.classList.contains('show')){
|
||||
marker_new_messages.classList.remove('show')
|
||||
marker_new_messages.classList.add('hide')
|
||||
}
|
||||
}
|
||||
deleteMarkerMessages(el)
|
||||
checkStatesAfterTransitionToAnotherTabProfile()
|
||||
goToChatIfChat()
|
||||
if (window.location.href.includes("chat") || window.location.href.includes("chat")) {
|
||||
if (getInfoAboutUser('screen_width') < 800) {
|
||||
let marker_new_messages = document.querySelector(".marker_messages_mobile");
|
||||
if (marker_new_messages.classList.contains('show')) {
|
||||
marker_new_messages.classList.remove('show')
|
||||
marker_new_messages.classList.add('hide')
|
||||
}
|
||||
}
|
||||
}
|
||||
setCokie(365,'twb_new_messages','false')
|
||||
},
|
||||
error: function (data){
|
||||
console.log(data)
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="button_profile_header_mobile" onclick="open_curtain_w_btn_profile()">
|
||||
<div class="marker_messages_mobile hide"></div>
|
||||
<img src="/static/img/svg/userMobile.svg" alt="">
|
||||
{# <div class="icon_unread_messages" style="position:absolute;right: 5px;top: 0;">#}
|
||||
{# <div class="cost-messages-in-user-tab-messenger" style="background: #ff0000;">#}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<div class="txt_cookie">Сайт использует файлы cookie. Просматривая этот сайт, Вы соглашаетесь
|
||||
<a class="a_cookie" href="#">с условиями использования cookie-файлов</a>
|
||||
</div>
|
||||
<button class="cookie_btn" onclick="setCokie()">Понятно</button>
|
||||
<button class="cookie_btn" onclick="setCokie(182,'allow_cookie','true')">Понятно</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user