From 96c1b2336206ce0a80cbff3ca622aad264dc8efd Mon Sep 17 00:00:00 2001 From: borissedw Date: Mon, 18 Sep 2023 00:25:09 +0300 Subject: [PATCH] 0.0.254 --- static/css/styles(boris).css | 25 ++++++++++++++++--- .../etc_operations_for_chat_socket.js | 18 +++++++++++++ static/js/chat_sockets.js | 3 ++- static/js/user_profile(boris).js | 1 - static/js/user_profile.js | 23 +++++++++++++++-- templates/blocks/profile/b_chats.html | 1 + .../f_find_route_form_main_find_routes.html | 2 +- 7 files changed, 64 insertions(+), 9 deletions(-) diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 6e9a087..8a9d566 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -461,6 +461,21 @@ margin-left: 5px; } +.loader_show_message.show{ + width: 40px; + height: 40px; + margin-left: 5px; + display: inline-block; +} + +.loader_show_message{ + display: none; +} + +.send-message.hide{ + display: none; +} + .errors{ color: red; font-size: 11px; @@ -676,22 +691,24 @@ .file_border_cont{ padding: 5%; - width: 95%; - height: 100%; + width: 90%; + height: 90%; } .left_part_file_w{ - width: 20%; + width: 10%; height: 100%; float: left; } .right_part_file_w{ - width: 80%; + width: 85%; height: 100%; color: #FFFFFF; font-size: 14px; float: right; + overflow-wrap: break-word; + padding-left: 5%; } .right_part_file_w.left{ color: #000000; diff --git a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js index 935e0bf..eaa59f4 100644 --- a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js +++ b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js @@ -13,4 +13,22 @@ function update_count_unread_messages (data) { function play_required_beep (data,beep) { beep.play() +} + + +function loader_show_message (data) { + let loader = document.querySelector(".loader_show_message"); + let send_btn = document.querySelector(".send-message") + if (loader){ + if (loader.classList.contains("show")){ + send_btn.classList.remove("hide") + loader.classList.remove("show") + } else { + send_btn.classList.add("hide") + loader.classList.add("show") + } + + } else { + console.log("cannot find loader") + } } \ No newline at end of file diff --git a/static/js/chat_sockets.js b/static/js/chat_sockets.js index e3a5786..7d9e2c6 100644 --- a/static/js/chat_sockets.js +++ b/static/js/chat_sockets.js @@ -4,7 +4,7 @@ function sendMessageSocket (data) { if (chatSocket.readyState !== 1 && chatSocket.readyState !== 0){ init_ws() } - + loader_show_message(data) chatSocket.send(JSON.stringify(data)); if (!data.ticket_id){ let el_tab = document.querySelector(".tab_user_messanger.select") @@ -105,6 +105,7 @@ function wsReceiveData (e) { if (data.required_beep === true) { play_required_beep(data,beep) } + loader_show_message(data) } diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index d39eff2..af51b45 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -218,7 +218,6 @@ async function attachFilemeassge (el,id_ticket=null,sender,receiver){ - } diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 130592f..730dba8 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -229,12 +229,31 @@ function confirmRemove(el) { } } - +function loader_place_ins_boris (el,type=null){ + if (el){ + let loader_place = document.querySelector(".abbreviation_airport_in_search") + let cur_loader_place = el.nextElementSibling + if (type){ + cur_loader_place.innerHTML = "" + } else { + if (loader_place){ + if (cur_loader_place.innerHTML === ''){ + cur_loader_place.innerHTML = "" + } else { + cur_loader_place.innerHTML = "" + } + } + } + } +} function searchTown(el){ if (el.value.length > 0){ el.style.background = 'white url("/static/img/svg/loader.svg") no-repeat calc(100% - 15px) center'; + loader_place_ins_boris(el) + + }else { el.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; } @@ -269,7 +288,7 @@ function searchTown(el){ data: JSON.stringify(get_address_point), success: function(data){ el.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; - + loader_place_ins_boris(el,"el") return insertSearchList(data, el.name + '_list'); diff --git a/templates/blocks/profile/b_chats.html b/templates/blocks/profile/b_chats.html index 71ba611..14ef8b4 100644 --- a/templates/blocks/profile/b_chats.html +++ b/templates/blocks/profile/b_chats.html @@ -65,6 +65,7 @@ + {# #} diff --git a/templates/forms/f_find_route_form_main_find_routes.html b/templates/forms/f_find_route_form_main_find_routes.html index 1cb4285..86cac0d 100644 --- a/templates/forms/f_find_route_form_main_find_routes.html +++ b/templates/forms/f_find_route_form_main_find_routes.html @@ -32,7 +32,7 @@ id="id_from_address_point_txt" {% if route_form.initial.from_address_point_txt %}value="{{ route_form.initial.from_address_point_txt }}"{% endif %} /> - +