Subversion Repositories DevTools

Rev

Rev 7064 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

//  Vix specific Javascript for jquery use
//  Dynamic header support. Dynamically updates the page header to indicate
//      State of the build daemons
//      User has been logged out
//      Other information ....
//

//  Function to update the dynamic header content
function updateHeader()
{
    //console.log ("Dynamic header update");
    el = $('#hdrError');
    $.get('_json_daemon.asp', {opr : 'dynaHead'},function(data){

        // Display Build Daemon Error message
        if(data.indefPause > 0){
            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>');
        }else{
            el.empty();
        }

        //  Indicate if the user is now logged out
        if ( !data.loggedIn ) {
            $('#usrName')[0].style.textDecoration='line-through';
        } else {
            $('#usrName')[0].style.textDecoration='none';
        }

        // Insert server date-time
        $('#hdrDateTime').text(data.now);
        
    },'json');
}

// Function to blink Text. Use sparingly

function blink_text() {
    $('.blink').fadeOut(500);
    $('.blink').fadeIn(500);
}
setInterval(blink_text, 1000);

//  
//  Init the dynamic header content
$(document).ready(function () {
    //console.log ("Dynamic header loaded");
    //
    //  Setup a function to be called every 30 seconds
    var indefTimer = null;
    updateHeader();
    indefTimer = setInterval( updateHeader,30000 );
});