Subversion Repositories DevTools

Rev

Rev 7064 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7063 dpurdie 1
//  Vix specific Javascript for jquery use
2
//  Dynamic header support. Dynamically updates the page header to indicate
3
//      State of the build daemons
4
//      User has been logged out
5
//      Other information ....
6
//
7
 
8
//  Function to update the dynamic header content
9
function updateHeader()
10
{
11
    //console.log ("Dynamic header update");
12
    el = $('#hdrError');
13
    $.get('_json_daemon.asp', {opr : 'dynaHead'},function(data){
14
 
15
        // Display Build Daemon Error message
16
        if(data.indefPause > 0){
17
            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</span></a>');
18
        }else{
19
            el.empty();
20
        }
21
 
22
        //  Indicate if the user is now logged out
23
        if ( !data.loggedIn ) {
24
            $('#usrName')[0].style.textDecoration='line-through';
25
        } else {
26
            $('#usrName')[0].style.textDecoration='none';
27
        }
28
 
29
        // Insert server date-time
30
        $('#hdrDateTime').text(data.now);
31
 
32
    },'json');
33
}
34
 
35
// Function to blink Text. Use sparingly
36
 
37
function blink_text() {
38
    $('.blink').fadeOut(500);
39
    $('.blink').fadeIn(500);
40
}
41
setInterval(blink_text, 1000);
42
 
43
//  
44
//  Init the dynamic header content
45
$(document).ready(function () {
46
    //console.log ("Dynamic header loaded");
47
    //
48
    //  Setup a function to be called every 30 seconds
49
    var indefTimer = null;
50
    updateHeader();
51
    indefTimer = setInterval( updateHeader,30000 );
52
});
53