All right, this is more or less it. I had to resort to creating a function stuffbar...
authorArt Cancro <ajc@citadel.org>
Thu, 14 Jul 2022 15:39:25 +0000 (11:39 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 14 Jul 2022 15:39:25 +0000 (11:39 -0400)
webcit-ng/static/index.html
webcit-ng/static/js/roomlist.js
webcit-ng/static/js/user_profile.js
webcit-ng/static/js/views.js

index a25df864ebfaceea73cb6adf9ed8842da75f8798..3370e656edb21487baeb8fe0fab0d25bde89418a 100644 (file)
@@ -30,8 +30,8 @@ LOADING
                <div class="w3-col s8 w3-bar">
                        <span id="current_user">Not logged in.</span><br>
                        <a href="#" class="w3-bar-item w3-button"><i class="fa fa-envelope" onClick="gotoroom('_MAIL_');"></i></a>
-                       <a href="#" class="w3-bar-item w3-button"><i class="fa fa-user"></i></a>
-                       <a href="#" class="w3-bar-item w3-button"><i class="fa fa-cog" onClick="user_profile(current_user);"></i></a>
+                       <a href="#" class="w3-bar-item w3-button"><i class="fa fa-user" onClick="user_profile(current_user);"></i></a>
+                       <a href="#" class="w3-bar-item w3-button"><i class="fa fa-cog"></i></a>
                </div>
        </div>
        <hr>
index 6366e6246883fef3f49c229ab8a54780cd8aaad0..3c0764ae8331057a17917d5426355e453ec26966 100644 (file)
@@ -6,6 +6,7 @@
 
 function render_room_list() {
 
+       stuffbar("none");                                                               // No stuffbar on this screen
        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
 
index 70c853bf941f34b58f86892bfb48dfbbfac992e0..4d2bad317e6de5bd2a70f0ac81a4e1b9137b6394 100644 (file)
@@ -5,5 +5,6 @@
 
 
 function user_profile(who) {
+       stuffbar("none");
        document.getElementById("ctdl-main").innerHTML = `user_profile(${who})`;
 }
index c3a7d4e9978469913617f2c4581615932a69a0ff..12de1a39b8ea0d9034b825aea1f865ec859c2862 100644 (file)
@@ -22,6 +22,7 @@ function render_room_view(gt_msg, lt_msg) {
 
                // The "forum" module displays rooms with the "VIEW_BBS" view as classic style web forums.
                case views.VIEW_BBS:
+                       stuffbar("none");
                        document.getElementById("ctdl-sidebar-button-forums").classList.add("w3-blue");
                        document.getElementById("ctdl-main").innerHTML = "<div id=\"ctdl-mrp\" class=\"ctdl-msg-reading-pane\"></div>";
                        forum_readmessages("ctdl-mrp", gt_msg, lt_msg);
@@ -29,12 +30,14 @@ function render_room_view(gt_msg, lt_msg) {
 
                // The "mail" module displays rooms with the VIEW_MAILBOX view as a webmail program.
                case views.VIEW_MAILBOX:
+                       stuffbar("block");
                        document.getElementById("ctdl-sidebar-button-mail").classList.add("w3-blue");
                        document.getElementById("ctdl-main").innerHTML = "";
                        mail_display();
                        break;
 
                default:
+                       stuffbar("none");
                        document.getElementById("ctdl-main").innerHTML =
                                "<center>The view for " + current_room + " is " + current_view + " but there is no renderer.</center>";
                        break;
@@ -54,3 +57,11 @@ function entmsg_dispatcher() {
                        break;
        }
 }
+
+
+// The "stuffbar" is an extension of the top navigation bar that can be used for elements such as
+// a mailbox view, etc.  Many of our operations require activating or deactivating the stuffbar. 
+// This is a convenience function to make the stuffbar appear or disappear.
+function stuffbar(state) {
+       document.getElementById("ctdl-stuffbar").style.display = state;
+}