mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
add support for hiding non-assessments (discord issue)
This commit is contained in:
@@ -991,6 +991,37 @@ function handleTimetableZoom(): void {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleTimetableAssessmentHide(): void {
|
||||||
|
const hideControls = document.createElement("div")
|
||||||
|
hideControls.className = "timetable-hide-controls"
|
||||||
|
|
||||||
|
const hideOn = document.createElement("button")
|
||||||
|
hideOn.className = "uiButton timetable-hide iconFamily"
|
||||||
|
hideOn.innerHTML = "" // Using unicode for zoom in icon
|
||||||
|
|
||||||
|
hideControls.appendChild(hideOn)
|
||||||
|
|
||||||
|
const toolbar = document.getElementById("toolbar")
|
||||||
|
toolbar?.appendChild(hideControls)
|
||||||
|
|
||||||
|
function hideElements(): void {
|
||||||
|
const entries = document.querySelectorAll(".entry")
|
||||||
|
entries.forEach((entry: Element) => {
|
||||||
|
const entryEl = entry as HTMLElement
|
||||||
|
if (!entryEl.classList.contains("assessment") && !(entryEl.style.display === "none")) {
|
||||||
|
entryEl.style.display = "none"
|
||||||
|
} else {
|
||||||
|
entryEl.style.display = ""
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
hideOn.addEventListener("click", () => {
|
||||||
|
hideElements()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async function handleNotices(node: Element): Promise<void> {
|
async function handleNotices(node: Element): Promise<void> {
|
||||||
if (!(node instanceof HTMLElement)) return
|
if (!(node instanceof HTMLElement)) return
|
||||||
if (!settingsState.animations) return
|
if (!settingsState.animations) return
|
||||||
@@ -1068,6 +1099,7 @@ async function handleTimetable(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleTimetableZoom()
|
handleTimetableZoom()
|
||||||
|
handleTimetableAssessmentHide()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleNewsPage(): Promise<void> {
|
async function handleNewsPage(): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user