* Placed a mini roomlist in the iconbar. This is not in its final form.
authorArt Cancro <ajc@citadel.org>
Thu, 24 Nov 2005 04:32:48 +0000 (04:32 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 24 Nov 2005 04:32:48 +0000 (04:32 +0000)
webcit/ChangeLog
webcit/iconbar.c
webcit/roomops.c
webcit/static/wclib.js
webcit/static/webcit.css

index 71ce3ba7555160df59d1ca36677afe449dc0f1f0..33b8b930f4eb1e6f64efbe9e9d2e51f756d65655 100644 (file)
@@ -1,5 +1,8 @@
 $Id$
 
+Wed Nov 23 23:32:04 EST 2005 ajc
+* Placed a mini roomlist in the iconbar.  This is not in its final form.
+
 Wed Nov 23 16:42:15 CET 2005 dothebart
 * added missing german translations
 * changed multi line strings with empty string in first line to be searchable
index 69803f4f6bc181de03e27df3b472e1291b637dc4..f1d4c8ed43291f958f936f55ab2140f9448d7569 100644 (file)
@@ -378,7 +378,8 @@ void do_iconbar_roomlist(void) {
        
        wprintf("</ul>\n");
 
-       wprintf("<br><br>Room list<br>will be<br>here<br><br>");
+       /* embed the room list */
+       list_all_rooms_by_floor("iconbar");
 
        wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
        wprintf("Drag to trash here...<br>");
index 1078845fb4fb200f4541a465fa6d07cbfba44b98..6351ddfa7815b3685924853a25692f7251e9bcfa 100644 (file)
@@ -2531,6 +2531,83 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) {
 }
 
 
+/*
+ *
+ */
+void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
+       char buf[256];
+       char floor_name[256];
+       char old_floor_name[256];
+       char boxtitle[256];
+       int levels, oldlevels;
+       int i, t;
+       int nf;
+
+       strcpy(floor_name, "");
+       strcpy(old_floor_name, "");
+
+       nf = num_floors;
+
+       levels = 0;
+       oldlevels = 0;
+       for (i=0; i<max_folders; ++i) {
+
+               levels = num_tokens(fold[i].name, '|');
+               extract_token(floor_name, fold[i].name, 0,
+                       '|', sizeof floor_name);
+
+               if ( (strcasecmp(floor_name, old_floor_name))
+                  && (strlen(old_floor_name) > 0) ) {
+                       /* End inner box */
+                       wprintf("<br>\n");
+               }
+               strcpy(old_floor_name, floor_name);
+
+               if (levels == 1) {
+                       /* Begin inner box */
+                       stresc(boxtitle, floor_name, 1, 0);
+                       svprintf("BOXTITLE", WCS_STRING, boxtitle);
+                       wprintf("<span class=\"ib_roomlist_floor\">%s</span><br>\n", boxtitle);
+               }
+
+               oldlevels = levels;
+
+               if (levels > 1) {
+                       wprintf("&nbsp;");
+                       if (levels>2) for (t=0; t<(levels-2); ++t) wprintf("&nbsp;&nbsp;&nbsp;");
+                       if (fold[i].selectable) {
+                               wprintf("<a href=\"dotgoto?room=");
+                               urlescputs(fold[i].room);
+                               wprintf("\">");
+                       }
+                       else {
+                               wprintf("<i>");
+                       }
+                       if (fold[i].hasnewmsgs) {
+                               wprintf("<SPAN CLASS=\"ib_roomlist_new\">");
+                       }
+                       else {
+                               wprintf("<SPAN CLASS=\"ib_roomlist_old\">");
+                       }
+                       extract_token(buf, fold[i].name, levels-1, '|', sizeof buf);
+                       escputs(buf);
+                       wprintf("</SPAN>");
+                       if (fold[i].selectable) {
+                               wprintf("</A>");
+                       }
+                       else {
+                               wprintf("</i>");
+                       }
+                       if (!strcasecmp(fold[i].name, "My Folders|Mail")) {
+                               wprintf(" (INBOX)");
+                       }
+                       wprintf("<br />\n");
+               }
+       }
+}
+
+
+
 /*
  * Show the room list.  (only should get called by
  * knrooms() because that's where output_headers() is called from)
@@ -2548,6 +2625,8 @@ void list_all_rooms_by_floor(char *viewpref) {
        int flags = 0;
        int num_floors = 1;     /* add an extra one for private folders */
 
+       load_floorlist();
+
        /* Start with the mailboxes */
        max_folders = 1;
        alloc_folders = 1;
@@ -2624,23 +2703,24 @@ void list_all_rooms_by_floor(char *viewpref) {
                }
        }
 
-/* test only hackish view 
-       wprintf("<table><TR><TD>A Table</TD></TR></table>\n");
-       for (i=0; i<max_folders; ++i) {
-               escputs(fold[i].name);
-               wprintf("<br />\n");
-       }
- */
 
        if (!strcasecmp(viewpref, "folders")) {
                do_folder_view(fold, max_folders, num_floors);
        }
+       else if (!strcasecmp(viewpref, "hackish_view")) {
+               for (i=0; i<max_folders; ++i) {
+                       escputs(fold[i].name);
+                       wprintf("<br />\n");
+               }
+       }
+       else if (!strcasecmp(viewpref, "iconbar")) {
+               do_iconbar_view(fold, max_folders, num_floors);
+       }
        else {
                do_rooms_view(fold, max_folders, num_floors);
        }
 
        free(fold);
-       wDumpContent(1);
 }
 
 
@@ -2651,7 +2731,6 @@ void knrooms() {
        char listviewpref[SIZ];
 
        output_headers(1, 1, 2, 0, 0, 0);
-       load_floorlist();
 
        /* Determine whether the user is trying to change views */
        if (bstr("view") != NULL) {
@@ -2710,6 +2789,7 @@ void knrooms() {
 
        /* Display the room list in the user's preferred format */
        list_all_rooms_by_floor(listviewpref);
+       wDumpContent(1);
 }
 
 
index 1f10ec063328c4130a747d7309fb5a57571b8e88..a3bb8adeb89347b7176cf6fcdd188bc281492c2e 100644 (file)
@@ -360,6 +360,7 @@ function ctdl_ts_getInnerText(el) {
 
 function switch_to_room_list() {
        new Ajax.Updater('iconbar', 'iconbar_ajax_rooms', { method: 'get' } );
+       fuckitup();
 }
 
 function switch_to_menu_buttons() {
index b5dd545e47ae2cbb19346a63c7ded505faf37ba2..dce6fd6dd2d1af136966ef838d6fb9449547a8ef 100644 (file)
@@ -346,6 +346,23 @@ a:hover {
        color: #000088;
 }
 
+.ib_roomlist_floor {
+       font-size: 8pt;
+       font-weight: bold;
+       color: #000000;
+}
+
+.ib_roomlist_new {
+       font-size: 6pt;
+       color: #880000;
+       font-weight: bold;
+}
+
+.ib_roomlist_old {
+       font-size: 6pt;
+       color: #000088;
+}
+
 .mailbox_summary {
        font-size: 10pt;
        color: #000000;