MarseyWorld/files/assets/js/admin/post.js

43 lines
849 B
JavaScript
Raw Normal View History

2022-10-23 16:24:17 +00:00
function removePost(t,post_id,button1,button2,cls) {
2023-08-23 21:57:39 +00:00
url = "/remove_post/"+post_id
2022-10-23 16:24:17 +00:00
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
{
2023-06-23 16:49:23 +00:00
document.getElementById("reports-"+post_id).remove()
2022-11-03 19:07:08 +00:00
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) {
2023-08-23 21:57:39 +00:00
url = "/approve_post/"+post_id
2022-10-23 16:24:17 +00:00
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
{
2023-06-23 16:49:23 +00:00
document.getElementById("reports-"+post_id).remove()
2022-11-03 19:07:08 +00:00
document.getElementById("post-"+post_id).remove()
}
else
{
document.getElementById("post-"+post_id).classList.remove("banned");
}
}
);
2022-10-23 16:24:17 +00:00
}