From b7dff552f0eba23d3a4afe55127be59a7939b2a8 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Sat, 27 Jun 2020 21:12:06 +0200 Subject: [PATCH] cruft: Remove unecessary consolelogs (#4141) --- src/static/js/broadcast.js | 11 ----------- src/static/js/collab_client.js | 2 -- src/static/js/pad.js | 5 ----- src/static/js/timeslider.js | 2 -- tests/frontend/specs/caret.js | 1 - tests/frontend/specs/clear_authorship_colors.js | 2 -- tests/frontend/specs/ordered_list.js | 1 - tests/frontend/specs/redo.js | 2 -- tests/frontend/specs/responsiveness.js | 1 - tests/frontend/specs/unordered_list.js | 1 - 10 files changed, 28 deletions(-) diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js index 380f69d6c..117aab671 100644 --- a/src/static/js/broadcast.js +++ b/src/static/js/broadcast.js @@ -100,7 +100,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro // remove spliced-out lines from DOM for (var i = start; i < start + numRemoved && i < this.currentDivs.length; i++) { - debugLog("removing", this.currentDivs[i].attr('id')); this.currentDivs[i].remove(); } @@ -226,7 +225,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro function loadedNewChangeset(changesetForward, changesetBackward, revision, timeDelta) { var broadcasting = (BroadcastSlider.getSliderPosition() == revisionInfo.latest); - debugLog("broadcasting:", broadcasting, BroadcastSlider.getSliderPosition(), revisionInfo.latest, revision); revisionInfo.addChangeset(revision, revision + 1, changesetForward, changesetBackward, timeDelta); BroadcastSlider.setSliderLength(revisionInfo.latest); if (broadcasting) applyChangeset(changesetForward, revision + 1, false, timeDelta); @@ -261,7 +259,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro padContents.currentRevision = revision; padContents.currentTime += timeDelta * 1000; - debugLog('Time Delta: ', timeDelta) updateTimer(); var authors = _.map(padContents.getActiveAuthors(), function(name) @@ -335,7 +332,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro padContents.targetRevision = newRevision; var self = this; var path = revisionInfo.getPath(padContents.currentRevision, newRevision); - debugLog('newRev: ', padContents.currentRevision, path); hooks.aCallAll('goToRevisionEvent', { rev: newRevision @@ -344,7 +340,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro if (path.status == 'complete') { var cs = path.changesets; - debugLog("status: complete, changesets: ", cs, "path:", path); var changeset = cs[0]; var timeDelta = path.times[0]; for (var i = 1; i < cs.length; i++) @@ -356,7 +351,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro } else if (path.status == "partial") { - debugLog('partial'); var sliderLocation = padContents.currentRevision; // callback is called after changeset information is pulled from server // this may never get called, if the changeset has already been loaded @@ -475,7 +469,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro }, handleResponse: function(data, start, granularity, callback) { - debugLog("response: ", data); var pool = (new AttribPool()).fromJsonable(data.apool); for (var i = 0; i < data.forwardsChangesets.length; i++) { @@ -491,15 +484,12 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro }, handleMessageFromServer: function (obj) { - debugLog("handleMessage:", arguments); - if (obj.type == "COLLABROOM") { obj = obj.data; if (obj.type == "NEW_CHANGES") { - debugLog(obj); var changeset = Changeset.moveOpsToNewPool( obj.changeset, (new AttribPool()).fromJsonable(obj.apool), padContents.apool); @@ -555,7 +545,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro padContents.currentDivs.push(div); $("#innerdocbody").append(div); } - debugLog(padContents.currentDivs); }); // this is necessary to keep infinite loops of events firing, diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index 0031354f6..9b8a8c07e 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -272,8 +272,6 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad) function handleMessageFromServer(evt) { - if (window.console) console.log(evt); - if (!getSocket()) return; if (!evt.data) return; var wrapper = evt; diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 7f1b6d406..9753d68fc 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -278,9 +278,6 @@ function handshake() //if we haven't recieved the clientVars yet, then this message should it be else if (!receivedClientVars && obj.type == "CLIENT_VARS") { - //log the message - if (window.console) console.log(obj); - receivedClientVars = true; //set some client vars @@ -353,8 +350,6 @@ function handshake() //this message advices the client to disconnect if (obj.disconnect) { - console.warn("FORCED TO DISCONNECT"); - console.warn(obj); padconnectionstatus.disconnected(obj.disconnect); socket.disconnect(); diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index 56856cece..21dc4eb40 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -78,8 +78,6 @@ function init() { //route the incoming messages socket.on('message', function(message) { - if(window.console) console.log(message); - if(message.type == "CLIENT_VARS") { handleClientVars(message); diff --git a/tests/frontend/specs/caret.js b/tests/frontend/specs/caret.js index 45c2eb3be..b15dd1597 100644 --- a/tests/frontend/specs/caret.js +++ b/tests/frontend/specs/caret.js @@ -334,6 +334,5 @@ function caretPosition($){ var pos = doc.getSelection(); pos.y = pos.anchorNode.parentElement.offsetTop; pos.x = pos.anchorNode.parentElement.offsetLeft; - console.log(pos); return pos; } diff --git a/tests/frontend/specs/clear_authorship_colors.js b/tests/frontend/specs/clear_authorship_colors.js index 49ac5905d..143a8612d 100644 --- a/tests/frontend/specs/clear_authorship_colors.js +++ b/tests/frontend/specs/clear_authorship_colors.js @@ -39,7 +39,6 @@ describe("clear authorship colors button", function(){ $clearauthorshipcolorsButton.click(); // does the first divs span include an author class? - console.log(inner$("div span").first().attr("class")); var hasAuthorClass = inner$("div span").first().attr("class").indexOf("author") !== -1; //expect(hasAuthorClass).to.be(false); @@ -94,7 +93,6 @@ describe("clear authorship colors button", function(){ $clearauthorshipcolorsButton.click(); // does the first divs span include an author class? - console.log(inner$("div span").first().attr("class")); var hasAuthorClass = inner$("div span").first().attr("class").indexOf("author") !== -1; //expect(hasAuthorClass).to.be(false); diff --git a/tests/frontend/specs/ordered_list.js b/tests/frontend/specs/ordered_list.js index 174baa489..4f81c4564 100644 --- a/tests/frontend/specs/ordered_list.js +++ b/tests/frontend/specs/ordered_list.js @@ -100,7 +100,6 @@ describe("assign ordered list", function(){ }).done(function(){ var $newSecondLine = inner$("div").first().next(); var hasOLElement = $newSecondLine.find("ol li").length === 1; - console.log($newSecondLine.find("ol")); expect(hasOLElement).to.be(true); expect($newSecondLine.text()).to.be("line 2"); var hasLineNumber = $newSecondLine.find("ol").attr("start") === 2; diff --git a/tests/frontend/specs/redo.js b/tests/frontend/specs/redo.js index a8e874da7..be85d44c3 100644 --- a/tests/frontend/specs/redo.js +++ b/tests/frontend/specs/redo.js @@ -25,7 +25,6 @@ describe("undo button then redo button", function(){ $redoButton.click(); // resends foo helper.waitFor(function(){ - console.log(inner$("div span").first().text()); return inner$("div span").first().text() === newString; }).done(function(){ var finalValue = inner$("div").first().text(); @@ -58,7 +57,6 @@ describe("undo button then redo button", function(){ inner$("#innerdocbody").trigger(e); helper.waitFor(function(){ - console.log(inner$("div span").first().text()); return inner$("div span").first().text() === newString; }).done(function(){ var finalValue = inner$("div").first().text(); diff --git a/tests/frontend/specs/responsiveness.js b/tests/frontend/specs/responsiveness.js index dec7b8dce..47386c8ad 100644 --- a/tests/frontend/specs/responsiveness.js +++ b/tests/frontend/specs/responsiveness.js @@ -68,7 +68,6 @@ describe('Responsiveness of Editor', function() { var end = Date.now(); // get the current time var delay = end - start; // get the delay as the current time minus the start time - console.log('delay:', delay); expect(delay).to.be.below(200); done(); }, 1000); diff --git a/tests/frontend/specs/unordered_list.js b/tests/frontend/specs/unordered_list.js index c3010c353..2af843d61 100644 --- a/tests/frontend/specs/unordered_list.js +++ b/tests/frontend/specs/unordered_list.js @@ -97,7 +97,6 @@ describe("keep unordered list on enter key", function(){ }).done(function(){ var $newSecondLine = inner$("div").first().next(); var hasULElement = $newSecondLine.find("ul li").length === 1; - console.log($newSecondLine.find("ul").length); expect(hasULElement).to.be(true); expect($newSecondLine.text()).to.be("line 2"); done();