1var timeout_window; 2var countdown_timer; 3var timeout_flag = false; 4var settings = { 5 timeout: 1200,//in seconds 6 countdown: 60,//1 min 7 display_starttime:null, 8 timeout_url: null 9} 10function init_timeout(){ 11 stop_timeout(); 12 startTimer(); 13} 14function stop_timeout(){ 15 timeout_flag = false; 16 $("#timeoutWarning").hide(); 17 stopTimer(); 18} 19function startCountdown(display){ 20 if(countdown_timer){ 21 window.clearInterval(countdown_timer); 22 countdown_timer = null; 23 } 24 var timer = settings.countdown, minutes, seconds; 25 countdown_timer = window.setInterval(function () { 26 minutes = parseInt(timer / 60, 10) 27 seconds = parseInt(timer % 60, 10); 28 minutes = minutes < 10 ? "0" + minutes : minutes; 29 seconds = seconds < 10 ? "0" + seconds : seconds; 30 if(seconds%2 == 0){ 31 display.css('background-color', '#F79F81'); 32 }else{ 33 display.css('background-color', '#FEEFB3'); 34 } 35 display.html(minutes + " min " + seconds + " sec"); 36 if (--timer < 0) { 37 window.clearInterval(countdown_timer); 38 timeout_flag = true; 39 timeoutOrder(); 40 } 41 }, 1000); 42} 43function startTimer(){ 44 if(timeout_window){ 45 stopTimer(); 46 timeout_window = null; 47 } 48 timeout_window = window.setTimeout(function() { 49 displayTimeoutMsg(); 50 }, (settings.timeout - settings.countdown) * 1000); 51} 52function displayTimeoutMsg(){ 53 $(window).scrollTop(0); 54 $("#timeoutWarning").show(); 55 startCountdown($("#timeout_countdown")); 56} 57function stopTimer(){ 58 window.clearTimeout(timeout_window); 59 if(countdown_timer){ 60 window.clearInterval(countdown_timer); 61 countdown_timer = null; 62 } 63} 64function timeoutOrder(){ 65 //alert("updating timeout.."); 66 submitRequest(settings.timeout_url); 67}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.