Can somebody please make me a simple script to stop this popup from
coming up, and just refresh the counter.
It is so annoying, especially if i have 4 or 5 windows open, they
popup ALL the time.
Any help would be greatly appreciated.
I haven't a clue how to make a script.
The script::
<!--
D2LSessionManager = function() {
this.m_timeoutTime = 0;
// NOTE: when PM#43062 is resolved, we no longer need to divide by 2
this.m_sessionLength = 5400000;
this.m_handled = false;
};
D2LSessionManager.prototype.Reset = function() {
// amount of time before the session ends that we warn the user
// by default, 5 minutes unless timeout is less than 5 minutes
// in which case it's a minute, unless timeout is less than 1 minute
var beforeTime = 5 * 60 * 1000;
if( this.m_sessionLength <= beforeTime ) {
if( this.m_sessionLength > 60 * 1000 ) {
beforeTime = 60 * 1000;
} else {
beforeTime = 0;
}
}
// calculate the time the timeout could occur
var now = new Date();
this.m_timeoutTime = now.getTime() + this.m_sessionLength;
// timeout is un-handled
this.m_handled = false;
var me = this;
// prompt 5 minutes before the timeout could occur
setTimeout( function() {
var now2 = new Date();
// timeout hasn't been renewed by another page, so prompt
// (we add 1 second here as a small buffer)
if( !me.m_handled && now2.getTime() + 1000 >= me.m_timeoutTime -
beforeTime ) {
// timeout is handled (to prevent multiple alerts)
me.m_handled = true;
// notify the user
alert( 'Your session has been inactive for some time.
Press \'OK\'
to remain logged in.' );
// perform an Rpc to renew the session
var rpc = new d2l_ServerComm();
rpc.RequestMethod = 'GET';
rpc.CallbackFunction = function( responseText ) {
var result = eval( responseText );
// session was renewed successfully
if( result === true ) {
me.Reset();
// session expired, so redirect
} else {
document.location.href =
'/d2l/tools/login/noLogin.asp';
}
};
rpc.Url = '/d2l/tools/ouHome/extendSession.asp';
rpc.Send();
}
}, this.m_sessionLength - beforeTime );
};
var d2l_sessionManager = new D2LSessionManager();
//-->
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---