This commit is contained in:
2023-09-10 14:43:14 +03:00
parent b0f138489d
commit d14e2dcbbe
6 changed files with 50 additions and 65 deletions

View File

@@ -58,7 +58,7 @@ function check_new_messages_timeout(timeout_time=1000){
// // }
// check_msg = setInterval(function () {
//
// // let new_message = getNewMessageSession()
// // let new_message = middleWareJS()
// // let user_online = userOnline('set')
// window = document.querySelector(".container-messages")
// if (window === null){

View File

@@ -1,13 +1,25 @@
// $(document).ready(function (){
// getNewMessageSession()
// middleWareJS()
// })
// window.onfocus = function () {
// getSocketState()
// }
window.onload = function (){
middleWareJS()
}
function getNewMessageSession(){
function middleWareJS(){
let footer = document.querySelector("footer")
if (document.querySelector("h1")){
if (document.querySelector("h1").innerHTML === "Написать сообщение" || document.querySelector("h1").innerHTML === "Write message") {
footer.style.display = "none"
} else {
footer.style.display = ""
}
} else {
footer.style.display = ""
}
// let window_messages = document.querySelector(".container-messages")
// let new_timeout_time;
// if (window_messages !== null){
@@ -104,7 +116,7 @@ function socket_close(e){
}
// var window_messages = document.querySelector(".container-messages")
// function getNewMessageSession (){
// function middleWareJS (){
// let prs_ = null
// // if (r !== 'undefined' && r !== null && r !== ""){
// //

View File

@@ -44,7 +44,7 @@
// // document.getElementById('id_to_address_point_txt').style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center';
//
//
// getNewMessageSession()
// middleWareJS()
// let insert_place_1 = element.nextSibling
// let insert_place_2 = insert_place_1.nextSibling
// let insert_place = insert_place_2.nextSibling

View File

@@ -12,11 +12,9 @@ function createTicketShow () {
// enctype: 'json',
// data: formData,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
document.querySelector(".insert-tech-place").innerHTML = data.html;
document.querySelector(".insert-tech-place").innerHTML = data.html;
middleWareJS()
},
});
}
@@ -84,12 +82,10 @@ function attachFileCreateTicket () {
// enctype: 'json',
data: data,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
document.querySelector(".insert-tech-place").innerHTML = data.html;
middleWareJS()
},
});
@@ -114,12 +110,10 @@ function attachFilemeassge () {
// enctype: 'json',
data: data,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
document.querySelector(".insert-tech-place").innerHTML = data.html;
middleWareJS()
},
});
input.remove()
@@ -140,9 +134,7 @@ function createTicket (el) {
// enctype: 'json',
data: formData,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
middleWareJS()
document.querySelector(".insert-tech-place").innerHTML = data.html;
@@ -182,9 +174,7 @@ function selectedUserMessenger (ticket_id=null,user_id=null){
// enctype: 'json',
data: JSON.stringify(data),
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
middleWareJS()
document.querySelector(".info_profile").innerHTML = data.html;
@@ -247,7 +237,7 @@ function sendMessage(id_ticket=null,sender,receiver){
// // enctype: 'json',
// data: JSON.stringify(data),
// success: function(data){
// getNewMessageSession()
// middleWareJS()
//
// document.querySelector(".container-messages").innerHTML = data.html;
// document.querySelector(".enter-message-inp").focus()
@@ -280,9 +270,7 @@ function openTicket (ticket_id){
// enctype: 'json',
data: JSON.stringify(data),
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
middleWareJS()
document.querySelector(".info_profile").innerHTML = data.html;

View File

@@ -10,9 +10,7 @@ function writeMessage(el){
// enctype: 'json',
// data: formData,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html;
@@ -22,6 +20,7 @@ function writeMessage(el){
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/chat/')
middleWareJS()
},
error: function (data, exception){
@@ -44,10 +43,7 @@ function technicalSupport(el){
// enctype: 'json',
// data: formData,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
getNewMessageSession()
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html;
@@ -58,7 +54,7 @@ function technicalSupport(el){
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/support/')
middleWareJS()
},
error: function (data, exception){
@@ -80,9 +76,7 @@ function mySubscription(el){
// enctype: 'json',
// data: formData,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
document.querySelector(".info_profile").innerHTML = data.html;
// location.href = '/profile'
@@ -94,7 +88,7 @@ function mySubscription(el){
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/my_subscribe/')
middleWareJS()
},
error: function (data, exception){
@@ -115,9 +109,7 @@ function myProfile(el){
// enctype: 'json',
// data: formData,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html;
@@ -128,7 +120,7 @@ function myProfile(el){
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/change_profile/')
middleWareJS()
},
error: function (data, exception){
@@ -173,9 +165,7 @@ function removeRoute(el) {
// enctype: 'json',
data: JSON.stringify(remove_data) ,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html;
@@ -187,7 +177,7 @@ function removeRoute(el) {
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/change_profile/')
middleWareJS()
},
error: function (data, exception){
console.log(400)
@@ -280,10 +270,10 @@ function searchTown(el){
success: function(data){
el.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center';
getNewMessageSession()
return insertSearchList(data, el.name + '_list');
middleWareJS()
},
error: function (data){
@@ -494,9 +484,7 @@ function sendRoute(el, routeID = null){
// enctype: 'json',
data: JSON.stringify(obj_w_el_form),
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html
@@ -505,7 +493,7 @@ function sendRoute(el, routeID = null){
let my_routes = document.getElementById("my_routes_id")
list_div.forEach(el=>{ el.classList.remove('selected'); });
my_routes.classList.add('selected')
middleWareJS()
},
error: function (data, exception){
@@ -589,9 +577,7 @@ function createRoute(el, owner_type){
// enctype: 'json',
data: JSON.stringify(obj),
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html
@@ -606,7 +592,7 @@ function createRoute(el, owner_type){
} else {
window.history.pushState(null, null, '/ru/profile/page/create_route_for_mover/')
}
middleWareJS()
@@ -643,9 +629,7 @@ function getRoute(el){
// enctype: 'json',
// data: formData,
success: function(data){
if (data.user_alerts) {
getNewMessageSession()
}
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html;
@@ -656,7 +640,7 @@ function getRoute(el){
window.history.pushState(null, null, '/ru/profile/page/my_routes/')
middleWareJS()
},
error: function (data, exception){

View File

@@ -1,6 +1,9 @@
{% load static %}
<div class="block-finded-routes">
<div class="width-100 text-align-center {% if routes %}mb-10{% endif %}">
<img class="loader_filters_routes" src="{% static "img/svg/loader.svg" %}">
</div>
{% if not routes %}
{# <span style='color: #ff0000;font-weight: 800;font-size: 18px;padding: 10px;'>Нечего не найдено!</span>#}
<div class="not_found_routes show">
@@ -13,9 +16,7 @@
<img class="boxes_not_fond_routes right" src="{% static "/img/boxes_for_not_found_routes/b_2.svg" %}">
</div>
{% endif %}
<div class="width-100 text-align-center mb-10">
<img class="loader_filters_routes" src="{% static "img/svg/loader.svg" %}">
</div>
<div class="page_routes_1">
{% include "blocks/b_search_routes.html" %}
</div>