From 2dd03e4d2f57eea937bc63d3efc2c42e512e6b4e Mon Sep 17 00:00:00 2001 From: borissedw Date: Sun, 13 Aug 2023 14:42:52 +0300 Subject: [PATCH] 0.0.123 --- static/js/chat_sockets.js | 14 ++++++-------- templates/pages/profile/p_user_profile.html | 4 ++-- templates/tb_base.html | 4 ++++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/static/js/chat_sockets.js b/static/js/chat_sockets.js index c276540..c0a10ed 100644 --- a/static/js/chat_sockets.js +++ b/static/js/chat_sockets.js @@ -39,14 +39,13 @@ // } // } - // var i = 0 -window.onload = function (){ - let user_id = document.querySelector(".button_profile_header").dataset['userId'] - let url = `ws://localhost:8000/ws/socket-server/?user_id=${user_id}`; - const chatSocket = new WebSocket(url); -} + +url = `ws://localhost:8000/ws/socket-server/?user_id=${user_id}`; + +const chatSocket = new WebSocket(url); + function sendMessageSocket (data) { chatSocket.send(JSON.stringify(data)); } @@ -103,5 +102,4 @@ chatSocket.onmessage = function (e) { // // btn.reset() // }) // } -// let form = document.getElementById('form') - +// let form = document.getElementById('form') \ No newline at end of file diff --git a/templates/pages/profile/p_user_profile.html b/templates/pages/profile/p_user_profile.html index 41147e0..2b46d78 100644 --- a/templates/pages/profile/p_user_profile.html +++ b/templates/pages/profile/p_user_profile.html @@ -8,12 +8,11 @@ - {# #} - + @@ -21,5 +20,6 @@ {% block content %} {% include 'blocks/b_user_profile.html' %} + {% endblock %} diff --git a/templates/tb_base.html b/templates/tb_base.html index 62104fe..0f5d4a6 100644 --- a/templates/tb_base.html +++ b/templates/tb_base.html @@ -7,6 +7,10 @@ +