padding: 10px;
}
-.ctdl-sidebar-class button {
+.ctdl-sidebar-button {
width: 100%;
padding: 10px;
text-align: left;
border-color: GhostWhite;
- background-color: GhostWhite;
+ background-color: Gainsboro;
color: #000000;
font-size: 1vw;
}
-.ctdl-sidebar-class button:hover {
- background-color: White;
+.ctdl-sidebar-button:hover {
+ background-color: Blue;
+ color: White;
+}
+
+.ctdl-sidebar-button-selected {
+ font-weight: bold;
+ color: White;
+ background-color: SlateGrey;
}
.ctdl-grid-banner-item button {
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-around;
- align-items: stretch;
+ align-items: center;
overflow: hidden;
border-radius: 10px;
border-style: outset;
background-color: White;
- padding: 0.5vw;
+ padding: 0.3vw;
margin-top: 0;
margin-bottom: 0.25vw;
margin-left: 1vw;
.ctdl-roomlist-roomicon {
overflow: hidden;
font-size: large;
- margin-left: 1vw;
- margin-right: 1vw;
- padding-left: 0.75vw;
- padding-right: 1.75vw;
- padding-top: 0.75vw;
- padding-bottom: 0.75vw;
+ margin-right: auto;
}
.ctdl-roomlist-roomname {
font-size: large;
+ margin-right: auto;
+ padding-left: 1vw;
+ padding-right: 1vw;
}
.ctdl-roomlist-roomname-hasnewmsgs {
font-weight: bold;
+ margin-right: auto;
}
.ctdl-roomlist-mtime {
+ margin-left: auto;
}
.ctdl-mailbox-grid-container {
</div>
<div class="ctdl-grid-sidebar-item" id="sidebar">
- <ul id="ctdl-sidebar" class="ctdl-sidebar-class">
- <!-- <li><a href="#"><i class="fa fa-envelope" onClick="gotoroom('_MAIL_');"></i></a> -->
- <!-- <li><a href="#"><i class="fa fa-user" onClick="user_profile(current_user);"></i></a> -->
- <!-- <li><a href="#"<i class="fa fa-cog"></i></a> -->
- <!-- <li><hr> -->
- <!-- <li><button onClick="sidebar_close()" title="close menu"><i class="fa fa-remove fa-fw"></i> Close Menu</button> -->
- <li><button id="ctdl-sidebar-button-mail" onClick="gotoroom('_MAIL_');"><i class="fa fa-envelope fa-fw"></i> Mail</button>
+ <ul id="ctdl-sidebar">
+ <li><button class="ctdl-sidebar-button" id="ctdl-sidebar-button-mail" onClick="gotoroom('_MAIL_');"><i class="fa fa-envelope fa-fw"></i> Mail</button>
<li id="ctdl_mail_folder_list" style="display:none"></li>
- <li><button id="ctdl-sidebar-button-forums" onClick="render_room_list();"><i class="fas fa-comments fa-fw"></i> Forums</button>
- <li><button id="ctdl-sidebar-button-calendar"> <i class="fa fa-calendar-alt fa-fw"></i> Calendar</button>
- <li><button id="ctdl-sidebar-button-contacts"><i class="fa fa-address-book fa-fw"></i> Contacts</button>
- <li><button id="ctdl-sidebar-button-blogs"><i class="fa fa-blog fa-fw"></i> Blogs</button>
- <li><button id="ctdl-sidebar-button-wikis"><i class="fa fa-book fa-fw"></i> Wikis</button>
- <li><button id="ctdl-sidebar-button-settings"><i class="fa fa-cog fa-fw"></i> Settings</button>
+ <li><button class="ctdl-sidebar-button" id="ctdl-sidebar-button-forums" onClick="render_room_list();"><i class="fas fa-comments fa-fw"></i> Forums</button>
+ <li><button class="ctdl-sidebar-button" id="ctdl-sidebar-button-calendar"><i class="fa fa-calendar-alt fa-fw"></i> Calendar</button>
+ <li><button class="ctdl-sidebar-button" id="ctdl-sidebar-button-contacts"><i class="fa fa-address-book fa-fw"></i> Contacts</button>
+ <li><button class="ctdl-sidebar-button" id="ctdl-sidebar-button-blogs"><i class="fa fa-blog fa-fw"></i> Blogs</button>
+ <li><button class="ctdl-sidebar-button" id="ctdl-sidebar-button-wikis"><i class="fa fa-book fa-fw"></i> Wikis</button>
+ <li><button class="ctdl-sidebar-button" id="ctdl-sidebar-button-settings"><i class="fa fa-cog fa-fw"></i> Settings</button>
</ul>
</div>
document.getElementById("ctdl-newmsg-button").style.display = "none"; // There is no "enter" button on this screen
document.getElementById("ctdl-main").innerHTML = "<img src=\"/ctdl/s/images/throbber.gif\" />"; // show throbber while loading
+ clear_sidebar_selection();
+ document.getElementById("ctdl-sidebar-button-forums").classList.add("ctdl-sidebar-button-selected");
fetch_room_list = async() => {
floor_response = await fetch("/ctdl/f/");
// disclosure are subject to the GNU General Public License v3.
-// This function is the dispatcher that determines the correct view for a room,
-// and calls the correct renderer. Greater/Less than bounds are accepted.
-function render_room_view(gt_msg, lt_msg) {
- document.getElementById("ctdl-newmsg-button").style.display = "none"; // the view renderer will set this
-
- // Clear the highlighting out of all the sidebar buttons
+// Clear the sidebar buttons of any style indicating that one is selected
+function clear_sidebar_selection() {
var items = document.getElementById("ctdl-sidebar").getElementsByTagName("*");
for (var i = items.length; i--;) {
if (items[i].id.includes("ctdl-sidebar-button-")) {
- items[i].classList.remove("w3-blue");
+ items[i].classList.remove("ctdl-sidebar-button-selected");
}
}
+}
+
+
+// This function is the dispatcher that determines the correct view for a room,
+// and calls the correct renderer. Greater/Less than bounds are accepted.
+function render_room_view(gt_msg, lt_msg) {
+
+ document.getElementById("ctdl-newmsg-button").style.display = "none"; // the view renderer will set this
+ clear_sidebar_selection();
switch(current_view) {
// The "forum" module displays rooms with the "VIEW_BBS" view as classic style web forums.
case views.VIEW_BBS:
- document.getElementById("ctdl-sidebar-button-forums").classList.add("w3-blue");
+ document.getElementById("ctdl-sidebar-button-forums").classList.add("ctdl-sidebar-button-selected");
document.getElementById("ctdl-main").innerHTML = "<div id=\"ctdl-mrp\" class=\"ctdl-forum-reading-pane\"></div>";
forum_readmessages("ctdl-mrp", gt_msg, lt_msg);
break;
// The "mail" module displays rooms with the VIEW_MAILBOX view as a webmail program.
case views.VIEW_MAILBOX:
- document.getElementById("ctdl-sidebar-button-mail").classList.add("w3-blue");
+ document.getElementById("ctdl-sidebar-button-mail").classList.add("ctdl-sidebar-button-selected");
document.getElementById("ctdl-main").innerHTML = "";
mail_display();
break;