httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r386824 - in /httpd/mod_mbox/trunk: data/archives.js module-2.0/mod_mbox_out.c
Date Sat, 18 Mar 2006 09:05:42 GMT
Author: jerenkrantz
Date: Sat Mar 18 01:05:39 2006
New Revision: 386824

URL: http://svn.apache.org/viewcvs?rev=386824&view=rev
Log:
Replicate the 'Message view' header as a footer too.

Modified:
    httpd/mod_mbox/trunk/data/archives.js
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c

Modified: httpd/mod_mbox/trunk/data/archives.js
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/data/archives.js?rev=386824&r1=386823&r2=386824&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/data/archives.js (original)
+++ httpd/mod_mbox/trunk/data/archives.js Sat Mar 18 01:05:39 2006
@@ -371,6 +371,27 @@
   return str;
 }
 
+function getMessageView(id, msg_num)
+{
+	var str = '<tr><th class="title"><a href="' + id +
+	'" title="Direct link to this message">Message view</a></th><th class="nav">';
+
+	if (msg_num) {
+	  str += '<a href="browser" onclick="javascript:toggleMessage(' + (msg_num-1) +
+	    '); return false;" title="View previous message">Previous</a> &middot;
';
+	}
+
+	if (msg_num+1 < _msglist.getElementsByTagName('message').length) {
+	  str += '<a href="browser" onclick="javascript:toggleMessage(' + (msg_num+1) +
+	  '); return false;" title="View next message">Next</a> &middot; ';
+	}
+
+	str += '<a href="browser" onclick="javascript:closeMessage(); return false;" ' +
+	'title="Close message">x</a></th></tr>';
+
+  return str;
+}
+
 /* Get a message */
 function getMessage (id, msg_num)
 {
@@ -391,21 +412,7 @@
 	msgview.setAttribute('id', 'msgview');
 	msgview.setAttribute('class', 'js');
 
-	var str = '<thead><tr><th class="title"><a href="' + id +
-	'" title="Direct link to this message">Message view</a></th><th class="nav">';
-
-	if (msg_num) {
-	  str += '<a href="browser" onclick="javascript:toggleMessage(' + (msg_num-1) +
-	    '); return false;" title="View previous message">Previous</a> &middot;
';
-	}
-
-	if (msg_num+1 < _msglist.getElementsByTagName('message').length) {
-	  str += '<a href="browser" onclick="javascript:toggleMessage(' + (msg_num+1) +
-	  '); return false;" title="View next message">Next</a> &middot; ';
-	}
-
-	str += '<a href="browser" onclick="javascript:closeMessage(); return false;" ' +
-	'title="Close message">x</a></th></tr></thead>';
+	var str = '<thead>' + getMessageView(id, msg_num) + '</thead>';
 
 	str += '<tbody>';
 
@@ -430,6 +437,9 @@
 	'<a href="' + _baseURI + _mbox + '/raw/' + id + '" rel="nofollow">View raw message</a></td></tr>';
 
 	str += '</tbody>';
+
+	str += '<tfoot>' + getMessageView(id, msg_num) + '</tfoot>';
+
 	msgview.innerHTML = str;
 
 	/* Place our msgview just under the msglist */

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c?rev=386824&r1=386823&r2=386824&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c Sat Mar 18 01:05:39 2006
@@ -674,6 +674,38 @@
     }
 }
 
+apr_status_t mbox_static_msglist_nav(request_rec *r, char *baseURI,
+                                     int pages, int current_page,
+                                     int sortFlags)
+{
+    ap_rputs("   <tr><th class=\"title\"><a href=\"browser\">Message list</a></th>",
r);
+
+    ap_rputs("<th class=\"pages\">", r);
+    mbox_static_msglist_page_selector(r, baseURI, pages, current_page);
+    ap_rputs("</th>", r);
+
+    ap_rputs("<th class=\"sort\">", r);
+    if (sortFlags == MBOX_SORT_THREAD) {
+        ap_rprintf(r, "Thread &middot; "
+		   "<a href=\"%s/author\">Author</a> &middot; "
+		   "<a href=\"%s/date\">Date</a>",
+		   baseURI, baseURI);
+    }
+    else if (sortFlags == MBOX_SORT_AUTHOR) {
+        ap_rprintf(r, "<a href=\"%s/thread\">Thread</a> &middot; "
+		   "Author &middot; "
+		   "<a href=\"%s/date\">Date</a>",
+		   baseURI, baseURI);
+    }
+    else {
+        ap_rprintf(r, "<a href=\"%s/thread\">Thread</a> &middot; "
+		   "<a href=\"%s/author\">Author</a> &middot; "
+		   "Date",
+		   baseURI, baseURI);
+    }
+    ap_rputs("</th></tr>\n", r);
+}
+
 /* Display the XHTML index of the specified mbox file. */
 apr_status_t mbox_static_msglist(request_rec *r, apr_file_t *f, int sortFlags)
 {
@@ -781,32 +813,9 @@
 	       "List index</a></h5>", get_base_path(r));
 
     ap_rputs("  <table id=\"msglist\">\n", r);
-    ap_rputs("   <thead><tr><th class=\"title\"><a href=\"browser\">Message
list</a></th>", r);
-
-    ap_rputs("<th class=\"pages\">", r);
-    mbox_static_msglist_page_selector(r, baseURI, pages, current_page);
-    ap_rputs("</th>", r);
-
-    ap_rputs("<th class=\"sort\">", r);
-    if (sortFlags == MBOX_SORT_THREAD) {
-        ap_rprintf(r, "Thread &middot; "
-		   "<a href=\"%s/author\">Author</a> &middot; "
-		   "<a href=\"%s/date\">Date</a>",
-		   baseURI, baseURI);
-    }
-    else if (sortFlags == MBOX_SORT_AUTHOR) {
-        ap_rprintf(r, "<a href=\"%s/thread\">Thread</a> &middot; "
-		   "Author &middot; "
-		   "<a href=\"%s/date\">Date</a>",
-		   baseURI, baseURI);
-    }
-    else {
-        ap_rprintf(r, "<a href=\"%s/thread\">Thread</a> &middot; "
-		   "<a href=\"%s/author\">Author</a> &middot; "
-		   "Date",
-		   baseURI, baseURI);
-    }
-    ap_rputs("</th></tr></thead>\n", r);
+    ap_rputs("  <thead>\n", r);
+    mbox_static_msglist_nav(r, baseURI, pages, current_page, sortFlags);
+    ap_rputs("  </thead>\n", r);
 
     ap_rputs("   <tbody>\n", r);
 
@@ -850,6 +859,9 @@
     }
 
     ap_rputs("   </tbody>\n", r);
+    ap_rputs("  <tfoot>\n", r);
+    mbox_static_msglist_nav(r, baseURI, pages, current_page, sortFlags);
+    ap_rputs("  </tfoot>\n", r);
     ap_rputs("  </table>\n", r);
 
     /* Display box list */



Mime
View raw message