idle-timer

How to check idle time using jQuery and PHP?

ぃ、小莉子 提交于 2019-12-07 06:33:30
I have a script that uses PHP SESSION . I manage PHP sessions using a class. Within this class I have a method that returns how many seconds remaining before the session expires. Also, Evey time the user refresh the page or open a new page (new request to the server) the idle time counter starts over $_SESSION['MA_IDLE_TIMEOUT'] = time()+900; What I am looking to do is display a dialog message 2 minutes before the PHP session expire and check if the user is still on the page or not. If the use clicks "Keep working" then the jQuery script will send PHP AJAX request to renew the session $

Mouseenter and Mouseleave to trigger timer on/off

点点圈 提交于 2019-12-06 15:35:59
How would I code a mouseenter event to trigger timer off and a mouseleave event to trigger the timer on ? If the timer interval is reached then webpage will refresh. I've tried to do it but couldn't work it out: <script> $(document).ready(function() { var timer; function start() { timer = setInterval(function(){refresh()}, 5000); } start(); $('body').mouseenter(function() { clearTimeout(timer); }); }).mouseleave(function(e) { var pageX = e.pageX || e.clientX, pageY = e.pageY || e.clientY; if (pageX <= 0 || pageY <= 0) { start(); } else clearTimeout(timer); }); function refresh() { window

User idle time while typing in input

删除回忆录丶 提交于 2019-12-06 07:32:53
The problem I'm having is a search function which should call my doSearch() -method after the user stopped typing for at least 100ms in my $("input#q) field. I tried to achieve this by using the logic of this answer , but I'm stuck with where I should set/unset the setInterval() which increments the idleTime . var idleTime = 0; $("input#q").keyup(function() { idleTime = 0; idleInterval = setInterval(function() { idleTimeIncrement(); }, 25); }); function idleTimeIncrement() { idleTime += 25; if (idleTime >= 100) { doSearch($("input#q").val()); } } The error I'm getting in Firebug Console says:

phonegap, iphone and the big bad idleTimerDisabled

白昼怎懂夜的黑 提交于 2019-12-06 07:05:41
问题 reading a lot about how to prevent iphone goingto sleep while running my app I am very unhappy at the moment because nothing worked.. here I read about the idea to set up a timer for every 30 seconds to set the idleTimerDisabled to NO and then YES, but my objC isn't that good yet. could anybody tell me how (and where)? thnx! edit: here is the code I tried: - (void)applicationDidFinishLaunching:(UIApplication *)application { [ super applicationDidFinishLaunching:application ]; //application

phonegap, iphone and the big bad idleTimerDisabled

懵懂的女人 提交于 2019-12-04 13:36:58
reading a lot about how to prevent iphone goingto sleep while running my app I am very unhappy at the moment because nothing worked.. here I read about the idea to set up a timer for every 30 seconds to set the idleTimerDisabled to NO and then YES, but my objC isn't that good yet. could anybody tell me how (and where)? thnx! edit: here is the code I tried: - (void)applicationDidFinishLaunching:(UIApplication *)application { [ super applicationDidFinishLaunching:application ]; //application.idleTimerDisabled = NO; //application.idleTimerDisabled = YES; //[[UIApplication sharedApplication]

JDialog's timeout when idle

て烟熏妆下的殇ゞ 提交于 2019-12-02 14:54:47
问题 How can I set the timeout for a JDialog when it is idle for example 90 seconds? It exits once no action, movement ,selection is done in the JDialog for 90 seconds. This thread gives timeouts but no idle condition - Can I set a timer on a Java Swing JDialog box to close after a number of milliseconds Thanks! 回答1: Okay, so the biggest problem will be getting enough information about interaction from the user. You could try using AWTEventListener , which is a way to monitor AWTEvent s going

JDialog's timeout when idle

℡╲_俬逩灬. 提交于 2019-12-02 12:02:52
How can I set the timeout for a JDialog when it is idle for example 90 seconds? It exits once no action, movement ,selection is done in the JDialog for 90 seconds. This thread gives timeouts but no idle condition - Can I set a timer on a Java Swing JDialog box to close after a number of milliseconds Thanks! Okay, so the biggest problem will be getting enough information about interaction from the user. You could try using AWTEventListener , which is a way to monitor AWTEvent s going through the EventQueue and should, for the most part, give you enough information about possible interactions.

Timeout via PrimeFaces p:idleMonitor

房东的猫 提交于 2019-12-01 11:09:14
问题 I am trying to handle the session timeout via idlemonitor, a primefaces component. I am doing this because i need to let the user know that due to inactivity the session has expired. I need to display this message through a dialog, after he closes the dialog he should be redirected to the loginpage. He should not be able to click "back" and browse on the application just as nothing happend; if he clicks "back" he should be redirected to a sessionexpired.xhtml page. I put the idleMonitor in my

Using Golang to get Windows idle time (GetLastInputInfo or similar)

女生的网名这么多〃 提交于 2019-11-30 05:12:45
Is there an example or method of getting a Windows system's idle time using Go? I've been looking at the documentation at the Golang site but I think I'm missing how to access (and use) the API to get system information including the idle time. Go's website is hardcoded to show the documentation for the standard library packages on Linux. You will need to get godoc and run it yourself: go get golang.org/x/tools/cmd/godoc godoc --http=:6060 then open http://127.0.0.1:6060/ in your web browser. Of note is package syscall , which provides facilities for accessing functions in DLLs, including UTF

Idle Detection in WPF

帅比萌擦擦* 提交于 2019-11-29 02:13:14
I'm new in using WPF so I have no Idea how to detect Idle time and show the main window after 5mins of Idle. Can anyone help me? Thank you so much. owen79 You can do; var timer = new DispatcherTimer ( TimeSpan.FromMinutes(5), DispatcherPriority.ApplicationIdle,// Or DispatcherPriority.SystemIdle (s, e) => { mainWindow.Activate(); }, // or something similar Application.Current.Dispatcher ); picked up from here 来源: https://stackoverflow.com/questions/23286766/idle-detection-in-wpf