allow board resizing

This commit is contained in:
Ali Asaria 2011-05-27 01:08:25 -04:00
parent efb28ac4f1
commit 431f0e76d6
3 changed files with 68 additions and 1 deletions

View file

@ -287,6 +287,19 @@ function scrub( text ) {
broadcastToRoom( client, { action: 'addSticker', data: { cardId: cardId, stickerId: stickerId }});
break;
case 'setBoardSize':
var size = {};
size.width = scrub(message.data.width);;
size.height = scrub(message.data.height);
getRoom(client, function(room) {
db.setBoardSize( room, size );
});
broadcastToRoom( client, { action: 'setBoardSize', data: size } );
break;
default:
console.log('unknown action');
@ -346,6 +359,18 @@ function initClient ( client )
}
);
});
db.getBoardSize( room, function(size) {
if (size != null) {
client.send(
{
action: 'setBoardSize',
data: size
}
);
}
});
roommates_clients = rooms.room_clients(room);
roommates = [];