Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -1,36 +1,73 @@
|
||||
window.onload = function () {
|
||||
funcFocus()
|
||||
}
|
||||
|
||||
//
|
||||
// document.querySelector(".enter-message-inp").onload(
|
||||
// funcFocus()
|
||||
// )
|
||||
|
||||
function funcFocus(){
|
||||
|
||||
$(document).ready(
|
||||
check_new_messages_timeout()
|
||||
|
||||
)
|
||||
let inp = document.querySelector(".enter-message-inp")
|
||||
if (inp !== null){
|
||||
inp.focus()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var check_msg = null
|
||||
var it = 0
|
||||
|
||||
function check_new_messages_timeout(){
|
||||
|
||||
|
||||
// function initial_function (){
|
||||
// var it_set_func = 0
|
||||
// var it_func = 0
|
||||
// check_new_messages_timeout(60000,it_set_func,it_func)
|
||||
// }
|
||||
|
||||
function check_new_messages_timeout(timeout_time=1000){
|
||||
|
||||
|
||||
let window = document.querySelector(".container-messages")
|
||||
if (window !== null){
|
||||
|
||||
|
||||
}
|
||||
// if (window !== null){
|
||||
//
|
||||
//
|
||||
// }
|
||||
// if (it_set_func === 0){
|
||||
// // clearInterval(check_msg)
|
||||
// if (window === null){
|
||||
// it_set_func++
|
||||
// check_new_messages_timeout(60000,it_set_func,it_func)
|
||||
// } else {
|
||||
// let new_timeout_time = 1000
|
||||
// it_set_func++
|
||||
// check_new_messages_timeout(new_timeout_time,it_set_func,it_func)
|
||||
// }
|
||||
//
|
||||
// }
|
||||
check_msg = setInterval(function () {
|
||||
// let new_message = getNewMessageSession()
|
||||
// let user_online = userOnline('set')
|
||||
window = document.querySelector(".container-messages")
|
||||
if (window === null){
|
||||
|
||||
// let new_message = getNewMessageSession()
|
||||
// let user_online = userOnline('set')
|
||||
window = document.querySelector(".container-messages")
|
||||
if (window === null){
|
||||
// let new_timeout_time = 60000
|
||||
//
|
||||
} else {
|
||||
it = 0
|
||||
check_new_messages(window)
|
||||
}
|
||||
},
|
||||
60000)
|
||||
// check_new_messages_timeout(new_timeout_time,it_set_func,it_func)
|
||||
} else {
|
||||
// if (it_func === 0){
|
||||
// let new_timeout_time = 1000
|
||||
// it_func++
|
||||
// check_new_messages_timeout(new_timeout_time,it_set_func,it_func)
|
||||
// }
|
||||
check_new_messages(window)
|
||||
}
|
||||
|
||||
},
|
||||
timeout_time)
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +151,9 @@ function success_check_new_messages (data) {
|
||||
if (data.users_list_html){
|
||||
document.querySelector(".block-list-of-users").innerHTML = data.users_list_html
|
||||
}
|
||||
if (data.tickets_list_html){
|
||||
document.querySelector(".block-list-of-users").innerHTML = data.tickets_list_html
|
||||
}
|
||||
// let updatedCookie = encodeURIComponent(name_cookie) + "=" + encodeURIComponent('');
|
||||
// let search_cookie = document.cookie.match("(^|[^;]+)\s*" + name_cookie + "\s*=\s*([^;]+)")[0].substring(1)
|
||||
// let search_cookie = getCookieValue('user_alerts')
|
||||
|
||||
@@ -184,7 +184,9 @@ function selectedUserMessenger (ticket_id=null,user_id=null){
|
||||
getNewMessageSession()
|
||||
}
|
||||
|
||||
|
||||
document.querySelector(".info_profile").innerHTML = data.html;
|
||||
document.querySelector(".enter-message-inp").focus()
|
||||
|
||||
},
|
||||
error: function (data){
|
||||
|
||||
Reference in New Issue
Block a user