Git Product home page Git Product logo

Comments (15)

joshiamit24 avatar joshiamit24 commented on July 20, 2024

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.

JillElaine avatar JillElaine commented on July 20, 2024

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.

joshiamit24 avatar joshiamit24 commented on July 20, 2024

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.

joshiamit24 avatar joshiamit24 commented on July 20, 2024

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.

JillElaine avatar JillElaine commented on July 20, 2024

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.

joshiamit24 avatar joshiamit24 commented on July 20, 2024

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.

JillElaine avatar JillElaine commented on July 20, 2024

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.

joshiamit24 avatar joshiamit24 commented on July 20, 2024

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.

JillElaine avatar JillElaine commented on July 20, 2024

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.

joshiamit24 avatar joshiamit24 commented on July 20, 2024

are you adding the document.ready function on every page? or on master page?

from jquery-idletimeout.

JillElaine avatar JillElaine commented on July 20, 2024

The document.ready function is on a page snippet that is included within every page, like a template piece.

from jquery-idletimeout.

joshiamit24 avatar joshiamit24 commented on July 20, 2024

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.

a-espitia avatar a-espitia commented on July 20, 2024

in my branch, i added:
if (dialogDisplaySeconds <= 0) dialogDisplaySeconds = 0; //get rid of NaN display
on the line after dialogDisplaySeconds -= 1;

from jquery-idletimeout.

joshiamit24 avatar joshiamit24 commented on July 20, 2024

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.

JillElaine avatar JillElaine commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.