war/src/main/webapp/scripts/hudson-behavior.js
/*
redirects to a page once the page is ready.

    @param url
        Specifies the URL to redirect the user.
*/
redirects to a page once the page is ready.
@param url
Specifies the URL to redirect the user.
redirects to a page once the page is ready . @param url Specifies the URL to redirect the user .
function applySafeRedirector(url) {
    var i=0;
    new PeriodicalExecuter(function() {
      i = (i+1)%4;
      var s = "";
      var j=0;
      for( j=0; j<i; j++ )
        s+='.';
      s+="<span style='visibility:hidden'>";
      for( ; j<4; j++ )
        s+='.';
      s+="</span>";
      $('progress').innerHTML = s;
    },1);
    window.setTimeout(function() {
      var statusChecker = arguments.callee;
        new Ajax.Request(url, {
            method: "get",
            onFailure: function(rsp) {
                if(rsp.status==503 && rsp.getHeader("X-Jenkins-Interactive")==null) {
                  window.setTimeout(statusChecker,5000);
                } else {
                  window.location.replace(url);
                }
            },
            onSuccess: function(rsp) {
                if(rsp.status!=200) {
                    window.setTimeout(statusChecker,5000);
                } else {
                    window.location.replace(url);
                }
            }
        });
    }, 5000);
}
function applySafeRedirector ( url ) { var i = 0 ; new PeriodicalExecuter ( function ( ) { i = ( i + 1 ) % 4 ; var s = "" ; var j = 0 ; for ( j = 0 ; j < i ; j ++ ) s += '.' ; s += "<span style='visibility:hidden'>" ; for ( ; j < 4 ; j ++ ) s += '.' ; s += "</span>" ; $ ( 'progress' ) . innerHTML = s ; } , 1 ) ; window . setTimeout ( function ( ) { var statusChecker = arguments . callee ; new Ajax . Request ( url , { method : "get" , onFailure : function ( rsp ) { if ( rsp . status == 503 && rsp . getHeader ( "X-Jenkins-Interactive" ) == null ) { window . setTimeout ( statusChecker , 5000 ) ; } else { window . location . replace ( url ) ; } } , onSuccess : function ( rsp ) { if ( rsp . status != 200 ) { window . setTimeout ( statusChecker , 5000 ) ; } else { window . location . replace ( url ) ; } } } ) ; } , 5000 ) ; }
redirects to a page once the page is ready.
redirects to a page once the page is ready .
// put the rest of dots as hidden so that the layout doesn't change // depending on the # of dots. // redirect as long as we are still loading // if connection fails, somehow Prototype thinks it's a success