From 74aa78ec8568026f4afac5d5a0605092f6828b79 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 24 Sep 2004 04:04:35 +0000 Subject: [PATCH] * "folders view" of room list now uses Dave Lindquist's "menuExpandable3" tree view. --- webcit/ChangeLog | 5 ++- webcit/README.txt | 1 + webcit/roomops.c | 70 ++++++++++++++++++++++++------- webcit/static/menuExpandable3.js | 29 +++++++++++++ webcit/static/minus.gif | Bin 0 -> 273 bytes webcit/static/plus.gif | Bin 0 -> 274 bytes webcit/static/square.gif | Bin 0 -> 170 bytes webcit/static/style.css | 62 +++++++++++++++++++++++++++ 8 files changed, 150 insertions(+), 17 deletions(-) create mode 100644 webcit/static/menuExpandable3.js create mode 100644 webcit/static/minus.gif create mode 100644 webcit/static/plus.gif create mode 100644 webcit/static/square.gif 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 0000000000000000000000000000000000000000..608bc2908dce58c02d76968636466017768a53d2 GIT binary patch literal 273 zcmZ?wbhEHb>(LqLWH4=3XZl>`kA3s&aC u6C5-|__~e@D84FFJ$$6;Vu6c>^NA%%I}=O}pIP?!V~xczB|#Au25SJFrEqru literal 0 HcmV?d00001 diff --git a/webcit/static/plus.gif b/webcit/static/plus.gif new file mode 100644 index 0000000000000000000000000000000000000000..87ccefe9d71b73d74e7f35508166076430f39fe6 GIT binary patch literal 274 zcmZ?wbhEHbCGajmLepp~7l|1nUCliA;0JocJg#Z8m literal 0 HcmV?d00001 diff --git a/webcit/static/square.gif b/webcit/static/square.gif new file mode 100644 index 0000000000000000000000000000000000000000..a413fc80d5a4c9cf8e5f86ea16fdb43086828403 GIT binary patch literal 170 zcmZ?wbhEHb^1 z4{ttxaP$7{OLuOZzkTh@jmsymUpjv6;;~C-4qQ63|NM#F$M&r|yld5=9V-s*Sbkvp zvJHnWSIpST00TN82FNZ3R{aOZdR5e!GPru29&kAu3b~{!pUSvWZY;+c-TqNRS7t&- UN|0or&I}*7V#BE(vjrHe0iy0+Qvd(} literal 0 HcmV?d00001 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; +} + + -- 2.39.2