-// Copyright (c) 2016-2022 by the citadel.org team
+// Copyright (c) 2016-2023 by the citadel.org team
//
// This program is open source software. Use, duplication, or
-// disclosure are subject to the GNU General Public License v3.
+// disclosure is subject to the GNU General Public License v3.
function render_room_list() {
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
+ document.getElementById("ctdl-main").innerHTML = "<div class=\"ctdl-middle\"><img src=\"/ctdl/s/images/throbber.gif\" /></div>"; // 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/");
for (var i in room_list) {
if (room_list[i].current_view == views.VIEW_BBS) {
output[room_list[i].floor] +=
- "<div class=\"w3-button ctdl-roomlist-room\" onClick=\"javascript:gotoroom('"
+
+ "<div class=\"ctdl-roomlist-room\" onClick=\"javascript:gotoroom('" // container
+ escapeJS(escapeHTML(room_list[i].name)) + "');\">"
- + "<i class=\"w3-badge ctdl-roomlist-roomicon w3-left "
+
+ + "<div><i class=\"ctdl-roomlist-roomicon " // room icon
+ (room_list[i].hasnewmsgs ? "w3-blue" : "w3-gray")
- + " fas fa-comments fa-fw\"></i><span class=\"ctdl-roomlist-roomname"
+ + " fas fa-comments fa-fw\"></i></div>"
+
+ + "<div class=\"ctdl-roomlist-roomname" // room name
+ (room_list[i].hasnewmsgs ? " ctdl-roomlist-roomname-hasnewmsgs" : "")
- + " w3-left\">"
+ + "\">"
+ escapeHTML(room_list[i].name)
- + "</span><span class=\"ctdl-roomlist-mtime w3-right\">"
+ + "</div>"
+
+ + "<div class=\"ctdl-roomlist-mtime\">" // date/time of last post
+ string_timestamp(room_list[i].mtime)
- + "</span></div>";
+ + "</div>"
+
+ + "</div>" // end container
}
}