0.0.102
This commit is contained in:
@@ -1,36 +1,70 @@
|
|||||||
|
window.onload = function () {
|
||||||
|
funcFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// document.querySelector(".enter-message-inp").onload(
|
||||||
|
// funcFocus()
|
||||||
|
// )
|
||||||
|
|
||||||
|
function funcFocus(){
|
||||||
|
|
||||||
$(document).ready(
|
document.querySelector(".enter-message-inp").focus()
|
||||||
check_new_messages_timeout()
|
}
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var check_msg = null
|
var check_msg = null
|
||||||
var it = 0
|
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")
|
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 () {
|
check_msg = setInterval(function () {
|
||||||
// let new_message = getNewMessageSession()
|
|
||||||
// let user_online = userOnline('set')
|
// let new_message = getNewMessageSession()
|
||||||
window = document.querySelector(".container-messages")
|
// let user_online = userOnline('set')
|
||||||
if (window === null){
|
window = document.querySelector(".container-messages")
|
||||||
|
if (window === null){
|
||||||
|
// let new_timeout_time = 60000
|
||||||
//
|
//
|
||||||
} else {
|
// check_new_messages_timeout(new_timeout_time,it_set_func,it_func)
|
||||||
it = 0
|
} else {
|
||||||
check_new_messages(window)
|
// if (it_func === 0){
|
||||||
}
|
// let new_timeout_time = 1000
|
||||||
},
|
// it_func++
|
||||||
60000)
|
// check_new_messages_timeout(new_timeout_time,it_set_func,it_func)
|
||||||
|
// }
|
||||||
|
check_new_messages(window)
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
timeout_time)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,9 @@ function selectedUserMessenger (ticket_id=null,user_id=null){
|
|||||||
getNewMessageSession()
|
getNewMessageSession()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
document.querySelector(".info_profile").innerHTML = data.html;
|
document.querySelector(".info_profile").innerHTML = data.html;
|
||||||
|
document.querySelector(".enter-message-inp").focus()
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (data){
|
error: function (data){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<section class="profile">
|
<section class="profile" >
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div
|
<div
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
<div class="footer-chat">
|
<div class="footer-chat">
|
||||||
<div class="left-part-block-enter-message">
|
<div class="left-part-block-enter-message">
|
||||||
<input class="enter-message-inp" onkeypress="sendMessageEnter(event,null,{{ user.id }},{{ cur_receiver.id }})" placeholder="Отправить сообщение">
|
<input class="enter-message-inp" onfocus="check_new_messages_timeout()" onkeypress="sendMessageEnter(event,null,{{ user.id }},{{ cur_receiver.id }})" placeholder="Отправить сообщение">
|
||||||
</div>
|
</div>
|
||||||
<div class="right-part-block-enter-message">
|
<div class="right-part-block-enter-message">
|
||||||
<button class="attach-file-btn-message" onclick="attachFilemeassge()"></button>
|
<button class="attach-file-btn-message" onclick="attachFilemeassge()"></button>
|
||||||
|
|||||||
Reference in New Issue
Block a user