Show very basic info about current race in diagram box
This commit is contained in:
parent
7d7f35d3ca
commit
7bcf0eb078
@ -65,7 +65,7 @@ preprocessor.load(function(data) {
|
||||
// Fetch race data
|
||||
var rdata = slyelement.curRaces.filter(r => r.raceInfo.raceId == raceI)[0];
|
||||
// Put information about race into info box
|
||||
$("#race-infobox").html("joah");
|
||||
$("#race-infobox").html(renderRaceInfoBox(rdata)); // See util.js
|
||||
// Hand off to diagram rendering
|
||||
$("#lineGraphBox").empty();
|
||||
createLineGraph("#lineGraphBox", rdata);
|
||||
@ -126,4 +126,6 @@ preprocessor.load(function(data) {
|
||||
// Select most recent year by default
|
||||
$("#seasonByYearSelector").val($("#seasonByYearSelector option").first().val()).change();
|
||||
|
||||
// Enable tooltips
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
});
|
||||
|
12
js/util.js
12
js/util.js
@ -147,3 +147,15 @@ function getImageFromWikipedia(data,pageName,imagesize,callback){
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function renderRaceInfoBox(race) {
|
||||
var raceInfo = race.raceInfo;
|
||||
//console.log(raceInfo);
|
||||
var content = "";
|
||||
|
||||
content = "<h1 data-toggle=\"tooltip\" data-placement=\"top\" title=\"#"+raceInfo.raceId+"\">"+raceInfo.name+"</h1>";
|
||||
content += "<h5>"+raceInfo.date.toLocaleDateString("de-DE")+"</h5>";
|
||||
content += "<a class=\"btn btn-primary\" target=\"_blank\" href=\""+raceInfo.url+"\" role=\"button\">See on Wikipedia</a>";
|
||||
|
||||
return content;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user