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..ea2021e 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 { @@ -278,7 +278,7 @@ xopacity: .5; .sticker { padding-top: 3px; padding-left: 2px; - z-index:10; + xz-index:10; 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; +} diff --git a/client/lib/jquery.jeditable.js b/client/lib/jquery.jeditable.js index 365d899..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) { @@ -279,16 +285,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/lib/data.js b/lib/data.js index cd05b55..d6549a3 100644 --- a/lib/data.js +++ b/lib/data.js @@ -17,7 +17,6 @@ var db = function(callback) { db.prototype = { clearRoom: function(room, callback) { -console.log('here',room); this.rooms.remove({name:room},callback); }, diff --git a/server.js b/server.js index 3392c63..8606ded 100644 --- a/server.js +++ b/server.js @@ -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', { - 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; 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; @@ -447,9 +466,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(); @@ -594,16 +611,10 @@ function setUserName ( client, name ) console.dir(sids_to_user_names); } - - - -// DUMMY DATA -/* -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() { +function cleanAndInitializeDemoRoom() +{ + // DUMMY DATA + db.clearRoom('/demo', function() { createColumn( '/demo', 'Not Started' ); createColumn( '/demo', 'Started' ); 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', 'card7', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); createCard('/demo', 'card8', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); - }); -}); -/* }); -}); -*/ +} // - +var db = new data.db(function() { + 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