Subversion Repositories DevTools

Rev

Rev 7063 | Rev 7065 | Go to most recent revision | Details | Compare with Previous | 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
 
7064 dpurdie 22
        // Insert server date-time
23
        $('#hdrDateTime').text(data.now);
24
 
7063 dpurdie 25
        //  Indicate if the user is now logged out
7064 dpurdie 26
        var ul =  $('#usrName');
27
        if ( ul.length ){
28
            if ( !data.loggedIn ) {
29
                ul[0].style.textDecoration = 'line-through'; 
30
            } else {
31
                ul[0].style.textDecoration='none';
32
            }
7063 dpurdie 33
        }
34
 
35
    },'json');
36
}
37
 
38
// Function to blink Text. Use sparingly
39
 
40
function blink_text() {
41
    $('.blink').fadeOut(500);
42
    $('.blink').fadeIn(500);
43
}
44
setInterval(blink_text, 1000);
45
 
46
//  
47
//  Init the dynamic header content
48
$(document).ready(function () {
49
    //console.log ("Dynamic header loaded");
50
    //
51
    //  Setup a function to be called every 30 seconds
52
    var indefTimer = null;
53
    updateHeader();
54
    indefTimer = setInterval( updateHeader,30000 );
55
});
56