master
Aevann1 2021-10-06 01:41:55 +02:00
parent 54df1b0a14
commit 221c1640e3
4 changed files with 12 additions and 22 deletions

View File

@ -33,14 +33,14 @@
{% if v %}
{% include "award_modal.html" %}
<script src="/assets/js/comments_v.js?v=10"></script>
<script src="/assets/js/comments_v.js?v=11"></script>
{% endif %}
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
{% if v and v.admin_level == 6 %}
<script src="/assets/js/comments_admin.js?v=1"></script>
<script src="/assets/js/comments_admin.js?v=2"></script>
{% endif %}
<script>

View File

@ -1,28 +1,18 @@
<script>
function post(url, callback, errortext) {
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
var form = new FormData()
form.append("formkey", formkey());
xhr.withCredentials=true;
xhr.onerror=function() { alert(errortext); };
xhr.onload = function() {
if (xhr.status >= 200 && xhr.status < 300) {
callback();
} else {
xhr.onerror();
}
};
xhr.send(form);
};
function delete_postModal(id) {
function delete_post(){
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting post';
this.disabled = true;
post('/delete_post/' + id);
var url = '/delete_post/' + id
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
var form = new FormData()
form.append("formkey", formkey());
xhr.withCredentials=true;
xhr.send(form);
location.reload();
}

View File

@ -6,7 +6,7 @@
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}
<script src="/assets/js/setting_profile.js?v=1"></script>
<script src="/assets/js/settings_profile.js?v=2"></script>
<div id="posts" class="row">

View File

@ -45,7 +45,7 @@
{% if 'rdrama' not in request.host %}
{% if v %}
<script src="/assets/js/comments_v.js?v=10"></script>
<script src="/assets/js/comments_v.js?v=11"></script>
{% include "award_modal.html" %}
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}