Refactoring JavaScript, reduces bandwidth usage on message list when fancy highlighti...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 Mar 2005 21:47:51 +0000 (21:47 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 15 Mar 2005 21:47:51 +0000 (21:47 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9040 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
functions/page_header.php

index f8c6d32b694ece278c49c5b3043e8f63128390ab..3239fd33555e3f0939548e2928122e591d0b3c09 100644 (file)
@@ -311,9 +311,17 @@ function printMessageInfo($aMsg) {
     // this stuff does the auto row highlighting on mouseover
     //
     if ($javascript_on && $fancy_index_highlite) {
     // this stuff does the auto row highlighting on mouseover
     //
     if ($javascript_on && $fancy_index_highlite) {
+
         $mouseoverColor = $color[5];
         $mouseoverColor = $color[5];
+
+        // set this to an empty string to turn off extra 
+        // highlighting of checked rows
+        //
+        //$clickedColor = '';
         $clickedColor = $color[2];
         $clickedColor = $color[2];
+
         $row_extra .= ' onmouseover="setPointer(this, ' . $t . ', \'over\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');" onmouseout="setPointer(this, ' . $t . ', \'out\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');" onmousedown="setPointer(this, ' . $t . ', \'click\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');"';
         $row_extra .= ' onmouseover="setPointer(this, ' . $t . ', \'over\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');" onmouseout="setPointer(this, ' . $t . ', \'out\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');" onmousedown="setPointer(this, ' . $t . ', \'click\', \'' . $hlt_color . '\', \'' . $mouseoverColor . '\', \'' . $clickedColor . '\');"';
+
     }
 
 
     }
 
 
@@ -325,7 +333,7 @@ function printMessageInfo($aMsg) {
     //
     $javascript_auto_click = '';
     if ($javascript_on && $fancy_index_highlite)
     //
     $javascript_auto_click = '';
     if ($javascript_on && $fancy_index_highlite)
-        $javascript_auto_click = ' onMouseDown="if (document.getElementById(\'msg[' . $t . ']\')) { document.getElementById(\'msg[' . $t . ']\').checked = (document.getElementById(\'msg[' . $t . ']\').checked ? false : true); }"';
+        $javascript_auto_click = ' onMouseDown="row_click(\'msg[' . $t . ']\')"';
 
 
     if (sizeof($index_order)) {
 
 
     if (sizeof($index_order)) {
index 8014dd2918f9cfbc4082d09ab5360d2e99c87cb5..424d420a7f563a3c23ab8e740118363fae10ac86 100644 (file)
@@ -273,7 +273,22 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
 var marked_row = new Array;
 
 
 var marked_row = new Array;
 
 
-/**
+/* 
+ * (un)Checks checkbox for the row that the current table cell is in
+ * when it gets clicked.
+ *
+ * @param   string   the name of the checkbox that should be (un)checked
+ */
+function row_click(chkboxName) {
+    chkbox = document.getElementById(chkboxName);
+    if (chkbox) { 
+        chkbox.checked = (chkbox.checked ? false : true); 
+    }
+}
+
+
+
+/*
  * Sets/unsets the pointer and marker in browse mode
  *
  * @param   object    the table row
  * Sets/unsets the pointer and marker in browse mode
  *
  * @param   object    the table row