commit bd2cdcd476ccc01055762e1cf7713fc45d61cba6 Author: Iain R. Learmonth irl@fsfe.org Date: Tue Nov 14 13:51:27 2017 +0000
Change Top 10 relays to query 50 relays (#23871) --- js/router.js | 11 ++++++----- js/views/search/main.js | 4 ++-- templates/search/main.html | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/js/router.js b/js/router.js index 3c66664..c4966f7 100644 --- a/js/router.js +++ b/js/router.js @@ -13,7 +13,8 @@ define([ // Define the routes for the actions in Atlas 'details/:fingerprint': 'mainDetails', 'search/:query': 'doSearch', - 'top10': 'showTop10', + 'top10': 'showTopRelays', + 'toprelays': 'showTopRelays', // Default '*actions': 'defaultAction' }, @@ -92,19 +93,19 @@ define([ }); } }, - showTop10: function(){ - $(".breadcrumb").html("<li><a href="https://metrics.torproject.org/%5C%22%3EHome</a></li><li><a href="https://metrics.torproject.org/services.html%5C%22%3EServices</a></li><li><a href="#">Relay Search</a></li><li class="active">Top 10 Relays</li>"); + showTopRelays: function(){ + $(".breadcrumb").html("<li><a href="https://metrics.torproject.org/%5C%22%3EHome</a></li><li><a href="https://metrics.torproject.org/services.html%5C%22%3EServices</a></li><li><a href="#">Relay Search</a></li><li class="active">Top Relays</li>");
$("#content").hide(); $(".progress").show();
- doSearchView.collection.url = "https://onionoo.torproject.org/summary?type=relay&order=-consensus_weigh..."; + doSearchView.collection.url = "https://onionoo.torproject.org/summary?type=relay&order=-consensus_weigh..."; doSearchView.collection.lookup({ success: function(err){ doSearchView.relays = doSearchView.collection.models; doSearchView.error = err; doSearchView.render(""); - $("#search-title").text("Top 10 Relays by Consensus Weight"); + $("#search-title").text("Top Relays by Consensus Weight"); $(".progress").hide(); $("#content").show(); }, diff --git a/js/views/search/main.js b/js/views/search/main.js index bfb069b..d5142c2 100644 --- a/js/views/search/main.js +++ b/js/views/search/main.js @@ -14,8 +14,8 @@ define([ var compiledTemplate = _.template(mainSearchTemplate, data); this.el.html(compiledTemplate);
- $("#do-top10").bind('click', function(){ - document.location = "#top10"; + $("#do-top-relays").bind('click', function(){ + document.location = "#toprelays"; return false; });
diff --git a/templates/search/main.html b/templates/search/main.html index aa835f2..13b4a0a 100644 --- a/templates/search/main.html +++ b/templates/search/main.html @@ -4,7 +4,7 @@ with graphs about their past.</p> <form id="home-search"> <div class="input-group"> <input class="search-query form-control" id="query" placeholder="Query" type="text"> - <span class="input-group-btn"><button id="do-search" class="btn btn-primary" type="button">Search</button><button class="btn btn-secondary" type="button" id="do-top10">Top 10</button></span> + <span class="input-group-btn"><button id="do-search" class="btn btn-primary" type="button">Search</button><button class="btn btn-secondary" type="button" id="do-top-relays">Top Relays</button></span> </div> </form> <div class="well">