merged with upstream

This commit is contained in:
David Dunlop 2011-03-12 14:54:02 -05:00
commit afe96eeec1
7 changed files with 77 additions and 47 deletions

View file

@ -27,7 +27,7 @@ if you are a developer, please fork and submit changes/fixes.
browser support browser support
--------------- ---------------
scrumblr works on up to date chrome and firefox browsers. enable websockets for optimal performance. tested mainly on chrome for osx. this was not designed for browser support. scrumblr works on up to date chrome and firefox browsers. enable websockets for optimal performance. tested mainly on chrome for osx. this was not designed for browser support. use chrome for this app.
design philosophy design philosophy
----------------- -----------------
@ -64,7 +64,7 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
Foobar is distributed in the hope that it will be useful, scrumblr is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
@ -78,4 +78,4 @@ the *images* used in scrumblr, however are licensed under cc non commercial node
author author
------ ------
ali asaria - [well.ca](http://well.ca) - ali@well.ca ali asaria - [well.ca](http://well.ca) - ali [at] well.ca

View file

@ -10,8 +10,8 @@ body {
padding-left: 10px; padding-left: 10px;
height: 1400px; xheight: 1400px;
width: 2000px; xwidth: 2000px;
} }
#board { #board {
@ -278,7 +278,7 @@ xopacity: .5;
.sticker { .sticker {
padding-top: 3px; padding-top: 3px;
padding-left: 2px; padding-left: 2px;
z-index:10; xz-index:10;
display: inline; display: inline;
} }
@ -451,3 +451,16 @@ input:hover {
} }
.notice-bar {
xbackground-color: #ccc;
opacity: .2;
padding: 0;
margin: 0;
xtext-align: center;
margin-left: 300px;
}
.notice-bar a {
color: #333;
}

View file

@ -177,7 +177,13 @@
$(self).html(''); $(self).html('');
/* create the form object */ /* create the form object */
var form = $('<form />'); /* #########################
###################
##################
Big HACK by ali: i make the form a div so that it no longer has default
submit behaviours -- because we don't want HTTP submissions to happen */
//var form = $('<form />');
var form = $('<div />');
/* apply css or style or both */ /* apply css or style or both */
if (settings.cssclass) { if (settings.cssclass) {
@ -279,16 +285,16 @@
} else if ('submit' == settings.onblur) { } else if ('submit' == settings.onblur) {
input.blur(function(e) { input.blur(function(e) {
/* prevent double submit if submit was clicked */ /* prevent double submit if submit was clicked */
t = setTimeout(function() { //t = setTimeout(function() {
form.submit(); form.submit();
}, 200); //}, 200);
}); });
//ali here: i hacked this in so that submit happens on mouseout too //ali here: i hacked this in so that submit happens on mouseout too
input.mouseout(function(e) { input.mouseout(function(e) {
/* prevent double submit if submit was clicked */ /* prevent double submit if submit was clicked */
t = setTimeout(function() { //t = setTimeout(function() {
form.submit(); form.submit();
}, 200); //}, 200);
}); });
} else if ($.isFunction(settings.onblur)) { } else if ($.isFunction(settings.onblur)) {
input.blur(function(e) { input.blur(function(e) {

View file

@ -17,7 +17,6 @@ var db = function(callback) {
db.prototype = { db.prototype = {
clearRoom: function(room, callback) { clearRoom: function(room, callback) {
console.log('here',room);
this.rooms.remove({name:room},callback); this.rooms.remove({name:room},callback);
}, },

View file

@ -66,9 +66,16 @@ app.get('/', function(req, res) {
}); });
}); });
app.get('/:id', function(req, res){ app.get('/demo', function(req, res) {
res.render('index.jade', { res.render('index.jade', {
locals: {pageTitle: 'scrumblr'} locals: {pageTitle: 'scrumblr - demo', demo: true}
});
});
app.get('/:id', function(req, res){
res.render('index.jade', {
locals: {pageTitle: ('scrumblr - ' + req.params.id) }
}); });
}); });
@ -242,35 +249,47 @@ function scrub( text ) {
break; break;
case 'updateColumns': case 'updateColumns':
//@TODO -- scrub each column var columns = message.data;
getRoom( client, function(room) {
setColumns( room, message.data );
});
broadcastToRoom( client, message ); if (!(columns instanceof Array))
break;
var clean_columns = [];
for (i in columns)
{
clean_columns[i] = scrub( columns[i] );
}
setColumns( room, clean_columns );
broadcastToRoom( client, { action: 'updateColumns', data: clean_columns } );
break; break;
case 'changeTheme': case 'changeTheme':
//@TODO -- scrub var clean_message = {};
message.data = scrub(message.data); clean_message.data = scrub(message.data);
getRoom( client, function(room) { getRoom( client, function(room) {
setTheme( room, message.data ); setTheme( room, clean_message.data );
}); });
broadcastToRoom( client, message ); clean_message.action = 'changeTheme';
broadcastToRoom( client, clean_message );
break; break;
case 'setUserName': case 'setUserName':
//@TODO -- scrub var clean_message = {};
name = scrub(message.data);
setUserName(client, name); clean_message.data = scrub(message.data);
setUserName(client, clean_message.data);
var msg = {}; var msg = {};
msg.action = 'nameChangeAnnounce'; msg.action = 'nameChangeAnnounce';
msg.data = { sid: client.sessionId, user_name: name }; msg.data = { sid: client.sessionId, user_name: clean_message.data };
broadcastToRoom( client, msg ); broadcastToRoom( client, msg );
break; break;
@ -447,9 +466,7 @@ function setColumns ( room, columns ) {
async.forEachSeries( async.forEachSeries(
columns, columns,
function( item, callback ) { function( item, callback ) {
//console.log('rpush: ' + REDIS_PREFIX + '-room:' + room + '-columns' + ' -- ' + item); //console.log('rpush: ' + REDIS_PREFIX + '-room:' + room + '-columns' + ' -- ' + item);
item = sanitizer.sanitize(item);
redisClient.rpush(REDIS_PREFIX + '-room:' + room + '-columns', item, redisClient.rpush(REDIS_PREFIX + '-room:' + room + '-columns', item,
function (err, res) { function (err, res) {
callback(); callback();
@ -594,16 +611,10 @@ function setUserName ( client, name )
console.dir(sids_to_user_names); console.dir(sids_to_user_names);
} }
function cleanAndInitializeDemoRoom()
{
// DUMMY DATA
// DUMMY DATA db.clearRoom('/demo', function() {
/*
redisClient.del(REDIS_PREFIX + '-room:/demo-cards', function (err, res) {
redisClient.del(REDIS_PREFIX + '-room:/demo-columns', function (err, res) {
*/
var db = new data.db(function() {
db.clearRoom('/demo', function() {
createColumn( '/demo', 'Not Started' ); createColumn( '/demo', 'Not Started' );
createColumn( '/demo', 'Started' ); createColumn( '/demo', 'Started' );
createColumn( '/demo', 'Testing' ); createColumn( '/demo', 'Testing' );
@ -620,16 +631,14 @@ var db = new data.db(function() {
createCard('/demo', 'card6', 'Hello this is a new card.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); createCard('/demo', 'card6', 'Hello this is a new card.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow');
createCard('/demo', 'card7', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); createCard('/demo', 'card7', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue');
createCard('/demo', 'card8', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); createCard('/demo', 'card8', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green');
});
});
/*
}); });
}); }
*/
// //
var db = new data.db(function() {
cleanAndInitializeDemoRoom();
});

View file

@ -1,3 +1,6 @@
- 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>
h1 <a href="http://scrumblr.ca">scrumblr</a> by <a href="http://aliasaria.ca">aliasaria</a> h1 <a href="http://scrumblr.ca">scrumblr</a> by <a href="http://aliasaria.ca">aliasaria</a>
div.board-outline div.board-outline

View file

@ -20,6 +20,6 @@ html(lang="en")
<link href='http://fonts.googleapis.com/css?family=Rock+Salt' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Rock+Salt' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Covered+By+Your+Grace' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Covered+By+Your+Grace' rel='stylesheet' type='text/css'>
title scrumblr title= locals.pageTitle
body!= body body!= body