v1.2.3.1
This commit is contained in:
@@ -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 + '';
|
||||
@@ -123,7 +127,7 @@
|
||||
{
|
||||
return $(sel).datepicker(opt || {});
|
||||
}
|
||||
sax.allowClearCalendar = function(sel)
|
||||
sax.allowClearCalendar = function (sel)
|
||||
{
|
||||
$(sel).datepicker().on('keyup', function (e)
|
||||
{
|
||||
@@ -375,39 +379,26 @@
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// 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');
|
||||
var onKeepLoggedIn = function (response)
|
||||
{
|
||||
//sax.debug('KeepLoggedIn Responded', response);
|
||||
sax.configureKeepLoggedIn();
|
||||
}
|
||||
sax.doAjaxRequest({ url: sax.url.base + 'Security/Ajax/KeepLoggedIn', formId: 'frmNavigate', noWaitIcon: true, callbackFn: onKeepLoggedIn }, 1000)
|
||||
let kli = sax.kli;
|
||||
delete kli.timeout;
|
||||
sax.doAjaxRequest({ url: sax.url.base + 'Security/Ajax/KeepLoggedIn', formId: 'frmNavigate', noWaitIcon: true, callbackFn: function (response) { kli.lastAt = sax.getTime(); if (!single) sax.configureKeepLoggedIn(); } }, 1000)
|
||||
}
|
||||
sax.configureSessionRefresh = function ()
|
||||
{
|
||||
//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);
|
||||
if (sax.kli.timeout) return;
|
||||
sax.configureKeepLoggedIn(1);
|
||||
}
|
||||
sax.refreshSession = function ()
|
||||
{
|
||||
//sax.debug('sax.refreshSession');
|
||||
sax.doKeepLoggedIn();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Data entry.
|
||||
sax.clearControlErrors = function (context)
|
||||
@@ -520,7 +511,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();
|
||||
|
||||
Reference in New Issue
Block a user