Remove unnecessary js code

This commit is contained in:
Oliver Rümpelein 2021-09-26 15:08:45 +02:00
parent 814d2885ed
commit 847d09e734
3 changed files with 3 additions and 8 deletions

View file

@ -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 {

View file

@ -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);

View file

@ -1,5 +0,0 @@
'use strict';
function appendUsername(username) {
$('ol#usernames').append(`<li>${username}</li>`)
}