]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/static/js/main.js
Make the font sizes less cartoonish at extreme viewport sizes
[citadel.git] / webcit-ng / static / js / main.js
index 070f05ef759fc64ea9b52ec41c2ccd2048de3775..541a593c62db5d986cd317abe94fe5bb260fe7f7 100644 (file)
@@ -1,4 +1,4 @@
-// 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.
@@ -16,7 +16,7 @@ do_biff = async() => {
        }
 
        if (new_mail > 0) {
-               console.log("YOU'VE GOT MAIL!");
+               console.log("YOU'VE GOT MAIL!  new_mail = " + new_mail);
                new_mail_sound.play();                  // FIXME do a visual notification as well
                new_mail = 0;
        }
@@ -25,7 +25,6 @@ do_biff = async() => {
 
 // This is called at the very beginning of the main page load.
 ctdl_startup = async() => {
-       var BiffInterval;
        response = await fetch("/ctdl/c/info");
 
        if (response.ok) {
@@ -45,18 +44,18 @@ ctdl_startup = async() => {
                        display_login_screen("");                                       // display the login modal.
                }
 
-               var BiffInterval;
-               try {                                                   // if this was already set up, clear it so there aren't multiple
-                       clearInterval(BiffInterval);
+               var biff_interval;
+               try {                                                                   // if this was already set up,
+                       clearInterval(biff_interval);                                   // clear the old one so there's only one.
                }
                catch {
                }
                do_biff();
-               BiffInterval = setInterval(do_biff, 10000);
+               biff_interval = setInterval(do_biff, 10000);
        }
        else {
                document.getElementById("ctdl-main").innerHTML =
-                       "<div class=\"w3-panel w3-red\"><p>"
+                       "<div class=\"ctdl-fatal-error\"><p>"
                        + _("This program was unable to connect or stay connected to the Citadel server.  Please report this problem to your system administrator.")
                        + "</div>";
        }
@@ -70,6 +69,9 @@ function update_banner() {
        detect_logged_in();
        if (current_room) {
                document.getElementById("ctdl_banner_title").innerHTML = current_room;
+               if (is_trash_folder) {
+                       document.getElementById("ctdl_banner_title").innerHTML += "&nbsp;<i class=\"fa fa-trash\"></i>";
+               }
                if (is_room_aide) {
                        document.getElementById("ctdl_banner_title").innerHTML += "&nbsp;<i class=\"fa fa-user-cog\"></i>";
                }
@@ -78,14 +80,15 @@ function update_banner() {
        else {
                document.getElementById("ctdl_banner_title").innerHTML = serv_info.serv_humannode;
        }
+
+       document.getElementById("current_user_avatar").innerHTML = render_userpic(current_user);
        document.getElementById("current_user").innerHTML = current_user ;
+
        if (logged_in) {
-               document.getElementById("lilo").innerHTML = "<a href=\"/ctdl/a/logout\"><i class=\"fa fa-right-from-bracket\"></i>" + _("Log off") + "</a>" ;
-               document.getElementById("current_user_avatar").innerHTML = render_userpic(current_user);
+               document.getElementById("lilo").innerHTML = "<a href=\"/ctdl/a/logout\"><i class=\"fa fa-right-from-bracket\"></i>&nbsp;" + _("Log off") + "</a>" ;
        }
        else {
-               document.getElementById("lilo").innerHTML = "<a href=\"javascript:display_login_screen('')\"><i class=\"fa fa-right-to-bracket\"></i>" + _("Log in") + "</a>" ;
-               document.getElementById("current_user_avatar").innerHTML = "<i class=\"fa fa-user-circle fa-3x\"></i>";
+               document.getElementById("lilo").innerHTML = "<a href=\"javascript:display_login_screen('')\"><i class=\"fa fa-right-to-bracket\"></i>&nbsp;" + _("Log in") + "</a>" ;
        }
 }
 
@@ -104,6 +107,7 @@ function gotoroom(roomname) {
                        default_view = data.default_view;
                        last_seen = data.last_seen;
                        is_room_aide = data.is_room_aide;
+                       is_trash_folder = data.is_trash_folder;
                        room_mtime = data.room_mtime;
                        can_delete_messages = data.can_delete_messages;
                        update_banner();
@@ -175,14 +179,8 @@ function load_new_march_list(which_oper) {
 // Activate the "Loading..." modal
 function activate_loading_modal() {
        document.getElementById("ctdl_big_modal").innerHTML =
-                 "<div class=\"w3-modal-content\">"
-               + "  <div class=\"w3-container\">"
-
-               + "<i class=\"fas fa-spinner fa-spin\"></i>&nbsp;&nbsp;"
-               + _("Loading messages from server, please wait")
-
-               + "  </div>"
-               + "</div>";
+               "<i class=\"fas fa-spinner fa-spin\"></i>&nbsp;&nbsp;"
+               + _("Loading messages from server, please wait");
        document.getElementById("ctdl_big_modal").style.display = "block";
 }