13-swipe-p2p chat app/index.js
// Add the message (user or peer) to the chatbox

Add the message (user or peer) to the chatbox
Add the message ( user or peer ) to the chatbox
function addToList(user, message_text) {
	var message = addSmiley(message_text);
    var time = document.getElementById('date_time').innerHTML;
    var chat = document.getElementById('messages');
    var elem = document.createElement('li');
    elem.className = 'media';
    elem.innerHTML = '<div class="media-body"><div class="media"><a class="pull-left" href="#" title="' +
					user + '"><img class="media-object img-circle i-thumbnail" src="assets/img/' +
					user + '.png" /></a><div class="media-body" >' +
					message + '<br /><small class="text-muted timestamp">' +
					time + '</small></div></div></div>';
    chat.appendChild(elem);
	var box = document.getElementById('chat_box');
	box.scrollTop = box.scrollHeight;
}
function addToList ( user , message_text ) { var message = addSmiley ( message_text ) ; var time = document . getElementById ( 'date_time' ) . innerHTML ; var chat = document . getElementById ( 'messages' ) ; var elem = document . createElement ( 'li' ) ; elem . className = 'media' ; elem . innerHTML = '<div class="media-body"><div class="media"><a class="pull-left" href="#" title="' + user + '"><img class="media-object img-circle i-thumbnail" src="assets/img/' + user + '.png" /></a><div class="media-body" >' + message + '<br /><small class="text-muted timestamp">' + time + '</small></div></div></div>' ; chat . appendChild ( elem ) ; var box = document . getElementById ( 'chat_box' ) ; box . scrollTop = box . scrollHeight ; }
Add the message (user or peer) to the chatbox
Add the message ( user or peer ) to the chatbox