This repository has been archived by the owner on Feb 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
current_players.html
92 lines (84 loc) · 2.71 KB
/
current_players.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!-- #include file="header.inc" -->
<div id="content">
<h2><%page.title%></h2>
<div class="section narrow">
<table id="players" class="grid">
<thead>
<tr>
<th> </th>
<th><a href="<%page.fulluri%>?sortby=name&reverse=<%reverse.name%>" class="sortable <%sorted.name%>">Player name</a></th>
<th>Perk</th>
<th>Level</th>
<th><a href="<%page.fulluri%>?sortby=ping&reverse=<%reverse.ping%>" class="sortable <%sorted.ping%>">Ping</a></th>
<th>IP</th>
<th title="The unique ID for this game account.">Unique Net ID</th>
<th>Steam ID</th>
<th title="The Steam community ID.">Community ID</th>
<th>Admin</th>
<th title="Spectator">Spec.</th>
<th>Controls</th>
</tr>
</thead>
<tbody>
<%players%>
</tbody>
</table>
</div>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
if ($("#players td").size() <= 1) return;
$("#players th a").each(function(){
jthis = $(this);
jthis.before(jthis.html());
jthis.remove();
});
$("#players th").wrapInner("<span></span>");
$("#players").tablesorter({sortList:[[1,0]], widgets: ['zebra'], headers: { 9: {sorter: false} }});
$("#players form").each(function(i){
var frm = $(this);
frm.submit(function() {
$.ajax({
type: "POST",
url: '<%page.fulluri%>+data',
data: {ajax: 1, action: $('[name="action"]', frm).val(), playerkey: $('[name="playerkey"]', frm).val()},
success: actionSuccess,
error: ajaxError,
dataType: 'xml'
});
return false;
});
});
});
function actionSuccess(data, textStatus) {
var jdata = $(data);
var old = $('#messages *');
var newmsg = $(jdata.find('request messages').text());
newmsg.hide();
$('#messages').prepend(newmsg);
newmsg.fadeIn();
old.remove();
var result = jdata.find('request kicked');
if (result.length > 0)
{
var playerkey = result.attr('playerkey');
$('[name="playerkey"][value="'+playerkey+'"]').parents('tr').fadeOut('normal', function(){$(this).remove()});
}
result = jdata.find('request text');
if (result.length > 0)
{
var playerkey = result.attr('playerkey');
$('option[value="toggletext"]', $('[name="playerkey"][value="'+playerkey+'"]').parent()).html(result.attr('label'));
}
}
function ajaxError(XMLHttpRequest, textStatus, errorThrown) {
if (XMLHttpRequest.status == 403) {
document.location = '<%page.fulluri%>';
}
}
//]]>
</script>
</div>
<span class="kf2waveinfo" data-kf2waveinfo="<%wave.num%>,<%wave.max%>">
<!-- #include file="navigation.inc" -->
<!-- #include file="footer.inc" -->