@@ -391,6 +391,9 @@ <h3>Muon Veto</h3>
391391 var display_counter = 0 ;
392392 document . superman = "nobody" ;
393393
394+ // Check if page timed out with this one
395+ var pageTimeoutTimer = 0 ;
396+
394397 // The progress bar update for page refresh
395398
396399 var pageupdatebar = new ProgressBar . Circle ( "#updatebar" , {
@@ -403,6 +406,14 @@ <h3>Muon Veto</h3>
403406 svgStyle : null
404407} ) ;
405408
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+ } ;
406417 // Update function for the run start messages
407418 function FeedbackLoop ( ) {
408419 $ . getJSON ( feedbackURL , function ( data ) {
@@ -487,6 +498,7 @@ <h3>Muon Veto</h3>
487498
488499 }
489500 function UpdatePage ( thechart ) {
501+
490502 $ . getJSON ( currentShifterUrl , function ( data ) {
491503 document . superman = data [ 'starting_user' ] ;
492504 document . canstartruns = false ;
@@ -504,7 +516,8 @@ <h3>Muon Veto</h3>
504516 ResizeDetailWindows ( ) ;
505517 ResizeTriggerWindow ( ) ;
506518
507- var updatecounter = 0 ;
519+ var updatecounter = 0 ;
520+ pageTimeoutTimer = 0 ;
508521 FeedbackLoop ( ) ;
509522
510523 timerLoop ( updatecounter , thechart ) ;
@@ -622,6 +635,7 @@ <h3>Muon Veto</h3>
622635 }
623636
624637 $ ( function ( ) { //DOM Ready
638+ PageTimeoutCounter ( ) ;
625639 document . autoplay = false ;
626640 // Save some info from template tags
627641 document . user = "{{ request.user.username }}" ;
0 commit comments