]> code.citadel.org Git - citadel.git/commitdiff
* <tr> and </tr> tags for each row in a mailbox summary view, are now
authorArt Cancro <ajc@citadel.org>
Thu, 13 Oct 2005 19:31:41 +0000 (19:31 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 13 Oct 2005 19:31:41 +0000 (19:31 +0000)
  output by display_summarized() instead of by readloop().  This makes the
  code easier to read and refactors it slightly in preparation for some evil
  plans...

webcit/ChangeLog
webcit/messages.c

index 7759aec5d902013bc73c10b4b541c22f48524951..0e1e45033fd6302894b18917822eea851948f921 100644 (file)
@@ -1,3 +1,9 @@
+Thu Oct 13 15:30:08 EDT 2005 Art Cancro <ajc@uncensored.citadel.org>
+* <tr> and </tr> tags for each row in a mailbox summary view, are now
+  output by display_summarized() instead of by readloop().  This makes the
+  code easier to read and refactors it slightly in preparation for some evil
+  plans...
+
 Wed Oct 12 23:58:15 EDT 2005 Art Cancro <ajc@uncensored.citadel.org>
 * Rooms view -- render properly when empty floors exist
   [fixes bugzilla issue # 156]
index e86ea2f0bf3bf1380526b70e72a35edbf6e6e9e8..3559c26060b6ca09e9faa0076ecfdab2abda0a80 100644 (file)
@@ -1308,6 +1308,15 @@ ENDBODY:
 void display_summarized(int num) {
        char datebuf[64];
 
+       wprintf("<tr bgcolor=\"#%s\" ",
+               ((num % 2) ? "DDDDDD" : "FFFFFF")
+       );
+
+
+
+       wprintf("onClick=\" new Ajax.Updater('preview_pane', '/msg', { method: 'get', parameters: 'msgnum=%ld' } ); \" ", WC->summ[num].msgnum);
+       wprintf(">");
+
        wprintf("<TD>");
        if (WC->summ[num].is_new) wprintf("<B>");
        escputs(WC->summ[num].subj);
@@ -1327,6 +1336,8 @@ void display_summarized(int num) {
                "</TD>\n",
                WC->summ[num].msgnum
        );
+
+       wprintf("</tr>");
 }
 
 
@@ -1768,7 +1779,6 @@ void readloop(char *oper)
        long pn_previous = 0L;
        long pn_current = 0L;
        long pn_next = 0L;
-       int bg = 0;
        struct addrbookent *addrbook = NULL;
        int num_ab = 0;
        char *sortby = NULL;
@@ -1992,18 +2002,6 @@ void readloop(char *oper)
                        if (a > 0) pn_previous = WC->msgarr[a-1];
                        if (a < (nummsgs-1)) pn_next = WC->msgarr[a+1];
 
-                       /* If a tabular view, set up the line */
-                       if (is_summary) {
-                               bg = 1 - bg;
-                               wprintf("<tr bgcolor=\"#%s\" ",
-                                       (bg ? "DDDDDD" : "FFFFFF")
-                               );
-
-                               wprintf("onClick=\" new Ajax.Updater('preview_pane', '/msg', { method: 'get', parameters: 'msgnum=%ld' } ); \" ", WC->summ[a].msgnum);
-
-                               wprintf(">");
-                       }
-
                        /* Display the message */
                        if (is_summary) {
                                display_summarized(a);
@@ -2030,11 +2028,6 @@ void readloop(char *oper)
                                read_message(WC->msgarr[a], 0);
                        }
 
-                       /* If a tabular view, finish the line */
-                       if (is_summary) {
-                               wprintf("</TR>\n");
-                       }
-
                        if (lowest_displayed < 0) lowest_displayed = a;
                        highest_displayed = a;