Permalink
Browse files

Clean up calls to console.log

  • Loading branch information...
1 parent 8c32d93 commit 20f0de86d1c03cc7e76e1415453df1e8e9165d4e @mythmon mythmon committed May 10, 2012
Showing with 3 additions and 16 deletions.
  1. +3 −12 web/js/board.js
  2. +0 −4 web/js/tools.js
View
@@ -262,6 +262,9 @@ var Board = Class.extend({
d.hover = d.hit_test(x, y);
}
+ if (self.drag[id] == undefined) {
+ self.drag[id] = {};
+ }
if (self.drag[id].status == 0) {
self.cur_tool.move(x, y, id);
} else if (self.drag[id].status == 1) {
@@ -309,7 +312,6 @@ var Board = Class.extend({
touchmove: function(self, e) {
var event = e.originalEvent;
- console.log("touchmove");
if (event.changedTouches === undefined) {
throw "Got touch event with unknown API. Giving up.";
@@ -367,7 +369,6 @@ var Board = Class.extend({
self.action = action;
var text = self.serialize(false);
self.curUndo++;
- console.log(self.curUndo);
var diff = self.undoLog.length - self.curUndo;
for (var i=0; i<diff; i++) {
self.undoLog.pop();
@@ -378,15 +379,12 @@ var Board = Class.extend({
undoOverride: function(self, action) {
self.action = action;
var text = self.serialize(false);
- console.log(self.curUndo);
self.undoLog[self.curUndo] = text;
self.replayAdd(action);
},
undo: function(self) {
self.curUndo--;
- console.log(self.curUndo);
- console.log(self.undoLog[self.curUndo]);
if (self.curUndo < 0) {
self.curUndo = 0;
}
@@ -396,8 +394,6 @@ var Board = Class.extend({
redo: function(self) {
self.curUndo++;
- console.log(self.curUndo);
- console.log(self.undoLog[self.curUndo]);
if (self.curUndo > (self.undoLog.length-1)) {
self.curUndo = self.undoLog.length-1;
}
@@ -427,7 +423,6 @@ var Board = Class.extend({
keys = keys.concat(['undoLog', 'curUndo']);
}
var text = JSON.stringify(self, keys);
- console.log(text);
return text;
},
@@ -476,7 +471,6 @@ var Board = Class.extend({
return 'rgb(255, 255, 255)';
}
var c = self.colors.pop();
- console.log('Giving out {0}'.format(c));
return c;
},
@@ -745,7 +739,6 @@ var ProtoWire = ScreenObject.extend({
if (board) {
self.board.elements.push(self);
}
- console.log('Element.init');
self.color = 'rgb(0,0,0)';
},
@@ -1027,8 +1020,6 @@ var Resistor = ProtoResistor.extend({
.appendTo('#selectedinfo');
$('<label style="color: #000">Resistance</label> <input type="text" value="{0}" size="1" />'.format(self.resistance))
.bind('change', function (e) {
- console.log('Changing resistance with ');
- console.log(this);
self.resistance = parseFloat($(this).val());
})
.appendTo(self.widget_elem)
View
@@ -89,7 +89,6 @@ var MoveTool = Tool.extend({
},
drag: function(self, x, y, id, target) {
- console.log('arrow tool.drag, id=' + id);
if (target) {
var dx = x - self.state[id].last_drag.x;
var dy = y - self.state[id].last_drag.y;
@@ -145,7 +144,6 @@ var NodeTool = Tool.extend({
},
click: function(self, x, y, id, target) {
- console.log('NodeTool.click');
self._super(x, y, id, target);
var p = self.board.snap_to(x, y);
var n = new Node(self.board, p.x, p.y);
@@ -175,7 +173,6 @@ var WireTool = Tool.extend({
},
dragstart: function(self, x, y, id, target) {
- console.log('WireTool.dragstart');
self._super(x, y, id, target);
var p = self.board.snap_to(x, y);
if (target && target.type == "node") {
@@ -197,7 +194,6 @@ var WireTool = Tool.extend({
},
dragend: function(self, x, y, id, target) {
- console.log('WireTool.dragend');
self._super(x, y, id, target);
var hit = false;

0 comments on commit 20f0de8

Please sign in to comment.