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.

Run script on screen open
#4
Hi,

All is possible as you have client (JS and LUA) and server side (LUA) scripting at your service including websockets and KNX listeners to do whatever you need but it would help to have a real use case, a read request on a screen open can be done but I don’t think you want to perform a read request on any page, any time as that does not makes sense to me..

A popup any time you access a page is also not logical, so what do you want exact?

You can fetch a user on a page but who, when and how do you want to inform anyone and for what purpose?

I never seen your requests as a standard feature for HMI’s so can you give a sample?

Back to start can be done by custom JS and there is a script created for this as that makes sense (:

Code:
$(function() {
 
  // Back to Start after x seconds (in miliseconds)
  var SE_Timeout = 90000; // 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);
    $(location).attr("href", "/logout");
    }
  }, 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();
    });
  });

});
BR,

Erwin
Reply


Messages In This Thread
Run script on screen open - by p_xatzi - 25.09.2020, 14:47
RE: Run script on screen open - by admin - 25.09.2020, 14:58
RE: Run script on screen open - by p_xatzi - 25.09.2020, 17:45
RE: Run script on screen open - by Erwin van der Zwart - 25.09.2020, 22:05
RE: Run script on screen open - by p_xatzi - 27.09.2020, 13:30
RE: Run script on screen open - by admin - 18.01.2021, 08:45
RE: Run script on screen open - by admin - 04.02.2021, 12:27

Forum Jump: