dfsfds
This commit is contained in:
parent
7adf7f779f
commit
ebf182f062
5 changed files with 6 additions and 17 deletions
|
@ -1,17 +1,9 @@
|
||||||
function post(url, callback, errortext) {
|
function post(url) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("POST", url, true);
|
xhr.open("POST", url, true);
|
||||||
var form = new FormData()
|
var form = new FormData()
|
||||||
form.append("formkey", formkey());
|
form.append("formkey", formkey());
|
||||||
xhr.withCredentials=true;
|
xhr.withCredentials=true;
|
||||||
xhr.onerror=function() { alert(errortext); };
|
|
||||||
xhr.onload = function() {
|
|
||||||
if (xhr.status >= 200 && xhr.status < 300) {
|
|
||||||
if (typeof callback === "function") callback();
|
|
||||||
} else {
|
|
||||||
xhr.onerror();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.send(form);
|
xhr.send(form);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ def api_vote_comment(comment_id, new, v):
|
||||||
|
|
||||||
@app.post("/vote/poll/<comment_id>")
|
@app.post("/vote/poll/<comment_id>")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
@validate_formkey
|
||||||
def api_vote_poll(comment_id, v):
|
def api_vote_poll(comment_id, v):
|
||||||
|
|
||||||
vote = request.values.get("vote")
|
vote = request.values.get("vote")
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
{% include "award_modal.html" %}
|
{% include "award_modal.html" %}
|
||||||
<script src="/assets/js/comments_v.js?v=9"></script>
|
<script src="/assets/js/comments_v.js?v=10"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
|
||||||
|
|
|
@ -22,12 +22,8 @@
|
||||||
|
|
||||||
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting post';
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting post';
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
post('/delete_post/' + id,
|
post('/delete_post/' + id);
|
||||||
callback = function() {
|
location.reload();
|
||||||
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("deletePostButton-mobile").onclick = delete_post;
|
document.getElementById("deletePostButton-mobile").onclick = delete_post;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
{% if 'rdrama' not in request.host %}
|
{% if 'rdrama' not in request.host %}
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<script src="/assets/js/comments_v.js?v=9"></script>
|
<script src="/assets/js/comments_v.js?v=10"></script>
|
||||||
{% include "award_modal.html" %}
|
{% include "award_modal.html" %}
|
||||||
{% include "emoji_modal.html" %}
|
{% include "emoji_modal.html" %}
|
||||||
{% include "gif_modal.html" %}
|
{% include "gif_modal.html" %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue