Subversion Repositories DevTools

Rev

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){
7162 dpurdie 17
            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>');
7063 dpurdie 19
        }else{
20
            el.empty();
21
        }
22
 
7064 dpurdie 23
        // Insert server date-time
24
        $('#hdrDateTime').text(data.now);
25
 
7063 dpurdie 26
        //  Indicate if the user is now logged out
7064 dpurdie 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
            }
7063 dpurdie 34
        }
35
 
36
    },'json');
37
}
38
 
39
//  
40
//  Init the dynamic header content
41
$(document).ready(function () {
42
    //console.log ("Dynamic header loaded");
43
    //
44
    //  Setup a function to be called every 30 seconds
45
    var indefTimer = null;
46
    updateHeader();
47
    indefTimer = setInterval( updateHeader,30000 );
7065 dpurdie 48
 
49
    // Function to blink Text. Use sparingly
50
 
51
    function blink_text() {
52
        $('.blink').fadeOut(500);
53
        $('.blink').fadeIn(500);
54
    }
55
    setInterval(blink_text, 1000);
56
 
7063 dpurdie 57
});
58