fix: JS code indentation/syntax

This commit fixes the syntax and indentation of the JavaScript code to meet the organization standard.
This commit is contained in:
ThePedroo
2024-07-14 22:40:14 -03:00
parent ce54123a7c
commit dde0436fd9
7 changed files with 11 additions and 7 deletions
+3 -3
View File
@@ -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. */
+1 -1
View File
@@ -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) {
+3 -2
View File
@@ -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;
+1
View File
@@ -3,6 +3,7 @@ let sys_error = localStorage.getItem('/system/error')
if (!sys_error) {
localStorage.setItem('/system/error', '')
sys_error = localStorage.getItem('/system/error')
}
+1
View File
@@ -18,5 +18,6 @@ button.addEventListener('click', () => {
function setData(mode) {
localStorage.setItem('/system/theme', mode)
return mode
}
+1
View File
@@ -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 */
+1 -1
View File
@@ -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()