Merge branch 'master' of https://git.wmi.amu.edu.pl/s457990/Watch-with-friends
This commit is contained in:
commit
78b11327d4
42
public/chat.html
Normal file
42
public/chat.html
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<!doctype html>
|
||||||
|
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
|
||||||
|
<title>Chat</title>
|
||||||
|
<link rel="icon" href="/img/favicon.png">
|
||||||
|
<link rel="stylesheet" href="/css/styles.min.css">
|
||||||
|
<link rel="stylesheet" href="/css/styles.css">
|
||||||
|
<meta name="description" content="Chat">
|
||||||
|
<meta name="author" content="SitePoint">
|
||||||
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/3.0.1/mustache.min.js"></script>
|
||||||
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
|
||||||
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/qs/6.6.0/qs.min.js"></script>
|
||||||
|
<script defer src="/socket.io/socket.io.js"></script>
|
||||||
|
<script defer src="/js/chat.js"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="chat">
|
||||||
|
<div class="chat__sidebar">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="chat__main">
|
||||||
|
<div id="messages-container" class="chat__messages"> </div>
|
||||||
|
|
||||||
|
<div class="compose">
|
||||||
|
<form action="POST" id="sendMessForm">
|
||||||
|
<input placeholder="Write your message">
|
||||||
|
<button type="submit" id="formButton">Send</button>
|
||||||
|
</form>
|
||||||
|
<button id="sendLocation">Send location!</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -39,7 +39,6 @@ io.on('connection', (socket) => {
|
|||||||
'message',
|
'message',
|
||||||
generateMessage(`Welcome to the server, ${username}!`)
|
generateMessage(`Welcome to the server, ${username}!`)
|
||||||
);
|
);
|
||||||
|
|
||||||
socket.broadcast
|
socket.broadcast
|
||||||
.to(user.room)
|
.to(user.room)
|
||||||
.emit('message', generateMessage(`${user.username} has joined`));
|
.emit('message', generateMessage(`${user.username} has joined`));
|
||||||
|
Loading…
Reference in New Issue
Block a user