remotes/1693045480750635534/spooky-22
Aevann1 2021-08-31 19:14:09 +02:00
parent d35ece36ff
commit 9b41e55fc1
2 changed files with 32 additions and 32 deletions

View File

@ -166,34 +166,34 @@
{{c.realbody(v) | safe}}
{% if not c.parent_submission and c.author_id!=NOTIFICATIONS_ACCOUNT and c.author_id!=AUTOJANNY_ACCOUNT and c.author_id!=v.id %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="document.getElementById('reply-to-message-{{c.id}}').classList.toggle('d-none')">Reply</a>
<pre></pre>
<form class="d-none" id="reply-to-message-{{c.id}}" action="/reply" method="post" class="input-group" enctype="multipart/form-data">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="sentto" value="{{c.author.username}}">
<textarea name="body" form="reply-to-t3_{{c.id}}" class="comment-box form-control rounded" id="reply-form-body-{{c.fullname}}" aria-label="With textarea" rows="3"></textarea>
<div class="comment-format" id="comment-format-bar-{{c.id}}">
<label class="btn btn-secondary format d-inline-block m-0" for="gif-reply-btn-{{c.fullname}}">
<span id="gif-reply-btn-{{c.fullname}}" class="font-weight-bolder text-uppercase" onclick="commentForm('reply-form-body-{{c.fullname}}');getGif()" aria-hidden="true" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</span>
</label>
&nbsp;
<label class="btn btn-secondary format d-inline-block m-0" for="gif-reply-btn-{{c.fullname}}">
<i id="emoji-reply-btn-{{c.fullname}}" class="fas fa-smile-beam" onclick="loadEmojis('reply-form-body-{{c.fullname}}')" aria-hidden="true" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></i>
</label>
&nbsp;
<label class="btn btn-secondary format d-inline-block m-0" for="file-upload-reply-{{c.fullname}}">
<div id="filename-show-reply-{{c.id}}"><i class="far fa-image"></i></div>
<input id="file-upload-reply-{{c.fullname}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-show-reply-{{c.id}}').innerHTML='image';" hidden>
</label>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-message-{{c.id}}').classList.add('d-none')" class="d-none d-md-block btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a id="save-reply-to-message-{{c.id}}" class="d-none d-md-block btn btn-primary text-white ml-2" onclick="post_reply('{{c.id}}, {{c.fullname}}');" href="javascript:void(0)">Reply</a>
</div>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-message-{{c.id}}').classList.add('d-none')" class="d-block d-md-none btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a id="save-reply-to-message-{{c.id}}" class="d-block d-md-none btn btn-primary text-white ml-2" onclick="post_reply('{{c.id}}, {{c.fullname}}');" href="javascript:void(0)">Reply</a>
</form>
<a class="btn btn-primary" href="javascript:void(0)" onclick="document.getElementById('reply-to-message-{{c.id}}').classList.toggle('d-none')">Reply</a>
<pre></pre>
<form class="d-none" id="reply-to-message-{{c.id}}" action="/reply" method="post" class="input-group" enctype="multipart/form-data">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="sentto" value="{{c.author.username}}">
<textarea name="body" form="reply-to-t3_{{c.id}}" class="comment-box form-control rounded" id="reply-form-body-{{c.id}}" aria-label="With textarea" rows="3"></textarea>
<div class="comment-format" id="comment-format-bar-{{c.id}}">
<label class="btn btn-secondary format d-inline-block m-0" for="gif-reply-btn-{{c.id}}">
<span id="gif-reply-btn-{{c.id}}" class="font-weight-bolder text-uppercase" onclick="commentForm('reply-form-body-{{c.id}}');getGif()" aria-hidden="true" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</span>
</label>
&nbsp;
<label class="btn btn-secondary format d-inline-block m-0" for="gif-reply-btn-{{c.id}}">
<i id="emoji-reply-btn-{{c.id}}" class="fas fa-smile-beam" onclick="loadEmojis('reply-form-body-{{c.id}}')" aria-hidden="true" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></i>
</label>
&nbsp;
<label class="btn btn-secondary format d-inline-block m-0" for="file-upload-reply-{{c.id}}">
<div id="filename-show-reply-{{c.id}}"><i class="far fa-image"></i></div>
<input id="file-upload-reply-{{c.id}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-show-reply-{{c.id}}').innerHTML='image';" hidden>
</label>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-message-{{c.id}}').classList.add('d-none')" class="d-none d-md-block btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a id="save-reply-to-message-{{c.id}}" class="d-none d-md-block btn btn-primary text-white ml-2" onclick="post_reply('{{c.id}}');" href="javascript:void(0)">Reply</a>
</div>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-message-{{c.id}}').classList.add('d-none')" class="d-block d-md-none btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a id="save-reply-to-message-{{c.id}}" class="d-block d-md-none btn btn-primary text-white ml-2" onclick="post_reply('{{c.id}}');" href="javascript:void(0)">Reply</a>
</form>
{% endif %}
</div>
</div>
{% if c.parent_submission %}

View File

@ -519,20 +519,20 @@
}
post_reply=function(id, fullname){
post_reply=function(id){
var form = new FormData();
form.append('formkey', formkey());
form.append('parent_id', id);
form.append('body', document.getElementById('reply-form-body-'+fullname).value);
form.append('file', document.getElementById('file-upload-reply-'+fullname).files[0]);
form.append('body', document.getElementById('reply-form-body-'+id).value);
form.append('file', document.getElementById('file-upload-reply-'+id).files[0]);
var xhr = new XMLHttpRequest();
xhr.open("post", "/reply");
xhr.withCredentials=true;
xhr.onload=function(){
if (xhr.status==200) {
commentForm=document.getElementById('comment-form-space-'+fullname);
commentForm=document.getElementById('comment-form-space-'+id);
commentForm.innerHTML=JSON.parse(xhr.response)["html"];
$('#toast-comment-success').toast('dispose');
$('#toast-comment-error').toast('dispose');
@ -548,7 +548,7 @@
}
xhr.send(form)
document.getElementById('save-reply-to-'+fullname).classList.add('disabled');
document.getElementById('save-reply-to-'+id).classList.add('disabled');
}