From: Art Cancro Date: Fri, 24 Sep 2004 04:04:35 +0000 (+0000) Subject: * "folders view" of room list now uses Dave Lindquist's "menuExpandable3" X-Git-Tag: v7.86~5247 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=74aa78ec8568026f4afac5d5a0605092f6828b79;p=citadel.git * "folders view" of room list now uses Dave Lindquist's "menuExpandable3" tree view. --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 8965d77c1..44a10925a 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 523.6 2004/09/24 04:04:34 ajc +* "folders view" of room list now uses Dave Lindquist's "menuExpandable3" + tree view. + Revision 523.5 2004/09/23 03:21:10 ajc * roomops.c: "folders" view of rooms is an actual Unnumbered List now. @@ -2052,4 +2056,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/README.txt b/webcit/README.txt index 312add914..f7442ccb0 100644 --- a/webcit/README.txt +++ b/webcit/README.txt @@ -7,6 +7,7 @@ Nick Grossman Andru Luvisi Kevin Roth + Dave Lindquist This program is free software released under the terms of the GNU General Public License. Please read COPYING.txt for more licensing information. diff --git a/webcit/roomops.c b/webcit/roomops.c index 98b20e579..2317751b6 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1929,33 +1929,53 @@ void do_folder_view(struct folder *fold, int max_folders, int num_floors) { char buf[SIZ]; int levels, oldlevels; int i, t; + int actnum = 0; + int has_subfolders = 0; + + /* Include the menu expanding/collapsing code */ + wprintf("\n"); do_template("beginbox_nt"); + wprintf("
\n"); + wprintf("
    \n"); levels = 0; oldlevels = 0; for (i=0; i oldlevels) for (t=0; t<(levels-oldlevels); ++t) { - wprintf("
      \n"); - } - if (levels < oldlevels) for (t=0; t<(oldlevels-levels); ++t) { - wprintf("
    \n"); + if ( (levels < oldlevels) || ((levels==1)&&(i!=0)) ) { + for (t=0; t<(oldlevels-levels); ++t) { + wprintf("
\n"); + } } - wprintf("
  • "); - oldlevels = levels; + if (has_subfolders) { + wprintf(""); + wprintf("\n", actnum); + } + else { + wprintf("
  • "); + } if (fold[i].selectable) { wprintf(""); } - else { - wprintf(""); - } + +/* if (levels == 1) { wprintf(""); } @@ -1965,20 +1985,38 @@ void do_folder_view(struct folder *fold, int max_folders, int num_floors) { else { wprintf(""); } +*/ extract(buf, fold[i].name, levels-1); escputs(buf); +/* wprintf(""); +*/ + + if (!strcasecmp(fold[i].name, "My Folders|Mail")) { + wprintf(" (INBOX)"); + } + if (fold[i].selectable) { wprintf(""); } - else { - wprintf(""); - } - if (!strcasecmp(fold[i].name, "My Folders|Mail")) { - wprintf(" (INBOX)"); + wprintf("\n"); + + if (has_subfolders) { + wprintf("
      \n", + actnum++, + ( (levels == 1) ? "menu" : "submenu") + ); } - wprintf("\n"); + + oldlevels = levels; + } + wprintf("
    \n"); + wprintf(" \n"); + wprintf("
  • \n"); do_template("endbox"); } diff --git a/webcit/static/menuExpandable3.js b/webcit/static/menuExpandable3.js new file mode 100644 index 000000000..d898aa622 --- /dev/null +++ b/webcit/static/menuExpandable3.js @@ -0,0 +1,29 @@ +/* + * menuExpandable3.js - implements an expandable menu based on a HTML list + * Author: Dave Lindquist (http://www.gazingus.org) + */ + +if (!document.getElementById) + document.getElementById = function() { return null; } + +function initializeMenu(menuId, actuatorId) { + var menu = document.getElementById(menuId); + var actuator = document.getElementById(actuatorId); + + if (menu == null || actuator == null) return; + + //if (window.opera) return; // I'm too tired + + actuator.parentNode.style.backgroundImage = "url(/static/plus.gif)"; + actuator.onclick = function() { + var display = menu.style.display; + this.parentNode.style.backgroundImage = + (display == "block") ? "url(/static/plus.gif)" : "url(/static/minus.gif)"; + menu.style.display = (display == "block") ? "none" : "block"; + + return false; + } +} + + + diff --git a/webcit/static/minus.gif b/webcit/static/minus.gif new file mode 100644 index 000000000..608bc2908 Binary files /dev/null and b/webcit/static/minus.gif differ diff --git a/webcit/static/plus.gif b/webcit/static/plus.gif new file mode 100644 index 000000000..87ccefe9d Binary files /dev/null and b/webcit/static/plus.gif differ diff --git a/webcit/static/square.gif b/webcit/static/square.gif new file mode 100644 index 000000000..a413fc80d Binary files /dev/null and b/webcit/static/square.gif differ diff --git a/webcit/static/style.css b/webcit/static/style.css index 6c974c026..115154a03 100644 --- a/webcit/static/style.css +++ b/webcit/static/style.css @@ -336,3 +336,65 @@ strong.legal { input#toggler, .toolbar { display: none } } + + +#mainMenu { + background-color: #EEE; + border: 1px solid #CCC; + color: #000; + width: 203px; +} + +#menuList { + margin: 0px; + padding: 10px 0px 10px 15px; +} + +li.menubar { + background: url(/static/plus.gif) no-repeat 0em 0.3em; + font-size: 12px; + line-height: 1.5em; + list-style: none outside; +} + +.menu, .submenu { + display: none; + margin-left: 15px; + padding: 0px; +} + +.menu li, .submenu li { + background: url(/static/square.gif) no-repeat 0em 0.3em; + list-style: none outside; +} + +a.actuator { + background-color: transparent; + color: #000; + font-size: 12px; + padding-left: 15px; + text-decoration: none; +} + +a.actuator:hover { + text-decoration: underline; +} + +.menu li a, .submenu li a { + background-color: transparent; + color: #000; + font-size: 12px; + padding-left: 15px; + text-decoration: none; +} + +.menu li a:hover, submenu li a:hover { + /*border-bottom: 1px dashed #000;*/ + text-decoration: underline; +} + +span.key { + text-decoration: underline; +} + +