-
Notifications
You must be signed in to change notification settings - Fork 79
Home
###WIKI PAGES Please read all the jquery-idleTimeout Wiki Pages. Note the wiki navigation on the right.
###HOW IT WORKS The best way to understand how the idleTimeout script works is to load the jquery-idleTimeout-for-testing.js on your site, and watch the console debug log. One way to do this is to use Mozilla Firefox with the Firebug web developer addon: http://getfirebug.com/
Jquery-idleTimeout-for-testing.js includes iframe functionality and is heavily commented. You can learn quite a bit just by reading the code.
###USAGE Dependencies
- JQuery core version 1.7 or newer
- JQuery UI version 1.9 or newer
- store.js - https://github.com/marcuswestin/store.js - version 1.3.4 or newer
Choose the best jquery-idleTimeout script for your situation. Load the three scripts listed above before you load one of the jquery-idleTimeout scripts. You may choose to load JQuery core and JQuery UI from Google's Hosted Libraries.
Next call the jquery-idleTimeout script in a 'document ready' function. Set the jquery-idleTimeout configuration variable, 'redirectUrl', to your site's logout page. This is the only variable you must set: all other variables may be left at their default values.
Example 'document ready':
$(document).ready(function () {
$(document).idleTimeout({
redirectUrl: '/logout' // redirect to this url. Set this value to YOUR site's logout page.
});
});
Information on all the public configuration variables here: https://github.com/JillElaine/jquery-idleTimeout/wiki/Public-Configuration-Variables
To create a demo test page on your site, copy & paste the example.html code into a page on your site. https://github.com/JillElaine/jquery-idleTimeout/blob/master/example.html
###PROBLEMS? Please read the GENERAL TROUBLESHOOTING and IFRAMES INFORMATION & TROUBLESHOOTING pages.
###REQUEST FOR INPUT If you have a suggestion, question or problem, please submit an issue or send an email. Your feedback helps to improve this plugin!
###HISTORY The original script was philpalmieri's jquery-idleTimeout, but it did not have activity detection across multiple windows & tabs. A request to add this functionality was submitted, and the response from nestoru suggested the use of marcuswestin's store.js that uses local storage to communicate across browser windows and tabs. https://github.com/philpalmieri/jquery-idleTimeout/issues/2#issuecomment-20855442
Later, josebalius created a fork of philpalmieri's that included the use of marcuswestin's store.js. The JillElaine version of the jquery-idleTimeout script was forked from the josebalius version and includes additional functionality.
###DEVELOPER GOALS
- Provide easy-to-understand, well-documented, usable code that helps others learn
- Ongoing improvement of the code
- Continuous knowledge uptake
Couldn't have done it without GitHub's Community. Thanks for all the help & support.