From 6502ea502653c784cf81687a93405d78b082f86d Mon Sep 17 00:00:00 2001 From: Sean Lip Date: Mon, 20 Jun 2016 15:05:39 -0700 Subject: [PATCH] Remove unnecessary logging. --- accessible/clipboard.service.js | 6 ------ accessible/field.component.js | 1 - accessible/tree.service.js | 14 -------------- accessible/utils.service.js | 4 +--- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/accessible/clipboard.service.js b/accessible/clipboard.service.js index dee70dfc0..de9b382a3 100644 --- a/accessible/clipboard.service.js +++ b/accessible/clipboard.service.js @@ -25,7 +25,6 @@ blocklyApp.ClipboardService = ng.core .Class({ constructor: function() { - blocklyApp.debug && console.log('Clipboard service constructed'); this.clipboardBlockXml_ = null; this.clipboardBlockSuperiorConnection_ = null; this.clipboardBlockNextConnection_ = null; @@ -35,7 +34,6 @@ blocklyApp.ClipboardService = ng.core var blockSummary = block.toString(); this.copy(block, false); block.dispose(true); - blocklyApp.debug && console.log('cut'); alert(Blockly.Msg.CUT_BLOCK_MSG + blockSummary); }, copy: function(block, announce) { @@ -43,7 +41,6 @@ blocklyApp.ClipboardService = ng.core this.clipboardBlockSuperiorConnection_ = block.outputConnection || block.previousConnection; this.clipboardBlockNextConnection_ = block.nextConnection; - blocklyApp.debug && console.log('copy'); if (announce) { alert(Blockly.Msg.COPIED_BLOCK_MSG + block.toString()); } @@ -61,7 +58,6 @@ blocklyApp.ClipboardService = ng.core default: connection.connect(reconstitutedBlock.outputConnection); } - blocklyApp.debug && console.log('paste'); alert( Blockly.Msg.PASTED_BLOCK_FROM_CLIPBOARD_MSG + reconstitutedBlock.toString()); @@ -73,7 +69,6 @@ blocklyApp.ClipboardService = ng.core this.markedConnection_.connect( reconstitutedBlock.outputConnection || reconstitutedBlock.previousConnection); - blocklyApp.debug && console.log('paste to marked connection'); if (announce) { alert( Blockly.Msg.PASTED_BLOCK_TO_MARKED_SPOT_MSG + @@ -82,7 +77,6 @@ blocklyApp.ClipboardService = ng.core }, markConnection: function(connection) { this.markedConnection_ = connection; - blocklyApp.debug && console.log('mark connection'); alert(Blockly.Msg.MARKED_SPOT_MSG); }, isCompatibleWithConnection_: function(blockConnection, connection) { diff --git a/accessible/field.component.js b/accessible/field.component.js index 6f5f06284..bb6b4cf07 100644 --- a/accessible/field.component.js +++ b/accessible/field.component.js @@ -128,7 +128,6 @@ blocklyApp.FieldComponent = ng.core return; } if (this.field instanceof Blockly.FieldVariable) { - blocklyApp.debug && console.log(); Blockly.FieldVariable.dropdownChange.call(this.field, text); } else { this.field.setValue(text); diff --git a/accessible/tree.service.js b/accessible/tree.service.js index c7ad06b55..84ac80541 100644 --- a/accessible/tree.service.js +++ b/accessible/tree.service.js @@ -135,13 +135,10 @@ blocklyApp.TreeService = ng.core this.activeDescendantIds_[tree.id] = newActiveDesc.id; }, onWorkspaceToolbarKeypress: function(e, treeId) { - blocklyApp.debug && console.log( - e.keyCode + 'inside TreeService onWorkspaceToolbarKeypress'); switch (e.keyCode) { case 9: // 16,9: shift, tab if (e.shiftKey) { - blocklyApp.debug && console.log('shifttabbing'); // If the previous key is shift, we're shift-tabbing mode. this.focusOnPreviousTree_(treeId); } else { @@ -160,12 +157,10 @@ blocklyApp.TreeService = ng.core if (!node) { blocklyApp.debug && console.log('KeyHandler: no active descendant'); } - blocklyApp.debug && console.log(e.keyCode + ': inside TreeService'); switch (e.keyCode) { case 9: // 16,9: shift, tab if (e.shiftKey) { - blocklyApp.debug && console.log('shifttabbing'); // If the previous key is shift, we're shift-tabbing. this.focusOnPreviousTree_(treeId); } else { @@ -182,7 +177,6 @@ blocklyApp.TreeService = ng.core break; case 37: // Left-facing arrow: go out a level, if possible. If not, do nothing. - blocklyApp.debug && console.log('in left arrow section'); var nextNode = node.parentNode; if (node.tagName == 'BUTTON' || node.tagName == 'INPUT') { nextNode = nextNode.parentNode; @@ -201,7 +195,6 @@ blocklyApp.TreeService = ng.core break; case 38: // Up-facing arrow: go up a level, if possible. If not, do nothing. - blocklyApp.debug && console.log('node passed in: ' + node.id); var prevSibling = this.getPreviousSibling(node); if (prevSibling && prevSibling.tagName != 'H1') { this.setActiveDesc(prevSibling, tree); @@ -213,7 +206,6 @@ blocklyApp.TreeService = ng.core e.stopPropagation(); break; case 39: - blocklyApp.debug && console.log('in right arrow section'); var firstChild = this.getFirstChild(node); if (firstChild) { this.setActiveDesc(firstChild, tree); @@ -227,7 +219,6 @@ blocklyApp.TreeService = ng.core case 40: // Down-facing arrow: go down a level, if possible. // If not, do nothing. - blocklyApp.debug && console.log('preventing propogation'); var nextSibling = this.getNextSibling(node); if (nextSibling) { this.setActiveDesc(nextSibling, tree); @@ -240,7 +231,6 @@ blocklyApp.TreeService = ng.core break; case 13: // If I've pressed enter, I want to interact with a child. - blocklyApp.debug && console.log('enter is pressed'); var activeDesc = node; if (activeDesc) { var children = activeDesc.children; @@ -319,15 +309,12 @@ blocklyApp.TreeService = ng.core } else { var parent = element.parentNode; while (parent) { - blocklyApp.debug && console.log('looping'); if (parent.tagName == 'OL') { break; } if (parent.previousElementSibling) { - blocklyApp.debug && console.log('parent has a sibling!'); var node = parent.previousElementSibling; if (node.tagName == 'LI') { - blocklyApp.debug && console.log('return the sibling of the parent!'); return node; } else { // Find the last list element child of the sibling of the parent. @@ -342,7 +329,6 @@ blocklyApp.TreeService = ng.core }, getLastChild: function(element) { if (!element) { - blocklyApp.debug && console.log('no element'); return element; } else { var childList = element.children; diff --git a/accessible/utils.service.js b/accessible/utils.service.js index 7a1e0d273..5afd89698 100644 --- a/accessible/utils.service.js +++ b/accessible/utils.service.js @@ -29,9 +29,7 @@ var blocklyApp = {}; blocklyApp.UtilsService = ng.core .Class({ - constructor: function() { - blocklyApp.debug && console.log('Utils service constructed'); - }, + constructor: function() {}, generateUniqueId: function() { return 'blockly-' + Blockly.genUid(); },