Finished up implementing channel-based user bans.
This commit is contained in:
parent
ef79e9941c
commit
96953979a2
19 changed files with 518 additions and 202 deletions
|
|
@ -34,6 +34,64 @@ class canopyUXUtils{
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
//We should really move this over to uxutils along with newrow & newtable functions
|
||||
newTableCell(content, firstCol = false){
|
||||
//Create a new 'td' element
|
||||
const cell = document.createElement('td');
|
||||
cell.classList.add("admin-list-entry","admin-list-entry-item");
|
||||
|
||||
//If it's not the first column, mention it!
|
||||
if(!firstCol){
|
||||
cell.classList.add("admin-list-entry-not-first-col");
|
||||
}
|
||||
|
||||
//check for arrays
|
||||
if(content.forEach == null){
|
||||
//add single items
|
||||
addContent(content);
|
||||
}else{
|
||||
//Crawl through content array
|
||||
content.forEach((item)=>{
|
||||
//add each item
|
||||
addContent(item);
|
||||
});
|
||||
}
|
||||
|
||||
//return the resulting cell
|
||||
return cell;
|
||||
|
||||
|
||||
function addContent(ct){
|
||||
//If we're adding as node
|
||||
if(ct.cloneNode != null){
|
||||
//append it like it's a node
|
||||
cell.appendChild(ct);
|
||||
}else{
|
||||
//otherwise use it as innerHTML
|
||||
cell.innerHTML = ct;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
newTableRow(cellContent){
|
||||
//Create an empty table row to hold the cells
|
||||
const entryRow = document.createElement('tr');
|
||||
entryRow.classList.add("admin-list-entry");
|
||||
|
||||
entryRow.appendChild(this.newTableCell(cellContent[0], true));
|
||||
|
||||
cellContent.forEach((content, i)=>{
|
||||
if(i > 0){
|
||||
entryRow.append(this.newTableCell(content));
|
||||
}
|
||||
});
|
||||
|
||||
return entryRow;
|
||||
}
|
||||
|
||||
|
||||
static popup = class{
|
||||
constructor(content, ajaxPopup = false, cb){
|
||||
//Define non-popup node values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue