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;
|
) as HTMLButtonElement;
|
||||||
const systemWindow = document.getElementById("chat-system-box") as HTMLDivElement;
|
const systemWindow = document.getElementById("chat-system-box") as HTMLDivElement;
|
||||||
|
|
||||||
|
|
||||||
function chatKeyToggle() {
|
function chatKeyToggle() {
|
||||||
let anti_flicker_control = false;
|
let anti_flicker_control = false;
|
||||||
const chat_hide_key = 'escape';
|
const chat_hide_key = 'escape';
|
||||||
const chat_display_key = 'f2';
|
const chat_display_key = 'f2';
|
||||||
const pong_display_key = 'f4';
|
const home_display_key = 'f8';
|
||||||
const ttt_display_key = 'f8';
|
|
||||||
const home_display_key = 'f9';
|
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (event.repeat && keysPressed[chat_hide_key] === true) {
|
if (event.repeat && keysPressed[chat_hide_key] === true) {
|
||||||
anti_flicker_control = true;
|
anti_flicker_control = true;
|
||||||
|
|
@ -126,17 +123,9 @@ function chatKeyToggle() {
|
||||||
windowStateVisable();
|
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) {
|
if (keysPressed[home_display_key] === true) {
|
||||||
quitChat();
|
|
||||||
navigateTo('/app/');
|
navigateTo('/app/');
|
||||||
|
quitChat();
|
||||||
}
|
}
|
||||||
}, 1000/10);
|
}, 1000/10);
|
||||||
};
|
};
|
||||||
|
|
@ -163,7 +152,6 @@ function initChatSocket() {
|
||||||
!sendButton ||
|
!sendButton ||
|
||||||
!sendtextbox ||
|
!sendtextbox ||
|
||||||
!systemWindow
|
!systemWindow
|
||||||
|
|
||||||
) return showError("fatal error");
|
) return showError("fatal error");
|
||||||
|
|
||||||
// Listen for the 'connect' event
|
// Listen for the 'connect' event
|
||||||
|
|
@ -289,9 +277,7 @@ function initChatSocket() {
|
||||||
let message = "";
|
let message = "";
|
||||||
if (data.userState === "block") {
|
if (data.userState === "block") {
|
||||||
(message = "un-block");
|
(message = "un-block");
|
||||||
// ((message = "un-block"), (blockMessage = true));
|
|
||||||
} else {
|
} else {
|
||||||
// ((message = "block"), (blockMessage = false));
|
|
||||||
(message = "block");
|
(message = "block");
|
||||||
}
|
}
|
||||||
blockUserBtn.textContent = message;
|
blockUserBtn.textContent = message;
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ export function cmdList() {
|
||||||
addMessage('** ********** function keys ********** **');
|
addMessage('** ********** function keys ********** **');
|
||||||
addMessage('\'ESC\' - chat box display toggles off');
|
addMessage('\'ESC\' - chat box display toggles off');
|
||||||
addMessage('\'F2\' - chat box display toggles on');
|
addMessage('\'F2\' - chat box display toggles on');
|
||||||
addMessage('\'F4\' - navigates to Pong Box');
|
addMessage('\'F8\' - navigates to Home Page');
|
||||||
addMessage('\'F8\' - navigates to TTT Box');
|
|
||||||
addMessage('\'F9\' - navigates to Home Page');
|
|
||||||
addMessage('** *********************************** **');
|
addMessage('** *********************************** **');
|
||||||
addMessage('*');
|
addMessage('*');
|
||||||
}
|
}
|
||||||
|
|
@ -67,3 +67,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="historyBtn">History</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-2">
|
<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>
|
||||||
<div class="flex flex-col gap-2 p-8 items-end">
|
<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>
|
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="JoinQueueBtn">Join Queue</button>
|
||||||
|
|
@ -13,9 +13,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-[auto_1fr_auto_1fr_auto] items-center px-4 py-3">
|
<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-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-name" id="playerX-name"></div>
|
||||||
<div class="player-timer" id="playerX-timer"></div>
|
<div class="player-timer" id="playerX-timer"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-center text-sm text-gray-800 px-4 whitespace-nowrap">
|
<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 id="currentPlayerTimer">Waiting for match...</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-right">
|
<div class="text-right text-2xl">
|
||||||
<div class="player-name" id="playerO-name"></div>
|
<div class="player-name" id="playerO-name"></div>
|
||||||
<div class="player-timer" id="playerO-timer"></div>
|
<div class="player-timer" id="playerO-timer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue