jquery - Configure Session Timeout Dialog without Logout Now button -


i using jillelaine's jquery session timeout dialog pop out displaying timeout alert on .aspx page. working fine, don;t wanna give user option of logging out , remove log out button of control.

its not listed in configurable variables plug in . know how use that. here github link plugin itself.

to remove 'log out now' button, can directly edit unminified .js code file: jquery-idletimeout.js or jquery-idletimeout-iframes.js.

in code section commented with

//----------- warning dialog functions --------------//

replace

openwarningdialog = function () {    var dialogcontent = "<div id='idletimer_warning_dialog'><p>" + currentconfig.dialogtext + "</p><p style='display:inline'>" + currentconfig.dialogtimeremaining + ": <div style='display:inline' id='countdowndisplay'></div></p></div>";    $(dialogcontent).dialog({     buttons: [{       text: currentconfig.dialogstayloggedinbutton,       click: function () {         destroywarningdialog();         stopdialogtimer();         startidletimer();       }     },       {         text: currentconfig.dialoglogoutnowbutton,         click: function () {           logoutuser();         }       }       ],     closeonescape: false,     modal: true,     title: currentconfig.dialogtitle,     open: function () {       $(this).closest('.ui-dialog').find('.ui-dialog-titlebar-close').hide();     }   });    countdowndisplay();    document.title = currentconfig.dialogtitle;    if (currentconfig.sessionkeepalivetimer) {     stopkeepsessionalive();   } }; 

with

openwarningdialog = function () {    var dialogcontent = "<div id='idletimer_warning_dialog'><p>" + currentconfig.dialogtext + "</p><p style='display:inline'>" + currentconfig.dialogtimeremaining + ": <div style='display:inline' id='countdowndisplay'></div></p></div>";    $(dialogcontent).dialog({     buttons: [{       text: currentconfig.dialogstayloggedinbutton,       click: function () {         destroywarningdialog();         stopdialogtimer();         startidletimer();       }     }],     closeonescape: false,     modal: true,     title: currentconfig.dialogtitle,     open: function () {       $(this).closest('.ui-dialog').find('.ui-dialog-titlebar-close').hide();     }   });    countdowndisplay();    document.title = currentconfig.dialogtitle;    if (currentconfig.sessionkeepalivetimer) {     stopkeepsessionalive();   } }; 

save modified code file new name (example: jquery-idletimer-no-logoutnow-button.js), , upload file server.

next load modified code. @ example file how load required javascript files: https://github.com/jillelaine/jquery-idletimeout/blob/master/example.html

replace

<script src="/js/store.min.js" type="text/javascript"></script> <script src="/js/jquery-idletimeout.min.js" type="text/javascript"></script> 

with

<script src="/js/store.min.js" type="text/javascript"></script> <script src="/js/jquery-idletimeout-no-logoutnow-button.js" type="text/javascript"></script> 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -