rDrama/files/assets/js/admin/submission.js

43 lines
847 B
JavaScript
Raw Normal View History

2022-10-23 16:24:17 +00:00
function removePost(t,post_id,button1,button2,cls) {
url="/remove_post/"+post_id
postToastSwitch(t, url,
2022-11-03 19:07:08 +00:00
button1,
button2,
cls,
() => {
2022-12-30 12:52:59 +00:00
if (location.pathname == '/admin/reported/posts')
2022-11-03 19:07:08 +00:00
{
document.getElementById("flaggers-"+post_id).remove()
document.getElementById("post-"+post_id).remove()
}
else
{
document.getElementById("post-"+post_id).classList.add("banned");
}
}
);
}
2022-10-23 16:24:17 +00:00
function approvePost(t,post_id,button1,button2,cls) {
url="/approve_post/"+post_id
postToastSwitch(t, url,
2022-11-03 19:07:08 +00:00
button1,
button2,
cls,
() => {
2022-12-30 12:52:59 +00:00
if (location.pathname == '/admin/reported/posts')
2022-11-03 19:07:08 +00:00
{
document.getElementById("flaggers-"+post_id).remove()
document.getElementById("post-"+post_id).remove()
}
else
{
document.getElementById("post-"+post_id).classList.remove("banned");
}
}
);
2022-10-23 16:24:17 +00:00
}