Skip to content

Commit

Permalink
Removed stale js
Browse files Browse the repository at this point in the history
  • Loading branch information
greghaynes committed May 28, 2010
1 parent 00b4645 commit 4f50ed5
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions tools/http/js/xsbs.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,8 @@
function getScoreboard(hostname, callback) {
$.getJSON('http://' + hostname + '/json/scoreboard', function(data) {
callback(data);
});
}

function getClientState(hostname, cn, callback) {
$.getJSON('http://' + hostname + '/json/clients/' + cn, function(data) {
callback(data);
});
}

function getClients(hostname, callback) {
$.getJSON('http://' + hostname + '/json/clients', function(data) {
callback(data);
});
}

function foreachClient(hostname, callback) {
getClients(hostname, function(clients) {
$.each(clients, function(i, client) {
callback(client)
});
});
}

function displayAlert(text) {
$('#content').fadeTo('slow', 0.4).attr('disabled', '');
$('<div class=\"alert_box\" id=\"alert\">' + text + '</div>').fadeIn('slow').appendTo('#alerts');
}

function clearAlert() {
$('#alert').fadeOut('slow', function() {
$('#alerts').empty();
});
$('#content').fadeTo('slow', 1.0);
}

function kickClient(hostname, username, password, cn, callback) {
displayAlert('Kicking client...');
$.getJSON('http://' + hostname + '/json/admin/kick?username=' + username + '&password=' + password + '&cn=' + cn, callback);
}

function loadPlayerAdminPage(hostname, username, password) {
$('#main_content').empty();
html_page = "<h3>Players</h3><ul id=\"players_list\"></ul>";
$(html_page).appendTo('#main_content');
getScoreboard(hostname, function(data) {
$.each(data.clients, function(i, client) {
html_player = '<li>' + client.name + ': ' + client.frags + ' frags, '
+ client.deaths + ' deaths (<a href=\"#\" id=\"kick_' + client.cn + '\">kick</a>)</li>';
$(html_player).appendTo('#players_list');
$('#kick_' + client.cn).click(function() {
kickClient(hostname, username, password, client.cn, function(data) {
clearAlert();
loadPlayerAdminPage(hostname, username, password);
});
});
});
});
}

function tryLogin(hostname, username, password, error_callback, success_callback) {
$.getJSON('http://' + hostname + '/json/account?username=' + username + '&password=' + password, function(data) {
if(data.hasOwnProperty('user'))
Expand Down

0 comments on commit 4f50ed5

Please sign in to comment.