]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/summaryview.js
* add conditional to check room-types
[citadel.git] / webcit / static / summaryview.js
index 259d9755e08ee926eeb3b84e53821e238fec057c..1077932787e28d30899c0450cfa10ed9ec6260b7 100644 (file)
@@ -1,7 +1,10 @@
-/** Webcit Summary View v2
-    All comments, flowers and death threats to Mathew McBride
-    <matt@mcbridematt.dhs.org> / <matt@comalies>
-*/
+/**
+ * Webcit Summary View v2
+ *   All comments, flowers and death threats to Mathew McBride
+ *   <matt@mcbridematt.dhs.org> / <matt@comalies>
+ * Copyright 2009 The Citadel Team
+ * Licensed under the GPL V3
+ */
 document.observe("dom:loaded", createMessageView);
 
 var message_view = null;
@@ -158,7 +161,7 @@ function loadMessages(transport) {
   currentSorterToggle = toggles[sortmode];
   }
   if (!is_safe_mode) {
-  resortAndDisplay(sortRowsByDateDescending);
+  resortAndDisplay(currentSortMode[1]);
   } else {
     setupPageSelector();
     resortAndDisplay(null);
@@ -237,7 +240,7 @@ function sortRowsBySubjectAscending(a, b) {
 function sortRowsBySubjectDescending(a, b) {
   var subjectOne = getTextContent(a.getElementsByTagName("td")[0]).toLowerCase();
   var subjectTwo = getTextContent(b.getElementsByTagName("td")[0]).toLowerCase();
-  return strcmp(subjectOne, subjectTwo);
+  return strcmp(subjectTwo, subjectOne);
 }
 
 function sortRowsByFromAscending(a, b) {
@@ -249,7 +252,7 @@ function sortRowsByFromAscending(a, b) {
 function sortRowsByFromDescending(a, b) {
   var fromOne = getTextContent(a.getElementsByTagName("td")[1]).toLowerCase();
   var fromTwo = getTextContent(b.getElementsByTagName("td")[1]).toLowerCase();
-  return strcmp(fromOne, fromTwo);
+  return strcmp(fromTwo, fromOne);
 }
 
 function CtdlMessageListClick(evt) {
@@ -263,7 +266,7 @@ function CtdlMessageListClick(evt) {
     unmarkAllRows();
     markedRowId = parent.ctdlRowId;
     document.getElementById("preview_pane").innerHTML = "";
-    new Ajax.Updater('preview_pane', 'msg/'+msgId+'?Mail=1', {method: 'get'});
+    new Ajax.Updater('preview_pane', 'msg/'+msgId, {method: 'get'});
     markRow(parent);
     new Ajax.Request('ajax_servcmd', {
       method: 'post',