0
아래 스크립트가 어떻게 작동합니까? 나는 사용자에게 다른 옵션을 자동으로 로그 아웃 할 수있는 옵션을 제공하기 위해 모든 hr에 대한 팝업을 구현하려고합니다. 작동하지만 여러 사용자가 로그인 할 때 어떤 일이 발생하는지 의심 스럽습니다. 귀하의 페이지에서 로그 아웃을 누르면 다른 사람들이 로그 아웃됩니까? 는 현재 스크립트의 taskPoll을 중지 특정 의지아래의 코드는 어떻게 작동합니까? (Extjs)
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.stop(taskPoll);
되려면?
<script>
var counter = 3600;
var counter1 = 20;
var taskPoll =
{
run: function()
{
counter -= 1;
if(counter < 1)
{
Ext.TaskMgr.stop(taskPoll);
countDownComplete();
return false;
}
else
{
}
},
interval:1000
}
countDownComplete = function()
{
var taskPoll1 =
{
run: function()
{
counter1 -= 1;
if(counter1 < 1)
{
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.stop(taskPoll);
// Ext.TaskMgr.stopAll();
logout('imagelogout');
return false;
}
else
{
Ext.MessageBox.updateText('You will be logged out in next <b>' + counter1+' </b> seconds. Please click on <b> Continue </b> if you do not wish to be logged out.');
}
},
interval:1000
}
Ext.MessageBox.maxWidth=420;
Ext.MessageBox.buttonText.yes = 'Continue';
Ext.MessageBox.buttonText.no = 'LogOut';
Ext.MessageBox.confirm('Attention', 'You will be logged out in next 30 seconds. Please click on <b> Continue </b> if you do not wish to be logged out.',
function(btn)
{
if(btn == 'yes')
{
counter=3600;
counter1=20;
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.start(taskPoll);
return false;
}
else
{
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.stop(taskPoll);
// Ext.TaskMgr.stopAll();
logout('imagelogout');
return false;
}
});
Ext.TaskMgr.start(taskPoll1);
}
// Ext.TaskMgr.start(taskPoll); is the starting point of timeout Pop up
Ext.TaskMgr.start(taskPoll);
</script>