Started work on new navbar, just needs user count

This commit is contained in:
rainbow napkin 2026-10-17 02:07:58 -04:00
parent 17e256e038
commit b9bfa5271e
3 changed files with 45 additions and 11 deletions

View file

@ -336,6 +336,14 @@ input.control-prompt, input.control-prompt:focus{
padding-right: 0.5em;
}
.navbar-item.first{
margin-left: 0.25em;
}
.navbar-item-seperator.first{
display: none;
}
/* index */
.channel-guide-entry{
background-color: var(--bg1);

View file

@ -145,11 +145,19 @@ class channel{
this.user.permMap.chan = new Map(data.user.permMap.chan);
//If we can read the schedule
if(client.user.permMap.chan.get('readSchedule')){
if(this.user.permMap.chan.get('readSchedule')){
//Display the queue icon
this.chatBox.adminIcon.style.display = "";
}
//If we can manage the channel
if(this.user.permMap.chan.get('manageChannel')){
//Unhide the channel settings button
document.querySelector('.navbar-item#channel-settings-button-span').style.display = "";
//Annoyingly, there isn't a good way in html to set a links relative filepath to use the current 'file' as a directory
document.querySelector('.navbar-item#channel-settings-button-span a').href = `${document.URL}/settings`;
}
//Tell the chatbox to handle client info
//should it have its own event listener instead? Guess it's a stylistic choice :P
this.chatBox.handleClientInfo(data);
@ -218,6 +226,17 @@ class channel{
return results;
}
insertSettingsIcon(){
const settingsIcon = document.createElement('i');
settingsIcon.classList.add('navbar-item', 'bi-projector-fill');
settingsIcon.id = "channel-settings-button";
//Insert settings icon into navbar
document.querySelector('.navbar-item#logout-button').insertAdjacentElement('beforebegin', settingsIcon);
//Insert icon seperator
settingsIcon.insertAdjacentText('afterend', ' - ');
}
/**
* Processes and applies default config on any unset settings
* @param {Boolean} force - Whether or not to forcefully reset already set settings