commander update
This commit is contained in:
parent
8b0735fca2
commit
fb0f49fdd5
@ -138,6 +138,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
function getDataFomEl(el)
|
||||
{
|
||||
while (el.tagName != "BODY" && el.dataset['id'] == null)
|
||||
{
|
||||
el = el.parentElement;
|
||||
}
|
||||
return el.dataset;
|
||||
}
|
||||
|
||||
function kickClient(e)
|
||||
{
|
||||
let client = getDataFomEl(e.target);
|
||||
console.log("kickClient", client);
|
||||
conn.send(passEl.value + ";kick;" + client['id']);
|
||||
}
|
||||
|
||||
function freeBoat(e)
|
||||
{
|
||||
let boat = getDataFomEl(e.target);
|
||||
console.log("unlockBoat", boat);
|
||||
conn.send(passEl.value + ";free;" + boat['id']);
|
||||
}
|
||||
|
||||
function lockBoat(e)
|
||||
{
|
||||
let boat = getDataFomEl(e.target);
|
||||
console.log("lockBoat", boat);
|
||||
conn.send(passEl.value + ";lock;" + boat['id']);
|
||||
}
|
||||
|
||||
function reqBoats()
|
||||
{
|
||||
conn.send(passEl.value + ";boats");
|
||||
@ -260,36 +290,6 @@
|
||||
{
|
||||
console.warn("addClient(): incorect number of args (" + client.length.toString() + "; " + client.toString() + ")");
|
||||
}
|
||||
|
||||
function getDataFomEl(el)
|
||||
{
|
||||
while (el.tagName != "BODY" && el.dataset['id'] == null)
|
||||
{
|
||||
el = el.parentElement;
|
||||
}
|
||||
return el.dataset;
|
||||
}
|
||||
|
||||
function kickClient(e)
|
||||
{
|
||||
let client = getDataFomEl(e.target);
|
||||
console.log("kickClient", client);
|
||||
conn.send(passEl.value + ";kick;" + client['id']);
|
||||
}
|
||||
|
||||
function freeBoat(e)
|
||||
{
|
||||
let boat = getDataFomEl(e.target);
|
||||
console.log("unlockBoat", boat);
|
||||
conn.send(passEl.value + ";free;" + boat['id']);
|
||||
}
|
||||
|
||||
function lockBoat(e)
|
||||
{
|
||||
let boat = getDataFomEl(e.target);
|
||||
console.log("lockBoat", boat);
|
||||
conn.send(passEl.value + ";lock;" + boat['id']);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user