Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Utils for detecting inactive clients

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 jquery.away.js
README.md

jquery-away

Utils for detecting inactive clients

Usage example

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();
    }
});

License

Released under the MIT license http://www.opensource.org/licenses/mit-license.php

Functions

$.idle()

Return idle time in seconds

$.idle(n)

Return registered callbacks for specified seconds

$.idle(n, function)

Register a callback to be run when N idle seconds occurs

$.away(message)

Mark the client as away

$.away()

Mark the client as not away

$.isAway()

Return wether the client is away or not

Something went wrong with that request. Please try again.