Subversion Repositories DevTools

Rev

Rev 7064 | Rev 7162 | 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
//  
39
//  Init the dynamic header content
40
$(document).ready(function () {
41
    //console.log ("Dynamic header loaded");
42
    //
43
    //  Setup a function to be called every 30 seconds
44
    var indefTimer = null;
45
    updateHeader();
46
    indefTimer = setInterval( updateHeader,30000 );
7065 dpurdie 47
 
48
    // Function to blink Text. Use sparingly
49
 
50
    function blink_text() {
51
        $('.blink').fadeOut(500);
52
        $('.blink').fadeIn(500);
53
    }
54
    setInterval(blink_text, 1000);
55
 
7063 dpurdie 56
});
57