commit 38631e5bf458c4c6521d1d1e958062d09cb3c4af Author: cypherpunks cypherpunks@torproject.org Date: Tue May 16 09:09:55 2017 +0000
Remove logging to the console
Closes #22272. --- js/collections/results.js | 13 ----------- js/libs/datatables/dataTables.TorStatus.js | 2 -- js/models/graph.js | 2 -- js/models/relay.js | 11 +++------ js/router.js | 1 - js/views/details/main.js | 2 -- js/views/search/do.js | 36 ++---------------------------- 7 files changed, 5 insertions(+), 62 deletions(-)
diff --git a/js/collections/results.js b/js/collections/results.js index 13cf7ac..c341321 100644 --- a/js/collections/results.js +++ b/js/collections/results.js @@ -20,7 +20,6 @@ define([ this.valid_after = response.valid_after; var relays = []; options.error = function(options) { - console.log('error..'); error(options.error, collection, options); } _.each(response.relays, function(relay, resultsC) { @@ -35,12 +34,10 @@ define([ }); if (relays.length == 0) { error(0); - console.log('Empty result set was returned'); return false; } else if (relays.length > 50) { relays = relays.slice(0, 50); err = 4; - console.log(options); } var lookedUpRelays = 0; _.each(relays, function(relay) { @@ -56,7 +53,6 @@ define([ lookedUp(); }, error: function() { - console.log("error in loading one relay.."); lookedUp(); error(0); } @@ -64,20 +60,11 @@ define([ }); }).error( function(jqXHR, textStatus, errorThrown) { - console.log(jqXHR); if(jqXHR.statusText == "error") { error(2); } else { error(3); } - /* - console.log("jqXHR: " + - jqXHR + " textStauts: " + - textStatus + " errorThrown: " + - errorThrown); - console.log("error in doing query.."); - error(2) - */ } ); } diff --git a/js/libs/datatables/dataTables.TorStatus.js b/js/libs/datatables/dataTables.TorStatus.js index 19b0ee0..b5319ed 100644 --- a/js/libs/datatables/dataTables.TorStatus.js +++ b/js/libs/datatables/dataTables.TorStatus.js @@ -13,8 +13,6 @@ $.fn.dataTableExt.afnFiltering.push( function( oSettings, aData, iDataIndex ) { var iMin = document.getElementById('bw_from').value * 1; var iMax = document.getElementById('bw_from').value * 1; - console.log("iMin: "+iMin+" iMax: "+iMax); - console.log(aData); var iVersion = aData[3] == "-" ? 0 : aData[3]*1;
if ( iMin == "" && iMax == "" ) diff --git a/js/models/graph.js b/js/models/graph.js index 1f356db..668fc6d 100644 --- a/js/models/graph.js +++ b/js/models/graph.js @@ -12,8 +12,6 @@ define([ var first = history[period].first.split(' '); var date = first[0].split('-'); var time = first[1].split(':'); - //console.log(date); - //console.log(time); first = new Date(date[0], date[1]-1, date[2], time[0], time[1], time[2]); var y = first.getTime(); diff --git a/js/models/relay.js b/js/models/relay.js index d53eb81..1cd4f74 100644 --- a/js/models/relay.js +++ b/js/models/relay.js @@ -75,10 +75,6 @@ define([ secs = secs % 60; mins = mins % 60; hours = hours % 24; - // console.log("secs: "+secs); - // console.log("mins: "+mins); - // console.log("hours: "+hours); - // console.log("days: "+days); var hr_date = ""; var hr_date_full = ""; var hr = 0; @@ -135,7 +131,6 @@ define([ var success = options.success; var error = options.error; var model = this; - console.log("doing query.."); var xhr = $.getJSON(this.baseurl+'/details?lookup='+this.fingerprint, function(data) { checkIfDataIsUpToDate(xhr.getResponseHeader("Last-Modified")); var relay = null; @@ -147,7 +142,6 @@ define([ relay.is_bridge = true; } if (relay) { - //console.log(data); relay.contact = relay.contact ? relay.contact : 'undefined'; relay.platform = relay.platform ? relay.platform : null; relay.recommended_version = (typeof relay.recommended_version !== 'undefined') ? relay.recommended_version : null; @@ -180,7 +174,6 @@ define([ relay.uptime = relay.last_restarted ? model.parsedate(relay.last_restarted) : null; relay.uptime_hr = relay.last_restarted ? relay.uptime.hr : null; relay.uptime_hrfull = relay.last_restarted ? relay.uptime.hrfull : null; - //console.log(relay.uptime.hrfull); relay.uptime = relay.last_restarted ? relay.uptime.millisecs : null; relay.last_restarted = relay.last_restarted ? relay.last_restarted : null; relay.last_seen = relay.last_seen ? relay.last_seen : null; @@ -197,7 +190,9 @@ define([ } else { error(model) } - }).error(function() {console.log("error...");error();}); + }).error(function() { + error(); + }); }
}); diff --git a/js/router.js b/js/router.js index 5219c23..769fca9 100644 --- a/js/router.js +++ b/js/router.js @@ -156,7 +156,6 @@ define([ $("#nav-search").submit(function(e){ var query = _.escape($(this).children("input.search-query").val()); query = query.trim(); - console.log(query); $("#suggestion").hide(); document.location = "#search/"+query; return false; diff --git a/js/views/details/main.js b/js/views/details/main.js index 5605c0c..d47899d 100644 --- a/js/views/details/main.js +++ b/js/views/details/main.js @@ -20,7 +20,6 @@ define([ initialize: function() { this.model = new relayModel; this.graph = new graphModel; - //console.log(this.graph); }, plot: function(g, data, labels, legendPos, colors, tickFormat, tooltipFormat) { @@ -173,7 +172,6 @@ define([ }, render: function() { var data = {relay: this.model}; - //console.log(data); var compiledTemplate; if (!this.model) compiledTemplate = _.template(errorDetailsTemplate, data); diff --git a/js/views/search/do.js b/js/views/search/do.js index 8bc38b8..74f38f0 100644 --- a/js/views/search/do.js +++ b/js/views/search/do.js @@ -22,10 +22,6 @@ define([ var iMax = document.getElementById(data.idb).value;
if ( iMin == "" && iMax == "") { - //console.log("True!") - //console.log("RAW: "+rawdata); - //console.log("iMin: "+iMin+" iMax: "+iMax); - //console.log("datafilter:"+datafilter); return true; } else { var rawdata = $(data.aData[data.i]).attr('data-filter'); @@ -33,28 +29,12 @@ define([ }
if ( iMin == "" && datafilter < iMax*1) { - //console.log("True!") - //console.log("RAW: "+rawdata); - //console.log("iMin: "+iMin+" iMax: "+iMax); - //console.log("datafilter:"+datafilter); return true; } else if (iMin*1 <= datafilter && "" == iMax) { - //console.log("True!") - //console.log("RAW: "+rawdata); - //console.log("iMin: "+iMin+" iMax: "+iMax); - //console.log("datafilter:"+datafilter); return true; } else if (iMin*1 <= datafilter && datafilter <= iMax*1) { - //console.log("True!") - //console.log("RAW: "+rawdata); - //console.log("iMin: "+iMin+" iMax: "+iMax); - //console.log("datafilter:"+datafilter); return true; } - //console.log("FALSE!") - //console.log("RAW: "+rawdata); - //console.log("iMin: "+iMin+" iMax: "+iMax); - //console.log("datafilter:"+datafilter);
return false;
@@ -62,12 +42,7 @@ define([ var imagefilter = function(data) { var name = document.getElementById(data.id).value; var result = false; - //console.log(name); if ( name == "" ) { - //console.log("True!") - //console.log("RAW: "+rawdata); - //console.log("iMin: "+iMin+" iMax: "+iMax); - //console.log("datafilter:"+datafilter); return true; } else { var elements = $(data.aData[data.i]); @@ -75,12 +50,9 @@ define([ _.each(elements, function(el) { var datafilter = $(el).attr('title'); if (datafilter != undefined) { - //console.log("Datafilter: "+datafilter); var fRegex = new RegExp(datafilter);
if (name.match(fRegex)) { - console.log("fRegex: "+fRegex); - console.log("name: "+name); result |= true; } else { result |= false; @@ -88,8 +60,7 @@ define([ } });
- if (result == 1) { console.log('TRUE');return true; } - else { console.log("FALSE");return false; } + return (result == 1); }
$.fn.dataTableExt.afnFiltering.push( @@ -112,7 +83,6 @@ define([ idb: "uptime_to", i: 2, transform: function(data) { - console.log(data); return Math.floor(data/1000/3600/24); } }); @@ -129,9 +99,7 @@ define([ i: 5 });
- //console.log(result); - if (result == 1) { return true; } - else { return false; } + return (result == 1); } );