Skip to content

Commit

Permalink
Update README for NPM markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
JillElaine committed Apr 10, 2015
1 parent ac10f07 commit cfe1410
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions README.md
Expand Up @@ -4,26 +4,24 @@ Highly configurable idle (no activity) timer and logout redirect for jQuery.

**Functions across multiple browser windows, tabs and, optionally, iframes (single or nested) as long as the iframes meet the '[Same-Origin Policy](http://en.wikipedia.org/wiki/Same-origin_policy)'.**

Listed on JQuery's Plugin site: http://plugins.jquery.com/idleTimeout/
Listed on [NPM](https://www.npmjs.com/package/jquery-idletimeout) and [JQuery's Plugin site](http://plugins.jquery.com/idleTimeout/).

Requires https://github.com/marcuswestin/store.js which uses localStorage, globalStorage and userData behavior to 'communicate' across multiple browser windows & tabs without cookies or flash.
Requires [Marcus Westin's store.js](https://github.com/marcuswestin/store.js) which uses localStorage, globalStorage and userData behavior to 'communicate' across multiple browser windows & tabs without cookies or flash.

#### Demo Page - http://jillelaine.github.io/jquery-idleTimeout/
** [Basic Demo Page](http://jillelaine.github.io/jquery-idleTimeout/) and [Iframes Demo Page](http://jillelaine.github.io/jquery-idleTimeout/iframe-demo.html) **

##### Iframes Demo Page - http://jillelaine.github.io/jquery-idleTimeout/iframe-demo.html

#### Wiki - https://github.com/JillElaine/jquery-idleTimeout/wiki
** [Informative Wiki Pages!](https://github.com/JillElaine/jquery-idleTimeout/wiki) **

#### Communication Across Multiple Browser Windows, Tabs and Iframes

* Functions across multiple instances of a browser window and across multiple browser tabs within the same domain
* Use **jquery-idleTimeout-iframes.min.js** if detection of activity within iframes is desired
* Use **jquery-idleTimeout-iframes.min.js** if detection of activity within 'same domain' iframes is desired

#### Required 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
* store.js - [https://github.com/marcuswestin/store.js](https://github.com/marcuswestin/store.js) - version 1.3.4 or newer

#### Functionality

Expand All @@ -45,25 +43,23 @@ Requires https://github.com/marcuswestin/store.js which uses localStorage, globa
![Warning Dialog](https://raw.github.com/JillElaine/jquery-idleTimeout/master/warning_dialog.png)

**If the warning dialog box is disabled:**
* After the configured `idleTimeLimit` amount of user inactivity, idleTimer will redirect to configured `redirectUrl`.
* After the configured `idleTimeLimit` amount of user inactivity, idleTimeout script will redirect to configured `redirectUrl`.
* No warning dialog box will appear and browser window and tab title bar(s) do not display a warning.

#### How to Use

* Load the required JQuery dependencies on your website: JQuery core and JQuery UI
* Download store.min.js from https://github.com/marcuswestin/store.js and the appropriate minified jquery-idleTimeout code, jquery-idleTimeout.min.js or jquery-idleTimeout-iframes.min.js
* Load the required jQuery dependencies on your website: jQuery core and jQuery UI
* Download [store.min.js](https://github.com/marcuswestin/store.js) and the appropriate minified jquery-idleTimeout script: jquery-idleTimeout.min.js or jquery-idleTimeout-iframes.min.js
* Upload these .js files and make them available to your website
* Call the jquery-idleTimeout script in a 'document ready', **`$(document).ready(function ()...`**, function somewhere on your site
* Configure the **`redirectUrl`** variable within the 'document ready' function to redirect to your site's logout page
* Configure the `redirectUrl` variable within the 'document ready' function to redirect to your site's logout page
* Use the public logout function on your site's 'Logout' button: **`$.fn.idleTimeout().logout()`**

For more information, please read the Wiki: https://github.com/JillElaine/jquery-idleTimeout/wiki

Information on all the public configuration variables here: https://github.com/JillElaine/jquery-idleTimeout/wiki/Public-Configuration-Variables
For lots more information, please read the [Wiki](https://github.com/JillElaine/jquery-idleTimeout/wiki)

**Example Usage Page**
Detailed information on all the ** [Public Configuration Variables](https://github.com/JillElaine/jquery-idleTimeout/wiki/Public-Configuration-Variables) **.

Please see: https://github.com/JillElaine/jquery-idleTimeout/blob/master/example.html
** [Example Usage Page](https://github.com/JillElaine/jquery-idleTimeout/blob/master/example.html) **

**Example Basic Document Ready Function**

Expand All @@ -80,24 +76,23 @@ Please see: https://github.com/JillElaine/jquery-idleTimeout/blob/master/example
If user voluntarily logs out of your site with your 'Logout' button (instead of timing out), you can force all 'same domain' windows and tabs to log out too! Attach this small snippet of code, **`$.fn.idleTimeout().logout();`**, to the 'onclick' function of your site's 'Logout' button. See example below.

```
<input type="button" value="Logout" onclick="$.fn.idleTimeout().logout();" title="This button will logout ALL 'same domain' Windows & Tabs" />
<input value="Logout" onclick="$.fn.idleTimeout().logout();" type="button" title="Logout ALL 'same domain' Windows & Tabs" />
```

#### Iframe Information

If you require activity detection within iframes, use the jquery-idleTimeout-iframe.min.js script.
If you require activity detection within iframes, use the **jquery-idleTimeout-iframe.min.js** script.

Please read the Iframe Wiki Page: https://github.com/JillElaine/jquery-idleTimeout/wiki/Iframes---Information-&-Troubleshooting
Please read the [Iframe Wiki Page](https://github.com/JillElaine/jquery-idleTimeout/wiki/Iframes---Information-&-Troubleshooting).

#### Troubleshooting

Please read the Troubleshooting Wiki Page: https://github.com/JillElaine/jquery-idleTimeout/wiki/General-Troubleshooting
Please read the [Troubleshooting Wiki Page](https://github.com/JillElaine/jquery-idleTimeout/wiki/General-Troubleshooting)

##### Possible 'mousemove' bug with Chrome browser (on Windows?)

User g4g4r1n reports 'mousemove' event fires when mouse is still and offers a possible solution.
https://github.com/JillElaine/jquery-idleTimeout/issues/13
User g4g4r1n reports 'mousemove' event sometimes fires when mouse is not moving on Chrome browser and offers a [possible solution](https://github.com/JillElaine/jquery-idleTimeout/issues/13).

##### Your suggestions and bug reports are appreciated

Use jquery-idleTimeout-for-testing.js with Firefox with Firebug add-on or similar for debugging. Your feedback helps to improve this plugin!
Use **jquery-idleTimeout-for-testing.js** with Firefox with Firebug add-on or similar for debugging. Your feedback helps to improve this plugin!

0 comments on commit cfe1410

Please sign in to comment.