Split chat messages into username and message, and change UI for displaying messages

This commit is contained in:
Micah Lee 2020-08-19 19:40:00 -04:00
parent b7ec7694c3
commit 0d4d5b773c
6 changed files with 202 additions and 80 deletions

View file

@ -1,46 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>OnionShare</title>
<link href="{{ static_url_path }}/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" rel="subresource" type="text/css" href="{{ static_url_path }}/css/style.css" media="all">
</head>
<body>
<header class="clearfix">
<img class="logo" src="{{ static_url_path }}/img/logo.png" title="OnionShare">
<h1>OnionShare</h1>
</header>
<noscript>
<p>
Chat <b>requires JavaScript</b>, so you must set your Tor Browser security
level to <b>Safer</b> or <b>Standard</b> to join.
</p>
</noscript>
<div class="chat-container no-js">
<div class="chat-users">
<div class="editable-username">
<input id="username" value="{{ username }}" />
<button id="update-username" disabled>Save</button>
</div>
<ul id="user-list">
</ul>
</div>
<div class="chat-wrapper">
<p class="chat-header">Chat Messages</p>
<div id="chat"></div>
<div class="chat-form">
<p><input type="text" id="new-message" name="new-message" placeholder="Type your message"/></p>
<p><button type="button" id="send-button" class="button">Send Message</button></p>
</div>
<head>
<title>OnionShare</title>
<link href="{{ static_url_path }}/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" rel="subresource" type="text/css" href="{{ static_url_path }}/css/style.css" media="all">
</head>
<body>
<header class="clearfix">
<img class="logo" src="{{ static_url_path }}/img/logo.png" title="OnionShare">
<h1>OnionShare</h1>
</header>
<noscript>
<p>
Chat <b>requires JavaScript</b>, so you must set your Tor Browser security
level to <b>Safer</b> or <b>Standard</b> to join.
</p>
</noscript>
<div class="chat-container no-js">
<div class="chat-users">
<div class="editable-username">
<input id="username" value="{{ username }}" />
<button id="update-username" disabled>Set Name</button>
</div>
<ul id="user-list">
</ul>
</div>
<script src="{{ static_url_path }}/js/jquery-3.5.1.min.js"></script>
<script src="{{ static_url_path }}/js/socket.io.min.js"></script>
<script async src="{{ static_url_path }}/js/chat.js"></script>
</body>
</html>
<div class="chat-wrapper">
<p class="chat-header">Chat Messages</p>
<div id="chat"></div>
<div class="chat-form">
<p><input type="text" id="new-message" name="new-message" placeholder="Type your message" /></p>
<p><button type="button" id="send-button" class="button">Send Message</button></p>
</div>
</div>
</div>
<script src="{{ static_url_path }}/js/jquery-3.5.1.min.js"></script>
<script src="{{ static_url_path }}/js/socket.io.min.js"></script>
<script async src="{{ static_url_path }}/js/chat.js"></script>
</body>
</html>