forked from mstock/FOSSGIS-WorkAdventure-Maps
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
44 lines (41 loc) · 1.2 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>FOSSGIS-WorkAdventure-Maps</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
</head>
<body>
<h1>FOSSGIS-WorkAdventure-Maps</h1>
<ul id="maps"></ul>
<script type="text/javascript">
(function() {
const maps = [
{
name: 'FOSSGIS Update 2021',
path: 'fossgis-update-2021/fossgis-update.json'
},
{
name: 'FOSSGIS Konferenz 2023',
path: 'fossgis-2023/base.json'
}
];
const waBaseUrl = 'https://play.workadventu.re';
const mapsList = document.getElementById('maps');
const host = window.location.host;
const instanceId = Math.random().toString(36).substring(2, 15);
let path = window.location.pathname;
if (path.endsWith('index.html')) {
path = path.substr(path, path.length - 'index.html'.length);
}
maps.forEach(map => {
const listEntry = document.createElement('li');
const link = document.createElement('a');
link.setAttribute('href', `${waBaseUrl}/_/${instanceId}/${host}${path}${map.path}`);
link.textContent = map.name;
listEntry.appendChild(link);
mapsList.appendChild(listEntry);
});
})();
</script>
</body>
</html>