|
From: Lo?c C. <lo...@us...> - 2001-05-04 16:26:31
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs
In directory usw-pr-cvs1:/tmp/cvs-serv22210/chat/lib/index_libs
Modified Files:
start_page.lib.js main_index.lib.php3
do_enter_frameset.lib.php3 do_enter_db_work.lib.php3
Log Message:
Improved a bit the message box size
Index: start_page.lib.js
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/start_page.lib.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** start_page.lib.js 2001/04/19 21:05:04 1.6
--- start_page.lib.js 2001/05/04 16:26:28 1.7
***************
*** 26,31 ****
/**
! * Updates the "jsVersion" field in the form below according to the JavaScript
! * abilities of the browser
*
* @access public
--- 26,91 ----
/**
! * Get the with and the height of the phpMyChat window and the size in pixels
! * of a column of an input field, then update the starting form with these
! * values
! *
! * @access public
! */
! function pmcSetSizes()
! {
! // Get the screen size
! if (typeof(document.body) != 'undefined'
! && typeof(document.body.clientWidth) != 'undefined')
! {
! var theWinWidth = document.body.clientWidth;
! var theWinHeight = document.body.clientHeight;
! }
! else if (typeof(window.innerWidth) != 'undefined')
! {
! var theWinWidth = window.innerWidth;
! var theWinHeight = window.innerHeight;
! }
!
! // Get the size of a text input field column
! if (jsIsDOM)
! {
! var aCell = document.getElementById('testSize');
! var aColWidth = Math.floor(aCell.offsetWidth / aCell.size);
! var aRowHeight = Math.floor(aCell.offsetHeight);
! }
! else if (jsIsIE4)
! {
! var aCell = document.all['testSize'];
! var aColWidth = Math.floor(aCell.offsetWidth / aCell.size);
! var aRowHeight = Math.floor(aCell.offsetHeight);
! }
! else if (jsIsNS4)
! {
! // TODO (can't find a way to compute this value :()
! // var aCell = document.layers['testSize'];
! // var aColWidth = Math.floor(aCell.document.width / 11);
! // var aRowHeight = Math.floor(aCell.document.height);
! }
!
! // Update the starting form
! with (document.forms['startingForm'])
! {
! if (typeof(theWinWidth) != 'undefined')
! {
! elements['winWidth'].value = theWinWidth;
! elements['winHeight'].value = theWinHeight;
! }
! if (typeof(aColWidth) != 'undefined')
! {
! elements['colWidth'].value = aColWidth;
! elements['rowHeight'].value = aRowHeight;
! }
! }
! } // end of the 'pmcSetSizes()' function
!
!
! /**
! * Updates the "jsVersion" field in the starting form according to the
! * JavaScript abilities of the browser
*
* @access public
Index: main_index.lib.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/main_index.lib.php3,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** main_index.lib.php3 2001/05/04 09:26:43 1.28
--- main_index.lib.php3 2001/05/04 16:26:28 1.29
***************
*** 604,608 ****
<!-- The main form -->
! <form action="<?php echo($action); ?>" method="post" name="startingForm" onsubmit="pmcDefineVerField(); return pmcIndexValidate(<?php echo(C_REQUIRE_REGISTER); ?>);">
<?php
// Put the session id in an hidden field
--- 604,608 ----
<!-- The main form -->
! <form action="<?php echo($action); ?>" method="post" name="startingForm" onsubmit="pmcSetSizes(); pmcDefineVerField(); return pmcIndexValidate(<?php echo(C_REQUIRE_REGISTER); ?>);">
<?php
// Put the session id in an hidden field
***************
*** 611,614 ****
--- 611,618 ----
<input type="hidden" name="jsVersion" value="noJs" />
<input type="hidden" name="isJsValidated" value="0" />
+ <input type="hidden" name="winWidth" value="800" />
+ <input type="hidden" name="winHeight" value="600" />
+ <input type="hidden" name="colWidth" value="<?php echo(L_FONT_SIZE * 0.85); ?>" />
+ <input type="hidden" name="rowHeight" value="<?php echo((L_FONT_SIZE * 1.5) + 5); ?>" />
<table border="0" cellpadding="3" class="chatTable" style="margin-bottom: 3px">
***************
*** 661,665 ****
<td align="<?php echo($cellAlign); ?>" valign="top" class="chatCell" nowrap="nowrap"><?php echo(L_SET_2); ?> :</td>
<td valign="top" class="chatCell">
! <input type="text" name="nick" size="11" maxlength="10" value="<?php echo(htmlspecialchars($layoutNick)); ?>" class="chatBox" />
</td>
</tr>
--- 665,669 ----
<td align="<?php echo($cellAlign); ?>" valign="top" class="chatCell" nowrap="nowrap"><?php echo(L_SET_2); ?> :</td>
<td valign="top" class="chatCell">
! <input id="testSize" type="text" name="nick" size="11" maxlength="10" value="<?php echo(htmlspecialchars($layoutNick)); ?>" class="chatBox" />
</td>
</tr>
Index: do_enter_frameset.lib.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/do_enter_frameset.lib.php3,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** do_enter_frameset.lib.php3 2001/04/30 22:44:58 1.9
--- do_enter_frameset.lib.php3 2001/05/04 16:26:28 1.10
***************
*** 34,38 ****
. $pmcQueryArgSeparator . 'reloading=nsResize';
// The height of the input frame
! $inputHeight = L_FONT_SIZE * 6.2;
--- 34,39 ----
. $pmcQueryArgSeparator . 'reloading=nsResize';
// The height of the input frame
! // = (row height * 2) + 5 for a little row used as separator + margins
! $inputHeight = ($dbSessionVars['rowHeight'] * 2) + 30;
Index: do_enter_db_work.lib.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/do_enter_db_work.lib.php3,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** do_enter_db_work.lib.php3 2001/04/21 19:37:40 1.13
--- do_enter_db_work.lib.php3 2001/05/04 16:26:28 1.14
***************
*** 277,280 ****
--- 277,284 ----
// 'loader.php3' and 'input.php3' scripts if they are called for the first time
$dbSessionVars['noKickTest'] = 1;
+ // some sizes
+ $dbSessionVars['winWidth'] = (isset($winWidth)) ? $winWidth : 800;
+ $dbSessionVars['colWidth'] = (isset($colWidth)) ? $colWidth : (L_FONT_SIZE * 0.85);
+
dbSessionSave();
unset($keptLang);
|