aboutsummaryrefslogtreecommitdiff
path: root/webAO/master.ts
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2023-11-13 13:44:33 +0100
committerGitHub <noreply@github.com>2023-11-13 13:44:33 +0100
commit074114f8157aadc1cd85d55aa7a9343872389ee6 (patch)
treeef57dba7ccea154bd0c6eaafa3cba34c15664a3b /webAO/master.ts
parent3b57ceff07be9fc86ee5ba73a0614ee754f8f8c6 (diff)
parentc6b046917f71940f75f5028c64298ec146f9a487 (diff)
Merge pull request #196 from Troid-Tech/query-params-and-name
Rework query param parsing and set window title to server name
Diffstat (limited to 'webAO/master.ts')
-rw-r--r--webAO/master.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/webAO/master.ts b/webAO/master.ts
index 833a0b3..e596406 100644
--- a/webAO/master.ts
+++ b/webAO/master.ts
@@ -137,12 +137,13 @@ function processServerlist(thelist: { name: string, description: string, ip: str
servers[i].online = "Offline";
const ipport = `${serverEntry.ip}:${serverEntry.ws_port}`;
+ const serverName = serverEntry.name;
if (serverEntry.ws_port) {
document.getElementById('masterlist').innerHTML
+= `<li id="server${i}" onmouseover="setServ(${i})"><p>${safeTags(serverEntry.name)}</p>`
- + `<a class="button" href="${myURL}client.html?mode=watch&ip=${ipport}">Watch</a>`
- + `<a class="button" href="${myURL}client.html?mode=join&ip=${ipport}">Join</a></li>`;
+ + `<a class="button" href="${myURL}client.html?mode=watch&ip=${ipport}&serverName=${serverName}">Watch</a>`
+ + `<a class="button" href="${myURL}client.html?mode=join&ip=${ipport}&serverName=${serverName}">Join</a></li>`;
}
}
}