From: Art Cancro Date: Thu, 28 Jul 2005 03:16:30 +0000 (+0000) Subject: * Awesome new 2-pane layout with ajax functionality for mailbox view. X-Git-Tag: v7.86~4767 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=eb5cdfb4706f648eadc11e71ea5c7c94e751fe11;p=citadel.git * Awesome new 2-pane layout with ajax functionality for mailbox view. * Slick new fade-out effect for "important message" boxes. --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 4f6ccc17c..7ad3a8ae5 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 619.37 2005/07/28 03:16:30 ajc +* Awesome new 2-pane layout with ajax functionality for mailbox view. +* Slick new fade-out effect for "important message" boxes. + Revision 619.36 2005/07/26 04:08:41 ajc * Previous checkin broke viewing of individual messages while in mailbox summary mode. Fixed. @@ -2756,3 +2760,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/messages.c b/webcit/messages.c index 53e5461db..575c0216f 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -337,7 +337,7 @@ void display_parsed_vcard(struct vCard *v, int full) { if (strlen(mailto) > 0) strcat(mailto, "
"); strcat(mailto, ""); urlesc(&mailto[strlen(mailto)], thisvalue); @@ -550,7 +550,7 @@ void read_message(long msgnum) { format_type = atoi(&buf[5]); if (!strncasecmp(buf, "from=", 5)) { strcpy(from, &buf[5]); - wprintf("from " "\n" @@ -619,7 +619,7 @@ void read_message(long msgnum) { snprintf(&mime_http[strlen(mime_http)], (sizeof(mime_http) - strlen(mime_http) - 1), "", + "msgnum=%ld?partnum=%s\">", msgnum, mime_partnum); } @@ -677,7 +677,7 @@ void read_message(long msgnum) { /* Reply */ wprintf("[Reply] "); @@ -810,7 +810,7 @@ void read_message(long msgnum) { || (WC->wc_view == VIEW_ADDRESSBOOK) ) { wprintf("", + "msgnum=%ld?partnum=%s\">", msgnum, vcard_partnum); wprintf("[edit]"); } @@ -849,14 +849,60 @@ ENDBODY: } + +/* + * Unadorned HTML output of an individual message, suitable + * for placing in a hidden iframe, for printing, or whatever + */ +void embed_message(void) { + long msgnum = 0L; + char *sourceiframe; + char *targetdiv; + + msgnum = atol(bstr("msgnum")); + sourceiframe = bstr("sourceiframe"); + targetdiv = bstr("targetdiv"); + + output_headers(1, 0, 0, 0, 0, 1, 0); + begin_burst(); + + wprintf(""); + + /* If we're loading into a hidden iframe, chances are the caller told us + * about a target div somewhere that we need to copy into when we're done. + */ + if (strlen(targetdiv) > 0) wprintf( +" \n" +" \n", + targetdiv, + sourceiframe + ); + + wprintf(""); + wprintf(" 0) { + wprintf(" onLoad='loaded_now_copy_it();'"); + } + wprintf(">\n"); + read_message(msgnum); + wprintf("\n"); + wDumpContent(0); +} + + + + void display_summarized(int num) { char datebuf[64]; wprintf(""); if (WC->summ[num].is_new) wprintf(""); - wprintf("", - WC->msgarr[num]); + wprintf("", + WC->summ[num].msgnum); escputs(WC->summ[num].subj); wprintf(""); if (WC->summ[num].is_new) wprintf(""); @@ -987,7 +1033,7 @@ void display_addressbook(long msgnum, char alpha) { || (WC->wc_view == VIEW_ADDRESSBOOK) ) { wprintf("", + "msgnum=%ld?partnum=%s\">", msgnum, vcard_partnum); wprintf("[edit]"); } @@ -1179,7 +1225,7 @@ void do_addrbook_view(struct addrbookent *addrbook, int num_ab) { wprintf("", bstr("alpha")); + wprintf("?maxmsgs=1?summary=0?alpha=%s\">", bstr("alpha")); vcard_n_prettyize(addrbook[i].ab_name); escputs(addrbook[i].ab_name); wprintf("\n"); @@ -1330,10 +1376,6 @@ void readloop(char *oper) } if (strlen(sortby) == 0) sortby = sortpref_value; if (strlen(sortby) == 0) sortby = "msgid"; - if ( (strcasecmp(sortby, "msgid")) & (maxmsgs != 1) ) { - startmsg = 1; - maxmsgs = 9999999; - } output_headers(1, 1, 1, 0, 0, 0, 0); @@ -1358,11 +1400,13 @@ void readloop(char *oper) if ((WC->wc_view == VIEW_ADDRESSBOOK) && (maxmsgs > 1)) { is_addressbook = 1; strcpy(cmd, "MSGS ALL"); - maxmsgs = 32767; + maxmsgs = 9999999; } if (is_summary) { strcpy(cmd, "MSGS ALL"); + startmsg = 1; + maxmsgs = 9999999; } /* Are we doing a summary view? If so, we need to know old messages @@ -1471,41 +1515,42 @@ void readloop(char *oper) } } - wprintf("
\n"); - if (!strcasecmp(sortby, "subject")) { - subjsort_button = "" ; + subjsort_button = "" ; } else if (!strcasecmp(sortby, "rsubject")) { - subjsort_button = "" ; + subjsort_button = "" ; } else { - subjsort_button = "" ; + subjsort_button = "" ; } if (!strcasecmp(sortby, "sender")) { - sendsort_button = "" ; + sendsort_button = "" ; } else if (!strcasecmp(sortby, "rsender")) { - sendsort_button = "" ; + sendsort_button = "" ; } else { - sendsort_button = "" ; + sendsort_button = "" ; } if (!strcasecmp(sortby, "date")) { - datesort_button = "" ; + datesort_button = "" ; } else if (!strcasecmp(sortby, "rdate")) { - datesort_button = "" ; + datesort_button = "" ; } else { - datesort_button = "" ; + datesort_button = "" ; } if (is_summary) { - wprintf("
" + wprintf("
"); /* end of 'content' div */ + + wprintf("
" + + "
\n" "\n" "" @@ -1577,7 +1622,16 @@ void readloop(char *oper) } if (is_summary) { - wprintf("
\n"); + wprintf("
\n"); /* end of 'fix_scrollbar_bug' div */ + wprintf(""); /* end of 'message_list' div */ + + /* Put the data transfer hidden iframe in a hidden div, to make it *really* hidden */ + wprintf("
\n" + "\n" + "
\n" + ); + + wprintf("
"); /* The preview pane will initially be empty */ } /* Bump these because although we're thinking in zero base, the user @@ -1596,16 +1650,11 @@ void readloop(char *oper) "", lowest_displayed, nummsgs); - if (is_summary) { - wprintf("\n"); - } - if (pn_previous > 0L) { wprintf("" + "?maxmsgs=1" + "?summary=0\">" "Previous \n", oper, pn_previous ); @@ -1614,15 +1663,15 @@ void readloop(char *oper) if (pn_next > 0L) { wprintf("" + "?maxmsgs=1" + "?summary=0\">" "Next \n", oper, pn_next ); } wprintf("" + "?maxmsgs=%d?summary=1\">" "Summary" "", oper, @@ -1640,11 +1689,14 @@ void readloop(char *oper) */ if (num_displayed > 1) { if ((!is_tasks) && (!is_calendar) && (!is_addressbook) - && (!is_notes) && (!is_singlecard)) { + && (!is_notes) && (!is_singlecard) && (!is_summary)) { + + wprintf("\n"); wprintf("Reading #", lowest_displayed, highest_displayed); - wprintf(" of %d messages.", nummsgs); - - if (is_summary) { - wprintf("\n"); - } - + wprintf(" of %d messages.", nummsgs); + wprintf("\n"); } } - wprintf("\n"); DONE: if (is_tasks) { @@ -1696,6 +1742,11 @@ DONE: do_addrbook_view(addrbook, num_ab); /* Render the address book */ } + /* Note: wDumpContent() will output one additional
tag. + * Which div it is the end of depends on what mode we're viewing in. + * If we're in summary mode, it's the end of the preview pane. + * Otherwise it's the end of the usual content div. + */ wDumpContent(1); if (addrbook != NULL) free(addrbook); diff --git a/webcit/roomops.c b/webcit/roomops.c index c3807b4c0..bee25dd2a 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -335,7 +335,7 @@ void embed_newmail_button(void) { void embed_view_o_matic(void) { int i; - wprintf("
\n" + wprintf("\n" "View as: " "