diff --git a/src/views/partial/channelSettings/banList.ejs b/src/views/partial/channelSettings/banList.ejs
index ceeffa8..9ff79a6 100644
--- a/src/views/partial/channelSettings/banList.ejs
+++ b/src/views/partial/channelSettings/banList.ejs
@@ -19,17 +19,22 @@ along with this program. If not, see . %>
-
+
-
-
Img
-
ID
-
Name
-
Ban Alts
-
Ban Date
-
Expires
-
-
+
+
+
Img
+
ID
+
Name
+
Ban Alts
+
Ban Date
+
Expires
+
+
+
+
+
+
<%# This is getting filled via AJAX since we need to refresh it when new users are added anywho. %>
diff --git a/src/views/partial/channelSettings/emoteList.ejs b/src/views/partial/channelSettings/emoteList.ejs
index 670df79..64f469a 100644
--- a/src/views/partial/channelSettings/emoteList.ejs
+++ b/src/views/partial/channelSettings/emoteList.ejs
@@ -23,6 +23,6 @@ along with this program. If not, see . %>
-
+
\ No newline at end of file
diff --git a/src/views/partial/channelSettings/tokeCommandList.ejs b/src/views/partial/channelSettings/tokeCommandList.ejs
index 6a28645..aaf6666 100644
--- a/src/views/partial/channelSettings/tokeCommandList.ejs
+++ b/src/views/partial/channelSettings/tokeCommandList.ejs
@@ -19,6 +19,6 @@ along with this program. If not, see . %>
!
-
+
\ No newline at end of file
diff --git a/src/views/partial/channelSettings/userList.ejs b/src/views/partial/channelSettings/userList.ejs
index 4d85802..e575949 100644
--- a/src/views/partial/channelSettings/userList.ejs
+++ b/src/views/partial/channelSettings/userList.ejs
@@ -24,14 +24,18 @@ along with this program. If not, see . %>
<% }); %>
-
-
-
-
Img
-
ID
-
Name
-
Rank
-
+
+
+
+
+
Img
+
ID
+
Name
+
Rank
+
+
+
+
<%# This is getting filled via AJAX since we need to refresh it when new users are added anywho. %>
diff --git a/www/js/channelSettings.js b/www/js/channelSettings.js
index bf23907..dd2c145 100644
--- a/www/js/channelSettings.js
+++ b/www/js/channelSettings.js
@@ -207,7 +207,7 @@ class chanInfo{
class rankList{
constructor(channel){
this.channel = channel
- this.table = document.querySelector(".admin-list-table");
+ this.tbody = document.querySelector("#admin-rank-list-table tbody");
this.userPrompt = document.querySelector("#new-rank-input");
this.rankSelect = document.querySelector("#new-rank-select");
@@ -262,7 +262,7 @@ class rankList{
const rankEnum = await utils.ajax.getRankEnum();
//clear the table
- this.clearTable();
+ this.tbody.innerHTML = "";
//For each user in the list
Object.entries(data).forEach((userAr) => {
@@ -296,7 +296,7 @@ class rankList{
}
//Generate row and append to table
- this.table.appendChild(utils.ux.newTableRow([
+ this.tbody.appendChild(utils.ux.newTableRow([
imgNode,
user.id,
user.user,
@@ -304,23 +304,12 @@ class rankList{
]));
});
}
-
- clearTable(){
- //get all non-title table rows
- const rows = this.table.querySelectorAll("tr.gen-row");
-
- //for each row
- rows.forEach((row) => {
- //The Lord Yeeteth, and The Lord Yoinketh away...
- row.remove();
- });
- }
}
class banList{
constructor(channel){
this.channel = channel;
- this.table = document.querySelector("#admin-ban-list-table");
+ this.tbody = document.querySelector("#admin-ban-list-table tbody");
this.banPrompt = document.querySelector("#new-ban-input");
this.banButton = document.querySelector("#new-ban-button");
@@ -337,13 +326,6 @@ class banList{
this.updateList(data);
}
- clearList(){
- const oldRows = this.table.querySelectorAll('tr.gen-row');
- oldRows.forEach((row) => {
- row.remove();
- });
- }
-
async ban(event){
new chanBanUserPopup(this.channel, this.banPrompt.value, this.updateList.bind(this));
}
@@ -360,7 +342,8 @@ class banList{
updateList(bans){
//for each ban listed
- this.clearList();
+ this.tbody.innerHTML = "";
+
bans.forEach((ban)=>{
//Create IMG node
const imgNode = document.createElement('img');
@@ -382,7 +365,7 @@ class banList{
const expirationString = ban.expirationDays < 0 ? "Never" : `${new Date(ban.expirationDate).toDateString()} (${ban.daysUntilExpiration} day(s) left)`;
//Generate row and append to table
- this.table.appendChild(utils.ux.newTableRow([
+ this.tbody.appendChild(utils.ux.newTableRow([
imgNode,
ban.user.id,
ban.user.user,