This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Screen timeout/log out
#4
Admin is refereeing to the logout script available in the forum.

Code:
$(function() {
 
  // Back to Start after x seconds (in miliseconds)
  var SE_Timeout = 9000; // adjust this timer value if needed (90 seconds in miliseconds)
  var SE_Startpage = currentPlanId; // First page that is loaded
  var eventlist = 'vclick vmousedown vmouseout touchend';
 
  // Timer function no usage detected
  function No_Usage_Detected(callback, timeout, _this) {
    var timer;
    return function(e) {
        var _that = this;
        if (timer)
            clearTimeout(timer);
        timer = setTimeout(function() {
            callback.call(_this || _that, e);
        }, timeout);
    }
  }

  // Back to start function when timer elapsed
    var SE_Goto_Startpage = No_Usage_Detected(function(e) {
    if ( currentPlanId != SE_Startpage ) {
    showPlan(SE_Startpage);
    window.location.reload();
    }
  }, SE_Timeout);
 
  // Add event listener to document to detect user input
  $(document)
  .on(eventlist, function() {
    SE_Goto_Startpage();
  });

  // Add event listener to all iframes to detect user input inside iframes
  $('iframe').load(function() {
    var iframe = $('iframe').contents().find('html');
    iframe.on(eventlist, function(event) {
     SE_Goto_Startpage();
    });
  });

});
------------------------------
Ctrl+F5
Reply


Messages In This Thread
Screen timeout/log out - by MarcusH - 02.07.2021, 07:48
RE: Screen timeout/log out - by admin - 02.07.2021, 15:30
RE: Screen timeout/log out - by MarcusH - 05.07.2021, 08:50
RE: Screen timeout/log out - by Daniel - 05.07.2021, 09:31
RE: Screen timeout/log out - by MarcusH - 05.07.2021, 11:43

Forum Jump: