Remove unnecessary js code
This commit is contained in:
parent
814d2885ed
commit
847d09e734
3 changed files with 3 additions and 8 deletions
|
@ -16,7 +16,6 @@ fun HTML.createGameMasterDocument() {
|
||||||
src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"
|
src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"
|
||||||
defer = true
|
defer = true
|
||||||
}
|
}
|
||||||
script { src = "/assets/gameMasterClient.js" }
|
|
||||||
script { src = "/assets/buzzerWebSocket.js" }
|
script { src = "/assets/buzzerWebSocket.js" }
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
|
|
|
@ -29,16 +29,16 @@ fun HTML.createPlayerDocument() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
|
xData("{playerName: \"\", buzzerWebSocket: null}")
|
||||||
div(classes = "parent") {
|
div(classes = "parent") {
|
||||||
xInit(
|
xInit(
|
||||||
|
//language=JavaScript
|
||||||
"""
|
"""
|
||||||
() => {
|
() => {
|
||||||
Alpine.data('buzzerWebSocket', null)
|
|
||||||
startWebSocket('/socket/player')
|
startWebSocket('/socket/player')
|
||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
xData("{playerName: \"\"}")
|
|
||||||
div(classes = "input") {
|
div(classes = "input") {
|
||||||
label { +"Player" }
|
label { +"Player" }
|
||||||
div(classes = "bumper") {}
|
div(classes = "bumper") {}
|
||||||
|
@ -58,6 +58,7 @@ fun HTML.createPlayerDocument() {
|
||||||
xData("{clicked: false}")
|
xData("{clicked: false}")
|
||||||
xOn(
|
xOn(
|
||||||
"click",
|
"click",
|
||||||
|
//language=JavaScript
|
||||||
"""
|
"""
|
||||||
() => {
|
() => {
|
||||||
sendUsername(playerName);
|
sendUsername(playerName);
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
function appendUsername(username) {
|
|
||||||
$('ol#usernames').append(`<li>${username}</li>`)
|
|
||||||
}
|
|
Loading…
Reference in a new issue