Created
April 1, 2015 03:31
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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