From 17cfb1850d35148b9e2445dfdd160a164d02ebf9 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 11 Apr 2013 20:18:34 +0400 Subject: Fix masterserver javascript: adjustable output id --- util/master/index.html | 2 +- util/master/list.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'util/master') diff --git a/util/master/index.html b/util/master/index.html index 63ee5c70f..328dd8934 100644 --- a/util/master/index.html +++ b/util/master/index.html @@ -5,7 +5,7 @@ Minetest server list -
+
diff --git a/util/master/list.js b/util/master/list.js index 990bb6ded..98f5ad490 100644 --- a/util/master/list.js +++ b/util/master/list.js @@ -1,3 +1,5 @@ +var master_root, output_to; + function e(s) { if (typeof s === "undefined") s = ''; return s.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); //mc" @@ -39,7 +41,7 @@ function human_time(t, abs) { function success(r) { if (!r || !r.list) return; - var h = ''; + var h = '
ip[:port]clients/maxversion gameidnamedescflagsuptimeping
'; for (var i = 0; i < r.list.length; ++i) { var s = r.list[i]; if (!s) continue; @@ -60,9 +62,8 @@ function success(r) { h += ''; } h += '
ip[:port]clients/maxversion gameidnamedescriptionflagsuptimeping
' - jQuery('#table').html(h); + jQuery(output_to || '#servers_table').html(h); } -var master_root; function get() { jQuery.getJSON((master_root || '') + 'list', success); -- cgit v1.2.3