Update of /cvsroot/phpmychat/phpMyChat-0.15/chat
In directory usw-pr-cvs1:/tmp/cvs-serv14819/chat
Modified Files:
input.php3
Log Message:
Improve a bit the solution to the size of the message box
Index: input.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** input.php3 2001/04/30 22:44:58 1.30
--- input.php3 2001/05/01 15:31:48 1.31
***************
*** 230,236 ****
$msgValue = '';
}
! // Define the message box size
! $msgBoxSize = 68 - ((L_FONT_SIZE - 10) * 3.5);
!
// The urls for the help and the smilies popups
$helpUrl = 'help_popup.' . C_EXTENSION
--- 230,235 ----
$msgValue = '';
}
! // Define the default message box size (presumed resolution is 800*600)
! $msgBoxSize = floor((800-130) / (L_FONT_SIZE * 0.85)) - 7;
// The urls for the help and the smilies popups
$helpUrl = 'help_popup.' . C_EXTENSION
***************
*** 315,319 ****
<table border="0" cellpadding="0" cellspacing="0">
<tr>
! <td align="<?php echo($cellAlign); ?>" colspan="3">
<?php
// Put the session id in an hidden field
--- 314,318 ----
<table border="0" cellpadding="0" cellspacing="0">
<tr>
! <td align="<?php echo($cellAlign); ?>" colspan="3" nowrap="nowrap">
<?php
// Put the session id in an hidden field
***************
*** 330,334 ****
--- 329,351 ----
<!-- Message box -->
+ <script type="text/javascript" language="javascript1.2">
+ <!--
+ // Get the size of the window
+ winWidth = 0;
+ if (typeof(document.body) != 'undefined'
+ && typeof(document.body.clientWidth) != 'undefined')
+ winWidth = document.body.clientWidth;
+ else if (typeof(window.innerWidth) != 'undefined')
+ winWidth = window.innerWidth;
+ // Define the size of the message box and display it
+ msgBoxSize = (winWidth)
+ ? Math.floor(winWidth / (<?php echo(L_FONT_SIZE); ?> * 0.85)) - 7
+ : <?php echo($msgBoxSize); ?>;
+ document.write('<input type="text" name="message" size="' + msgBoxSize + '" maxlength="299" value="<?php echo(addslashes($msgValue)); ?>" />');
+ // -->
+ </script>
+ <noscript>
<input type="text" name="message" size="<?php echo($msgBoxSize); ?>" maxlength="299" value="<?php echo($msgValue); ?>" />
+ </noscript>
|