Skip to content

Instantly share code, notes, and snippets.

@giobyte8
Created April 1, 2015 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giobyte8/56f593c685da24c35354 to your computer and use it in GitHub Desktop.
Save giobyte8/56f593c685da24c35354 to your computer and use it in GitHub Desktop.
Parte 3 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
/**
* Agrega un mensaje a la lista de mensajes
* pertenecientes a la conversacióñ
*/
function appendMessage(msg) {
var humanDate = moment(new Date(msg.date)).calendar();
var html = '<div class="small-11">' +
'<blockquote><h6>' + msg.username + ':</h6>' +
msg.message +
'<cite>' + humanDate + '</cite></blockquote>' +
'</div>';
$('#list-msgs').append( html );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment