Compare commits
No commits in common. "7660db75e78924eec218cbe54d3f1b9b0d15618a" and "441fb56f37204f8c697e1f1f3773f940d5f84a4e" have entirely different histories.
7660db75e7
...
441fb56f37
13 changed files with 82 additions and 142 deletions
|
|
@ -24,23 +24,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<%- include('partial/navbar', {user}); %>
|
<%- include('partial/navbar', {user}); %>
|
||||||
<div id="admin-panel-list-container">
|
<h1 class="panel-title"><%= unescape(channel.name) %> - Channel Settings</h1>
|
||||||
<div id="admin-nav-list">
|
<div class="admin-panel-container-div">
|
||||||
</div>
|
<%- include('partial/channelSettings/info.ejs', {unescape, channel}); %>
|
||||||
|
<%- include('partial/channelSettings/userList.ejs'); %>
|
||||||
<div class="admin-panel-container-div">
|
<%- include('partial/channelSettings/banList.ejs'); %>
|
||||||
<h1 class="panel-title"><%= unescape(channel.name) %> - Channel Settings</h1>
|
<%- include('partial/channelSettings/settings.ejs', {unescape, channel}); %>
|
||||||
<div class="admin-panel-container-div">
|
<%- include('partial/channelSettings/permList.ejs', {channel}); %>
|
||||||
<%- include('partial/channelSettings/info.ejs', {unescape, channel}); %>
|
<%- include('partial/channelSettings/tokeCommandList.ejs'); %>
|
||||||
<%- include('partial/channelSettings/userList.ejs'); %>
|
<%- include('partial/channelSettings/emoteList.ejs'); %>
|
||||||
<%- include('partial/channelSettings/banList.ejs'); %>
|
|
||||||
<%- include('partial/channelSettings/settings.ejs', {unescape, channel}); %>
|
|
||||||
<%- include('partial/channelSettings/permList.ejs', {channel}); %>
|
|
||||||
<%- include('partial/channelSettings/tokeCommandList.ejs'); %>
|
|
||||||
<%- include('partial/channelSettings/emoteList.ejs'); %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button href="javascript:" class="danger-button" id="chan-delete">Delete Channel</button>
|
||||||
<footer>
|
<footer>
|
||||||
<%- include('partial/scripts', {user}); %>
|
<%- include('partial/scripts', {user}); %>
|
||||||
<script src="/js/popup/banPopup.js"></script>
|
<script src="/js/popup/banPopup.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -13,28 +13,23 @@ GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div class="admin-list-div" id="chan-ban-list">
|
<div class="admin-list-div">
|
||||||
<h3 id="channel-ban-title">Channel Bans:</h3>
|
<h3 id="channel-ban-title">Channel Bans:</h3>
|
||||||
<div class="control-prompt">
|
<div class="control-prompt">
|
||||||
<input placeholder="Add Username..." id="new-ban-input" class="control-prompt">
|
<input placeholder="Add Username..." id="new-ban-input" class="control-prompt">
|
||||||
<button id="new-ban-button" class="danger-button">Ban</button>
|
<button id="new-ban-button" class="danger-button">Ban</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-container resizable table-container">
|
<div class="dynamic-container">
|
||||||
<table id="admin-ban-list-table" class="admin-list-table">
|
<table id="admin-ban-list-table" class="admin-list-table">
|
||||||
<thead>
|
<tr class="admin-list-entry-title-row">
|
||||||
<tr class="admin-list-entry-title-row">
|
<td class="admin-list-entry-item admin-list-entry-img-title"><h3>Img</h3></td>
|
||||||
<td class="admin-list-entry-item admin-list-entry-img-title"><h3>Img</h3></td>
|
<td id="admin-user-list-entry-id-title" class="admin-list-entry-item not-first-col"><h3>ID</h3></td>
|
||||||
<td id="admin-user-list-entry-id-title" class="admin-list-entry-item not-first-col"><h3>ID</h3></td>
|
<td class="admin-list-entry-item not-first-col"><h3>Name</h3></td>
|
||||||
<td class="admin-list-entry-item not-first-col"><h3>Name</h3></td>
|
<td class="admin-list-entry-item not-first-col"><h3>Ban<br>Alts</h3></td>
|
||||||
<td class="admin-list-entry-item not-first-col"><h3>Ban<br>Alts</h3></td>
|
<td id="channel-user-list-entry-ban-date-title" class="admin-list-entry-item not-first-col"><h3>Ban Date</h3></td>
|
||||||
<td id="channel-user-list-entry-ban-date-title" class="admin-list-entry-item not-first-col"><h3>Ban Date</h3></td>
|
<td id="channel-user-list-entry-expiration-date-title" class="admin-list-entry-item not-first-col"><h3>Expires</h3></td>
|
||||||
<td id="channel-user-list-entry-expiration-date-title" class="admin-list-entry-item not-first-col"><h3>Expires</h3></td>
|
<td id="channel-user-list-entry-actions-title" class="admin-list-entry-item not-first-col"> </td>
|
||||||
<td id="channel-user-list-entry-actions-title" class="admin-list-entry-item not-first-col"> </td>
|
</tr>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
<%# This is getting filled via AJAX since we need to refresh it when new users are added anywho. %>
|
<%# This is getting filled via AJAX since we need to refresh it when new users are added anywho. %>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div id="chan-emote-list" class="admin-list-div">
|
<div id="emote-list-div" class="admin-list-div">
|
||||||
<h3>Emote List:</h3>
|
<h3>Emote List:</h3>
|
||||||
<div class="control-prompt">
|
<div class="control-prompt">
|
||||||
<%# Probably not the cleanest way to do this but fuggit %>
|
<%# Probably not the cleanest way to do this but fuggit %>
|
||||||
|
|
@ -23,6 +23,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div class="control-prompt">
|
<div class="control-prompt">
|
||||||
<input placeholder="Emote Link..." id="new-emote-link-input" class="control-prompt">
|
<input placeholder="Emote Link..." id="new-emote-link-input" class="control-prompt">
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-container resizable" id="emote-list">
|
<div class="dynamic-container" id="emote-list">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -13,7 +13,7 @@ GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div class="admin-list-div" id="chan-info-list">
|
<div class="admin-list-div">
|
||||||
<h3 id="channel-info-title">Channel Info:</h3>
|
<h3 id="channel-info-title">Channel Info:</h3>
|
||||||
<div class="dynamic-container" id="channel-info-div">
|
<div class="dynamic-container" id="channel-info-div">
|
||||||
<span class="channel-info-span" id="channel-info-thumbnail-span">
|
<span class="channel-info-span" id="channel-info-thumbnail-span">
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div class="admin-list-div" id="chan-perm-list">
|
<div class="admin-list-div">
|
||||||
<h3> Permissions:</h3>
|
<h3> Permissions:</h3>
|
||||||
<div class="dynamic-container">
|
<div class="dynamic-container">
|
||||||
<form action="javascript:" class="admin-list-field">
|
<form action="javascript:" class="admin-list-field">
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div class="admin-list-div" id="chan-settings-list">
|
<div class="admin-list-div">
|
||||||
<h3>Channel Preferences:</h3>
|
<h3>Channel Preferences:</h3>
|
||||||
<div class="dynamic-container">
|
<div class="dynamic-container">
|
||||||
<form action="javascript:" class="admin-list-field">
|
<form action="javascript:" class="admin-list-field">
|
||||||
|
|
@ -45,7 +45,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<input type="radio" name="streamType" id="channel-preference-list-stream-type-hls" value="livehls" <% if(channel.settings["streamType"] == "livehls"){ %> checked <% }%> >
|
<input type="radio" name="streamType" id="channel-preference-list-stream-type-hls" value="livehls" <% if(channel.settings["streamType"] == "livehls"){ %> checked <% }%> >
|
||||||
<label for="channel-preference-list-stream-type-hls">Self-Hosted (HLS)</label>
|
<label for="channel-preference-list-stream-type-hls">Self-Hosted (HLS)</label>
|
||||||
</span>
|
</span>
|
||||||
<input <% if(channel.settings["streamType"] != "livehls"){ %> disabled <%}%> id="channel-preference-list-stream-url" placeholder="HLS Stream URL" value="<%= channel.settings["streamURL"] %>">
|
<input <% if(channel.settings["streamType"] != "livehls"){ %> disabled <%}%> id="channel-preference-list-stream-url" placeholder="Stream URL" value="<%= channel.settings["streamURL"] %>">
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,12 @@ GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div id="chan-toke-list" class="admin-list-div">
|
<div id="toke-command-list-div" class="admin-list-div">
|
||||||
<h3>Toke Command List:</h3>
|
<h3>Toke Command List:</h3>
|
||||||
<div class="control-prompt">
|
<div class="control-prompt">
|
||||||
!<input placeholder="Add Command..." id="new-toke-command-input" class="control-prompt">
|
!<input placeholder="Add Command..." id="new-toke-command-input" class="control-prompt">
|
||||||
<button id="new-toke-command-button" class="positive-button">Add</button>
|
<button id="new-toke-command-button" class="positive-button">Add</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-container toke-command-list resizable">
|
<div class="dynamic-container toke-command-list">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -13,7 +13,7 @@ GNU Affero General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div class="admin-list-div" id="chan-user-list">
|
<div class="admin-list-div">
|
||||||
<h3 id="channel-rank-title">Channel Ranks:</h3>
|
<h3 id="channel-rank-title">Channel Ranks:</h3>
|
||||||
<sup id="channel-rank-sup">Users set to default channel rank 'user' will NOT be listed below.</sup>
|
<sup id="channel-rank-sup">Users set to default channel rank 'user' will NOT be listed below.</sup>
|
||||||
<div class="control-prompt">
|
<div class="control-prompt">
|
||||||
|
|
@ -24,18 +24,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-container resizable table-container">
|
<div class="dynamic-container">
|
||||||
<table class="admin-list-table" id="admin-rank-list-table">
|
<table class="admin-list-table">
|
||||||
<thead>
|
<tr class="admin-list-entry-title-row">
|
||||||
<tr class="admin-list-entry-title-row">
|
<td class="admin-list-entry-item admin-list-entry-img-title"><h3>Img</h3></td>
|
||||||
<td class="admin-list-entry-item admin-list-entry-img-title"><h3>Img</h3></td>
|
<td id="admin-user-list-entry-id-title" class="admin-list-entry-item not-first-col"><h3>ID</h3></td>
|
||||||
<td id="admin-user-list-entry-id-title" class="admin-list-entry-item not-first-col"><h3>ID</h3></td>
|
<td class="admin-list-entry-item not-first-col"><h3>Name</h3></td>
|
||||||
<td class="admin-list-entry-item not-first-col"><h3>Name</h3></td>
|
<td id="channel-user-list-entry-rank-title" class="admin-list-entry-item not-first-col"><h3>Rank</h3></td>
|
||||||
<td id="channel-user-list-entry-rank-title" class="admin-list-entry-item not-first-col"><h3>Rank</h3></td>
|
</tr>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
</tbody>
|
|
||||||
<%# This is getting filled via AJAX since we need to refresh it when new users are added anywho. %>
|
<%# This is getting filled via AJAX since we need to refresh it when new users are added anywho. %>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<h2>Pros/Cons of WebRTC:</h2>
|
<h2>Pros/Cons of WebRTC:</h2>
|
||||||
WebRTC connections come in two flavors, STUN and TURN. STUN uses an intermediary server, to make a connection through your firewall, to another established peer. Some users, such as those on a CGNAT, will require a TURN server to relay the connection.
|
WebRTC connections come in two flavors, STUN and TURN. STUN uses an intermediary server, to make a connection through your firewall, to another established peer. For certain connections, some users, suchas those on a CGNAT, will require a TURN server to relay the connection. At the current moment, ourfore.st only supplies STUN servers, however we do plan on looking into TURN relay servers in the future.
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
This means that each viewer uses up part of a streamers bandwidth, comparitively to HLS, in which the streaming-server takes the load of multiple connections off of the streamers connection (assuming they're it's not hosted on the same connection.) Furthermore, WebRTC's video-chat roots prioritizes real-time communication over video/audio quality. That being said, WebRTC requires no extra setup, and no extra software other than this website and your browser.
|
This means that each viewer uses up part of a streamers bandwidth, comparitively to HLS, in which the streaming-server takes the load of multiple connections off of the streamers connection (assuming they're it's not hosted on the same connection.) Furthermore, WebRTC's video-chat roots prioritizes real-time communication over video/audio quality. That being said, WebRTC requires no extra setup, and no extra software other than this website and your browser.
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ a.admin-list-entry-item{
|
||||||
border-bottom: 1px var(--accent1) solid;
|
border-bottom: 1px var(--accent1) solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#admin-nav-list button:not(.positive-button, :hover, .danger-button){
|
#admin-nav-list button:not(.positive-button, :hover){
|
||||||
background-color: var(--bg1);
|
background-color: var(--bg1);
|
||||||
color: var(--accent1);
|
color: var(--accent1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ a.admin-list-entry-item{
|
||||||
border-bottom: 1px var(--accent1) solid;
|
border-bottom: 1px var(--accent1) solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#admin-nav-list button:not(.positive-button, :hover, .danger-button){
|
#admin-nav-list button:not(.positive-button, :hover){
|
||||||
background-image: var(--bg1-gradient);
|
background-image: var(--bg1-gradient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,83 +27,7 @@ class channelSettingsPage{
|
||||||
this.livestreamPreferences = new livestreamPreferences(this.channel);
|
this.livestreamPreferences = new livestreamPreferences(this.channel);
|
||||||
this.tokeCommandList = new tokeCommandList(this.channel);
|
this.tokeCommandList = new tokeCommandList(this.channel);
|
||||||
this.emoteList = new emoteList(this.channel);
|
this.emoteList = new emoteList(this.channel);
|
||||||
|
this.deleteBtn = new deleteBtn(this.channel);
|
||||||
//Setup nav buttons
|
|
||||||
this.navButtons = new chanAdminNavButtons(this.channel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class chanAdminNavButtons{
|
|
||||||
constructor(channel){
|
|
||||||
//Take down channel
|
|
||||||
this.channel = channel;
|
|
||||||
//Grab nav list
|
|
||||||
this.navList = document.querySelector("#admin-nav-list");
|
|
||||||
//Create empty map to do a holdem buttons
|
|
||||||
this.buttons = new Map();
|
|
||||||
|
|
||||||
//Build out options map
|
|
||||||
this.options = new Map([
|
|
||||||
["Channel Info", document.querySelector("#chan-info-list")],
|
|
||||||
["Ranked Users", document.querySelector("#chan-user-list")],
|
|
||||||
["Bans", document.querySelector("#chan-ban-list")],
|
|
||||||
["Preferences", document.querySelector("#chan-settings-list")],
|
|
||||||
["Permissions", document.querySelector("#chan-perm-list")],
|
|
||||||
["Toke Commands", document.querySelector("#chan-toke-list")],
|
|
||||||
["Emotes", document.querySelector("#chan-emote-list")],
|
|
||||||
["Delete Channel", null]
|
|
||||||
]);
|
|
||||||
|
|
||||||
//Render out buttons
|
|
||||||
this.renderButtons();
|
|
||||||
//Select the first option in the options map
|
|
||||||
this.displayOption(Array.from(this.options.keys())[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderButtons(){
|
|
||||||
//For erry list in the admin panel
|
|
||||||
for(const option of this.options.keys()){
|
|
||||||
//Create a button for it
|
|
||||||
const button = document.createElement('button');
|
|
||||||
button.innerText = option;
|
|
||||||
|
|
||||||
//If this aint the Delete Channel button
|
|
||||||
if(option != "Delete Channel"){
|
|
||||||
//Attatch an event listener to handle users clickin' der button
|
|
||||||
button.addEventListener('click',()=>{this.displayOption(option)});
|
|
||||||
}else{
|
|
||||||
//Attatch an event listener to blaire the fuckin' defcon five nukem alarm
|
|
||||||
button.addEventListener('click', () => {new deleteChannelPopup(this.channel)});
|
|
||||||
|
|
||||||
button.classList.add('danger-button');
|
|
||||||
}
|
|
||||||
|
|
||||||
//Drop button in the buttons map
|
|
||||||
this.buttons.set(option, button);
|
|
||||||
|
|
||||||
//Add that shit
|
|
||||||
this.navList.appendChild(button);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
displayOption(selectedOption){
|
|
||||||
//For every option
|
|
||||||
for(const option of this.options.keys()){
|
|
||||||
//If this is the Delete Channel button
|
|
||||||
if(option == "Delete Channel"){
|
|
||||||
//ignorem
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//If we're on the selected option
|
|
||||||
if(option == selectedOption){
|
|
||||||
this.options.get(option).style.display = 'flex';
|
|
||||||
this.buttons.get(option).classList.add('positive-button');
|
|
||||||
}else{
|
|
||||||
this.options.get(option).style.display = 'none';
|
|
||||||
this.buttons.get(option).classList.remove('positive-button');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -207,7 +131,7 @@ class chanInfo{
|
||||||
class rankList{
|
class rankList{
|
||||||
constructor(channel){
|
constructor(channel){
|
||||||
this.channel = channel
|
this.channel = channel
|
||||||
this.tbody = document.querySelector("#admin-rank-list-table tbody");
|
this.table = document.querySelector(".admin-list-table");
|
||||||
this.userPrompt = document.querySelector("#new-rank-input");
|
this.userPrompt = document.querySelector("#new-rank-input");
|
||||||
this.rankSelect = document.querySelector("#new-rank-select");
|
this.rankSelect = document.querySelector("#new-rank-select");
|
||||||
|
|
||||||
|
|
@ -262,7 +186,7 @@ class rankList{
|
||||||
const rankEnum = await utils.ajax.getRankEnum();
|
const rankEnum = await utils.ajax.getRankEnum();
|
||||||
|
|
||||||
//clear the table
|
//clear the table
|
||||||
this.tbody.innerHTML = "";
|
this.clearTable();
|
||||||
|
|
||||||
//For each user in the list
|
//For each user in the list
|
||||||
Object.entries(data).forEach((userAr) => {
|
Object.entries(data).forEach((userAr) => {
|
||||||
|
|
@ -296,7 +220,7 @@ class rankList{
|
||||||
}
|
}
|
||||||
|
|
||||||
//Generate row and append to table
|
//Generate row and append to table
|
||||||
this.tbody.appendChild(utils.ux.newTableRow([
|
this.table.appendChild(utils.ux.newTableRow([
|
||||||
imgNode,
|
imgNode,
|
||||||
user.id,
|
user.id,
|
||||||
user.user,
|
user.user,
|
||||||
|
|
@ -304,12 +228,23 @@ 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{
|
class banList{
|
||||||
constructor(channel){
|
constructor(channel){
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.tbody = document.querySelector("#admin-ban-list-table tbody");
|
this.table = document.querySelector("#admin-ban-list-table");
|
||||||
this.banPrompt = document.querySelector("#new-ban-input");
|
this.banPrompt = document.querySelector("#new-ban-input");
|
||||||
this.banButton = document.querySelector("#new-ban-button");
|
this.banButton = document.querySelector("#new-ban-button");
|
||||||
|
|
||||||
|
|
@ -326,6 +261,13 @@ class banList{
|
||||||
this.updateList(data);
|
this.updateList(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearList(){
|
||||||
|
const oldRows = this.table.querySelectorAll('tr.gen-row');
|
||||||
|
oldRows.forEach((row) => {
|
||||||
|
row.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async ban(event){
|
async ban(event){
|
||||||
new chanBanUserPopup(this.channel, this.banPrompt.value, this.updateList.bind(this));
|
new chanBanUserPopup(this.channel, this.banPrompt.value, this.updateList.bind(this));
|
||||||
}
|
}
|
||||||
|
|
@ -342,8 +284,7 @@ class banList{
|
||||||
|
|
||||||
updateList(bans){
|
updateList(bans){
|
||||||
//for each ban listed
|
//for each ban listed
|
||||||
this.tbody.innerHTML = "";
|
this.clearList();
|
||||||
|
|
||||||
bans.forEach((ban)=>{
|
bans.forEach((ban)=>{
|
||||||
//Create IMG node
|
//Create IMG node
|
||||||
const imgNode = document.createElement('img');
|
const imgNode = document.createElement('img');
|
||||||
|
|
@ -365,7 +306,7 @@ class banList{
|
||||||
const expirationString = ban.expirationDays < 0 ? "Never" : `${new Date(ban.expirationDate).toDateString()}<br>(${ban.daysUntilExpiration} day(s) left)`;
|
const expirationString = ban.expirationDays < 0 ? "Never" : `${new Date(ban.expirationDate).toDateString()}<br>(${ban.daysUntilExpiration} day(s) left)`;
|
||||||
|
|
||||||
//Generate row and append to table
|
//Generate row and append to table
|
||||||
this.tbody.appendChild(utils.ux.newTableRow([
|
this.table.appendChild(utils.ux.newTableRow([
|
||||||
imgNode,
|
imgNode,
|
||||||
ban.user.id,
|
ban.user.id,
|
||||||
ban.user.user,
|
ban.user.user,
|
||||||
|
|
@ -718,7 +659,21 @@ class emoteList{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class deleteChannelPopup{
|
class deleteBtn{
|
||||||
|
constructor(channel){
|
||||||
|
this.channel = channel;
|
||||||
|
this.delete = document.querySelector("#chan-delete");
|
||||||
|
|
||||||
|
this.setupInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
setupInput(){
|
||||||
|
this.delete.addEventListener('click', () => {new deleteAccountPopup(this.channel)});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class deleteAccountPopup{
|
||||||
constructor(channel){
|
constructor(channel){
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.popup = new canopyUXUtils.popup("nukeChannel", true, this.asyncConstructor.bind(this));
|
this.popup = new canopyUXUtils.popup("nukeChannel", true, this.asyncConstructor.bind(this));
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. -->
|
||||||
<link rel="stylesheet" type="text/css" href="/css/popup/delete.css">
|
<link rel="stylesheet" type="text/css" href="/css/popup/delete.css">
|
||||||
<h3 id="delete-channel-popup-title" class="popup-title">Delete Channel</h3>
|
<h3 id="delete-channel-popup-title" class="popup-title">Delete Channel</h3>
|
||||||
<div>
|
<div>
|
||||||
<p id="delete-channel-popup-content">WARNING: You are about to nuke the channel '[CHANNEL]' off of the face of the fucking planet.<br>
|
<p id="delete-channel-popup-content">WARNING: You are about to nuke channel '[CHANNEL]' off of the face of the fucking planet.<br>
|
||||||
Enter '[CHANNEL]' below to confirm:</p>
|
Enter '[CHANNEL]' below to confirm:</p>
|
||||||
<span id="delete-channel-popup-prompt-span">
|
<span id="delete-channel-popup-prompt-span">
|
||||||
<input type="text" id="delete-channel-popup-prompt">
|
<input type="text" id="delete-channel-popup-prompt">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue