How to use idyn hynds timeout plugin
I want to use this plugin here , which displays a message saying if you want to continue with the session or if this session will be disconnected. This is pretty much a widget created by eric hynds where if the user is not using the computer for a certain period of time then it will display a message if the user wants to continue or not. If yes then continue, if not then user timeout.
But anyway, my question is to be able to use this plugin, what files do I need? There is a src folder with 2 js scripts, but I don't know if I need one or both of them, so I thought about asking people who have used this plugin.
Also if I want to use a plugin for multiple documents, I just give them different id / class names?
thank
source to share
Just take a peak in the source code :
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"
type="text/javascript"></script>
<script src="src/jquery.idletimer.js" type="text/javascript"></script>
<script src="src/jquery.idletimeout.js" type="text/javascript"></script>
<script type="text/javascript">
$.idleTimeout('#idletimeout', '#idletimeout a', {
idleAfter: 5,
pollingInterval: 2,
keepAliveURL: 'keepalive.php',
serverResponseEquals: 'OK',
onTimeout: function () {
$(this).slideUp();
window.location = "timeout.htm";
},
onIdle: function () {
$(this).slideDown(); // show the warning bar
},
onCountdown: function (counter) {
$(this).find("span").html(counter); // update the counter
},
onResume: function () {
$(this).slideUp(); // hide the warning bar
}
});
</script>
source to share
You need to add the following two scripts to the workspace:
-
src/jquery.idletimer.js
-
src/jquery.idletimeout.js
Like here:
<script src="src/jquery.idletimer.js" type="text/javascript"></script>
<script src="src/jquery.idletimeout.js" type="text/javascript"></script>
Download it and add it to your workspace, then create a JSP, add the above code to the JSP and include anywhere you want to display the session timeout.
Best regards, Vakar Khan
source to share