2020-03-08 05:21:43 -04:00
|
|
|
<!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>
|
2020-07-04 09:55:38 -04:00
|
|
|
<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>
|
2020-03-08 05:21:43 -04:00
|
|
|
|
2020-07-04 09:55:38 -04:00
|
|
|
<div class="chat-container no-js">
|
2020-03-08 05:21:43 -04:00
|
|
|
<div class="chat-users">
|
Refactors logic for chat user list and scroll
- Refactors server side code to use instance variable instead of
background thread to generate a list of connected users
- Send this user list anytime any change is made to the list. It can
be: join, update username, disconnect
- In js, render the entire user list everytime it is received.
- Scroll to the bottom of the chat, everytime the current user
sends a message
- Else, if already at the bottom of the chat, scroll to the bottom
after appending incoming status or chat message. But if the user
is scrolled up in the chat window, then do not scroll to the bottom
- When refreshed or close tab is clicked, default browser warning is
shown.
- On receiving disconnect, the browser removes user from room.
- If refreshed, it is shown as if the user left and joined again.
2020-05-03 18:17:13 -04:00
|
|
|
<div class="editable-username">
|
|
|
|
<input id="username" value="{{ username }}" />
|
2020-05-09 16:25:31 -04:00
|
|
|
<button id="update-username" disabled>Save</button>
|
Refactors logic for chat user list and scroll
- Refactors server side code to use instance variable instead of
background thread to generate a list of connected users
- Send this user list anytime any change is made to the list. It can
be: join, update username, disconnect
- In js, render the entire user list everytime it is received.
- Scroll to the bottom of the chat, everytime the current user
sends a message
- Else, if already at the bottom of the chat, scroll to the bottom
after appending incoming status or chat message. But if the user
is scrolled up in the chat window, then do not scroll to the bottom
- When refreshed or close tab is clicked, default browser warning is
shown.
- On receiving disconnect, the browser removes user from room.
- If refreshed, it is shown as if the user left and joined again.
2020-05-03 18:17:13 -04:00
|
|
|
</div>
|
2020-03-12 05:24:48 -04:00
|
|
|
<ul id="user-list">
|
|
|
|
</ul>
|
2020-03-08 05:21:43 -04:00
|
|
|
</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>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-04 09:35:07 -04:00
|
|
|
<script src="{{ static_url_path }}/js/jquery-3.5.1.min.js"></script>
|
2020-03-08 05:21:43 -04:00
|
|
|
<script src="{{ static_url_path }}/js/socket.io.min.js"></script>
|
|
|
|
<script async src="{{ static_url_path }}/js/chat.js"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|