Deleted functions keys that could be dangerous
This commit is contained in:
parent
9e93306db1
commit
946478f301
4 changed files with 67 additions and 80 deletions
|
|
@ -83,14 +83,11 @@ const sendtextbox = document.getElementById(
|
|||
) as HTMLButtonElement;
|
||||
const systemWindow = document.getElementById("chat-system-box") as HTMLDivElement;
|
||||
|
||||
|
||||
function chatKeyToggle() {
|
||||
let anti_flicker_control = false;
|
||||
const chat_hide_key = 'escape';
|
||||
const chat_display_key = 'f2';
|
||||
const pong_display_key = 'f4';
|
||||
const ttt_display_key = 'f8';
|
||||
const home_display_key = 'f9';
|
||||
const home_display_key = 'f8';
|
||||
document.addEventListener("keydown", (event) => {
|
||||
if (event.repeat && keysPressed[chat_hide_key] === true) {
|
||||
anti_flicker_control = true;
|
||||
|
|
@ -126,17 +123,9 @@ function chatKeyToggle() {
|
|||
windowStateVisable();
|
||||
|
||||
}
|
||||
if (keysPressed[pong_display_key] === true) {
|
||||
quitChat();
|
||||
navigateTo('/app/pong');
|
||||
}
|
||||
if (keysPressed[ttt_display_key] === true) {
|
||||
quitChat();
|
||||
navigateTo('/app/ttt');
|
||||
}
|
||||
if (keysPressed[home_display_key] === true) {
|
||||
quitChat();
|
||||
navigateTo('/app/');
|
||||
quitChat();
|
||||
}
|
||||
}, 1000/10);
|
||||
};
|
||||
|
|
@ -163,7 +152,6 @@ function initChatSocket() {
|
|||
!sendButton ||
|
||||
!sendtextbox ||
|
||||
!systemWindow
|
||||
|
||||
) return showError("fatal error");
|
||||
|
||||
// Listen for the 'connect' event
|
||||
|
|
@ -289,9 +277,7 @@ function initChatSocket() {
|
|||
let message = "";
|
||||
if (data.userState === "block") {
|
||||
(message = "un-block");
|
||||
// ((message = "un-block"), (blockMessage = true));
|
||||
} else {
|
||||
// ((message = "block"), (blockMessage = false));
|
||||
(message = "block");
|
||||
}
|
||||
blockUserBtn.textContent = message;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@ export function cmdList() {
|
|||
addMessage('** ********** function keys ********** **');
|
||||
addMessage('\'ESC\' - chat box display toggles off');
|
||||
addMessage('\'F2\' - chat box display toggles on');
|
||||
addMessage('\'F4\' - navigates to Pong Box');
|
||||
addMessage('\'F8\' - navigates to TTT Box');
|
||||
addMessage('\'F9\' - navigates to Home Page');
|
||||
addMessage('\'F8\' - navigates to Home Page');
|
||||
addMessage('** *********************************** **');
|
||||
addMessage('*');
|
||||
}
|
||||
|
|
@ -67,3 +67,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="historyBtn">History</button>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2">
|
||||
<h1 class="page-title">Tic-tac-toe Box<span id="t-username"></span></h1>
|
||||
<h1 class="page-title">Tic-tac-toe<span id="t-username"></span></h1>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 p-8 items-end">
|
||||
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="JoinQueueBtn">Join Queue</button>
|
||||
|
|
@ -13,9 +13,10 @@
|
|||
</div>
|
||||
<div class="grid grid-cols-[auto_1fr_auto_1fr_auto] items-center px-4 py-3">
|
||||
<div class="text-7xl text-gray-800 mx-4 font-bold" id="playerX">X</div>
|
||||
<div class="text-left">
|
||||
<div class="text-left text-2xl">
|
||||
<div class="player-name" id="playerX-name"></div>
|
||||
<div class="player-timer" id="playerX-timer"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="text-center text-sm text-gray-800 px-4 whitespace-nowrap">
|
||||
|
|
@ -23,7 +24,7 @@
|
|||
<div id="currentPlayerTimer">Waiting for match...</div>
|
||||
</div>
|
||||
|
||||
<div class="text-right">
|
||||
<div class="text-right text-2xl">
|
||||
<div class="player-name" id="playerO-name"></div>
|
||||
<div class="player-timer" id="playerO-timer"></div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue