planet-wars/backend/static/script/maps.js
2020-03-27 10:31:56 +01:00

18 lines
No EOL
434 B
JavaScript

const ids = {};
["map_holder", "name", "turns", "nop"].forEach(id => ids[id] = document.getElementById(id));
var last_map;
async function handle_map_click(url, event) {
if (last_map) {
last_map.classList.remove("selected");
}
last_map = event.target;
event.target.classList.add("selected");
const c = await fetch(url);
ids["map_holder"].innerHTML = await c.text();
}
async function start_game() {
}