From de4815df15909ecb7f86bef5f92a381cd239412f Mon Sep 17 00:00:00 2001 From: darksurfer Date: Tue, 12 Jun 2012 18:16:25 +0300 Subject: [PATCH 1/2] update lib/data/mongodb.js Sorry a pull request again to remove the line to correct setBoardSize function with mondoDB --- lib/data/mongodb.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/data/mongodb.js b/lib/data/mongodb.js index 59b357c..23a2127 100644 --- a/lib/data/mongodb.js +++ b/lib/data/mongodb.js @@ -164,7 +164,6 @@ db.prototype = { ); }, setBoardSize: function(room, size) { - this.room.findOne({name:room}) this.rooms.update( {name:room}, {$set:{'size':size}} From 203e5404fb7c7ebb144ecb8c42c844c60e03332a Mon Sep 17 00:00:00 2001 From: Timothy Boronczyk Date: Wed, 3 Jul 2013 12:57:23 -0700 Subject: [PATCH 2/2] ESC key cancels card drag if one accidentally starts to drag a card (sensitive touchpad, cruddy mouse, etc.) --- client/script.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/client/script.js b/client/script.js index e7fe575..7dd8c96 100644 --- a/client/script.js +++ b/client/script.js @@ -3,7 +3,7 @@ var totalcolumns = 0; var columns = []; var currentTheme = "bigcards"; var boardInitialized = false; - +var keyTrap = null; var socket = io.connect(); @@ -154,7 +154,9 @@ function getMessage( m ) } - +$(document).bind('keyup', function(event) { + keyTrap = event.which; +}); function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed) { @@ -185,12 +187,25 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed) snap: false, snapTolerance: 5, containment: [0,0,2000,2000], - stack: ".card" + stack: ".card", + start: function (event, ui) { + keyTrap = null; + }, + drag: function (event, ui) { + if (keyTrap == 27) { + ui.helper.css(ui.originalPosition); + return false; + } + } } ); - + //After a drag: card.bind( "dragstop", function(event, ui) { + if (keyTrap == 27) { + keyTrap = null; + return; + } var data = { id: this.id,