bin/ion-dev.js
function(msg) {
    var status = 'success';

    if (msg.type === 'started') {
      status = 'active';
      this.buildingNotification(true);

    } else {

      if (msg.data.reloadApp) {
        this.reloadApp();
        return;
      }

      status = msg.data.diagnosticsHtml ? 'error' : 'success';

      this.buildingNotification(false);

      var diagnosticsEle = document.getElementById('ion-diagnostics');

      // If we have an element but no html created yet
      if (diagnosticsEle && !msg.data.diagnosticsHtml) {
        diagnosticsEle.classList.add('ion-diagnostics-fade-out');

        this.diagnosticsTimerId = setTimeout(function() {
          var diagnosticsEle = document.getElementById('ion-diagnostics');
          if (diagnosticsEle) {
            diagnosticsEle.parentElement.removeChild(diagnosticsEle);
          }
        }, 100);

      } else if (msg.data.diagnosticsHtml) {

        // We don't have an element but we have diagnostics HTML, so create the error

        if (!diagnosticsEle) {
          diagnosticsEle = document.createElement('div');
          diagnosticsEle.id = 'ion-diagnostics';
          diagnosticsEle.className = 'ion-diagnostics-fade-out';
          document.body.insertBefore(diagnosticsEle, document.body.firstChild);
        }

        // Show the last error
        clearTimeout(this.diagnosticsTimerId);
        this.diagnosticsTimerId = setTimeout(function() {
          var diagnosticsEle = document.getElementById('ion-diagnostics');
          if (diagnosticsEle) {
            diagnosticsEle.classList.remove('ion-diagnostics-fade-out');
          }
        }, 24);

        diagnosticsEle.innerHTML = msg.data.diagnosticsHtml
      }
    }

    this.buildStatus(status);
  }
function(msg) {
    var status = 'success';

    if (msg.type === 'started') {
      status = 'active';
      this.buildingNotification(true);

    } else {

      if (msg.data.reloadApp) {
        this.reloadApp();
        return;
      }

      status = msg.data.diagnosticsHtml ? 'error' : 'success';

      this.buildingNotification(false);

      var diagnosticsEle = document.getElementById('ion-diagnostics');

      // If we have an element but no html created yet
      if (diagnosticsEle && !msg.data.diagnosticsHtml) {
        diagnosticsEle.classList.add('ion-diagnostics-fade-out');

        this.diagnosticsTimerId = setTimeout(function() {
          var diagnosticsEle = document.getElementById('ion-diagnostics');
          if (diagnosticsEle) {
            diagnosticsEle.parentElement.removeChild(diagnosticsEle);
          }
        }, 100);

      } else if (msg.data.diagnosticsHtml) {

        // We don't have an element but we have diagnostics HTML, so create the error

        if (!diagnosticsEle) {
          diagnosticsEle = document.createElement('div');
          diagnosticsEle.id = 'ion-diagnostics';
          diagnosticsEle.className = 'ion-diagnostics-fade-out';
          document.body.insertBefore(diagnosticsEle, document.body.firstChild);
        }

        // Show the last error
        clearTimeout(this.diagnosticsTimerId);
        this.diagnosticsTimerId = setTimeout(function() {
          var diagnosticsEle = document.getElementById('ion-diagnostics');
          if (diagnosticsEle) {
            diagnosticsEle.classList.remove('ion-diagnostics-fade-out');
          }
        }, 24);

        diagnosticsEle.innerHTML = msg.data.diagnosticsHtml
      }
    }

    this.buildStatus(status);
  }
function ( msg ) { var status = 'success' ; if ( msg . type === 'started' ) { status = 'active' ; this . buildingNotification ( true ) ; } else { if ( msg . data . reloadApp ) { this . reloadApp ( ) ; return ; } status = msg . data . diagnosticsHtml ? 'error' : 'success' ; this . buildingNotification ( false ) ; var diagnosticsEle = document . getElementById ( 'ion-diagnostics' ) ; // If we have an element but no html created yet if ( diagnosticsEle && ! msg . data . diagnosticsHtml ) { diagnosticsEle . classList . add ( 'ion-diagnostics-fade-out' ) ; this . diagnosticsTimerId = setTimeout ( function ( ) { var diagnosticsEle = document . getElementById ( 'ion-diagnostics' ) ; if ( diagnosticsEle ) { diagnosticsEle . parentElement . removeChild ( diagnosticsEle ) ; } } , 100 ) ; } else if ( msg . data . diagnosticsHtml ) { // We don't have an element but we have diagnostics HTML, so create the error if ( ! diagnosticsEle ) { diagnosticsEle = document . createElement ( 'div' ) ; diagnosticsEle . id = 'ion-diagnostics' ; diagnosticsEle . className = 'ion-diagnostics-fade-out' ; document . body . insertBefore ( diagnosticsEle , document . body . firstChild ) ; } // Show the last error clearTimeout ( this . diagnosticsTimerId ) ; this . diagnosticsTimerId = setTimeout ( function ( ) { var diagnosticsEle = document . getElementById ( 'ion-diagnostics' ) ; if ( diagnosticsEle ) { diagnosticsEle . classList . remove ( 'ion-diagnostics-fade-out' ) ; } } , 24 ) ; diagnosticsEle . innerHTML = msg . data . diagnosticsHtml } } this . buildStatus ( status ) ; }
Process a build update message and display something to the friendly user.
Process a build update message and display something to the friendly user .