Subversion Repositories DevTools

Rev

Rev 7065 | 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){
            var hlpImg = "<img src='images/i_help.gif' width='12' height='12' hspace='2' align='absmiddle' border='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'+hlpImg+'</span></a>');
        }else{
            el.empty();
        }

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

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

//  
//  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 );

    // Function to blink Text. Use sparingly

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

});