forked from JillElaine/jquery-idleTimeout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
57 lines (43 loc) · 2.57 KB
/
example.html
File metadata and controls
57 lines (43 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jquery-idleTimeout - Example Page</title>
<link type="text/css" rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/ui-lightness/jquery-ui.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js" type="text/javascript"></script>
<script src="/js/store.min.js" type="text/javascript"></script>
<script src="/js/jquery-idleTimeout.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function (){
$(document).idleTimeout({
idleTimeLimit: 1200, // 'No activity' time limit in seconds. 1200 = 20 Minutes
redirectUrl: '/logout', // redirect to this url on timeout logout. Set to "redirectUrl: false" to disable redirect
// optional custom callback to perform before logout
customCallback: false, // set to false for no customCallback
// customCallback: function () { // define optional custom js function
// perform custom action before logout
// },
// configure which activity events to detect
// http://www.quirksmode.org/dom/events/
// https://developer.mozilla.org/en-US/docs/Web/Reference/Events
activityEvents: 'click keypress scroll wheel mousewheel mousemove', // separate each event with a space
// warning dialog box configuration
enableDialog: true, // set to false for logout without warning dialog
dialogDisplayLimit: 180, // time to display the warning dialog before logout (and optional callback) in seconds. 180 = 3 Minutes
dialogTitle: 'Session Expiration Warning',
dialogText: 'Because you have been inactive, your session is about to expire.',
// server-side session keep-alive timer
sessionKeepAliveTimer: 600 // Ping the server at this interval in seconds. 600 = 10 Minutes
// sessionKeepAliveTimer: false // Set to false to disable pings
});
});
</script>
</head>
<body>
<h1>jquery-idleTimeout Example Page</h1>
<p>This is an example of how to set up a webpage to use the jquery-idleTimeout.</p>
<p>You must change the 'redirectUrl' configuration value to point to your site's logout page.</p>
<p>All other configuration values can be run at their default setting.</p>
</body>
</html>