same as last commit but for comments
parent
32f079ed20
commit
24529678ce
|
@ -1,41 +1,65 @@
|
||||||
function removeComment(t,post_id,button1,button2,cls) {
|
function removeComment(t,comment_id,button1,button2,cls) {
|
||||||
url="/remove_comment/"+post_id
|
url="/remove_comment/"+comment_id
|
||||||
|
|
||||||
postToast(t,url,button1,button2,cls)
|
t.disabled = true;
|
||||||
|
t.classList.add("disabled");
|
||||||
if (window.location.pathname == '/admin/reported/comments')
|
postToast_callback(url,
|
||||||
{
|
{
|
||||||
document.getElementById("post-info-"+post_id).remove()
|
},
|
||||||
document.getElementById("comment-"+post_id).remove()
|
(xhr) => {
|
||||||
}
|
if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
else
|
if (window.location.pathname == '/admin/reported/comments')
|
||||||
{
|
{
|
||||||
try {
|
document.getElementById("post-info-"+comment_id).remove()
|
||||||
document.getElementById("comment-"+post_id+"-only").classList.add("banned");
|
document.getElementById("comment-"+comment_id).remove()
|
||||||
} catch(e) {
|
}
|
||||||
document.getElementById("context").classList.add("banned");
|
else
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
document.getElementById("comment-"+comment_id+"-only").classList.add("banned");
|
||||||
|
} catch(e) {
|
||||||
|
document.getElementById("context").classList.add("banned");
|
||||||
|
}
|
||||||
|
document.getElementById(button1).classList.toggle(cls);
|
||||||
|
document.getElementById(button2).classList.toggle(cls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
t.disabled = false;
|
||||||
|
t.classList.remove("disabled");
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
function approveComment(t,post_id,button1,button2,cls) {
|
function approveComment(t,comment_id,button1,button2,cls) {
|
||||||
url="/approve_comment/"+post_id
|
url="/approve_comment/"+comment_id
|
||||||
|
|
||||||
postToast(t,url,button1,button2,cls)
|
t.disabled = true;
|
||||||
|
t.classList.add("disabled");
|
||||||
if (window.location.pathname == '/admin/reported/comments')
|
postToast_callback(url,
|
||||||
{
|
{
|
||||||
document.getElementById("post-info-"+post_id).remove()
|
},
|
||||||
document.getElementById("comment-"+post_id).remove()
|
(xhr) => {
|
||||||
}
|
if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
else
|
if (window.location.pathname == '/admin/reported/comments')
|
||||||
{
|
{
|
||||||
try {
|
document.getElementById("post-info-"+comment_id).remove()
|
||||||
document.getElementById("comment-"+post_id+"-only").classList.remove("banned");
|
document.getElementById("comment-"+comment_id).remove()
|
||||||
} catch(e) {
|
}
|
||||||
document.getElementById("context").classList.remove("banned");
|
else
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
document.getElementById("comment-"+comment_id+"-only").classList.remove("banned");
|
||||||
|
} catch(e) {
|
||||||
|
document.getElementById("context").classList.remove("banned");
|
||||||
|
}
|
||||||
|
document.getElementById(button1).classList.toggle(cls);
|
||||||
|
document.getElementById(button2).classList.toggle(cls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
t.disabled = false;
|
||||||
|
t.classList.remove("disabled");
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function adminToggleMute(userId, muteStatus, buttonId) {
|
function adminToggleMute(userId, muteStatus, buttonId) {
|
||||||
|
|
Loading…
Reference in New Issue