This commit is contained in:
2022-02-16 10:47:45 +00:00
parent 5d15b28456
commit 4a394d3ff7
75 changed files with 3127 additions and 691 deletions
+18 -16
View File
@@ -21,6 +21,10 @@
{
return !isNaN(parseFloat(n)) && isFinite(n);
}
sax.getTime = function ()
{
return (new Date()).getTime();
}
sax.zeroPad = function (num, count)
{
var val = num + '';
@@ -353,37 +357,35 @@
//--------------------------------------------------------------
// Session.
sax.configureKeepLoggedIn = function ()
sax.configureKeepLoggedIn = function (single)
{
sax.debug('KeepLoggedIn Configuring');
setTimeout(sax.doKeepLoggedIn, Math.max(30000, sax.keepLoggedInDelay || 300000));
let kli = sax.kli;
if (!kli.timeout) kli.timeout = setTimeout(function () { sax.doKeepLoggedIn(single); }, Math.max(30000, kli.interval || 300000));
}
sax.doKeepLoggedIn = function ()
sax.doKeepLoggedIn = function (single)
{
//sax.debug('KeepLoggedIn Calling');
sax.debug('KeepLoggedIn Calling');
let kli = sax.kli;
delete kli.timeout;
var onKeepLoggedIn = function (response)
{
sax.debug('KeepLoggedIn Responded', response);
sax.configureKeepLoggedIn();
kli.lastAt = sax.getTime();
if (!single) sax.configureKeepLoggedIn();
}
sax.doAjaxRequest({ url: sax.url.base + 'Security/Ajax/KeepLoggedIn', formId: 'frmNavigate', noWaitIcon: true, callbackFn: onKeepLoggedIn }, 1000)
}
sax.configureSessionRefresh = function ()
{
//sax.debug('SessionRefresh Configuring');
sax.debug('SessionRefresh Configuring');
$(document).on('mousedown mousemove touchstart scroll keydown', sax.triggeRefreshSession);
}
sax.triggeRefreshSession = function ()
{
//sax.session = sax.session || { refresh: {} };
let ssr = sax.session.refresh;
win.clearTimeout(ssr.timeout);
ssr.timeout = setTimeout(function () { sax.refreshSession(); }, 150000);
}
sax.refreshSession = function ()
{
//sax.debug('sax.refreshSession');
sax.doKeepLoggedIn();
if (sax.kli.timeout) return;
sax.debug('SessionRefresh Triggering');
sax.configureKeepLoggedIn(1);
}
//--------------------------------------------------------------
@@ -499,7 +501,7 @@
$(function ()
{
$('.sax-button-cta,.sax-button-action,.sax-action-link,.sax-social-icon.sax-action').prop('tabindex', 0);
if (sax.keepLoggedIn)
if (sax.kli.active)
sax.configureKeepLoggedIn();
else if (!sax.awaitingLogin)
sax.configureSessionRefresh();