Utils for detecting inactive clients
setInterval(function() {
console.log('idle time: ' + $.idle());
}, 2000);
$.idle(30, function() {
console.log('are you there?');
});
$.idle(60, function() {
console.log('going away :)');
$.away('autoaway');
});
$.idle(0, function() {
if ($.isAway()) {
console.log('back from away');
$.away();
}
});
Released under the MIT license http://www.opensource.org/licenses/mit-license.php
Return idle time in seconds
Return registered callbacks for specified seconds
Register a callback to be run when N idle seconds occurs
Mark the client as away
Mark the client as not away
Return wether the client is away or not