Subversion Repositories DevTools

Rev

Rev 7162 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7162 Rev 7212
Line 4... Line 4...
4
//      User has been logged out
4
//      User has been logged out
5
//      Other information ....
5
//      Other information ....
6
//
6
//
7
 
7
 
8
//  Function to update the dynamic header content
8
//  Function to update the dynamic header content
-
 
9
//  Reduce server load. Only update the page if its visible
9
function updateHeader()
10
function updateHeader()
10
{
11
{
11
    //console.log ("Dynamic header update");
12
    //console.log ("Dynamic header update:", document.visibilityState, document.hidden);
-
 
13
    if (document.visibilityState !== 'hidden') {
12
    el = $('#hdrError');
14
        el = $('#hdrError');
13
    $.get('_json_daemon.asp', {opr : 'dynaHead'},function(data){
15
        $.get('_json_daemon.asp', {opr : 'dynaHead'},function(data){
14
 
16
 
15
        // Display Build Daemon Error message
17
            // Display Build Daemon Error message
16
        if(data.indefPause > 0){
18
            if(data.indefPause > 0){
17
            var hlpImg = "<img src='images/i_help.gif' width='12' height='12' hspace='2' align='absmiddle' border='0' >"
19
                var hlpImg = "<img src='images/i_help.gif' width='12' height='12' hspace='2' align='absmiddle' border='0' >"
18
            el.html('<a href=admin_build_service.asp style="text-decoration:none"><span class="mmError blink" title="Click for details">Warning: All Build Daemons are Stopped'+hlpImg+'</span></a>');
20
                el.html('<a href=admin_build_service.asp style="text-decoration:none"><span class="mmError blink" title="Click for details">Warning: All Build Daemons are Stopped'+hlpImg+'</span></a>');
19
        }else{
21
            }else{
20
            el.empty();
22
                el.empty();
21
        }
-
 
22
 
-
 
23
        // Insert server date-time
-
 
24
        $('#hdrDateTime').text(data.now);
-
 
25
 
-
 
26
        //  Indicate if the user is now logged out
-
 
27
        var ul =  $('#usrName');
-
 
28
        if ( ul.length ){
-
 
29
            if ( !data.loggedIn ) {
-
 
30
                ul[0].style.textDecoration = 'line-through'; 
-
 
31
            } else {
-
 
32
                ul[0].style.textDecoration='none';
-
 
33
            }
23
            }
-
 
24
 
-
 
25
            // Insert server date-time
-
 
26
            $('#hdrDateTime').text(data.now);
-
 
27
 
-
 
28
            //  Indicate if the user is now logged out
-
 
29
            var ul =  $('#usrName');
-
 
30
            if ( ul.length ){
-
 
31
                if ( !data.loggedIn ) {
-
 
32
                    ul[0].style.textDecoration = 'line-through'; 
-
 
33
                } else {
-
 
34
                    ul[0].style.textDecoration='none';
-
 
35
                }
34
        }
36
            }
35
        
37
            
36
    },'json');
38
        },'json');
-
 
39
    }
37
}
40
}
38
 
41
 
39
//  
42
//  
40
//  Init the dynamic header content
43
//  Init the dynamic header content
41
$(document).ready(function () {
44
$(document).ready(function () {
Line 54... Line 57...
54
    }
57
    }
55
    setInterval(blink_text, 1000);
58
    setInterval(blink_text, 1000);
56
 
59
 
57
});
60
});
58
 
61
 
-
 
62
//  Listen for visibility changes and force an update when the page is shown
-
 
63
$(document).on('visibilitychange', function() {
-
 
64
    if(document.visibilityState !== 'hidden') {
-
 
65
        updateHeader();
-
 
66
        //console.log ("Page is visible");
-
 
67
    }
-
 
68
});
-
 
69