diff --git a/tests_hugo/chat_node/README.md b/tests_hugo/chat_node/README.md index 866975b9..e1b0d68a 100644 --- a/tests_hugo/chat_node/README.md +++ b/tests_hugo/chat_node/README.md @@ -12,3 +12,7 @@ anytime : nodemon server - [ ] don't send message to oneself +- [ ] create a room +- [ ] automatically add someone to a room +- [ ] being able to accept or refuse to be added to a room +- [ ] what to do with message not received ? diff --git a/tests_hugo/chat_node/chat_client/chat_add_msg.js b/tests_hugo/chat_node/chat_client/chat_add_msg.js index 013c5175..1a17b841 100644 --- a/tests_hugo/chat_node/chat_client/chat_add_msg.js +++ b/tests_hugo/chat_node/chat_client/chat_add_msg.js @@ -2,8 +2,8 @@ const add_new_message = (message, from = "others") => { const div_thread = document.getElementById('msg_thread'); - console.log("received message:"); - console.log(`[${message}]`); + //console.log("received message:"); + //console.log(`[${message}]`); div_thread.appendChild(build_new_message(message, from)); } diff --git a/tests_hugo/chat_node/chat_client/chat_submit_msg.js b/tests_hugo/chat_node/chat_client/chat_submit_msg.js index c7c972e1..effd921d 100644 --- a/tests_hugo/chat_node/chat_client/chat_submit_msg.js +++ b/tests_hugo/chat_node/chat_client/chat_submit_msg.js @@ -1,5 +1,6 @@ const submit_new_message = () => { + const div_msg = document.getElementById('msg_write'); /* const msg = div_msg.value; @@ -7,10 +8,11 @@ const submit_new_message = () => { */ const msg = div_msg.innerText.trim(); div_msg.innerText = ""; + div_msg.focus(); - console.log("msg:"); - console.log(`[${msg}]`); - console.log(msg.length); + //console.log("msg:"); + //console.log(`[${msg}]`); + //console.log(msg.length); if (msg.length > 0) { socket.emit('chat_message', { data: msg }); diff --git a/tests_hugo/chat_node/chat_client/style/chat.css b/tests_hugo/chat_node/chat_client/style/chat.css index 973bc703..11def2cd 100644 --- a/tests_hugo/chat_node/chat_client/style/chat.css +++ b/tests_hugo/chat_node/chat_client/style/chat.css @@ -62,6 +62,7 @@ .chat_box .chat_item.button p { margin: auto; } +.chat_box .chat_item.button:focus, .chat_box .chat_item.button:hover { background-color: rgb(200, 200, 200); }