From: Lo?c C. <lo...@us...> - 2001-05-06 16:47:54
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv16582/chat/lib/index_libs Modified Files: do_enter_js_work.lib.php3 Added Files: connect_status.lib.js Log Message: The (in)famous IE4 javascript bug is fixed :))) --- NEW FILE --- // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html | // +--------------------------------------------------------------------------+ // | Set of JavaScript functions used to handle the connection state for the | // | 'standard' version of phpMyChat (the JavaScript loader is used). | // | | // | This library is called by the 'chat/lib/index_libs/main_index.lib.php3' | // | script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: connect_status.lib.js,v 1.1 2001/05/06 16:47:51 loic1 Exp $ // // Handle the connection state for the 'standard' version of phpMyChat. // var jsImgConnectOff = new Image(13,13); jsImgConnectOff.src = jsChatPath + 'images/connect_off.gif'; var jsImgConnectOn = new Image(13,13); jsImgConnectOn.src = jsChatPath + 'images/connect_on.gif'; var jsImgConnectErr = new Image(13,13); jsImgConnectErr.src = jsChatPath + 'images/connect_error.gif'; var jsImgConnect = new Image(13,13); var jsLeaveChat = false; var jsConnect = 0; var jsIsConnecting = null; var jsIsInitLoad = 1; var jsLastLoadedMsgTime = 0; var jsLastCheckedUserTime = 0; /** * Tries to connect twice if necessary and sets the icon for connection status * at the 'exit' frame * * @param numTry number of connection tries */ function pmcConnecting(numTry) { if (jsIsConnecting) clearTimeout(jsIsConnecting); jsConnect = numTry; var exitFrm = window.frames['exit']; if (typeof(exitFrm.document) == 'undefined') return; if (numTry == 1 || numTry == 2) { jsImgConnect.src = jsImgConnectOn.src; } else if (numTry == 3) { jsImgConnect.src = jsImgConnectErr.src; } if (jsIsDOM) { exitFrm.document.getElementById('imgConState').src = jsImgConnect.src; } else if (jsIsIE4) { exitFrm.document.all['imgConState'].src = jsImgConnect.src; } else if (jsIsNS4) { exitFrm.document.images['imgConState'].src = jsImgConnect.src; } if (numTry < 3) { numTry = numTry + 1; jsIsConnecting = setTimeout('pmcConnecting(' + numTry + ')', 30000); } else { clearTimeout(jsIsConnecting); jsConnect = 0; } return true; } // end of the 'pmcConnecting()' function /** * Kills the timeout defined in the 'pmcConnecting()' function to reconnect once * if the first connection failed, and sets the connection status icon to * 'done' in the exit frame */ function pmcConnectDone() { var exitFrm = window.frames['exit']; jsConnect = 0; if (jsIsConnecting) clearTimeout(jsIsConnecting); if (jsIsDOM) { if (typeof(exitFrm.document.getElementById('imgConState')) != 'undefined') exitFrm.document.getElementById('imgConState').src = jsImgConnectOff.src; } else if (jsIsIE4) { if (typeof(exitFrm.document.all['imgConState']) != 'undefined') exitFrm.document.all['imgConState'].src = jsImgConnectOff.src; } else if (jsIsNS4) { if (typeof(exitFrm.document.images['imgConState']) != 'undefined') exitFrm.document.images['imgConState'].src = jsImgConnectOff.src; } else return; } // end of the 'pmcConnectDone()' function /** * Refreshes the 'loader' frame */ function pmcDoRefreshLoader() { var jsLoaderUrl = 'loader.' + jsPhpExt + '?' + jsDbSessionSID + jsQueryArgSeparator + 'isInitLoad=' + jsIsInitLoad + jsQueryArgSeparator + 'lastMsgLoad=' + jsLastLoadedMsgTime + jsQueryArgSeparator + 'lastUsrCheck=' + jsLastCheckedUserTime; window.frames['loader'].window.location.replace(jsLoaderUrl); } // end of the 'pmcDoRefreshLoader()' function /** * Enforces a new connection try (used when the user click on the 'connection * status' icon at the exit frame) */ function pmcReConnect() { if (jsConnect != 1 && jsConnect != 2) { pmcConnecting(1); pmcDoRefreshLoader(); var inputForm = pmcGetInputForm(); if (inputForm != null) { inputForm.elements['sent'].value = '0'; if (typeof(inputForm.elements['submitType'].disabled) != 'undefined') inputForm.elements['submitType'].disabled = false; } } } // end of the 'pmcReConnect()' function Index: do_enter_js_work.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/do_enter_js_work.lib.php3,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** do_enter_js_work.lib.php3 2001/05/04 09:26:43 1.10 --- do_enter_js_work.lib.php3 2001/05/06 16:47:51 1.11 *************** *** 102,108 **** { ?> ! <!-- Gets the libraries for collapsible list and connection state --> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/users.lib.js" type="text/javascript" language="javascript1.2"></script> ! <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/connect_state.lib.js" type="text/javascript" language="javascript1.2"></script> <?php } // end of the DHTML enabled browser case --- 102,108 ---- { ?> ! <!-- Gets the libraries for collapsible list and connection status --> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/users.lib.js" type="text/javascript" language="javascript1.2"></script> ! <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/connect_status.lib.js" type="text/javascript" language="javascript1.2"></script> <?php } // end of the DHTML enabled browser case |