Added alt-detection. Just need to set up pre-delete for userModel function to remove refrences to itself on alt accounts

This commit is contained in:
rainbow napkin 2024-12-24 10:57:55 -05:00
parent 6e785dc211
commit 980c84afff
14 changed files with 346 additions and 12 deletions

View file

@ -265,6 +265,7 @@ class canopyAdminUtils{
class adminUserList{
constructor(){
this.userNames = document.querySelectorAll(".admin-user-list-name");
this.rankSelectors = document.querySelectorAll(".admin-user-list-rank-select");
this.banIcons = document.querySelectorAll(".admin-user-list-ban-icon");
@ -272,13 +273,33 @@ class adminUserList{
}
setupInput(){
this.rankSelectors.forEach((rankSelector)=>{
rankSelector.addEventListener("change", this.setRank.bind(this))
});
for(let userName of this.userNames){
//Splice username out of class name
const name = userName.id.replace('admin-user-list-name-','');
this.banIcons.forEach((banIcon) => {
//When the mouse starts to hover
userName.addEventListener('mouseenter',(event)=>{
//Create the tooltip
const tooltip = new canopyUXUtils.tooltip(`altList?user=${name}`, true);
//Do intial mouse move
tooltip.moveToMouse(event);
//Move the tooltip with the mouse
userName.addEventListener('mousemove', tooltip.moveToMouse.bind(tooltip));
//remove the tooltip on mouseleave
userName.addEventListener('mouseleave', tooltip.remove.bind(tooltip));
});
}
for(let rankSelector of this.rankSelectors){
rankSelector.addEventListener("change", this.setRank.bind(this))
}
for(let banIcon of this.banIcons){
banIcon.addEventListener("click", this.banPopup.bind(this));
})
}
}
async setRank(event){