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
/** css and js static routes */ | |
app.get('/css/foundation.min.css', function (req, res) { | |
res.sendFile(__dirname + '/views/css/foundation.min.css'); | |
}); | |
app.get('/css/normalize.css', function (req, res) { | |
res.sendFile(__dirname + '/views/css/normalize.css'); | |
}); | |
app.get('/css/chat.css', function (req, res) { |
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
/** | |
* Chat SS Styles | |
* | |
* @author : DiganmeGiovanni | https://twitter.com/DiganmeGiovanni | |
* @Updated at: Aug 16, 2015; | |
*/ | |
@import url(http://fonts.googleapis.com/css?family=Roboto:400,700); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Chat room</title> | |
<link rel="stylesheet" href="css/normalize.css"> | |
<link rel="stylesheet" href="css/foundation.min.css"> | |
<link rel="stylesheet" href="css/chat.css"> |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required | |
Plugin 'VundleVim/Vundle.vim' |
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
# Giovanni Color Scheme for Cmus player ... | |
# | |
# This theme is designed to be 1) Very readable on high-resolution or blurry | |
# displays (dying CRTs and TVs, for example). 2) Be more accessable to color- | |
# blind people, by removing chroma cues in favor of brightness and color | |
# inversion. 3) Show how to incorperate named and numbered colors into a | |
# single theme. 4) Provide a stating point for creating other mono-chromatic | |
# themes. | |
# | |
# Questions, comments (just a heads-up that you use/like this, especially), |
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
/** JSON Sobre el usuario conectado al sistema */ | |
var user = {}; | |
$(document).foundation(); | |
$(document).ready(function () { | |
$('#login-modal').foundation('reveal', 'open'); | |
}); | |
/** | |
* Autentica a un usuario en el servidor mediante |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Chat room</title> | |
<link rel="stylesheet" href="css/normalize.css"> | |
<link rel="stylesheet" href="css/foundation.min.css"> | |
</head> | |
<body> |
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
/** | |
* Emitimos un evento de tipo 'chat message' cada vez | |
* que se presiona 'Enter' en el textarea y enviamos | |
* su contenido como mensaje al servidor. | |
*/ | |
$('#new-msg').keyup(function (evt) { | |
if (evt.keyCode === 13) { | |
var nmsg = { | |
username : user._id, | |
message : $('#new-msg').val() |
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>' + |
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
/** | |
* Cuando el servidor envia los ultimos mensajes registrados | |
* se reciben a través de este evento. | |
* Cada mensaje se agrega a la lista de mensajes en la vista | |
* de la conversación. | |
*/ | |
socket.on('latest messages', function (messages) { | |
for (var i = messages.length - 1; i >= 0; i--) { | |
appendMessage(messages[i]); | |
}; |