From 96d09185cc9b946d17dc7061508208583dcb493b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 22 Nov 2005 05:01:37 +0000 Subject: [PATCH] * Set up a toggleable iconbar that can switch between the menu and a room list. The room list is not yet implemented, so a simple placeholder is there instead. --- webcit/ChangeLog | 5 +++ webcit/iconbar.c | 74 ++++++++++++++++++++++++++++++++++++++++++ webcit/static/wclib.js | 13 ++++++++ webcit/webcit.c | 10 ++++-- webcit/webcit.h | 1 + 5 files changed, 101 insertions(+), 2 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 14f774848..dce9c3875 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,5 +1,10 @@ $Id$ +Tue Nov 22 00:00:46 EST 2005 ajc +* Set up a toggleable iconbar that can switch between the menu and a room + list. The room list is not yet implemented, so a simple placeholder is + there instead. + Mon Nov 21 22:47:17 EST 2005 ajc * messages.c, webcit.css: message buttons (Reply, ReplyQuoted, etc.) are now in a smaller font (new style "msgbuttons" defined in the stylesheet) diff --git a/webcit/iconbar.c b/webcit/iconbar.c index 78ea655b2..69803f4f6 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -12,6 +12,7 @@ #define IB_PICONLY 1 #define IB_TEXTONLY 2 + void do_iconbar(void) { char iconbar[SIZ]; char buf[SIZ]; @@ -85,6 +86,7 @@ void do_iconbar(void) { _("CITADEL") ); + wprintf("
  • switch to room list\n"); if (ib_summary) { wprintf("
  • \n" + "\n"); + + wprintf("

    Room list
    will be
    here

    "); + + wprintf("
    "); + wprintf("Drag to trash here...
    "); + wprintf("
    "); + + wprintf("\n"); +} + + void display_customize_iconbar(void) { char iconbar[SIZ]; @@ -657,3 +730,4 @@ void commit_iconbar(void) { wprintf("\n"); wDumpContent(2); } + diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 69c0183df..1f10ec063 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -323,6 +323,8 @@ function CtdlMoveMsgMouseUp(evt) { r = parseInt($('dropstuff').offsetLeft) + parseInt($('dropstuff').offsetWidth); b = parseInt($('dropstuff').offsetTop) + parseInt($('dropstuff').offsetHeight); + // alert('Offsets are: ' + l + ' ' + t + ' ' + r + ' ' + b + '.'); + if ( (x >= l) && (x <= r) && (y >= t) && (y <= b) ) { // Yes, we dropped it on a hotspot. Just delete for now... FIXME CtdlDeleteSelectedMessages(evt); @@ -352,3 +354,14 @@ function ctdl_ts_getInnerText(el) { } return str; } + + +// icon bar toggler tabs... + +function switch_to_room_list() { + new Ajax.Updater('iconbar', 'iconbar_ajax_rooms', { method: 'get' } ); +} + +function switch_to_menu_buttons() { + new Ajax.Updater('iconbar', 'iconbar_ajax_menu', { method: 'get' } ); +} diff --git a/webcit/webcit.c b/webcit/webcit.c index 3644aca0f..c58876f9b 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1270,6 +1270,14 @@ void session_loop(struct httprequest *req) begin_ajax_response(); who_inner_div(); end_ajax_response(); + } else if (!strcasecmp(action, "iconbar_ajax_menu")) { + begin_ajax_response(); + do_iconbar(); + end_ajax_response(); + } else if (!strcasecmp(action, "iconbar_ajax_rooms")) { + begin_ajax_response(); + do_iconbar_roomlist(); + end_ajax_response(); } else if (!strcasecmp(action, "knrooms")) { knrooms(); } else if (!strcasecmp(action, "gotonext")) { @@ -1468,8 +1476,6 @@ void session_loop(struct httprequest *req) begin_ajax_response(); summary_inner_div(); end_ajax_response(); - } else if (!strcasecmp(action, "iconbar")) { - do_iconbar(); } else if (!strcasecmp(action, "display_customize_iconbar")) { display_customize_iconbar(); } else if (!strcasecmp(action, "commit_iconbar")) { diff --git a/webcit/webcit.h b/webcit/webcit.h index 7f61f0809..cbaa89b5f 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -582,6 +582,7 @@ void http_transmit_thing(char *thing, size_t length, char *content_type, int is_static); void unescape_input(char *buf); void do_iconbar(void); +void do_iconbar_roomlist(void); void display_customize_iconbar(void); void commit_iconbar(void); int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen); -- 2.39.2