MarseyWorld/files/assets/js/group_members_owner.js

31 lines
833 B
JavaScript
Raw Normal View History

2023-02-26 08:59:26 +00:00
const members_tbody = document.getElementById('members_tbody')
2023-02-25 21:44:02 +00:00
2023-02-26 00:05:37 +00:00
function approve_membership(t, group, uid) {
url = `/!${group}/${uid}/approve`
2023-02-24 19:29:07 +00:00
postToast(t, url,
{
},
() => {
const mod = document.getElementById(`mod-${uid}`)
if (mod) mod.classList.remove('d-none')
2023-02-25 21:44:02 +00:00
document.getElementById(`kick-${uid}`).classList.remove('d-none')
document.getElementById(`time-${uid}`).innerHTML = formatDate(new Date());
document.getElementById(`counter-${uid}`).innerHTML = parseInt(members_tbody.lastElementChild.firstElementChild.innerHTML) + 1
members_tbody.append(document.getElementById(uid));
t.parentElement.remove()
2023-02-24 19:29:07 +00:00
}
);
}
2023-02-26 00:05:37 +00:00
function reject_membership(t, group, uid) {
url = `/!${group}/${uid}/reject`
2023-02-24 19:29:07 +00:00
postToast(t, url,
{
},
() => {
2023-02-25 21:44:02 +00:00
t.parentElement.parentElement.parentElement.remove();
2023-02-24 19:29:07 +00:00
}
);
}