Skip to content
Permalink
Browse files

Tweak server list style

  • Loading branch information
ShadowNinja committed Jan 10, 2015
1 parent 2a5242e commit bbd3c127f1df6701945d54102e22208bf932c25f
Showing with 24 additions and 8 deletions.
  1. +2 −2 static/list.js
  2. +4 −2 static/servers.jst
  3. +18 −4 static/style.css
@@ -58,7 +58,7 @@ function tooltipString(str, maxLen) {
function hoverList(name, list) {
if (!list || list.length == 0) return '';
var str = '<div class="mts_hover_list">'
str += name + '(' + list.length + ')<br />';
str += name + ' (' + list.length + ')<br />';
for (var i in list) {
str += escapeHTML(list[i]) + '<br />';
}
@@ -74,7 +74,7 @@ function hoverString(name, string) {
}

function draw(json) {
html = window.render.servers(json);
var html = window.render.servers(json);
jQuery(master.output).html(html);
}

@@ -5,7 +5,7 @@
</div>
{{?}}
<table>
<tr>
<thead><tr>
{{? !master.no_address}}<th>Address[:Port]</th>{{?}}
{{? !master.no_clients}}<th>Players / Max{{? !master.no_avgtop}}<br/>Average / Top{{?}}</th>{{?}}
{{? !master.no_version}}<th>Version, Subgame, Mapgenerator</th>{{?}}
@@ -14,7 +14,8 @@
{{? !master.no_flags}}<th>Flags</th>{{?}}
{{? !master.no_uptime}}<th>Uptime, Age</th>{{?}}
{{? !master.no_ping}}<th>Ping, Lag</th>{{?}}
</tr>
</tr></thead>
<tbody>
{{~it.list :server:index}}
{{ if (master.limit && index + 1 > master.limit) break;}}
{{ if (master.min_clients && server.clients < master.min_clients) continue;}}
@@ -68,6 +69,7 @@
</td>{{?}}
</tr>
{{~}}
</tbody>
</table>
{{? master.min_clients || master.limit}}
<a class="clickable" onclick="delete master.min_clients; delete master.limit; get();">More...</a>
@@ -1,3 +1,7 @@
#server_list .total {
font-weight: bold;
}

#server_list table {
max-width: 100%;
width: 100%;
@@ -11,16 +15,25 @@
border: 1px solid gray;
}

tr:hover {
background-color: #f0f0f0;
#server_list thead {
background-color: #FFA;
}

#server_list tbody tr:nth-child(even) {
background-color: #EEE;
}

#server_list tbody tr:hover {
background-color: #CCC;
}

.mts_hover_list {
display: none;
border: gray solid 1px;
border: 1px solid #88F;
border-radius: 4px;
background-color: white;
position: absolute;
z-index: 100;
background-color: white;
padding: 0.5em;
}

@@ -37,3 +50,4 @@ td:hover .mts_hover_list {
text-decoration: underline;
cursor: pointer;
}

0 comments on commit bbd3c12

Please sign in to comment.