Commit 8f2863f8 authored by ali asaria's avatar ali asaria
Browse files

upgrade socket.io and express.js

required some retooling of how everything is setup
parent 08f86a05
......@@ -17,7 +17,7 @@
"async": "~0.9.0",
"redis": "~0.12.1",
"sanitizer": "~0.1.1",
"socket.io": "0.8.x",
"socket.io": "1.x",
"simplesets": "~1.2.0",
"express": "4.x",
"jade": "~1.5.0"
......
......@@ -20,31 +20,15 @@ var data = require('./lib/data.js').db;
var sids_to_user_names = [];
/**************
SETUP
SETUP EXPRESS
**************/
var app = express();
app.configure( function(){
app.use(express.static(__dirname + '/client'));
app.use(express.bodyParser());
//app.use(express.cookieParser());
//Cookies are not really needed... but may be in the future?
app.use(express.cookieParser());
app.use(
express.session({
key: "scrumscrum-cookie",
secret: "kookoorikoo",
// store: session_store,
cookie: { path: '/', httpOnly: true, maxAge: 14400000 }
})
);
});
app.listen(process.argv[2] || 8124);
app.use(express.static(__dirname + '/client'));
var server = require('http').Server(app);
server.listen(process.argv[2] || 8080);
//app.listen(process.argv[2] || 8080);
/**************
ROUTES
......@@ -53,21 +37,21 @@ app.get('/', function(req, res) {
//console.log(req.header('host'));
url = req.header('host');
res.render('home.jade', {
layout: false,
locals: {url: url}
url: url
});
});
app.get('/demo', function(req, res) {
res.render('index.jade', {
locals: {pageTitle: 'scrumblr - demo', demo: true}
pageTitle: 'scrumblr - demo',
demo: true
});
});
app.get('/:id', function(req, res){
res.render('index.jade', {
locals: {pageTitle: ('scrumblr - ' + req.params.id) }
pageTitle: ('scrumblr - ' + req.params.id)
});
});
......@@ -75,24 +59,8 @@ app.get('/:id', function(req, res){
/**************
SOCKET.I0
**************/
//I limit the number of potential transports because xhr was causing trouble
//with frequent disconnects
var socketio_options = {
transports: ['websocket', 'flashsocket', 'htmlfile', 'jsonp-polling']
};
// socket.io SETUP
var io = require('socket.io').listen(app);
io.configure(function () {
io.set('transports', [
'websocket'
, 'flashsocket'
, 'htmlfile'
// , 'xhr-polling'
, 'jsonp-polling'
]);
io.set('log level', 1);
});
var io = require('socket.io')(server);
io.sockets.on('connection', function (client) {
//santizes text
function scrub( text ) {
......
- if (locals.demo)
div.notice-bar this is a demo board. to make a private board, go to <a href="http://scrumblr.ca">scrumblr.ca</a>
extends layout
h1 <a href="http://scrumblr.ca">scrumblr</a> by <a href="http://aliasaria.ca">aliasaria</a>
block body
- if (locals.demo)
div.notice-bar this is a demo board. to make a private board, go to <a href="http://scrumblr.ca">scrumblr.ca</a>
div.board-outline
div#board
div#board-doodles
image#marker(src='/images/marker.png')
image#eraser(src='/images/eraser.png')
h1 <a href="http://scrumblr.ca">scrumblr</a> by <a href="http://aliasaria.ca">aliasaria</a>
div.board-outline
div#board
div#board-doodles
image#marker(src='/images/marker.png')
image#eraser(src='/images/eraser.png')
table#board-table.board-table
tr
td#icon-col(width='1%')
image#add-col.col-icon(width='20', height='20', src='/images/icons/iconic/raster/black/plus_alt_32x32.png')
image#delete-col.col-icon(width='20', height='20', src='/images/icons/iconic/raster/black/minus_alt_32x32.png')
table#board-table.board-table
tr
td#icon-col(width='1%')
image#add-col.col-icon(width='20', height='20', src='/images/icons/iconic/raster/black/plus_alt_32x32.png')
image#delete-col.col-icon(width='20', height='20', src='/images/icons/iconic/raster/black/minus_alt_32x32.png')
div.buttons
image#create-card.bottom-icon(width='24', height='24', src='/images/icons/iconic/raster/black/plus_alt_24x24.png')
image#smallify.bottom-icon(width="23",height="23",src="/images/icons/cc/black/png/zoom_icon&24.png")
div.buttons
image#create-card.bottom-icon(width='24', height='24', src='/images/icons/iconic/raster/black/plus_alt_24x24.png')
image#smallify.bottom-icon(width="23",height="23",src="/images/icons/cc/black/png/zoom_icon&24.png")
div.stickers
div.sticker#sticker-red
image(src="/images/stickers/sticker-red.png")
div.sticker#sticker-blue
image(src="/images/stickers/sticker-blue.png")
div.sticker#sticker-yellow
image(src="/images/stickers/sticker-yellow.png")
div.sticker#sticker-green
image(src="/images/stickers/sticker-green.png")
br
div.sticker#sticker-pink
image(src="/images/stickers/sticker-pink.png")
div.sticker#sticker-lightblue
image(src="/images/stickers/sticker-lightblue.png")
div.sticker#sticker-orange
image(src="/images/stickers/sticker-orange.png")
div.sticker#sticker-purple
image(src="/images/stickers/sticker-purple.png")
br
div.sticker#nosticker
image(src="/images/stickers/sticker-deletestar.png")
//br
//div.sticker#sticker-gold
// image(src="/images/stickers/sticker-gold.png")
//div.sticker#sticker-bluestar
// image(src="/images/stickers/sticker-bluestar.png")
//div.sticker#sticker-silverstar
// image(src="/images/stickers/sticker-silverstar.png")
//div.sticker#sticker-redstar
// image(src="/images/stickers/sticker-redstar.png")
div.stickers
div.sticker#sticker-red
image(src="/images/stickers/sticker-red.png")
div.sticker#sticker-blue
image(src="/images/stickers/sticker-blue.png")
div.sticker#sticker-yellow
image(src="/images/stickers/sticker-yellow.png")
div.sticker#sticker-green
image(src="/images/stickers/sticker-green.png")
br
div.sticker#sticker-pink
image(src="/images/stickers/sticker-pink.png")
div.sticker#sticker-lightblue
image(src="/images/stickers/sticker-lightblue.png")
div.sticker#sticker-orange
image(src="/images/stickers/sticker-orange.png")
div.sticker#sticker-purple
image(src="/images/stickers/sticker-purple.png")
br
div.sticker#nosticker
image(src="/images/stickers/sticker-deletestar.png")
//br
//div.sticker#sticker-gold
// image(src="/images/stickers/sticker-gold.png")
//div.sticker#sticker-bluestar
// image(src="/images/stickers/sticker-bluestar.png")
//div.sticker#sticker-silverstar
// image(src="/images/stickers/sticker-silverstar.png")
//div.sticker#sticker-redstar
// image(src="/images/stickers/sticker-redstar.png")
div.names
p connected:
//image#user-icon(src="/images/icons/cc/black/png/user_icon&16.png")
input#yourname-input
span.you-text (you)
ul#names-ul
div.names
p connected:
//image#user-icon(src="/images/icons/cc/black/png/user_icon&16.png")
input#yourname-input
span.you-text (you)
ul#names-ul
//<div style="width: 980px; height: 450px; border: solid 2px; opacity:.1; margin-top: 100px"> this will be the backlog that only appears on drag or perhaps not at all</div>
//<div style="width: 980px; height: 450px; border: solid 2px; opacity:.1; margin-top: 100px"> this will be the backlog that only appears on drag or perhaps not at all</div>
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-2069672-4']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
\ No newline at end of file
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-2069672-4']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
\ No newline at end of file
......@@ -27,4 +27,5 @@ html(lang="en")
title= locals.pageTitle
body!= body
body
block body
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment