function displayMessage(newPayload, typeValue) {
    var isUser = isUserMessage(typeValue);
    //var textExists = newPayload.generic;
    if ((newPayload.output && newPayload.output.generic) ||  newPayload.input){
      // Create new message generic elements
      var responses = buildMessageDomElements(newPayload, isUser);
      var chatBoxElement = document.querySelector(settings.selectors.chatBox);
      var previousLatest = chatBoxElement.querySelectorAll((isUser ? settings.selectors.fromUser : settings.selectors.fromWatson) +
        settings.selectors.latest);
      // Previous "latest" message is no longer the most recent
      if (previousLatest) {
        Common.listForEach(previousLatest, function (element) {
          element.classList.remove('latest');
        });
      }
      setResponse(responses, isUser, chatBoxElement, 0, true);
    }
  }
// Display a user or Watson message that has just been sent/received
Display a user or Watson message that has just been sent/received
Display a user or Watson message that has just been sent / received
function displayMessage(newPayload, typeValue) {
    var isUser = isUserMessage(typeValue);
    if ((newPayload.output && newPayload.output.generic) ||  newPayload.input){
      var responses = buildMessageDomElements(newPayload, isUser);
      var chatBoxElement = document.querySelector(settings.selectors.chatBox);
      var previousLatest = chatBoxElement.querySelectorAll((isUser ? settings.selectors.fromUser : settings.selectors.fromWatson) +
        settings.selectors.latest);
      if (previousLatest) {
        Common.listForEach(previousLatest, function (element) {
          element.classList.remove('latest');
        });
      }
      setResponse(responses, isUser, chatBoxElement, 0, true);
    }
  }
function displayMessage ( newPayload , typeValue ) { var isUser = isUserMessage ( typeValue ) ; if ( ( newPayload . output && newPayload . output . generic ) || newPayload . input ) { var responses = buildMessageDomElements ( newPayload , isUser ) ; var chatBoxElement = document . querySelector ( settings . selectors . chatBox ) ; var previousLatest = chatBoxElement . querySelectorAll ( ( isUser ? settings . selectors . fromUser : settings . selectors . fromWatson ) + settings . selectors . latest ) ; if ( previousLatest ) { Common . listForEach ( previousLatest , function ( element ) { element . classList . remove ( 'latest' ) ; } ) ; } setResponse ( responses , isUser , chatBoxElement , 0 , true ) ; } }
Display a user or Watson message that has just been sent/received
Display a user or Watson message that has just been sent / received
//var textExists = newPayload.generic; // Create new message generic elements // Previous "latest" message is no longer the most recent