rDrama/files/templates/chat.html

138 lines
4.3 KiB
HTML
Raw Normal View History

2022-03-19 21:20:23 +00:00
{% extends "default.html" %}
{% block title %}
2022-03-22 02:35:12 +00:00
<title>Chat</title>
<meta name="description" content="Chat">
2022-03-19 21:20:23 +00:00
{% endblock %}
{% block content %}
2022-03-22 00:56:41 +00:00
<div class="border-right py-3 px-3">
2022-03-22 03:32:24 +00:00
<span data-toggle="tooltip" data-placement="bottom" data-bs-title="Users online right now" title="Users online right now" class="text-muted">
2022-03-22 02:35:12 +00:00
<i class="far fa-user fa-sm mr-1"></i>
<span class="board-chat-count">0</span>
</span>
2022-03-22 00:56:41 +00:00
</div>
2022-03-19 23:14:44 +00:00
<div id="chat-line-template" class="d-none">
2022-03-24 03:00:39 +00:00
<div class="chat-line">
2022-03-22 02:35:12 +00:00
<div class="d-flex align-items-center">
<span class="rounded mb-auto d-none d-md-block chat-profile">
<img class="desktop-avatar rounded-circle w-100">
</span>
<div class="pl-md-3 text-muted">
<div>
2022-03-22 05:19:56 +00:00
<img class="mobile-avatar profile-pic-30 mr-1 d-inline-block d-md-none" data-toggle="tooltip" data-placement="right">
2022-03-22 02:35:12 +00:00
<a href="" class="font-weight-bold text-black userlink" target="_blank"></a>
<div style="overflow:hidden">
<span class="chat-message text-black text-break"></span>
2022-03-24 02:21:22 +00:00
<span class="text d-none"></span>
<button class="quote-btn btn d-inline-block pt-0" onclick="quote(this)"><i class="fas fa-reply" aria-hidden="true"></i></button>
2022-03-22 02:35:12 +00:00
</div>
</div>
</div>
</div>
</div>
2022-03-19 23:14:44 +00:00
</div>
2022-03-19 21:20:23 +00:00
2022-03-22 05:19:56 +00:00
<div class="container py-0 chat-container">
2022-03-22 02:35:12 +00:00
<div id="chat-window">
<div id="chat-text" class="fullchat">
2022-03-22 05:19:56 +00:00
{% for m in messages %}
2022-03-24 02:10:38 +00:00
{% set text_html = m['text_html'] %}
2022-03-24 02:12:05 +00:00
{% set link = '<a href="/id/' + v.id|string + '">' %}
2022-03-24 03:00:39 +00:00
<div class="chat-line {% if link in text_html %}chat-mention{% endif %}">
2022-03-22 05:19:56 +00:00
<div class="d-flex align-items-center">
<span class="rounded mb-auto d-none d-md-block chat-profile">
<img class="desktop-avatar rounded-circle w-100" src="{{m['avatar']}}">
</span>
<div class="pl-md-3 text-muted">
<div>
<img src="{{m['avatar']}}" class="mobile-avatar profile-pic-30 mr-1 d-inline-block d-md-none" data-toggle="tooltip" data-placement="right">
<a class="font-weight-bold text-black userlink" style="color:#{{m['namecolor']}}" target="_blank" href="/@{{m['username']}}">{{m['username']}}</a>
<div style="overflow:hidden">
2022-03-24 02:10:38 +00:00
<span class="chat-message text-black text-break">{{text_html | safe}}</span>
2022-03-24 02:21:22 +00:00
<span class="d-none">{{m['text']}}</span>
<button class="btn d-inline-block pt-0" onclick="quote(this)"><i class="fas fa-reply" aria-hidden="true"></i></button>
2022-03-22 05:19:56 +00:00
</div>
</div>
</div>
</div>
</div>
{% endfor %}
2022-03-22 02:35:12 +00:00
</div>
<div id="system-template">
<div class="system-line">
<p class="message text-muted"></p>
</div>
</div>
</div>
2022-03-23 16:08:57 +00:00
<div id='message' class="d-none position-relative form-group d-flex pb-3">
2022-03-22 02:35:12 +00:00
<div class="position-absolute text-muted text-small" style="bottom: -1.5rem; line-height: 1;">
<span id="typing-indicator"></span>
<span id="loading-indicator" class="d-none"></span>
</div>
2022-03-22 03:12:13 +00:00
<i class="btn btn-secondary mr-2 fas fa-smile-beam" style="padding-top:0.65rem" onclick="loadEmojis('input-text')" aria-hidden="true" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-placement="bottom" title="Add Emoji"></i>
2022-03-22 04:07:35 +00:00
<textarea id="input-text" minlength="1" maxlength="1000" type="text" class="form-control" placeholder="Message" autocomplete="off" autofocus rows="1"></textarea>
2022-03-22 02:35:12 +00:00
<button id="chatsend" onclick="send()" class="btn btn-primary ml-3" type="submit">Send</button>
</div>
2022-03-19 21:20:23 +00:00
</div>
2022-03-23 16:15:59 +00:00
<input id="vid" type="hidden" value="{{v.id}}">
<input id="site_name" type="hidden" value="{{SITE_NAME}}">
2022-03-22 02:35:12 +00:00
2022-03-24 03:10:30 +00:00
<script data-cfasync="false" src="/chat.js?v=2"></script>
2022-03-22 14:57:04 +00:00
<style>
#chat-window {
max-height:calc(100vh - 300px);
overflow-y: scroll;
}
.fullchat .chat-profile {
min-width: 42px;
width: 42px;
height: 42px;
}
#chat-window::-webkit-scrollbar {
display: none;
}
#chat-window {
-ms-overflow-style: none;
scrollbar-width: none;
}
.chat-mention {
background-color: var(--primary55);
border-radius: 5px;
}
.profile-pic-30 {
width: 30px;
height: 30px;
border-radius: 50%;
text-align: center;
object-fit: cover;
}
.chat-message p {
display: inline-block;
}
2022-03-24 03:00:39 +00:00
@media (max-width: 768px) {
* {
font-size: 10px !important;
}
}
2022-03-22 14:57:04 +00:00
</style>
2022-03-23 19:40:04 +00:00
<script>
2022-03-23 19:47:33 +00:00
box.scrollTo(0, box.scrollHeight)
2022-03-23 19:40:04 +00:00
</script>
2022-03-24 02:13:01 +00:00
2022-03-22 03:08:00 +00:00
{% include "emoji_modal.html" %}
2022-03-24 02:13:01 +00:00
{% include "expanded_image_modal.html" %}
2022-03-22 03:08:00 +00:00
2022-03-19 22:47:52 +00:00
{% endblock %}