MarseyWorld/files/assets/js/submission_admin.js

32 lines
759 B
JavaScript

function removePost(t,post_id,button1,button2,cls) {
url="/remove_post/"+post_id
postToast(t,url,button1,button2,cls)
if (window.location.pathname == '/admin/reported/posts')
{
document.getElementById("flaggers-"+post_id).remove()
document.getElementById("post-"+post_id).remove()
}
else
{
document.getElementById("post-"+post_id).classList.add("banned");
}
};
function approvePost(t,post_id,button1,button2,cls) {
url="/approve_post/"+post_id
postToast(t,url,button1,button2,cls)
if (window.location.pathname == '/admin/reported/posts')
{
document.getElementById("flaggers-"+post_id).remove()
document.getElementById("post-"+post_id).remove()
}
else
{
document.getElementById("post-"+post_id).classList.remove("banned");
}
}