From 8b3e17f0265622a583d0466475abdbc9cd2e5f9a Mon Sep 17 00:00:00 2001 From: root Date: Sun, 15 Dec 2024 11:26:26 +0000 Subject: [PATCH] fix refactoring --- html5/js/kubeinvaders.js | 2 +- html5/js/mode_controls.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/html5/js/kubeinvaders.js b/html5/js/kubeinvaders.js index 72a9e3b54..d74c8703c 100644 --- a/html5/js/kubeinvaders.js +++ b/html5/js/kubeinvaders.js @@ -90,7 +90,7 @@ function setCodeNameToTextInput(elementId) { var oReq = new XMLHttpRequest(); oReq.onreadystatechange = function () { if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { - globalState.set('codename') = this.responseText.trim(); + globalState.set('codename',this.responseText.trim()); $("#" + elementId).val(globalState.get('codename')); $("#" + elementId).text(globalState.get('codename')); if (globalState.get('codename') == "") { diff --git a/html5/js/mode_controls.js b/html5/js/mode_controls.js index ab3f88558..d9ebe2e72 100644 --- a/html5/js/mode_controls.js +++ b/html5/js/mode_controls.js @@ -21,6 +21,7 @@ and user interactions. function startGameMode() { let game_buttons = document.getElementById("game-buttons"); + let game_screen = document.getElementById("game-screen"); if (globalState.get('game_mode_switch')) { globalState.set('game_mode_switch', false); $("#gameModeButton").text("Enable Game Mode"); @@ -60,6 +61,7 @@ function startGameMode() { } function startProgrammingMode() { + let game_screen = document.getElementById("game-screen"); kubePingModalSwitch(); if (is_demo_mode()) { demo_mode_alert();