Comments (15)
How to disable the confirmation dialog once click on Log Out Now.? Can I customize the look and feel of the dialog box.
from jquery-idletimeout.
If the redirect process takes longer than the time remaining on the countdown timer...or if public variable 'redirectUrl' is set to false, the dialog box will show NaN. I do not have the ability to fix the code right now, but you could modify it: modify the jquery-idleTimeout-for-testing.js and watch the console to see how your changes affect the process.
To prevent the 'NaN' display, modify the 'countdownDisplay' function:
// display remaining time on warning dialog
countdownDisplay = function () {
var dialogDisplaySeconds = currentConfig.dialogDisplayLimit, mins, secs;
remainingTimer = setInterval(function () {
mins = Math.floor(dialogDisplaySeconds / 60); // minutes
secs = dialogDisplaySeconds - (mins * 60); // seconds
if (mins == 0 && secs == 0) {
$('#countdownDisplay').html('Times up! Be patient while we redirect.');
} else {
if (mins < 10) { mins = '0' + mins; }
if (secs < 10) { secs = '0' + secs; }
$('#countdownDisplay').html(mins + ':' + secs);
dialogDisplaySeconds -= 1;
}
}, 1000);
};
To customize the look and feel of the dialog box, please see this FAQ: https://github.com/JillElaine/jquery-idleTimeout/wiki/Frequently-Asked-Questions
from jquery-idletimeout.
Thanks.
From: JillElaine [email protected]
Sent: Tuesday, May 17, 2016 1:11 PM
To: JillElaine/jquery-idleTimeout
Cc: joshiamit24; Author
Subject: Re: [JillElaine/jquery-idleTimeout] Session time out counter show NAN (#33)
If the redirect process takes longer than the time remaining on the countdown timer...or if public variable 'redirectUrl' is set to false, the dialog box will show NaN. I do not have the ability to fix the code right now, but you could modify it: modify the jquery-idleTimeout-for-testing.js and watch the console to see how your changes affect the process.
To prevent the 'NaN' display, modify the 'countdownDisplay' function:
// display remaining time on warning dialog
countdownDisplay = function () {
var dialogDisplaySeconds = currentConfig.dialogDisplayLimit, mins, secs;
remainingTimer = setInterval(function () {
mins = Math.floor(dialogDisplaySeconds / 60); // minutes
secs = dialogDisplaySeconds - (mins * 60); // seconds
if (mins == 0 && secs == 0) {
$('#countdownDisplay').html('Times up! Be patient while we redirect.');
} else {
if (mins < 10) { mins = '0' + mins; }
if (secs < 10) { secs = '0' + secs; }
$('#countdownDisplay').html(mins + ':' + secs);
dialogDisplaySeconds -= 1;
}
}, 1000);
};
To customize the look and feel of the dialog box, please see this FAQ: https://github.com/JillElaine/jquery-idleTimeout/wiki/Frequently-Asked-Questions
[https://avatars0.githubusercontent.com/u/1692562?v=3&s=400]https://github.com/JillElaine/jquery-idleTimeout/wiki/Frequently-Asked-Questions
Frequently Asked Questions ยท JillElaine/jquery-idleTimeout ...https://github.com/JillElaine/jquery-idleTimeout/wiki/Frequently-Asked-Questions
github.com
jquery-idleTimeout - Idle activity timeout and logout redirect for jQuery for multiple windows & tabs
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-219787146
from jquery-idletimeout.
Hi Elaine,
In my project, I have three master pages and some pages don't have reference of master page. so I have created user control(added ideal time out script here) and added on master page and the page which doesn't have master page reference. The page without master page reference opens in tab. It shows time out dialog but when I click on logout button it is not logging out from parent page(with master page reference).
Do you have any suggestions?
from jquery-idletimeout.
Are all of your page from the same domain? If some of your pages are from a subdomain within your main domain, please see this: #24
Also, you must load the idleTimeout script only once per site. It sounds like you add the script multiple times, which will not work correctly.
from jquery-idletimeout.
All the pages are from same domain. But some don't have master page reference. so I need to add the user control on that page. The user control has the script for timeout. If I don't add user control on the page which doesn't have master page reference then time out dialog will not be displayed. It will get displayed on page which has master page reference.
Will this work in this scenario?
from jquery-idletimeout.
You need to configure your site so that only one instance of the idleTimeout script is running. If you load the script on the master page, and then load the script again on pages without a reference to the master page, the script will not work correctly.
from jquery-idletimeout.
Thanks Elaine for quick response. so in this demo http://jillelaine.github.io/jquery-idleTimeout/ it creates single instance because it opens same page in different tab. Is that correct? do I need to implement the session at db side? or can we use local storage to check if script is already loaded.
What if I create separate script file and reference it from all pages which don't have master page reference?
from jquery-idletimeout.
When I have use the script on a website, it is for logged-in users. So, when a user logs in (username + password), I then load the scripts (store.js & jquery-idleTimeout.js)
<script src="javascripts/store.min.js" type="text/javascript"></script>
<script src="javascripts/jquery-idleTimeout.js" type="text/javascript"></script>
in a header file that is included on every page on the site.
And then I add the document.ready function to start the idleTimeout script in the body of the page.
<script type="text/javascript" charset="utf-8"> $(document).ready(function () { $(document).idleTimeout({ redirectUrl: 'my-logged-out-page.html', // redirect to this url }); }); </script>
Once I have started the script, I do not start it again. It will already be running on every page within the domain.
from jquery-idletimeout.
are you adding the document.ready function on every page? or on master page?
from jquery-idletimeout.
The document.ready function is on a page snippet that is included within every page, like a template piece.
from jquery-idletimeout.
ok thanks. How to identify if one or more instance of scripts are running? so on every page header and document.ready code is present.
from jquery-idletimeout.
in my branch, i added:
if (dialogDisplaySeconds <= 0) dialogDisplaySeconds = 0; //get rid of NaN display
on the line after dialogDisplaySeconds -= 1;
from jquery-idletimeout.
Thanks
I have already modified my code.
Thanks
Amit Joshi
From: a-espitia [email protected]
Sent: Tuesday, June 28, 2016 2:38 PM
To: JillElaine/jquery-idleTimeout
Cc: joshiamit24; Author
Subject: Re: [JillElaine/jquery-idleTimeout] Session time out counter show NAN (#33)
in my branch, i added:
if (dialogDisplaySeconds <= 0) dialogDisplaySeconds = 0; //get rid of NaN display
on the line after dialogDisplaySeconds -= 1;
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/33#issuecomment-229142386, or mute the threadhttps://github.com/notifications/unsubscribe/AHx71MfrAAfmk7am6yTAmlWP9AHfXEhGks5qQWo1gaJpZM4Ifwrg.
from jquery-idletimeout.
joshiamit24, did you use my suggestion to prevent NaN or a-espitia's? Thank you both for your input. I hope to be able to update my code someday and appreciate the feedback.
from jquery-idletimeout.
Related Issues (20)
- Is there a way to change the timeout duration at runtime? HOT 5
- Dependency on jQuery UI for pop up. HOT 1
- iframe inactivity detection bug HOT 2
- Accessing the $.fn.idleTimeout() after it was initialized HOT 1
- customCallback repeating call if redirectUrl: false HOT 2
- IE recursive loop crash. HOT 7
- Does not function if the page is having frameset HOT 2
- Cannot find any error handling callback HOT 2
- Session lost when there is a pending AJAX request HOT 7
- Unable to change dialogue on buttons, HOT 19
- Configuration issue - activityEvents override without mousemove HOT 7
- Error message only on IE 11 on Windows 2012 R2 - Solved HOT 12
- Releasing jquery-idleTimeout under MIT license HOT 7
- Logged out of iframes, not main page HOT 4
- IE 11 Tabs or windows not communicating when over 2 tabs. HOT 2
- IE-11 windows 10 multiple logout calls HOT 1
- How much of jquery-ui do you need to bundle? HOT 3
- Uncaught TypeError: $(...).idleTimeout is not a function HOT 1
- store.js HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-idletimeout.