@@ -391,6 +391,9 @@ <h3>Muon Veto</h3>
391
391
var display_counter = 0 ;
392
392
document . superman = "nobody" ;
393
393
394
+ // Check if page timed out with this one
395
+ var pageTimeoutTimer = 0 ;
396
+
394
397
// The progress bar update for page refresh
395
398
396
399
var pageupdatebar = new ProgressBar . Circle ( "#updatebar" , {
@@ -403,6 +406,14 @@ <h3>Muon Veto</h3>
403
406
svgStyle : null
404
407
} ) ;
405
408
409
+ function PageTimeoutCounter ( ) {
410
+ if ( pageTimeoutTimer > 60 ) {
411
+ alert ( "Page has not updated for 60 seconds. You probably have a stale tab. Please refresh your browser." ) ;
412
+ return ;
413
+ }
414
+ pageTimeoutTimer += 5 ;
415
+ setTimeout ( function ( ) { PageTimeoutCounter ( ) ; } , 5000 ) ;
416
+ } ;
406
417
// Update function for the run start messages
407
418
function FeedbackLoop ( ) {
408
419
$ . getJSON ( feedbackURL , function ( data ) {
@@ -487,6 +498,7 @@ <h3>Muon Veto</h3>
487
498
488
499
}
489
500
function UpdatePage ( thechart ) {
501
+
490
502
$ . getJSON ( currentShifterUrl , function ( data ) {
491
503
document . superman = data [ 'starting_user' ] ;
492
504
document . canstartruns = false ;
@@ -504,7 +516,8 @@ <h3>Muon Veto</h3>
504
516
ResizeDetailWindows ( ) ;
505
517
ResizeTriggerWindow ( ) ;
506
518
507
- var updatecounter = 0 ;
519
+ var updatecounter = 0 ;
520
+ pageTimeoutTimer = 0 ;
508
521
FeedbackLoop ( ) ;
509
522
510
523
timerLoop ( updatecounter , thechart ) ;
@@ -622,6 +635,7 @@ <h3>Muon Veto</h3>
622
635
}
623
636
624
637
$ ( function ( ) { //DOM Ready
638
+ PageTimeoutCounter ( ) ;
625
639
document . autoplay = false ;
626
640
// Save some info from template tags
627
641
document . user = "{{ request.user.username }}" ;
0 commit comments