fdgd
This commit is contained in:
parent
ade27e2ad6
commit
9b18e87e92
7 changed files with 44 additions and 74 deletions
|
@ -1,19 +1,17 @@
|
||||||
function removeComment(post_id,button1,button2) {
|
function removeComment(post_id,button1,button2) {
|
||||||
url="/ban_comment/"+post_id
|
url="/ban_comment/"+post_id
|
||||||
|
|
||||||
callback=function(){
|
post(url)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
document.getElementById("comment-"+post_id+"-only").classList.add("banned");
|
document.getElementById("comment-"+post_id+"-only").classList.add("banned");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
document.getElementById("context").classList.add("banned");
|
document.getElementById("context").classList.add("banned");
|
||||||
}
|
|
||||||
|
|
||||||
button=document.getElementById("remove-"+post_id);
|
|
||||||
button.onclick=function(){approveComment(post_id)};
|
|
||||||
button.innerHTML='<i class="fas fa-clipboard-check"></i>Approve'
|
|
||||||
}
|
}
|
||||||
post(url, callback, "Comment has been removed.")
|
|
||||||
|
var button=document.getElementById("remove-"+post_id);
|
||||||
|
button.onclick=function(){approveComment(post_id)};
|
||||||
|
button.innerHTML='<i class="fas fa-clipboard-check"></i>Approve'
|
||||||
|
|
||||||
if (typeof button1 !== 'undefined') {
|
if (typeof button1 !== 'undefined') {
|
||||||
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
||||||
|
@ -24,19 +22,17 @@ function removeComment(post_id,button1,button2) {
|
||||||
function approveComment(post_id,button1,button2) {
|
function approveComment(post_id,button1,button2) {
|
||||||
url="/unban_comment/"+post_id
|
url="/unban_comment/"+post_id
|
||||||
|
|
||||||
callback=function(){
|
post(url)
|
||||||
try {
|
|
||||||
document.getElementById("comment-"+post_id+"-only").classList.remove("banned");
|
|
||||||
} catch(e) {
|
|
||||||
document.getElementById("context").classList.remove("banned");
|
|
||||||
}
|
|
||||||
|
|
||||||
button=document.getElementById("remove-"+post_id);
|
try {
|
||||||
button.onclick=function(){removeComment(post_id)};
|
document.getElementById("comment-"+post_id+"-only").classList.remove("banned");
|
||||||
button.innerHTML='<i class="fas fa-trash-alt"></i>Remove'
|
} catch(e) {
|
||||||
|
document.getElementById("context").classList.remove("banned");
|
||||||
}
|
}
|
||||||
|
|
||||||
post(url, callback, "Comment has been approved.")
|
var button=document.getElementById("remove-"+post_id);
|
||||||
|
button.onclick=function(){removeComment(post_id)};
|
||||||
|
button.innerHTML='<i class="fas fa-trash-alt"></i>Remove'
|
||||||
|
|
||||||
if (typeof button1 !== 'undefined') {
|
if (typeof button1 !== 'undefined') {
|
||||||
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
||||||
|
@ -48,14 +44,12 @@ function approveComment(post_id,button1,button2) {
|
||||||
function removeComment2(post_id,button1,button2) {
|
function removeComment2(post_id,button1,button2) {
|
||||||
url="/ban_comment/"+post_id
|
url="/ban_comment/"+post_id
|
||||||
|
|
||||||
callback=function(){
|
post(url)
|
||||||
document.getElementById("comment-"+post_id+"-only").classList.add("banned");
|
|
||||||
|
|
||||||
button=document.getElementById("remove-"+post_id);
|
document.getElementById("comment-"+post_id+"-only").classList.add("banned");
|
||||||
button.onclick=function(){approveComment(post_id)};
|
var button=document.getElementById("remove-"+post_id);
|
||||||
button.innerHTML='<i class="fas fa-clipboard-check"></i>Approve'
|
button.onclick=function(){approveComment(post_id)};
|
||||||
}
|
button.innerHTML='<i class="fas fa-clipboard-check"></i>Approve'
|
||||||
post(url, callback, "Comment has been removed.")
|
|
||||||
|
|
||||||
if (typeof button1 !== 'undefined') {
|
if (typeof button1 !== 'undefined') {
|
||||||
document.getElementById(button1).classList.toggle("d-none");
|
document.getElementById(button1).classList.toggle("d-none");
|
||||||
|
@ -66,15 +60,12 @@ function removeComment2(post_id,button1,button2) {
|
||||||
function approveComment2(post_id,button1,button2) {
|
function approveComment2(post_id,button1,button2) {
|
||||||
url="/unban_comment/"+post_id
|
url="/unban_comment/"+post_id
|
||||||
|
|
||||||
callback=function(){
|
post(url)
|
||||||
document.getElementById("comment-"+post_id+"-only").classList.remove("banned");
|
|
||||||
|
|
||||||
button=document.getElementById("remove-"+post_id);
|
document.getElementById("comment-"+post_id+"-only").classList.remove("banned");
|
||||||
button.onclick=function(){removeComment(post_id)};
|
var button=document.getElementById("remove-"+post_id);
|
||||||
button.innerHTML='<i class="fas fa-trash-alt"></i>Remove'
|
button.onclick=function(){removeComment(post_id)};
|
||||||
}
|
button.innerHTML='<i class="fas fa-trash-alt"></i>Remove'
|
||||||
|
|
||||||
post(url, callback, "Comment has been approved.")
|
|
||||||
|
|
||||||
if (typeof button1 !== 'undefined') {
|
if (typeof button1 !== 'undefined') {
|
||||||
document.getElementById(button1).classList.toggle("d-none");
|
document.getElementById(button1).classList.toggle("d-none");
|
||||||
|
|
|
@ -109,12 +109,8 @@ function delete_commentModal(id) {
|
||||||
|
|
||||||
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting comment';
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting comment';
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
post('/delete/comment/' + id,
|
post('/delete/comment/' + id)
|
||||||
callback = function() {
|
location.reload();
|
||||||
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
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) {
|
|
||||||
callback();
|
|
||||||
} else {
|
|
||||||
xhr.onerror();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.send(form);
|
xhr.send(form);
|
||||||
|
window.location.reload(true)
|
||||||
};
|
};
|
||||||
|
|
||||||
function updatebgselection(){
|
function updatebgselection(){
|
||||||
|
@ -74,7 +67,7 @@ function updatebgselection(){
|
||||||
let bgsDir = backgrounds[bgselector.selectedIndex].folder;
|
let bgsDir = backgrounds[bgselector.selectedIndex].folder;
|
||||||
for (i=0; i < bgsToDisplay.length; i++) {
|
for (i=0; i < bgsToDisplay.length; i++) {
|
||||||
let onclickPost = bgsDir + "/" + bgsToDisplay[i];
|
let onclickPost = bgsDir + "/" + bgsToDisplay[i];
|
||||||
str += `<button class="btn btn-secondary m-1 p-0" style="width:15rem; overflow: hidden;"><img loading="lazy" style="padding:0.25rem; width: 15rem" src="/assets/images/backgrounds/${bgsDir}/${bgsToDisplay[i]}" alt="${bgsToDisplay[i]}-background" onclick="post('/settings/profile?background=${onclickPost}', function(){window.location.reload(true);})"/></button>`;
|
str += `<button class="btn btn-secondary m-1 p-0" style="width:15rem; overflow: hidden;"><img loading="lazy" style="padding:0.25rem; width: 15rem" src="/assets/images/backgrounds/${bgsDir}/${bgsToDisplay[i]}" alt="${bgsToDisplay[i]}-background" onclick="post('/settings/profile?background=${onclickPost}')"/></button>`;
|
||||||
}
|
}
|
||||||
bgContainer.innerHTML = str;
|
bgContainer.innerHTML = str;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,14 +33,14 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
{% include "award_modal.html" %}
|
{% 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 %}
|
{% 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>
|
||||||
|
|
||||||
|
|
||||||
{% if v and v.admin_level == 6 %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,28 +1,18 @@
|
||||||
<script>
|
<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_postModal(id) {
|
||||||
|
|
||||||
function delete_post(){
|
function delete_post(){
|
||||||
|
|
||||||
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);
|
|
||||||
|
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();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{% include "emoji_modal.html" %}
|
{% include "emoji_modal.html" %}
|
||||||
{% include "gif_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">
|
<div id="posts" class="row">
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,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=10"></script>
|
<script src="/assets/js/comments_v.js?v=11"></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