From 67c4388a59c91f2403165c42efc2d1e93b4a6e41 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sat, 30 Dec 2017 01:40:59 +0100 Subject: [PATCH] Add first version of driver table --- js/util.js | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/js/util.js b/js/util.js index ed03079..ad6fba4 100644 --- a/js/util.js +++ b/js/util.js @@ -166,16 +166,41 @@ function renderRaceInfoBox(race) { function renderDriverInfoBox(race) { var raceInfo = race.raceInfo; - var circuit = preprocessor.getResults().circuits[raceInfo.circuitId]; + var drivers = race.drivers; console.log(raceInfo); var content = ""; - content = "

"+raceInfo.name+"

"; - content += "
"+circuit.name+" ("+circuit.location+", "+circuit.country+")
"; - content += "
"+raceInfo.date.toLocaleDateString("de-DE")+"
" - content += "
"; - content += "See Race on Wikipedia "; - content += "See Circuit on Wikipedia"; - content += "
"; + // Table header + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + + // Table body + content += ""; + for(var di in drivers) { + var driver = drivers[di]; + console.log(driver); + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + content += ""; + } + content += ""; + content += "
#CodeForenameSurnameNationalityBirthdayWikipedia
"+driver.number+""+driver.code+""+driver.forename+""+driver.surname+""+driver.nationality+""+driver.dob.toLocaleDateString("de-DE")+"Wikipedia
"; + return content; }