From 3932f996dce1fb97fec9463d95fbef765319b37f Mon Sep 17 00:00:00 2001 From: Lavender Date: Sat, 27 Mar 2021 20:42:29 -0700 Subject: [PATCH] Change formatting --- main.js | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/main.js b/main.js index 6e61053..14bf9b6 100644 --- a/main.js +++ b/main.js @@ -1,38 +1,39 @@ var request = new XMLHttpRequest() -request.open("GET", "https://cors-proxy.blaseball-reference.com/database/allTeams", true) +request.open( + "GET", + "https://cors-proxy.blaseball-reference.com/database/allTeams", + true) request.send(); request.onload = function() { var teams = JSON.parse(this.response) var totals = teams.map(team => team.lineup.length + team.rotation.length) // Get all player counts that there are from greatest to least - var playercounts = totals.slice().sort( - function (x, y) { - return y - x - } - ).filter( - function (item, pos, array) { - return !pos || item != array[pos - 1] - } - ) + var playercounts = totals.slice().sort(function (x, y) { + return y - x + }).filter(function (item, pos, array) { + return !pos || item != array[pos - 1] + }) // Now make headers & lists for all the player counts playercounts.forEach(function(item) { - document.body.insertAdjacentHTML("beforeend", "

" - + item - + " players

") + document.body.insertAdjacentHTML("beforeend", + "

" + + item + + " players

") }) // Put the teams in the lists teams.forEach(function(item, pos) { - document.getElementById("tlist" + totals[pos]).insertAdjacentHTML("beforeend", "
  • " - + item.fullName - + " (" - + item.lineup.length - + " hitters, " - + item.rotation.length - + " pitchers)
  • ") + document.getElementById("tlist" + totals[pos]).insertAdjacentHTML("beforeend", + "
  • " + + item.fullName + + " (" + + item.lineup.length + + " hitters, " + + item.rotation.length + + " pitchers)
  • ") }) document.getElementById("progress").remove()