Site
- Show list user when click on livechat new conversation
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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...';
|
||||
sendRequest("get_all_list_user", {});
|
||||
waitForallListUser().then((listUser) => {
|
||||
divMessageListChatHome.innerText = '';
|
||||
divMessageListChatHome.innerText = 'User list :\n';
|
||||
listUser.forEach(element => {
|
||||
let user = document.createElement("div");
|
||||
user.classList.add("user");
|
||||
@ -63,6 +63,7 @@ async function showListUser() {
|
||||
</div>
|
||||
<h3></h3>
|
||||
`
|
||||
|
||||
user.querySelector("img").src = element.pfp;
|
||||
user.querySelector("h3").innerText = element.name;
|
||||
divMessageListChatHome.appendChild(user);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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;
|
||||
|
||||
|
||||
function waitForallListUser() {
|
||||
function waitForallListUser()
|
||||
{
|
||||
return new Promise((resolve) => {
|
||||
|
||||
if (allListUserAvailable)
|
||||
@ -25,7 +26,8 @@ function waitForallListUser() {
|
||||
});
|
||||
}
|
||||
|
||||
function typePrivateListMessage(list) {
|
||||
function typeAllListUser(list)
|
||||
{
|
||||
allListUser = list;
|
||||
allListUserAvailable = true;
|
||||
if (allListUserResolve)
|
||||
@ -36,4 +38,4 @@ function typePrivateListMessage(list) {
|
||||
}
|
||||
}
|
||||
|
||||
export { waitForallListUser, typePrivateListMessage, allListUser };
|
||||
export { waitForallListUser, typeAllListUser, allListUser };
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 { typeNewPrivateMessage } from "/static/javascript/typeResponse/typeNewPrivateMessage.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";
|
||||
|
||||
const socket = new WebSocket('/ws');
|
||||
|
||||
const typeResponse = ["logged_in", "login", "private_list_user", "private_list_message", "new_private_message"];
|
||||
const functionResponse = [typeLogin, typeLogin, typePrivateListUser, typePrivateListMessage, typeNewPrivateMessage];
|
||||
const typeResponse = ["logged_in", "login", "private_list_user", "private_list_message", "new_private_message", "all_list_user"];
|
||||
const functionResponse = [typeLogin, typeLogin, typePrivateListUser, typePrivateListMessage, typeNewPrivateMessage, typeAllListUser];
|
||||
|
||||
const errorCode = [9007, 9010, 9011];
|
||||
const errorFunction = [typeErrorInvalidPassword, typeErrorInvalidToken42, typeErrorUnknown42Account];
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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;
|
||||
inset-inline: 0;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
z-index: 500;
|
||||
}
|
||||
|
||||
#topButton{
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* ::: :::::::: */
|
||||
/* loginPage.css :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: marvin <marvin@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -71,7 +71,7 @@ body {
|
||||
backdrop-filter: blur(5px);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1000;
|
||||
z-index: 503;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
|
Reference in New Issue
Block a user