$Id$
+Wed Nov 2 23:45:16 EST 2005 ajc
+* Mailbox view -- onClick is now implemented by a JavaScript function which
+ is defined in wclib.js -- now, it not only handles the Ajax load of the
+ message into the preview pane, but it also highlights the table row, and
+ remembers the highlighting so it can be turned off when another row is
+ selected. This is if course a prelude to ajaxifying the table...
+
Wed Nov 2 15:57:37 EST 2005 ajc
* Switched the mailbox summary back to a table. This is tabular data and it
ought to be marked up as a table. We went to fixed width floating div's in
}
-
-
-
void display_summarized(int num) {
char datebuf[64];
wprintf("<tr id=\"m%ld\" style=\"width:100%%;font-weight:%s;background-color:#fff\" "
- "onClick=\" new Ajax.Updater('preview_pane', '/msg/%d', { method: 'get' } ); \">",
+ "onClick=\"CtdlSingleClickMsg(%ld)\">",
WC->summ[num].msgnum,
(WC->summ[num].is_new ? "bold" : "normal"),
WC->summ[num].msgnum
new Ajax.Autocompleter('bcc_id', 'bcc_name_choices', '/bcc_autocomplete', {} );
new Ajax.Autocompleter('recp_id', 'recp_name_choices', '/recp_autocomplete', {} );
}
+
+
+// Static variables for mailbox view...
+//
+var CtdlNumMsgsSelected = 0;
+var CtdlMsgsSelected = new Array(100); // arbitrary
+
+// This gets called when you single click on a message in the mailbox view.
+// We know that the element id of the table row will be the letter 'm' plus the message number.
+//
+function CtdlSingleClickMsg(msgnum) {
+
+ // $('preview_pane').innerHTML = '<div align="center">Loading...</div>' ;
+
+ if (CtdlNumMsgsSelected > 0) {
+ for (i=0; i<CtdlNumMsgsSelected; ++i) {
+ $('m'+CtdlMsgsSelected[i]).style.backgroundColor = '#fff';
+ $('m'+CtdlMsgsSelected[i]).style.color = '#000';
+ }
+ CtdlNumMsgsSelected = 0;
+ }
+
+ $('m'+msgnum).style.backgroundColor='#69aaff';
+ $('m'+msgnum).style.color='#fff';
+ CtdlNumMsgsSelected = CtdlNumMsgsSelected + 1;
+ CtdlMsgsSelected[CtdlNumMsgsSelected-1] = msgnum;
+
+ new Ajax.Updater('preview_pane', '/msg/'+msgnum, { method: 'get' } );
+}