Update of /cvsroot/phpmychat/phpMyChat-0.15/chat
In directory usw-pr-cvs1:/tmp/cvs-serv8302/chat
Modified Files:
input.php3
Log Message:
The color picker has been rewritten in JavaScript
Index: input.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** input.php3 2001/04/14 17:51:47 1.18
--- input.php3 2001/04/17 19:45:53 1.19
***************
*** 100,104 ****
// Red colors are reserved to the admin or a moderator for the current room
! if (ereg('#(FF0000|fc403f|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color)
&& ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm'))
$color = '#000000';
--- 100,104 ----
// Red colors are reserved to the admin or a moderator for the current room
! if (ereg('#(FF0000|fc3f40|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color)
&& ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm'))
$color = '#000000';
***************
*** 284,330 ****
if ($dbSessionVars['jsVersion'] != 'low')
{
- unset($textColors);
- $textColors = array('#000000', '#ffffff');
- for ($x = 0; $x < 360; $x += 6)
- {
- $r = ceil(126 * (cos(deg2rad($x)) + 1));
- $g = ceil(126 * (cos(deg2rad($x + 240)) + 1));
- $b = ceil(126 * (cos(deg2rad($x + 120)) + 1));
- if (!($r > 128 && $g < 128 && $b < 128
- && !($dbSessionVars['status'] == 'a' || $dbSessionVars['status'] == 'm')))
- {
- $textColors[] = '#'
- . substr('0'.dechex($r), -2)
- . substr('0'.dechex($g), -2)
- . substr('0'.dechex($b), -2);
- }
- }
?>
<td> </td>
-
<!-- The color picker -->
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
! <?php
! while (list($key, $colorCode) = each($textColors))
! {
! $i = $key + 1;
! if ($colorCode == $color)
! {
! $wichImage = 'sel_color.gif';
! $wichSelected = $i;
! }
! else
! {
! $wichImage = 'unsel_color.gif';
! }
! echo("\n\t\t\t");
! echo('<td bgcolor="' . $colorCode . '"><a href="#" onclick="window.parent.pmcChangeColor(\'' . $colorCode . '\', \'C' . $i .'\'); return false"><img src="images/' . $wichImage . '" alt="' . $colorCode . '" name="C' . $i . '" border="0" width="2" height="20" /></a></td>');
! }
! unset($textColors);
! echo("\n");
! ?>
</tr>
</table>
--- 284,306 ----
if ($dbSessionVars['jsVersion'] != 'low')
{
?>
<td> </td>
<!-- The color picker -->
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
! <script type="text/javascript" language="javascript1.1">
! <!--
! // Buffer the color picker
! window.parent.jsIsModerator = <?php echo(($dbSessionVars['status'] == 'a' || $dbSessionVars['status'] == 'm') ? 1 : 0); ?>;
! window.parent.pmcSetColorPicker('<?php echo($color); ?>');
!
! // Diplay the color picker
! for (k = 0; k < window.parent.jsColorPicker.length; k++)
! document.writeln(window.parent.jsColorPicker[k]);
! window.parent.jsColorPicker = null;
! // -->
! </script>
</tr>
</table>
***************
*** 343,366 ****
<?php
- /**
- * Ensure a color is selected in the colors picker, else select the default one
- */
- if ($dbSessionVars['jsVersion'] != 'low')
- {
- ?>
- <script type="text/javascript" language="javascript">
- <!--
- <?php
- if (isset($wichSelected))
- echo('window.parent.jsSelectedColor = \'C' . $wichSelected . '\';' . "\n");
- else
- echo('window.parent.pmcChangeColor(\'#000000\', \'C1\');' . "\n");
- ?>
- // -->
- </script>
- <?php
- }
- echo("\n");
-
/**
* Refresh the messages frame if necessary
--- 319,322 ----
|