From c6c26a40e0acca1759ceabca25cce09853d3bce0 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Sat, 12 Mar 2011 11:15:59 -0500 Subject: [PATCH 1/5] start window off small but still allow dragging cards far outside the board --- README.markdown | 6 +++--- client/css/style.css | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.markdown b/README.markdown index f69e2a1..51a3052 100644 --- a/README.markdown +++ b/README.markdown @@ -27,7 +27,7 @@ if you are a developer, please fork and submit changes/fixes. 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 ----------------- @@ -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 (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 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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 ------ -ali asaria - [well.ca](http://well.ca) - ali@well.ca +ali asaria - [well.ca](http://well.ca) - ali [at] well.ca diff --git a/client/css/style.css b/client/css/style.css index 0649ea1..1c6d371 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -10,8 +10,8 @@ body { padding-left: 10px; - height: 1400px; - width: 2000px; + xheight: 1400px; + xwidth: 2000px; } #board { From 2870f10968631cb75f3b0596276b2218edf68a15 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Sat, 12 Mar 2011 11:18:06 -0500 Subject: [PATCH 2/5] remove forced sticker z-index so it appears below cards. fixes github issue #3 --- client/css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/css/style.css b/client/css/style.css index 1c6d371..6586869 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -278,7 +278,7 @@ xopacity: .5; .sticker { padding-top: 3px; padding-left: 2px; - z-index:10; + xz-index:10; display: inline; } From ae247f09bf1821319e8dd3d347184f7cfd3fe03b Mon Sep 17 00:00:00 2001 From: ali asaria Date: Sat, 12 Mar 2011 12:04:34 -0500 Subject: [PATCH 3/5] cleaned up some of the scrubbing of xss --- client/lib/jquery.jeditable.js | 8 +++---- server.js | 42 +++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/client/lib/jquery.jeditable.js b/client/lib/jquery.jeditable.js index 365d899..2d19b5a 100644 --- a/client/lib/jquery.jeditable.js +++ b/client/lib/jquery.jeditable.js @@ -279,16 +279,16 @@ } else if ('submit' == settings.onblur) { input.blur(function(e) { /* prevent double submit if submit was clicked */ - t = setTimeout(function() { + //t = setTimeout(function() { form.submit(); - }, 200); + //}, 200); }); //ali here: i hacked this in so that submit happens on mouseout too input.mouseout(function(e) { /* prevent double submit if submit was clicked */ - t = setTimeout(function() { + //t = setTimeout(function() { form.submit(); - }, 200); + //}, 200); }); } else if ($.isFunction(settings.onblur)) { input.blur(function(e) { diff --git a/server.js b/server.js index 8f1d679..016d573 100644 --- a/server.js +++ b/server.js @@ -236,35 +236,47 @@ function scrub( text ) { break; case 'updateColumns': - //@TODO -- scrub each column - getRoom( client, function(room) { - setColumns( room, message.data ); - }); + var columns = 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; case 'changeTheme': - //@TODO -- scrub - message.data = scrub(message.data); + var clean_message = {}; + clean_message.data = scrub(message.data); 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; case 'setUserName': - //@TODO -- scrub - name = scrub(message.data); + var clean_message = {}; - setUserName(client, name); + clean_message.data = scrub(message.data); + + setUserName(client, clean_message.data); var msg = {}; msg.action = 'nameChangeAnnounce'; - msg.data = { sid: client.sessionId, user_name: name }; + msg.data = { sid: client.sessionId, user_name: clean_message.data }; broadcastToRoom( client, msg ); break; @@ -433,9 +445,7 @@ function setColumns ( room, columns ) { async.forEachSeries( columns, function( item, callback ) { - //console.log('rpush: ' + REDIS_PREFIX + '-room:' + room + '-columns' + ' -- ' + item); - item = sanitizer.sanitize(item); - + //console.log('rpush: ' + REDIS_PREFIX + '-room:' + room + '-columns' + ' -- ' + item); redisClient.rpush(REDIS_PREFIX + '-room:' + room + '-columns', item, function (err, res) { callback(); From 6749ffb0fa34f0b07a35cf79c63bde6394152568 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Sat, 12 Mar 2011 12:11:26 -0500 Subject: [PATCH 4/5] this hack prevents http submit of forms when editing-in-place i do this by replacing the
element with a
so the form no longer has default behaviours that need to be overridden by jquery. --- client/lib/jquery.jeditable.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/lib/jquery.jeditable.js b/client/lib/jquery.jeditable.js index 2d19b5a..2fe9537 100644 --- a/client/lib/jquery.jeditable.js +++ b/client/lib/jquery.jeditable.js @@ -177,7 +177,13 @@ $(self).html(''); /* create the form object */ - var 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 = $(''); + var form = $('
'); /* apply css or style or both */ if (settings.cssclass) { From 7f98cac326c59c4196f2aba8263af5a72172b7f7 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Sat, 12 Mar 2011 12:36:30 -0500 Subject: [PATCH 5/5] add a notice that the demo is only a demo this is for visitors who don't read the docs and just arrive at the demo site -- i want them to know that the demo is not the whole product, just an example --- client/css/style.css | 13 +++++++++++ server.js | 52 +++++++++++++++++++++++++------------------- views/index.jade | 3 +++ views/layout.jade | 2 +- 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/client/css/style.css b/client/css/style.css index 6586869..ea2021e 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -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; +} diff --git a/server.js b/server.js index 016d573..d04c5b3 100644 --- a/server.js +++ b/server.js @@ -60,9 +60,16 @@ app.get('/', function(req, res) { }); }); -app.get('/:id', function(req, res){ +app.get('/demo', function(req, res) { 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) } }); }); @@ -572,33 +579,34 @@ function setUserName ( client, name ) } +function cleanAndInitializeDemoRoom() +{ + // DUMMY DATA + redisClient.del(REDIS_PREFIX + '-room:/demo-cards', function (err, res) { + redisClient.del(REDIS_PREFIX + '-room:/demo-columns', function (err, res) { + createColumn( '/demo', 'Not Started' ); + createColumn( '/demo', 'Started' ); + createColumn( '/demo', 'Testing' ); + createColumn( '/demo', 'Review' ); + createColumn( '/demo', 'Complete' ); -// DUMMY DATA -redisClient.del(REDIS_PREFIX + '-room:/demo-cards', function (err, res) { - redisClient.del(REDIS_PREFIX + '-room:/demo-columns', function (err, res) { - createColumn( '/demo', 'Not Started' ); - createColumn( '/demo', 'Started' ); - createColumn( '/demo', 'Testing' ); - createColumn( '/demo', 'Review' ); - createColumn( '/demo', 'Complete' ); + createCard('/demo', 'card1', 'Hello this is fun', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); + createCard('/demo', 'card2', 'Hello this is a new story.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'white'); + createCard('/demo', 'card3', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); + createCard('/demo', 'card4', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); - - createCard('/demo', 'card1', 'Hello this is fun', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); - createCard('/demo', 'card2', 'Hello this is a new story.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'white'); - createCard('/demo', 'card3', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); - createCard('/demo', 'card4', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); - - createCard('/demo', 'card5', 'Hello this is fun', 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', 'card8', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); + createCard('/demo', 'card5', 'Hello this is fun', 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', 'card8', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); + }); }); -}); +} // - +cleanAndInitializeDemoRoom(); diff --git a/views/index.jade b/views/index.jade index 079f1ea..2706ad3 100644 --- a/views/index.jade +++ b/views/index.jade @@ -1,3 +1,6 @@ +- if (locals.demo) + div.notice-bar this is a demo board. to make a private board, go to scrumblr.ca + h1 scrumblr by aliasaria div.board-outline diff --git a/views/layout.jade b/views/layout.jade index 5e17d20..4d06738 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -20,6 +20,6 @@ html(lang="en") - title scrumblr + title= locals.pageTitle body!= body