mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
Moar icons :D
This commit is contained in:
1 parent
59ddb289a8
commit
3ea2530dab
1 file changed
+5
-1
+5
-1
@@ -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);
|
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 to draw data we recieve from ajax requests
|
||||||
function drawcontents(data) {
|
function drawcontents(data) {
|
||||||
@@ -29,6 +31,8 @@ function drawcontents(data) {
|
|||||||
var img = "";
|
var img = "";
|
||||||
if(imagedata[data[i].name]){
|
if(imagedata[data[i].name]){
|
||||||
img = "https://wiki.factorio.com/images/" + imagedata[data[i].name] + ".png"
|
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 + "<tr><td><image src='" + img + "'></td><td>" + data[i].name + "</td><td>" + data[i].count + "</td></tr>";
|
result = result + "<tr><td><image src='" + img + "'></td><td>" + data[i].name + "</td><td>" + data[i].count + "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user