summary view: deleting messages now removes the table rows from
authorArt Cancro <ajc@citadel.org>
Fri, 1 Sep 2006 17:13:30 +0000 (17:13 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 1 Sep 2006 17:13:30 +0000 (17:13 +0000)
the DOM tree entirely, instead of merely hiding them.  This is important
because the next thing we're going to do is traverse the DOM tree to determine
what rows to use for group select.

webcit/static/wclib.js
webcit/static/webcit.css

index bf4ae9aa9876ff4e202b32aef0f34b3bf7704e84..23999c756e93c50ad54f85319367109259b1897c 100644 (file)
@@ -28,14 +28,14 @@ function extract_token(source_string, token_num, delimiter) {
                for (i=0; i<token_num; ++i) {
                        var j = extracted_string.indexOf(delimiter);
                        if (j >= 0) {
-                               extracted_string = extracted_string.substring(j+1);
+                               extracted_string = extracted_string.substr(j+1);
                        }
                }
        }
 
        j = extracted_string.indexOf(delimiter);
        if (j >= 0) {
-               extracted_string = extracted_string.substring(0, j);
+               extracted_string = extracted_string.substr(0, j);
        }
 
        return extracted_string;
@@ -255,12 +255,31 @@ function CtdlRemoveTheUnseenBold(msgnum) {
 }
 
 // A message has been deleted, so yank it from the list.
-// (IE barfs on m9999.innerHTML='' so we use a script.aculo.us effect instead.)
 function CtdlClearDeletedMsg(msgnum) {
-       new Effect.Squish('m'+msgnum);
-}
 
 
+       // Traverse the table looking for a row whose ID contains the desired msgnum
+       var table = $('summary_headers');
+       if (table) {
+               for (var r = 0; r < table.rows.length; r++) {
+                       var thename = table.rows[r].id;
+                       if (thename.substr(1) == msgnum) {
+                               try {
+                                       table.deleteRow(r);
+                               }
+                               catch(e) {
+                                       alert('error: browser failed to clear row ' + r);
+                               }
+                       }
+               }
+       }
+       else {                                          // if we can't delete it,
+               new Effect.Squish('m'+msgnum);          // just hide it.
+       }
+
+
+}
+
 // These functions called when the user down-clicks on the message list resizer bar
 
 var saved_x = 0;
index 1fc63da2b05054f1dd261e926be77c08a7db4c80..113071a53ea1a97c4c49574b53ea882d1aa2d5dc 100644 (file)
@@ -1,4 +1,3 @@
-<style type="text/css">
 
 * html {
        overflow: hidden;
@@ -214,7 +213,6 @@ html>body #button li a {
 }
 
 #button li a:hover {
-       //background-color: #ddddff;
        background-image:url(/static/body-background.gif);
        color: #000000;
 }
@@ -364,7 +362,6 @@ a:hover {
        color: #000000;
 }
 
-<!-- begin quote levels colors -->
 
 blockquote {
        color: navy !important; background-color: RGB(245,245,245) !important; 
@@ -387,7 +384,6 @@ blockquote pre {
        margin-right: 1%;
 }
 
-<!-- end quote levels colors -->
 
 var sub {
        font-style: normal;
@@ -490,7 +486,6 @@ td li.frameset, .elements li.frameset {
        input#toggler, .toolbar { display: none }
 }
 
-<!-- begin nanotree styles -->
 
 .treetitle {
        padding:2px;
@@ -536,9 +531,7 @@ td li.frameset, .elements li.frameset {
        font-size: 11px;
 }
 
-<!-- end nanotree styles -->
 
-<!-- begin address autocompleter styles -->
 
 div.auto_complete {
        width: 350px;
@@ -569,6 +562,4 @@ div.auto_complete ul strong.highlight {
        padding:0;
 }
 
-<!-- end address autocompleter styles -->
 
-</style>