- Show list user when click on livechat new conversation
This commit is contained in:
Kum1ta
2024-08-26 17:11:28 +02:00
parent 2bf30d07a3
commit 41b6c9cf9f
13 changed files with 19 additions and 15 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/22 17:19:17 by edbernar #+# #+# */ /* Created: 2024/08/22 17:19:17 by edbernar #+# #+# */
/* Updated: 2024/08/25 21:10:59 by edbernar ### ########.fr */ /* Updated: 2024/08/26 11:12:50 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/04 19:21:10 by edbernar #+# #+# */ /* Created: 2024/08/04 19:21:10 by edbernar #+# #+# */
/* Updated: 2024/08/26 01:24:28 by edbernar ### ########.fr */ /* Updated: 2024/08/26 15:57:20 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -53,7 +53,7 @@ async function showListUser() {
divMessageListChatHome.innerText = 'Loading...'; divMessageListChatHome.innerText = 'Loading...';
sendRequest("get_all_list_user", {}); sendRequest("get_all_list_user", {});
waitForallListUser().then((listUser) => { waitForallListUser().then((listUser) => {
divMessageListChatHome.innerText = ''; divMessageListChatHome.innerText = 'User list :\n';
listUser.forEach(element => { listUser.forEach(element => {
let user = document.createElement("div"); let user = document.createElement("div");
user.classList.add("user"); user.classList.add("user");
@ -63,6 +63,7 @@ async function showListUser() {
</div> </div>
<h3></h3> <h3></h3>
` `
user.querySelector("img").src = element.pfp; user.querySelector("img").src = element.pfp;
user.querySelector("h3").innerText = element.name; user.querySelector("h3").innerText = element.name;
divMessageListChatHome.appendChild(user); divMessageListChatHome.appendChild(user);

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/26 01:00:35 by edbernar #+# #+# */ /* Created: 2024/08/26 01:00:35 by edbernar #+# #+# */
/* Updated: 2024/08/26 01:11:49 by edbernar ### ########.fr */ /* Updated: 2024/08/26 14:57:58 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,7 +15,8 @@ let allListUserAvailable = false;
let allListUserResolve = null; let allListUserResolve = null;
function waitForallListUser() { function waitForallListUser()
{
return new Promise((resolve) => { return new Promise((resolve) => {
if (allListUserAvailable) if (allListUserAvailable)
@ -25,7 +26,8 @@ function waitForallListUser() {
}); });
} }
function typePrivateListMessage(list) { function typeAllListUser(list)
{
allListUser = list; allListUser = list;
allListUserAvailable = true; allListUserAvailable = true;
if (allListUserResolve) if (allListUserResolve)
@ -36,4 +38,4 @@ function typePrivateListMessage(list) {
} }
} }
export { waitForallListUser, typePrivateListMessage, allListUser }; export { waitForallListUser, typeAllListUser, allListUser };

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/31 22:17:24 by edbernar #+# #+# */ /* Created: 2024/07/31 22:17:24 by edbernar #+# #+# */
/* Updated: 2024/08/25 23:25:30 by edbernar ### ########.fr */ /* Updated: 2024/08/26 14:48:48 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -16,12 +16,13 @@ import { typeErrorInvalidToken42 } from "/static/javascript/typeErrorResponse/ty
import { typePrivateListMessage } from "/static/javascript/typeResponse/typePrivateListMessage.js"; import { typePrivateListMessage } from "/static/javascript/typeResponse/typePrivateListMessage.js";
import { typeNewPrivateMessage } from "/static/javascript/typeResponse/typeNewPrivateMessage.js"; import { typeNewPrivateMessage } from "/static/javascript/typeResponse/typeNewPrivateMessage.js";
import { typePrivateListUser } from "/static/javascript/typeResponse/typePrivateListUser.js"; import { typePrivateListUser } from "/static/javascript/typeResponse/typePrivateListUser.js";
import { typeAllListUser }from "/static/javascript/typeResponse/typeAllListUser.js";
import { typeLogin } from "/static/javascript/typeResponse/typeLogin.js"; import { typeLogin } from "/static/javascript/typeResponse/typeLogin.js";
const socket = new WebSocket('/ws'); const socket = new WebSocket('/ws');
const typeResponse = ["logged_in", "login", "private_list_user", "private_list_message", "new_private_message"]; const typeResponse = ["logged_in", "login", "private_list_user", "private_list_message", "new_private_message", "all_list_user"];
const functionResponse = [typeLogin, typeLogin, typePrivateListUser, typePrivateListMessage, typeNewPrivateMessage]; const functionResponse = [typeLogin, typeLogin, typePrivateListUser, typePrivateListMessage, typeNewPrivateMessage, typeAllListUser];
const errorCode = [9007, 9010, 9011]; const errorCode = [9007, 9010, 9011];
const errorFunction = [typeErrorInvalidPassword, typeErrorInvalidToken42, typeErrorUnknown42Account]; const errorFunction = [typeErrorInvalidPassword, typeErrorInvalidToken42, typeErrorUnknown42Account];

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/07 12:00:55 by edbernar #+# #+# */ /* Created: 2024/08/07 12:00:55 by edbernar #+# #+# */
/* Updated: 2024/08/25 16:31:32 by edbernar ### ########.fr */ /* Updated: 2024/08/26 11:09:03 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -64,7 +64,7 @@ body {
position: absolute; position: absolute;
inset-inline: 0; inset-inline: 0;
top: 0; top: 0;
z-index: 999; z-index: 500;
} }
#topButton{ #topButton{

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */ /* ::: :::::::: */
/* loginPage.css :+: :+: :+: */ /* loginPage.css :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: marvin <marvin@student.42.fr> +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/07 17:15:28 by edbernar #+# #+# */ /* Created: 2024/08/07 17:15:28 by edbernar #+# #+# */
/* Updated: 2024/08/13 13:30:43 by marvin ### ########.fr */ /* Updated: 2024/08/26 11:04:43 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -71,7 +71,7 @@ body {
backdrop-filter: blur(5px); backdrop-filter: blur(5px);
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 1000; z-index: 503;
} }
.popup-content { .popup-content {

BIN
site/.DS_Store vendored

Binary file not shown.