2 // Copyright (c) 2016-2022 by the citadel.org team
4 // This program is open source software. Use, duplication, or
5 // disclosure are subject to the GNU General Public License v3.
8 // This function is the dispatcher that determines the correct view for a room,
9 // and calls the correct renderer. Greater/Less than bounds are accepted.
10 function render_room_view(gt_msg, lt_msg) {
12 document.getElementById("ctdl-newmsg-button").style.display = "none"; // the view renderer will set this
14 // Clear the highlighting out of all the sidebar buttons
15 var items = document.getElementById("ctdl-sidebar").getElementsByTagName("*");
16 for (var i = items.length; i--;) {
17 if (items[i].id.includes("ctdl-sidebar-button-")) {
18 items[i].classList.remove("w3-blue");
22 switch(current_view) {
24 document.getElementById("ctdl-sidebar-button-forums").classList.add("w3-blue");
25 document.getElementById("ctdl-main").innerHTML = "<div id=\"ctdl-mrp\" class=\"ctdl-msg-reading-pane\"></div>";
26 forum_readmessages("ctdl-mrp", gt_msg, lt_msg);
29 document.getElementById("ctdl-main").innerHTML =
30 "<center>The view for " + current_room + " is " + current_view + " but there is no renderer.</center>";
37 // This gets called when the user clicks the "enter message" or "post message" or "add item" button etc.
38 function entmsg_dispatcher() {
39 switch(current_view) {