forked from rDrama/rDrama
more improvements to chat
parent
419f3da1e5
commit
c4953d924e
|
@ -174,13 +174,13 @@ function send() {
|
||||||
function quote(t) {
|
function quote(t) {
|
||||||
document.getElementById("quotes").classList.remove("d-none")
|
document.getElementById("quotes").classList.remove("d-none")
|
||||||
|
|
||||||
const text = t.parentElement.getElementsByClassName("text")[0].innerHTML.replace(/\*/g,"\\*").split('\n').pop()
|
const text = t.parentElement.parentElement.getElementsByClassName("text")[0].innerHTML.replace(/\*/g,"\\*").split('\n').pop()
|
||||||
document.getElementById('QuotedMessage').innerHTML = text
|
document.getElementById('QuotedMessage').innerHTML = text
|
||||||
|
|
||||||
const username = t.parentElement.parentElement.parentElement.parentElement.getElementsByClassName('userlink')[0].textContent
|
const username = t.parentElement.parentElement.parentElement.parentElement.parentElement.getElementsByClassName('userlink')[0].textContent
|
||||||
document.getElementById('QuotedUser').innerHTML = username
|
document.getElementById('QuotedUser').innerHTML = username
|
||||||
|
|
||||||
const id = t.parentElement.parentElement.parentElement.id
|
const id = t.parentElement.parentElement.parentElement.parentElement.id
|
||||||
document.getElementById('quotes_id').value = id
|
document.getElementById('quotes_id').value = id
|
||||||
document.getElementById('QuotedMessageLink').href = `#${id}`
|
document.getElementById('QuotedMessageLink').href = `#${id}`
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ socket.on('typing', function (users){
|
||||||
|
|
||||||
|
|
||||||
function del(t) {
|
function del(t) {
|
||||||
const chatline = t.parentElement.parentElement.parentElement
|
const chatline = t.parentElement.parentElement.parentElement.parentElement
|
||||||
socket.emit('delete', chatline.id);
|
socket.emit('delete', chatline.id);
|
||||||
chatline.remove()
|
chatline.remove()
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
{% set mentioned = m and vlink in m['text_html'] or (quote_exists and messages[m['quotes']]['user_id'] == v.id) %}
|
{% set mentioned = m and vlink in m['text_html'] or (quote_exists and messages[m['quotes']]['user_id'] == v.id) %}
|
||||||
<div class="chat-line {% if mentioned %}chat-mention{% endif %}" {% if m %}id="{{id}}"{% endif %}>
|
<div class="chat-line {% if mentioned %}chat-mention{% endif %}" {% if m %}id="{{id}}"{% endif %}>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<div class="text-muted chat-line-content d-flex">
|
<div class="text-muted chat-line-content">
|
||||||
<div class="{% if not (m and m['quotes']) %}d-none{% endif %} quotes" style="font-size:12px">
|
<div class="{% if not (m and m['quotes']) %}d-none{% endif %} quotes" style="font-size:12px">
|
||||||
<a class="QuotedMessageLink" {% if m and m['quotes'] %}href="#{{m['quotes']}}"{% endif %}>
|
<a class="QuotedMessageLink" {% if m and m['quotes'] %}href="#{{m['quotes']}}"{% endif %}>
|
||||||
<i class="fas fa-reply"></i>
|
<i class="fas fa-reply"></i>
|
||||||
|
@ -46,21 +46,23 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="chat-message text-black text-break">
|
<div class="d-flex">
|
||||||
{% if m %}
|
<span class="chat-message text-black text-break">
|
||||||
{% if v.slurreplacer %}
|
{% if m %}
|
||||||
{{m['text_censored'] | safe}}
|
{% if v.slurreplacer %}
|
||||||
{% else %}
|
{{m['text_censored'] | safe}}
|
||||||
{{m['text_html'] | safe}}
|
{% else %}
|
||||||
|
{{m['text_html'] | safe}}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
<span class="text d-none">{% if m %}{{m['text']}}{% endif %}</span>
|
||||||
|
<i class="quote btn fas fa-reply ml-auto" data-nonce="{{g.nonce}}" data-onclick="quote(this)"></i>
|
||||||
|
{% if v.admin_level > 1 %}
|
||||||
|
<i class="btn del fas fa-trash-alt"></i>
|
||||||
|
<i class="btn d-none del delmsg fas fa-trash-alt text-danger" data-nonce="{{g.nonce}}" data-onclick="del(this)"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</div>
|
||||||
<span class="text d-none">{% if m %}{{m['text']}}{% endif %}</span>
|
|
||||||
<i class="quote btn fas fa-reply ml-auto" data-nonce="{{g.nonce}}" data-onclick="quote(this)"></i>
|
|
||||||
{% if v.admin_level > 1 %}
|
|
||||||
<i class="btn del fas fa-trash-alt"></i>
|
|
||||||
<i class="btn d-none del delmsg fas fa-trash-alt text-danger" data-nonce="{{g.nonce}}" data-onclick="del(this)"></i>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue