= { ...commonProps, ...dynamicProps };
diff --git a/src/seqta/ui/colors/getThresholdColour.ts b/src/seqta/ui/colors/getThresholdColour.ts
index 1fe679c1..ac5ad8b4 100644
--- a/src/seqta/ui/colors/getThresholdColour.ts
+++ b/src/seqta/ui/colors/getThresholdColour.ts
@@ -1,5 +1,5 @@
import Color from "color";
-export function GetThresholdOfColor(color: string) {
+export function getThresholdOfColor(color: string) {
if (!color) return 0;
// Case-insensitive regular expression for matching RGBA colors
const rgbaRegex = /rgba?\(([^)]+)\)/gi;
diff --git a/src/seqta/ui/loading.ts b/src/seqta/ui/loading.ts
index 8b383d60..f07e84a6 100644
--- a/src/seqta/ui/loading.ts
+++ b/src/seqta/ui/loading.ts
@@ -274,7 +274,7 @@ function startCanvasForRoot(host: HTMLElement, shadow: ShadowRoot, variant: Load
stopCanvas = canvas ? startLoadingCanvas(canvas, host, variant) : null;
}
-export function AppendLoadingSymbol(givenID: string, position: string) {
+export function appendLoadingSymbol(givenID: string, position: string) {
const loadingsymbol = stringToHTML(/* html */ `
${loadingSpinner}
diff --git a/src/seqta/ui/renderStore.ts b/src/seqta/ui/renderStore.ts
index 1741dd70..d5070701 100644
--- a/src/seqta/ui/renderStore.ts
+++ b/src/seqta/ui/renderStore.ts
@@ -7,10 +7,10 @@ async function openThemesDestination(view: "store" | "community"): Promise
await openSettingsPopup();
}
-export async function OpenStorePage(): Promise {
+export async function openStorePage(): Promise {
await openThemesDestination("store");
}
-export async function OpenCommunityThemesPage(): Promise {
+export async function openCommunityThemesPage(): Promise {
await openThemesDestination("community");
}
diff --git a/src/seqta/utils/adders/addShortcuts.ts b/src/seqta/utils/adders/addShortcuts.ts
index d0df6b13..a42d809d 100644
--- a/src/seqta/utils/adders/addShortcuts.ts
+++ b/src/seqta/utils/adders/addShortcuts.ts
@@ -7,9 +7,9 @@ export function addShortcuts(shortcuts: Shortcut[]) {
const currentShortcut = shortcuts[i];
if (currentShortcut?.enabled) {
- const Itemname = (currentShortcut?.name ?? "").replace(/\s/g, "");
+ const itemName = (currentShortcut?.name ?? "").replace(/\s/g, "");
- const linkDetails = ShortcutLinks?.[Itemname as keyof typeof ShortcutLinks];
+ const linkDetails = ShortcutLinks?.[itemName as keyof typeof ShortcutLinks];
if (linkDetails) {
createNewShortcut(
linkDetails.link,
diff --git a/src/seqta/utils/createEnable/createCustomShortcutDiv.ts b/src/seqta/utils/createEnable/createCustomShortcutDiv.ts
index 1a5f0aeb..77174f35 100644
--- a/src/seqta/utils/createEnable/createCustomShortcutDiv.ts
+++ b/src/seqta/utils/createEnable/createCustomShortcutDiv.ts
@@ -11,7 +11,7 @@ function isSafeShortcutHref(url: string): boolean {
}
}
-export function CreateCustomShortcutDiv(element: CustomShortcut) {
+export function createCustomShortcutDiv(element: CustomShortcut) {
const container = document.getElementById("shortcuts");
if (!container) return;
diff --git a/src/seqta/utils/createEnable/createElement.ts b/src/seqta/utils/createEnable/createElement.ts
index 787dc936..922be1d0 100644
--- a/src/seqta/utils/createEnable/createElement.ts
+++ b/src/seqta/utils/createEnable/createElement.ts
@@ -1,4 +1,4 @@
-export function CreateElement(
+export function createElement(
type: string,
class_?: string,
id?: string,
diff --git a/src/seqta/utils/launchPageThemeBuilder.ts b/src/seqta/utils/launchPageThemeBuilder.ts
index d89b220c..8764b4b9 100644
--- a/src/seqta/utils/launchPageThemeBuilder.ts
+++ b/src/seqta/utils/launchPageThemeBuilder.ts
@@ -1,8 +1,8 @@
/** Close settings (if open) and mount the theme builder on the SEQTA page body. */
export async function launchPageThemeBuilder(themeId?: string): Promise {
const { closeExtensionPopup } = await import("@/seqta/utils/closers/closeExtensionPopup");
- const { OpenThemeCreator } = await import("@/plugins/built-in/themes/themeCreator");
+ const { openThemeCreator } = await import("@/plugins/built-in/themes/themeCreator");
closeExtensionPopup();
- await OpenThemeCreator(themeId ?? "");
+ await openThemeCreator(themeId ?? "");
}
diff --git a/src/seqta/utils/listeners/MessageHandler.ts b/src/seqta/utils/listeners/MessageHandler.ts
index 86feedf2..6d757de8 100644
--- a/src/seqta/utils/listeners/MessageHandler.ts
+++ b/src/seqta/utils/listeners/MessageHandler.ts
@@ -1,7 +1,7 @@
import browser from "@/lib/browser";
import { closeExtensionPopup } from "@/seqta/utils/closers/closeExtensionPopup";
-import { OpenMenuOptions } from "@/seqta/utils/openers/openMenuOptions";
+import { openMenuOptions } from "@/seqta/utils/openers/openMenuOptions";
import { isMenuOptionsOpen } from "@/seqta/utils/openers/menuOptionsState";
import sendThemeUpdate from "@/seqta/utils/sendThemeUpdate";
@@ -119,8 +119,8 @@ export class MessageHandler {
case "OpenThemeCreator": {
const themeID = request?.body?.themeID;
- void import("@/plugins/built-in/themes/themeCreator").then(({ OpenThemeCreator }) => {
- void OpenThemeCreator(themeID ? String(themeID) : "");
+ void import("@/plugins/built-in/themes/themeCreator").then(({ openThemeCreator }) => {
+ void openThemeCreator(themeID ? String(themeID) : "");
});
closeExtensionPopup();
sendResponse({ status: "success" });
@@ -136,9 +136,9 @@ export class MessageHandler {
return true;
case "CloseThemeCreator":
- void import("@/plugins/built-in/themes/themeCreator").then(({ CloseThemeCreator }) => {
+ void import("@/plugins/built-in/themes/themeCreator").then(({ closeThemeCreator }) => {
try {
- CloseThemeCreator();
+ closeThemeCreator();
sendResponse({ status: "success" });
} catch (error) {
console.error("Error closing theme creator:", error);
@@ -159,7 +159,7 @@ export class MessageHandler {
editSidebar() {
if (!isMenuOptionsOpen()) {
- OpenMenuOptions();
+ openMenuOptions();
}
}
}
diff --git a/src/seqta/utils/listeners/StorageChangeHandler.test.ts b/src/seqta/utils/listeners/StorageChangeHandler.test.ts
index 5e6fb3c5..bff264de 100644
--- a/src/seqta/utils/listeners/StorageChangeHandler.test.ts
+++ b/src/seqta/utils/listeners/StorageChangeHandler.test.ts
@@ -13,7 +13,7 @@ jest.mock("@/seqta/utils/menuItemVisibility", () => ({
scheduleMenuItemVisibility: jest.fn(),
}));
jest.mock("@/seqta/utils/openers/menuOrder", () => ({
- ChangeMenuItemPositions: jest.fn(),
+ changeMenuItemPositions: jest.fn(),
}));
jest.mock("@/seqta/utils/performanceMode", () => ({
syncPerformanceModeEffects: jest.fn(),
diff --git a/src/seqta/utils/listeners/StorageChangeHandler.ts b/src/seqta/utils/listeners/StorageChangeHandler.ts
index 2ae10451..ec4a000c 100644
--- a/src/seqta/utils/listeners/StorageChangeHandler.ts
+++ b/src/seqta/utils/listeners/StorageChangeHandler.ts
@@ -5,7 +5,7 @@ import { applySelectedFont } from "@/seqta/ui/fonts/fontManager";
import { renderShortcuts } from "@/seqta/utils/render/renderShortcuts";
import { registerHomeUpcomingSettingsListeners } from "@/seqta/utils/loaders/loadHomePage";
import { scheduleMenuItemVisibility } from "@/seqta/utils/menuItemVisibility";
-import { ChangeMenuItemPositions } from "@/seqta/utils/openers/menuOrder";
+import { changeMenuItemPositions } from "@/seqta/utils/openers/menuOrder";
import { syncPerformanceModeEffects } from "@/seqta/utils/performanceMode";
import type { CustomShortcut } from "@/types/storage";
@@ -41,7 +41,7 @@ export class StorageChangeHandler {
settingsState.register("menuitems", () => scheduleMenuItemVisibility());
settingsState.register("menuorder", (order) => {
if (Array.isArray(order) && order.length > 0) {
- ChangeMenuItemPositions(order);
+ changeMenuItemPositions(order);
}
});
}
diff --git a/src/seqta/utils/loaders/loadHomePage.ts b/src/seqta/utils/loaders/loadHomePage.ts
index 300cafc3..66ad2682 100644
--- a/src/seqta/utils/loaders/loadHomePage.ts
+++ b/src/seqta/utils/loaders/loadHomePage.ts
@@ -3,13 +3,13 @@ import { BookOpen, ChevronLeft, ChevronRight, ClipboardList } from "lucide-stati
import { animate, stagger } from "motion";
import LogoLight from "@/resources/icons/betterseqta-light-icon.png";
import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
-import { GetThresholdOfColor } from "@/seqta/ui/colors/getThresholdColour";
+import { getThresholdOfColor } from "@/seqta/ui/colors/getThresholdColour";
import { convertTo12HourFormat } from "../convertTo12HourFormat";
import { delay } from "../delay";
import { settingsState } from "../listeners/settingsState";
import stringToHTML from "../stringToHTML";
import { renderShortcuts } from "@/seqta/utils/render/renderShortcuts";
-import { CreateElement } from "@/seqta/utils/createEnable/createElement";
+import { createElement } from "@/seqta/utils/createEnable/createElement";
import { setupTooltips } from "@/seqta/utils/tooltip";
import { verboseInfo } from "@/utils/verboseLog";
import { getUserInfo } from "@/seqta/utils/userInfo";
@@ -126,8 +126,8 @@ export async function loadHomePage() {
const TodayFormatted = formatDate(new Date());
const [assessments, classes, prefs] = await Promise.all([
- GetUpcomingAssessments(),
- GetActiveClasses(),
+ getUpcomingAssessments(),
+ getActiveClasses(),
fetch(`${location.origin}/seqta/student/load/prefs?`, {
method: "POST",
headers: { "Content-Type": "application/json" },
@@ -144,7 +144,7 @@ export async function loadHomePage() {
const upcomingItems = document.getElementById("upcoming-items");
if (upcomingItems) {
- await CreateUpcomingSection(currentAssessments, activeSubjects);
+ await createUpcomingSection(currentAssessments, activeSubjects);
upcomingItems.classList.remove("loading");
}
@@ -185,14 +185,14 @@ async function renderHomeUpcomingAssessments() {
upcomingItems.classList.add("loading");
upcomingItems.innerHTML = "";
- const [assessments, classes] = await Promise.all([GetUpcomingAssessments(), GetActiveClasses()]);
+ const [assessments, classes] = await Promise.all([getUpcomingAssessments(), getActiveClasses()]);
const activeSubjects = activeSubjectsFromLearnPayload(classes);
const currentAssessments = filterAssessmentsForActiveSubjects(assessments, activeSubjects).sort(
comparedate,
) as HomeUpcomingAssessment[];
- await CreateUpcomingSection(currentAssessments, activeSubjects);
+ await createUpcomingSection(currentAssessments, activeSubjects);
upcomingItems.classList.remove("loading");
}
@@ -208,7 +208,7 @@ export function registerHomeUpcomingSettingsListeners() {
}
}
-async function GetUpcomingAssessments() {
+async function getUpcomingAssessments() {
try {
const { id: student } = await getUserInfo();
const response = await fetch(`${location.origin}/seqta/student/assessment/list/upcoming?`, {
@@ -244,7 +244,7 @@ function setupTimetableListeners() {
currentSelectedDate.setDate(currentSelectedDate.getDate() + value);
const formattedDate = formatDate(currentSelectedDate);
callHomeTimetable(formattedDate, true);
- SetTimetableSubtitle();
+ setTimetableSubtitle();
}
const backHandler = () => changeTimetable(-1);
@@ -268,7 +268,7 @@ function formatDate(date: Date): string {
return `${year}-${month}-${day}`;
}
-async function GetActiveClasses() {
+async function getActiveClasses() {
try {
const response = await fetch(`${location.origin}/seqta/student/load/subjects?`, {
method: "POST",
@@ -314,7 +314,7 @@ async function callHomeTimetable(date: string, change?: boolean) {
a.from.localeCompare(b.from),
);
- GetLessonColours().then((colours) => {
+ getLessonColours().then((colours) => {
for (let i = 0; i < lessonArray.length; i++) {
const subjectname =
lessonArray[i].type == "tutorial"
@@ -326,7 +326,7 @@ async function callHomeTimetable(date: string, change?: boolean) {
lessonArray[i].colour = "--item-colour: #8e8e8e;";
} else {
lessonArray[i].colour = `--item-colour: ${subject.value};`;
- if (GetThresholdOfColor(subject.value) > 300) {
+ if (getThresholdOfColor(subject.value) > 300) {
lessonArray[i].invert = true;
}
}
@@ -339,7 +339,7 @@ async function callHomeTimetable(date: string, change?: boolean) {
lessonArray[i].until = convertTo12HourFormat(lessonArray[i].until);
}
- lessonArray[i].attendanceTitle = CheckUnmarkedAttendance(lessonArray[i].attendance);
+ lessonArray[i].attendanceTitle = checkUnmarkedAttendance(lessonArray[i].attendance);
}
DayContainer.innerText = "";
@@ -356,9 +356,9 @@ async function callHomeTimetable(date: string, change?: boolean) {
const today = new Date();
if (currentSelectedDate.getDate() == today.getDate()) {
for (let i = 0; i < lessonArray.length; i++) {
- CheckCurrentLesson(lessonArray[i], i + 1);
+ checkCurrentLesson(lessonArray[i], i + 1);
}
- CheckCurrentLessonAll(lessonArray);
+ checkCurrentLessonAll(lessonArray);
}
});
}
@@ -376,16 +376,16 @@ async function callHomeTimetable(date: string, change?: boolean) {
}
}
-function CheckCurrentLessonAll(lessons: HomeTimetableLesson[]) {
+function checkCurrentLessonAll(lessons: HomeTimetableLesson[]) {
clearLessonInterval();
lessonInterval = setInterval(() => {
for (let i = 0; i < lessons.length; i++) {
- CheckCurrentLesson(lessons[i], i + 1);
+ checkCurrentLesson(lessons[i], i + 1);
}
}, 60000);
}
-async function CheckCurrentLesson(lesson: HomeTimetableLesson, num: number) {
+async function checkCurrentLesson(lesson: HomeTimetableLesson, num: number) {
const { from: startTime, until: endTime, code, description, room, staff } = lesson;
const currentDate = new Date();
@@ -506,7 +506,7 @@ function buildAssessmentURL(
: `${base}${programmeID}:${metaID}`;
}
-function CheckUnmarkedAttendance(lessonattendance: { label?: string } | null | undefined) {
+function checkUnmarkedAttendance(lessonattendance: { label?: string } | null | undefined) {
return lessonattendance ? lessonattendance.label : " ";
}
@@ -559,7 +559,7 @@ function applyHomeUpcomingLimits(
assessments.splice(0, assessments.length, ...limited);
}
-async function CreateUpcomingSection(
+async function createUpcomingSection(
assessments: HomeUpcomingAssessment[],
activeSubjects: ActiveSubjectLike[],
) {
@@ -580,7 +580,7 @@ async function CreateUpcomingSection(
applyHomeUpcomingLimits(assessments, activeSubjects);
- const colours = await GetLessonColours();
+ const colours = await getLessonColours();
for (let i = 0; i < assessments.length; i++) {
const subject = colours.find(
@@ -598,7 +598,7 @@ async function CreateUpcomingSection(
const element = assessments[i];
if (!upcomingDates[element.due]) {
const dateObj: UpcomingDateBucket = {
- div: CreateElement("div", "upcoming-date-container") as HTMLElement,
+ div: createElement("div", "upcoming-date-container") as HTMLElement,
assessments: [],
};
upcomingDates[element.due] = dateObj;
@@ -609,7 +609,7 @@ async function CreateUpcomingSection(
for (const date in upcomingDates) {
const assessmentdue = new Date(upcomingDates[date].assessments[0].due);
- const specialcase = CheckSpecialDay(Today, assessmentdue);
+ const specialcase = checkSpecialDay(Today, assessmentdue);
const assessmentDate = createAssessmentDateDiv(
date,
upcomingDates[date],
@@ -721,7 +721,7 @@ function createAssessmentDateDiv(
return container;
}
-function CheckSpecialDay(date1: Date, date2: Date) {
+function checkSpecialDay(date1: Date, date2: Date) {
if (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
@@ -745,7 +745,7 @@ function CheckSpecialDay(date1: Date, date2: Date) {
}
}
-async function GetLessonColours() {
+async function getLessonColours() {
try {
const { id: user } = await getUserInfo();
const response = await fetch(`${location.origin}/seqta/student/load/prefs?`, {
@@ -760,7 +760,7 @@ async function GetLessonColours() {
}
}
-function SetTimetableSubtitle() {
+function setTimetableSubtitle() {
const homelessonsubtitle = document.getElementById("home-lesson-subtitle");
if (!homelessonsubtitle) return;
homelessonsubtitle.innerText = lessonsSubtitleForViewDate(currentSelectedDate);
diff --git a/src/seqta/utils/notices/noticeHomeUi.ts b/src/seqta/utils/notices/noticeHomeUi.ts
index 5564826a..36b4b7aa 100644
--- a/src/seqta/utils/notices/noticeHomeUi.ts
+++ b/src/seqta/utils/notices/noticeHomeUi.ts
@@ -1,7 +1,7 @@
import { animate } from "motion";
import LogoLight from "@/resources/icons/betterseqta-light-icon.png";
import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
-import { GetThresholdOfColor } from "@/seqta/ui/colors/getThresholdColour";
+import { getThresholdOfColor } from "@/seqta/ui/colors/getThresholdColour";
import { getMockNotices } from "@/seqta/ui/dev/hideSensitiveContent";
import { settingsState } from "@/seqta/utils/listeners/settingsState";
import { noticeMatchesLabelFilter } from "@/seqta/utils/notices/noticeLabelFilters";
@@ -109,7 +109,7 @@ function elementScale(el: HTMLElement) {
export function processNoticeColor(colour: unknown): string | undefined {
if (typeof colour !== "string") return undefined;
- const rgb = GetThresholdOfColor(colour);
+ const rgb = getThresholdOfColor(colour);
if (rgb < 100 && settingsState.DarkMode) return undefined;
return colour;
}
diff --git a/src/seqta/utils/openThemeStoreWithHighlight.ts b/src/seqta/utils/openThemeStoreWithHighlight.ts
index d626eb14..8ce4f96e 100644
--- a/src/seqta/utils/openThemeStoreWithHighlight.ts
+++ b/src/seqta/utils/openThemeStoreWithHighlight.ts
@@ -11,7 +11,7 @@ export function consumePendingHighlightThemeId(): string | null {
export async function openThemeStoreWithHighlight(themeId: string): Promise {
pendingHighlightThemeId = themeId;
- const { OpenStorePage } = await import("@/seqta/ui/renderStore");
- await OpenStorePage();
+ const { openStorePage } = await import("@/seqta/ui/renderStore");
+ await openStorePage();
window.dispatchEvent(new CustomEvent("bsplus:highlight-theme", { detail: { themeId } }));
}
diff --git a/src/seqta/utils/openers/menuOptionsState.ts b/src/seqta/utils/openers/menuOptionsState.ts
index ee79163d..599d13e5 100644
--- a/src/seqta/utils/openers/menuOptionsState.ts
+++ b/src/seqta/utils/openers/menuOptionsState.ts
@@ -1,5 +1,5 @@
/**
- * Tiny flag module with no imports — breaks the OpenMenuOptions ↔ sidebarMenuIcons
+ * Tiny flag module with no imports — breaks the openMenuOptions ↔ sidebarMenuIcons
* cycle that caused Vite HMR: "does not provide an export named 'MenuOptionsOpen'".
*/
export let MenuOptionsOpen = false;
diff --git a/src/seqta/utils/openers/menuOrder.ts b/src/seqta/utils/openers/menuOrder.ts
index 5a857162..01704074 100644
--- a/src/seqta/utils/openers/menuOrder.ts
+++ b/src/seqta/utils/openers/menuOrder.ts
@@ -1,7 +1,7 @@
import type { SettingsState } from "@/types/storage";
/** Reorder `#menu > ul` children to match a saved `menuorder` key list. */
-export function ChangeMenuItemPositions(menuorder: SettingsState["menuorder"]) {
+export function changeMenuItemPositions(menuorder: SettingsState["menuorder"]) {
const menuRoot = document.querySelector("#menu")?.firstChild;
if (!menuRoot) return;
diff --git a/src/seqta/utils/openers/openAboutPage.ts b/src/seqta/utils/openers/openAboutPage.ts
index 25cab279..e3f3d40d 100644
--- a/src/seqta/utils/openers/openAboutPage.ts
+++ b/src/seqta/utils/openers/openAboutPage.ts
@@ -6,7 +6,7 @@ import { resolveExtensionAssetUrl } from "@/lib/extensionAssetUrl";
import brandingDark from "@/resources/branding/dark.jpg";
import brandingLight from "@/resources/branding/light.jpg";
-export function OpenAboutPage() {
+export function openAboutPage() {
const header = stringToHTML(
/* html */
`