diff --git a/webroot/js/language.js b/webroot/js/language.js index a27ff77..a036efb 100644 --- a/webroot/js/language.js +++ b/webroot/js/language.js @@ -27,9 +27,9 @@ export async function setNewLanguage(locate, initialize) { } export async function getTranslations(locate) { - const translateData = await fetch(`./lang/${locate}.json`) - .catch(() => null) - return await translateData.json() + const translateData = await fetch(`./lang/${locate}.json`).catch(() => { /* INFO: noop */ }) + + return translateData.json() } /* INFO: This list is in alphabetical order. */ diff --git a/webroot/js/modal/errorHistory.js b/webroot/js/modal/errorHistory.js index 000fac4..f7b68f9 100644 --- a/webroot/js/modal/errorHistory.js +++ b/webroot/js/modal/errorHistory.js @@ -20,7 +20,7 @@ close_button.addEventListener('click', () => { }) copy_button.addEventListener('click', () => { - navigator.clipboard.writeText(panel.innerHTML); + navigator.clipboard.writeText(panel.innerHTML) }) function setData(mode) { diff --git a/webroot/js/navbar.js b/webroot/js/navbar.js index aeb0f3e..37259a8 100644 --- a/webroot/js/navbar.js +++ b/webroot/js/navbar.js @@ -1,11 +1,12 @@ setData('home') + document.getElementById('ni_home').style.display = 'flex' document.getElementById('nid_home').style.display = 'none' document.getElementById('panel_home').style.display = 'block' document.querySelectorAll('[name=navbutton]').forEach((element) => { - element.addEventListener('click', (e) => { - const value = e.target.value + element.addEventListener('click', (event) => { + const value = event.target.value const previous = !localStorage.getItem('/cache/navbar/previous') ? setData('home') : localStorage.getItem('/cache/navbar/previous') if (previous === value) return; diff --git a/webroot/js/restoreError.js b/webroot/js/restoreError.js index 980ea0b..f079d1f 100644 --- a/webroot/js/restoreError.js +++ b/webroot/js/restoreError.js @@ -3,6 +3,7 @@ let sys_error = localStorage.getItem('/system/error') if (!sys_error) { localStorage.setItem('/system/error', '') + sys_error = localStorage.getItem('/system/error') } diff --git a/webroot/js/theme.js b/webroot/js/theme.js index dec5824..e4f5b1a 100644 --- a/webroot/js/theme.js +++ b/webroot/js/theme.js @@ -18,5 +18,6 @@ button.addEventListener('click', () => { function setData(mode) { localStorage.setItem('/system/theme', mode) + return mode } \ No newline at end of file diff --git a/webroot/js/themes/light.js b/webroot/js/themes/light.js index 1c77d81..4507c6d 100644 --- a/webroot/js/themes/light.js +++ b/webroot/js/themes/light.js @@ -4,6 +4,7 @@ import { light_copy_icon, } from './lightIcon.js' import { setLightNav } from './lightNavbar.js' + const rootCss = document.querySelector(':root') /* INFO: Changes the icons to match the theme */ diff --git a/webroot/js/themes/lightNavbar.js b/webroot/js/themes/lightNavbar.js index 1aa8a21..487f741 100644 --- a/webroot/js/themes/lightNavbar.js +++ b/webroot/js/themes/lightNavbar.js @@ -1,4 +1,4 @@ -import { light_action_icon, light_home_icon, light_module_icon, light_settings_icon } from "./lightIcon.js" +import { light_action_icon, light_home_icon, light_module_icon, light_settings_icon } from './lightIcon.js' export function setLightNav() { document.getElementById('nid_home').innerHTML = light_home_icon()