Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs
In directory usw-pr-cvs1:/tmp/cvs-serv31790/chat/lib/index_libs
Modified Files:
connect_status.lib.js
Log Message:
Optimize a bit js work
Index: connect_status.lib.js
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/connect_status.lib.js,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** connect_status.lib.js 2001/05/14 08:50:49 1.3
--- connect_status.lib.js 2001/05/17 19:28:14 1.4
***************
*** 65,70 ****
jsLoaderFrame.document.execCommand('Stop');
}
- if (jsIsConnecting)
- clearTimeout(jsIsConnecting);
// Do refresh the 'loader' frame
--- 65,68 ----
***************
*** 84,108 ****
clearTimeout(jsIsConnecting);
jsConnect = numTry;
-
- var exitFrame = window.frames['exit'];
- if (typeof(exitFrame.document) == 'undefined'
- || !exitFrame.document)
- return;
-
- jsImgConnect.src = (numTry < 3) ? jsImgConnectOn.src : jsImgConnectErr.src;
! if (jsIsDOM)
! {
! exitFrame.document.getElementById('imgConState').src = jsImgConnect.src;
! }
! else if (jsIsIE4)
! {
! exitFrame.document.all['imgConState'].src = jsImgConnect.src;
}
- else if (jsIsNS4)
- {
- exitFrame.document.images['imgConState'].src = jsImgConnect.src;
- }
if (numTry < 3)
{
--- 82,107 ----
clearTimeout(jsIsConnecting);
jsConnect = numTry;
! // Modify the connection status icon at the 'exit' frame
! var exitFrame = window.frames['exit'].window;
! if (typeof(exitFrame.document) == 'object')
! {
! jsImgConnect.src = (numTry < 3) ? jsImgConnectOn.src : jsImgConnectErr.src;
!
! if (jsIsDOM)
! {
! exitFrame.document.getElementById('imgConState').src = jsImgConnect.src;
! }
! else if (jsIsIE4)
! {
! exitFrame.document.all['imgConState'].src = jsImgConnect.src;
! }
! else if (jsIsNS4)
! {
! exitFrame.document.images['imgConState'].src = jsImgConnect.src;
! }
}
+ // Refresh the 'loader' frame or kill the timeout pointer
if (numTry < 3)
{
***************
*** 113,118 ****
else
{
- clearTimeout(jsIsConnecting);
jsConnect = 0;
}
--- 112,118 ----
else
{
jsConnect = 0;
+ if (jsIsConnecting)
+ clearTimeout(jsIsConnecting);
}
***************
*** 128,132 ****
function pmcConnectDone()
{
! var exitFrame = window.frames['exit'];
jsConnect = 0;
--- 128,132 ----
function pmcConnectDone()
{
! var exitFrame = window.frames['exit'].window;
jsConnect = 0;
***************
*** 134,151 ****
clearTimeout(jsIsConnecting);
! if (jsIsDOM)
! {
! if (typeof(exitFrame.document.getElementById('imgConState')) != 'undefined')
! exitFrame.document.getElementById('imgConState').src = jsImgConnectOff.src;
! }
! else if (jsIsIE4)
! {
! if (typeof(exitFrame.document.all['imgConState']) != 'undefined')
! exitFrame.document.all['imgConState'].src = jsImgConnectOff.src;
! }
! else if (jsIsNS4)
{
! if (typeof(exitFrame.document.images['imgConState']) != 'undefined')
! exitFrame.document.images['imgConState'].src = jsImgConnectOff.src;
}
--- 134,154 ----
clearTimeout(jsIsConnecting);
! if (typeof(exitFrame.document) == 'object')
{
! if (jsIsDOM)
! {
! if (typeof(exitFrame.document.getElementById('imgConState')) != 'undefined')
! exitFrame.document.getElementById('imgConState').src = jsImgConnectOff.src;
! }
! else if (jsIsIE4)
! {
! if (typeof(exitFrame.document.all['imgConState']) != 'undefined')
! exitFrame.document.all['imgConState'].src = jsImgConnectOff.src;
! }
! else if (jsIsNS4)
! {
! if (typeof(exitFrame.document.images['imgConState']) != 'undefined')
! exitFrame.document.images['imgConState'].src = jsImgConnectOff.src;
! }
}
|