[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io
2025-03-12 11:02:58 +00:00
parent 8cb052f2ff
commit 695357a639
+13 -13
View File
@@ -682,7 +682,7 @@ async function updateIframesWithDarkMode(): Promise<void> {
applyDarkModeToIframe(iframe, cssLink)
if (element.classList.contains("cke_wysiwyg_frame")) {
;(async () => {
(async () => {
await delay(100)
iframe.contentDocument?.body.setAttribute("spellcheck", "true")
})()
@@ -881,7 +881,7 @@ function handleTimetableZoom(): void {
// Update all day columns (TDs)
const dayColumns = document.querySelectorAll(".dailycal .content .days td")
dayColumns.forEach((td: Element) => {
;(td as HTMLElement).style.height = `${newContainerHeight}px`
(td as HTMLElement).style.height = `${newContainerHeight}px`
})
// Update all entries using stored ratios
@@ -907,7 +907,7 @@ function handleTimetableZoom(): void {
const times = timeColumn.querySelectorAll(".time")
const timeHeight = newContainerHeight / times.length
times.forEach((time: Element) => {
;(time as HTMLElement).style.height = `${timeHeight}px`
(time as HTMLElement).style.height = `${timeHeight}px`
})
}
@@ -1163,7 +1163,7 @@ function CheckNoticeTextColour(notice: any) {
const hex1 = hex.slice(0, -1)
var threshold = GetThresholdOfColor(hex1)
if (settingsState.DarkMode && threshold < 100) {
;(node as HTMLElement).style.cssText = "--color: undefined;"
(node as HTMLElement).style.cssText = "--color: undefined;"
}
}
},
@@ -1543,7 +1543,7 @@ export function OpenMenuOptions() {
;(element as HTMLElement).classList.add("draggable")
if ((element as HTMLElement).classList.contains("hasChildren")) {
;(element as HTMLElement).classList.remove("active")
(element as HTMLElement).classList.remove("active")
;(element.firstChild as HTMLElement).classList.remove("noscroll")
}
@@ -1580,12 +1580,12 @@ export function OpenMenuOptions() {
for (let i = 0; i < buttons.length; i++) {
let id = buttons[i].id as string | undefined
if (menuItems[id as keyof typeof menuItems]) {
;(buttons[i] as HTMLInputElement).checked =
(buttons[i] as HTMLInputElement).checked =
menuItems[id as keyof typeof menuItems].toggle
} else {
;(buttons[i] as HTMLInputElement).checked = true
(buttons[i] as HTMLInputElement).checked = true
}
;(buttons[i] as HTMLInputElement).checked = true
(buttons[i] as HTMLInputElement).checked = true
}
try {
@@ -1695,7 +1695,7 @@ function saveNewOrder(sortable: any) {
}
function cloneAttributes(target: any, source: any) {
;[...source.attributes].forEach((attr) => {
[...source.attributes].forEach((attr) => {
target.setAttribute(attr.nodeName, attr.nodeValue)
})
}
@@ -2346,7 +2346,7 @@ async function CreateUpcomingSection(assessments: any, activeSubjects: any) {
upcomingDates[element.due as keyof typeof upcomingDates]
if (assessmentDateDiv) {
;(assessmentDateDiv as any).assessments.push(element)
(assessmentDateDiv as any).assessments.push(element)
}
}
@@ -2413,7 +2413,7 @@ export function FilterUpcomingAssessments(subjectoptions: any) {
if (subjectoptions[item]) {
element.classList.remove("hidden")
}
;(element.parentNode! as HTMLElement).classList.remove("hidden")
(element.parentNode! as HTMLElement).classList.remove("hidden")
let children = element.parentNode!.parentNode!.children
for (let i = 0; i < children.length; i++) {
@@ -2433,7 +2433,7 @@ export function FilterUpcomingAssessments(subjectoptions: any) {
"data-day",
)
) {
;(element.parentNode!.parentNode! as HTMLElement).classList.add(
(element.parentNode!.parentNode! as HTMLElement).classList.add(
"hidden",
)
} else {
@@ -2444,7 +2444,7 @@ export function FilterUpcomingAssessments(subjectoptions: any) {
}
}
} else {
;(element.parentNode!.parentNode! as HTMLElement).classList.remove(
(element.parentNode!.parentNode! as HTMLElement).classList.remove(
"hidden",
)
}