diff --git a/js/app.js b/js/app.js index 979125d0..e2aeb92d 100644 --- a/js/app.js +++ b/js/app.js @@ -43,7 +43,7 @@ async function create() { }; document.getElementById('msgbox').addEventListener('keydown', (event) => { - if (event.keyCode === 13 && !event.shiftKey) { + if (event.key === 13 && !event.shiftKey) { event.preventDefault(); sendmsg(); } diff --git a/js/clickMenu.js b/js/clickMenu.js index 098a2b9a..4b1034e1 100644 --- a/js/clickMenu.js +++ b/js/clickMenu.js @@ -21,7 +21,7 @@ function addDocListener() { document.addEventListener('keydown', (e) => { // When ESC is pressed - if (e.keyCode == 27) { + if (e.key == 27) { // Safe check so there is only one DOM to edit messages checkEditDoms(); } diff --git a/js/guildList.js b/js/guildList.js index ef6876e5..a18c895a 100644 --- a/js/guildList.js +++ b/js/guildList.js @@ -57,10 +57,10 @@ async function addGuilds() { // Check if the icon is animated and add the animation on hover or remove it if (g.icon.startsWith('a_')) { - ico.onmouseenter = () => { + img.onmouseenter = () => { img.src = ico.replace('.webp', 'gif'); }; - ico.onmouseleave = () => { + img.onmouseleave = () => { img.src = ico; }; } diff --git a/js/rcMenuFuncs.js b/js/rcMenuFuncs.js index 08d7728f..1c0ab01c 100644 --- a/js/rcMenuFuncs.js +++ b/js/rcMenuFuncs.js @@ -63,7 +63,7 @@ function editMsg(target) { target.appendChild(textarea); textarea.addEventListener('keydown', (e) => { - if (e.keyCode === 13 && !e.shiftKey) { + if (e.key === 13 && !e.shiftKey) { if (textarea.value == text) return editDOM(target, textarea, text); let newText = textarea.value; newText = newText.replace( diff --git a/js/userSettings.js b/js/userSettings.js index a7f63ee6..24bfa181 100644 --- a/js/userSettings.js +++ b/js/userSettings.js @@ -512,7 +512,7 @@ function genCheckbox(parent, option) { // document.getElementById("tokenbox") // .addEventListener("keydown", event => { -// if (event.keyCode === 13) { +// if (event.key === 13) { // unloadAllScripts(); // setToken(); // } @@ -543,7 +543,7 @@ function genShortInput( if (id == 'tokenbox') { input.type = 'password'; input.addEventListener('keydown', (event) => { - if (event.keyCode === 13) showSplashScreen(input.value); + if (event.key === 13) showSplashScreen(input.value); }); } }