From: Paul L. <pdo...@us...> - 2005-03-15 21:48:08
|
Update of /cvsroot/squirrelmail/squirrelmail/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3614 Modified Files: page_header.php mailbox_display.php Log Message: Refactoring JavaScript, reduces bandwidth usage on message list when fancy highlighting is on Index: page_header.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/functions/page_header.php,v retrieving revision 1.186 retrieving revision 1.187 diff -u -w -r1.186 -r1.187 --- page_header.php 15 Mar 2005 20:19:14 -0000 1.186 +++ page_header.php 15 Mar 2005 21:47:50 -0000 1.187 @@ -273,7 +273,22 @@ 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 Index: mailbox_display.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/functions/mailbox_display.php,v retrieving revision 1.427 retrieving revision 1.428 diff -u -w -r1.427 -r1.428 --- mailbox_display.php 15 Mar 2005 06:59:06 -0000 1.427 +++ mailbox_display.php 15 Mar 2005 21:47:51 -0000 1.428 @@ -311,9 +311,17 @@ // this stuff does the auto row highlighting on mouseover // if ($javascript_on && $fancy_index_highlite) { + $mouseoverColor = $color[5]; + + // set this to an empty string to turn off extra + // highlighting of checked rows + // + //$clickedColor = ''; $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 . '\');"'; + } @@ -325,7 +333,7 @@ // $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)) { |