mirror of
https://github.com/moparisthebest/minetest
synced 2024-12-22 15:48:48 -05:00
Fix masterserver javascript: adjustable output id
This commit is contained in:
parent
e7f5cdf9d4
commit
17cfb1850d
@ -5,7 +5,7 @@
|
|||||||
<title>Minetest server list</title>
|
<title>Minetest server list</title>
|
||||||
<link rel="stylesheet" href="style.css"/>
|
<link rel="stylesheet" href="style.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body><div id="table"></div></body>
|
<body><div id="servers_table"></div></body>
|
||||||
</html>
|
</html>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||||
<script src="list.js"></script>
|
<script src="list.js"></script>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
var master_root, output_to;
|
||||||
|
|
||||||
function e(s) {
|
function e(s) {
|
||||||
if (typeof s === "undefined") s = '';
|
if (typeof s === "undefined") s = '';
|
||||||
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); //mc"
|
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); //mc"
|
||||||
@ -39,7 +41,7 @@ function human_time(t, abs) {
|
|||||||
|
|
||||||
function success(r) {
|
function success(r) {
|
||||||
if (!r || !r.list) return;
|
if (!r || !r.list) return;
|
||||||
var h = '<table class="mts_table"><tr class="mts_head"><th>ip[:port]</th><th>clients/max</th><th>version gameid</th><th>name</th><th>desc</th><th>flags</th><th>uptime</th><th>ping</th></tr>';
|
var h = '<table class="mts_table"><tr class="mts_head"><th>ip[:port]</th><th>clients/max</th><th>version gameid</th><th>name</th><th>description</th><th>flags</th><th>uptime</th><th>ping</th></tr>';
|
||||||
for (var i = 0; i < r.list.length; ++i) {
|
for (var i = 0; i < r.list.length; ++i) {
|
||||||
var s = r.list[i];
|
var s = r.list[i];
|
||||||
if (!s) continue;
|
if (!s) continue;
|
||||||
@ -60,9 +62,8 @@ function success(r) {
|
|||||||
h += '</tr>';
|
h += '</tr>';
|
||||||
}
|
}
|
||||||
h += '</table>'
|
h += '</table>'
|
||||||
jQuery('#table').html(h);
|
jQuery(output_to || '#servers_table').html(h);
|
||||||
}
|
}
|
||||||
var master_root;
|
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
jQuery.getJSON((master_root || '') + 'list', success);
|
jQuery.getJSON((master_root || '') + 'list', success);
|
||||||
|
Loading…
Reference in New Issue
Block a user