mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
/inventory/ now has a search field
This commit is contained in:
1 parent
b520d9611b
commit
bafc8dfc44
3 files changed
+10
-2
No files matched your search
@@ -9,6 +9,7 @@
|
|||||||
<div id="body">
|
<div id="body">
|
||||||
<div id="storage">
|
<div id="storage">
|
||||||
<h2>Storage</h2>
|
<h2>Storage</h2>
|
||||||
|
<input type="text" placeholder="search" id="search"></input>
|
||||||
<div id="contents">
|
<div id="contents">
|
||||||
</div>
|
</div>
|
||||||
<canvas id="contentGraph" width="200" height="200"></canvas>
|
<canvas id="contentGraph" width="200" height="200"></canvas>
|
||||||
|
|||||||
+4
-1
@@ -11,7 +11,10 @@ function drawcontents(data) {
|
|||||||
} else {
|
} else {
|
||||||
img = "https://wiki.factorio.com/images/" + capitalizeFirstLetter(data[i].name) + ".png";
|
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>"
|
result = result + "</table>"
|
||||||
document.getElementById("contents").innerHTML = result;
|
document.getElementById("contents").innerHTML = result;
|
||||||
|
|||||||
+5
-1
@@ -18,7 +18,11 @@ button {
|
|||||||
background-color: #262626;
|
background-color: #262626;
|
||||||
color: #C8C8C8;
|
color: #C8C8C8;
|
||||||
}
|
}
|
||||||
|
/* search field */
|
||||||
|
#storage > input {
|
||||||
|
background-color:black;
|
||||||
|
width:300px;
|
||||||
|
}
|
||||||
#sidenav {
|
#sidenav {
|
||||||
position:fixed;
|
position:fixed;
|
||||||
left:0px;
|
left:0px;
|
||||||
|
|||||||
Reference in new issue
Block a user