From 3ea2530dab5114e486d7925341ce7432d5b6eb63 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Fri, 21 Oct 2016 11:04:48 +0200 Subject: [PATCH] Moar icons :D --- static/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/main.js b/static/main.js index 3139d400..f62b5481 100644 --- a/static/main.js +++ b/static/main.js @@ -20,7 +20,9 @@ function hashColor(str) { return "#" + ("0" + r.toString(16)).substr(-2) + ("0" + g.toString(16)).substr(-2) + ("0" + b.toString(16)).substr(-2); } - +function capitalizeFirstLetter(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} // function to draw data we recieve from ajax requests function drawcontents(data) { @@ -29,6 +31,8 @@ function drawcontents(data) { var img = ""; if(imagedata[data[i].name]){ img = "https://wiki.factorio.com/images/" + imagedata[data[i].name] + ".png" + } else { + img = "https://wiki.factorio.com/images/" + capitalizeFirstLetter(data[i].name) + ".png"; } result = result + "" + data[i].name + "" + data[i].count + ""; }