mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
/inventory/ now has a search field
This commit is contained in:
1 parent
b520d9611b
commit
bafc8dfc44
3 files changed
+11
-3
No files matched your search
@@ -9,6 +9,7 @@
|
||||
<div id="body">
|
||||
<div id="storage">
|
||||
<h2>Storage</h2>
|
||||
<input type="text" placeholder="search" id="search"></input>
|
||||
<div id="contents">
|
||||
</div>
|
||||
<canvas id="contentGraph" width="200" height="200"></canvas>
|
||||
|
||||
+4
-1
@@ -11,7 +11,10 @@ function drawcontents(data) {
|
||||
} else {
|
||||
img = "https://wiki.factorio.com/images/" + capitalizeFirstLetter(data[i].name) + ".png";
|
||||
}
|
||||
result = result + "<tr><td><image src='" + img + "' onerror='hideThis(this);'></td><td>" + data[i].name + "</td><td>" + data[i].count + "</td></tr>";
|
||||
var searchField = document.querySelector("#search");
|
||||
if(!searchField.value || data[i].name.includes(searchField.value)) {
|
||||
result = result + "<tr><td><image src='" + img + "' onerror='hideThis(this);'></td><td>" + data[i].name + "</td><td>" + data[i].count + "</td></tr>";
|
||||
}
|
||||
}
|
||||
result = result + "</table>"
|
||||
document.getElementById("contents").innerHTML = result;
|
||||
|
||||
+6
-2
@@ -17,8 +17,12 @@ button {
|
||||
http://www.lua-api.factorio.com */
|
||||
background-color: #262626;
|
||||
color: #C8C8C8;
|
||||
}
|
||||
|
||||
}
|
||||
/* search field */
|
||||
#storage > input {
|
||||
background-color:black;
|
||||
width:300px;
|
||||
}
|
||||
#sidenav {
|
||||
position:fixed;
|
||||
left:0px;
|
||||
|
||||
Reference in new issue
Block a user