From 41bece1a1adffb524daa2203dfb91211f63989d8 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 17 May 2007 14:41:24 -0400
Subject: [PATCH] Add link to message subjects (#1484257); don't make selected list items bold; remove duplicate function

---
 program/js/list.js |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/program/js/list.js b/program/js/list.js
index eac19bb..23a9c34 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -95,7 +95,7 @@
 init_row: function(row)
 {
   // make references in internal array and set event handlers
-  if (row && String(row.id).match(/rcmrow([0-9]+)/))
+  if (row && String(row.id).match(/rcmrow([a-z0-9\-_=]+)/i))
   {
     var p = this;
     var uid = RegExp.$1;
@@ -117,12 +117,14 @@
 /**
  *
  */
-clear: function()
+clear: function(sel)
 {
   var tbody = document.createElement('TBODY');
   this.list.insertBefore(tbody, this.list.tBodies[0]);
   this.list.removeChild(this.list.tBodies[1]);
-  this.rows = new Array();  
+  this.rows = new Array();
+  
+  if (sel) this.clear_selection();
 },
 
 
@@ -272,7 +274,7 @@
     return false;
 
   var last_selected_row = this.rows[this.last_selected];
-  var new_row = last_selected_row && last_selected_row.obj.nextSibling;
+  var new_row = last_selected_row ? last_selected_row.obj.nextSibling : null;
   while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
     new_row = new_row.nextSibling;
 
@@ -285,7 +287,7 @@
     return false;
 
   var last_selected_row = this.rows[this.last_selected];
-  var new_row = last_selected_row && last_selected_row.obj.previousSibling;
+  var new_row = last_selected_row ? last_selected_row.obj.previousSibling : null;
   while (new_row && (new_row.nodeType != 1 || new_row.style.display == 'none'))
     new_row = new_row.previousSibling;
 
@@ -582,7 +584,7 @@
   
     // get subjects of selectedd messages
     var names = '';
-    var c, subject, obj;
+    var c, node, subject, obj;
     for(var n=0; n<this.selection.length; n++)
     {
       if (n>12)  // only show 12 lines
@@ -597,10 +599,11 @@
         subject = '';
 
         for(c=0; c<obj.childNodes.length; c++)
-          if (!subject && obj.childNodes[c].nodeName=='TD' && obj.childNodes[c].firstChild && obj.childNodes[c].firstChild.nodeType==3)
+          if (obj.childNodes[c].nodeName=='TD' && (node = obj.childNodes[c].firstChild) && (node.nodeType==3 || node.nodeName=='A'))
           {
-            subject = obj.childNodes[c].firstChild.data;
+            subject = node.nodeType==3 ? node.data : node.innerHTML;
             names += (subject.length > 50 ? subject.substring(0, 50)+'...' : subject) + '<br />';
+            break;
           }
       }
     }

--
Gitblit v1.9.1