Skip to content

Commit 2ff7f58

Browse files
authored
feat(web): add select all/none for columns & black theme (#2878)
1 parent d6d8ef2 commit 2ff7f58

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

Diff for: web/index.html

+30-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<html>
33
<head>
44
<title>streetmerchant control</title>
5+
<style>
6+
body {
7+
background-color: #222;
8+
color: #DDD;
9+
font-family: sans-serif;
10+
}
11+
a {
12+
color: aquamarine;
13+
}
14+
table th {
15+
width: 25vw;
16+
cursor: pointer;
17+
background-color: #444;
18+
}
19+
</style>
520
<script type="text/javascript">
621
let config;
722
let brands;
@@ -135,15 +150,26 @@
135150

136151
await loadScreenshots();
137152
}
153+
154+
function selectAll(element, columnId) {
155+
const list = document.querySelectorAll("#"+columnId+" input");
156+
const checked = [...list].filter( el => el.checked ).length;
157+
const newValue = (checked==list.length) ? false : true;
158+
159+
for (const htmlElement of list) {
160+
htmlElement.checked = newValue;
161+
}
162+
}
163+
138164
</script>
139165
</head>
140166
<body onload="loadInitial();">
141167
<table>
142168
<tr>
143-
<th>Stores</th>
144-
<th>Brands</th>
145-
<th>Series</th>
146-
<th>Models</th>
169+
<th onclick="selectAll(this, 'storeList');">Stores</th>
170+
<th onclick="selectAll(this, 'brandList');">Brands</th>
171+
<th onclick="selectAll(this, 'seriesList');">Series</th>
172+
<th onclick="selectAll(this, 'modelList');">Models</th>
147173
</tr>
148174
<tr>
149175
<td valign="top" id="storeList"></td>

0 commit comments

Comments
 (0)