Merge branch 'BetterSEQTA:main' into globalSearch-improvements

This commit is contained in:
StroepWafel
2026-01-27 21:25:07 +10:30
committed by GitHub
7 changed files with 1970 additions and 88 deletions
+1924
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "betterseqtaplus", "name": "betterseqtaplus",
"version": "3.4.12", "version": "3.4.13",
"type": "module", "type": "module",
"description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development add add heaps more features!", "description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development add add heaps more features!",
"browserslist": "> 0.5%, last 2 versions, not dead", "browserslist": "> 0.5%, last 2 versions, not dead",
@@ -49,7 +49,7 @@
"mime-types": "^3.0.1", "mime-types": "^3.0.1",
"prettier": "^3.5.3", "prettier": "^3.5.3",
"process": "^0.11.10", "process": "^0.11.10",
"publish-browser-extension": "^3.0.1", "publish-browser-extension": "^4.0.0",
"sass": "^1.85.1", "sass": "^1.85.1",
"sass-loader": "^16.0.5", "sass-loader": "^16.0.5",
"semver": "^7.7.1", "semver": "^7.7.1",
+6 -4
View File
@@ -50,10 +50,12 @@ async function init() {
documentLoadStyle.textContent = documentLoadCSS; documentLoadStyle.textContent = documentLoadCSS;
document.head.appendChild(documentLoadStyle); document.head.appendChild(documentLoadStyle);
const icon = document.querySelector( const icons =
'link[rel*="icon"]', document.querySelectorAll<HTMLLinkElement>('link[rel*="icon"]');
)! as HTMLLinkElement;
icon.href = icon48; // Change the icon icons.forEach((link) => {
link.href = icon48;
});
try { try {
await initializeSettingsState(); await initializeSettingsState();
+1 -1
View File
@@ -825,7 +825,7 @@ div > ol:has(.uiFileHandlerWrapper) {
[aria-labelledby="lixycoxs-tab-1"] [minlength="0"] { [aria-labelledby="lixycoxs-tab-1"] [minlength="0"] {
min-height: 128px !important; min-height: 128px !important;
} }
.student #menu > ul::before { body.student #menu > ul::before {
background-image: var(--betterseqta-logo) !important; background-image: var(--betterseqta-logo) !important;
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
+9 -2
View File
@@ -147,14 +147,21 @@ export class ThemeManager {
public async initialize(): Promise<void> { public async initialize(): Promise<void> {
console.debug("[ThemeManager] Starting initialization"); console.debug("[ThemeManager] Starting initialization");
try { try {
// Check if theme creator was open during reload const neumorphicThemeId = "9a9786d1-b5fc-4a91-8c7a-f8bf7f7679ad";
const migrationCSS = "#title {\nbackground: transparent !important;\n}";
const theme = (await localforage.getItem(neumorphicThemeId)) as CustomTheme | null;
if (theme && theme.CustomCSS && !theme.CustomCSS.includes("#title {\nbackground: transparent !important;\n}")) {
theme.CustomCSS = theme.CustomCSS + "\n" + migrationCSS;
await localforage.setItem(neumorphicThemeId, theme);
}
const themeCreatorOpen = localStorage.getItem("themeCreatorOpen"); const themeCreatorOpen = localStorage.getItem("themeCreatorOpen");
if (themeCreatorOpen === "true") { if (themeCreatorOpen === "true") {
console.debug( console.debug(
"[ThemeManager] Theme creator was open, clearing preview state", "[ThemeManager] Theme creator was open, clearing preview state",
); );
this.clearPreview(); this.clearPreview();
// Clean up the flag
localStorage.removeItem("themeCreatorOpen"); localStorage.removeItem("themeCreatorOpen");
} }
+10 -68
View File
@@ -104,17 +104,7 @@ export async function loadHomePage() {
const date = new Date(); const date = new Date();
const TodayFormatted = formatDate(date); const TodayFormatted = formatDate(date);
const [timetablePromise, assessmentsPromise, classesPromise, prefsPromise] = [ const [assessmentsPromise, classesPromise, prefsPromise] = [
fetch(`${location.origin}/seqta/student/load/timetable?`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
from: TodayFormatted,
until: TodayFormatted,
student: 69,
}),
}).then((res) => res.json()),
GetUpcomingAssessments(), GetUpcomingAssessments(),
GetActiveClasses(), GetActiveClasses(),
@@ -126,65 +116,13 @@ export async function loadHomePage() {
}).then((res) => res.json()), }).then((res) => res.json()),
]; ];
const [timetableData, assessments, classes, prefs] = await Promise.all([ const [assessments, classes, prefs] = await Promise.all([
timetablePromise,
assessmentsPromise, assessmentsPromise,
classesPromise, classesPromise,
prefsPromise, prefsPromise,
]); ]);
const dayContainer = document.getElementById("day-container"); callHomeTimetable(TodayFormatted, true);
if (dayContainer && timetableData.payload.items.length > 0) {
const lessonArray = timetableData.payload.items.sort((a: any, b: any) =>
a.from.localeCompare(b.from),
);
const colours = await GetLessonColours();
dayContainer.innerHTML = "";
for (let i = 0; i < lessonArray.length; i++) {
const lesson = lessonArray[i];
const subjectname = `timetable.subject.colour.${lesson.code}`;
const subject = colours.find(
(element: any) => element.name === subjectname,
);
lesson.colour = subject
? `--item-colour: ${subject.value};`
: "--item-colour: #8e8e8e;";
lesson.from = lesson.from.substring(0, 5);
lesson.until = lesson.until.substring(0, 5);
if (settingsState.timeFormat === "12") {
lesson.from = convertTo12HourFormat(lesson.from);
lesson.until = convertTo12HourFormat(lesson.until);
}
lesson.attendanceTitle = CheckUnmarkedAttendance(lesson.attendance);
const div = makeLessonDiv(lesson, i + 1);
if (GetThresholdOfColor(subject?.value) > 300) {
const firstChild = div.firstChild as HTMLElement;
if (firstChild) {
firstChild.classList.add("day-inverted");
}
}
dayContainer.appendChild(div.firstChild!);
}
if (currentSelectedDate.getDate() === date.getDate()) {
for (let i = 0; i < lessonArray.length; i++) {
CheckCurrentLesson(lessonArray[i], i + 1);
}
CheckCurrentLessonAll(lessonArray);
}
} else if (dayContainer) {
dayContainer.innerHTML = `
<div class="day-empty">
<img src="${browser.runtime.getURL(LogoLight)}" />
<p>No lessons available.</p>
</div>`;
}
dayContainer?.classList.remove("loading");
const activeClass = classes.find((c: any) => c.hasOwnProperty("active")); const activeClass = classes.find((c: any) => c.hasOwnProperty("active"));
const activeSubjects = activeClass?.subjects || []; const activeSubjects = activeClass?.subjects || [];
@@ -742,7 +680,8 @@ function callHomeTimetable(date: string, change?: any) {
GetLessonColours().then((colours) => { GetLessonColours().then((colours) => {
let subjects = colours; let subjects = colours;
for (let i = 0; i < lessonArray.length; i++) { for (let i = 0; i < lessonArray.length; i++) {
let subjectname = `timetable.subject.colour.${lessonArray[i].code}`;
let subjectname = ((lessonArray[i].type == "tutorial") ? `timetable.tutor.${lessonArray[i].tutorID}` : `timetable.subject.colour.${lessonArray[i].code}`);
let subject = subjects.find( let subject = subjects.find(
(element: any) => element.name === subjectname, (element: any) => element.name === subjectname,
@@ -930,17 +869,19 @@ function makeLessonDiv(lesson: any, num: number) {
programmeID, programmeID,
metaID, metaID,
assessments, assessments,
type
} = lesson; } = lesson;
let lessonString = ` let lessonString = `
<div class="day" id="${code + num}" style="${colour}"> <div class="day" id="${code + num}" style="${colour}">
<h2>${description || "Unknown"}</h2> <h2>${(type == "class") ? description : (type == "tutorial") ? "Tutorial" : "Unknown"}</h2>
<h3>${staff || "Unknown"}</h3> <h3>${staff || "Unknown"}</h3>
<h3>${room || "Unknown"}</h3> <h3>${(type == "class") ? room : (type == "tutorial") ? "N/A" : "Unknown"}</h3>
<h4>${from || "Unknown"} - ${until || "Unknown"}</h4> <h4>${from || "Unknown"} - ${until || "Unknown"}</h4>
<h5>${attendanceTitle || "Unknown"}</h5> <h5>${attendanceTitle || "Unknown"}</h5>
`; `;
if (type == "class") {
if (programmeID !== 0) { if (programmeID !== 0) {
lessonString += ` lessonString += `
<div class="day-button clickable" style="right: 5px;" onclick="location.href='${buildAssessmentURL(programmeID, metaID)}'">${assessmentsicon}</div> <div class="day-button clickable" style="right: 5px;" onclick="location.href='${buildAssessmentURL(programmeID, metaID)}'">${assessmentsicon}</div>
@@ -965,6 +906,7 @@ function makeLessonDiv(lesson: any, num: number) {
</div> </div>
`; `;
} }
}
lessonString += "</div>"; lessonString += "</div>";
const element = stringToHTML(lessonString); const element = stringToHTML(lessonString);
@@ -32,6 +32,13 @@ export function OpenWhatsNewPopup() {
const text = stringToHTML(/* html */ ` const text = stringToHTML(/* html */ `
<div class="whatsnewTextContainer" style="height: 50%;overflow-y: auto;"> <div class="whatsnewTextContainer" style="height: 50%;overflow-y: auto;">
<h1>3.4.13 - Bug Fixes & Styling Improvements</h1>
<li>Fixed house/year box hard failing when house_colour does not exist</li>
<li>Fixed message of the day being unreadable in light mode</li>
<li>Fixed global font styling issues due to SEQTA updates</li>
<li>Fixed styling issues with title bar and other elements</li>
<li>Other minor bug fixes and improvements</li>
<h1>3.4.12 - Privacy Updates & Bug Fixes</h1> <h1>3.4.12 - Privacy Updates & Bug Fixes</h1>
<li>Added privacy statement</li> <li>Added privacy statement</li>
<li>Added disclaimer modal to assessment averages switch</li> <li>Added disclaimer modal to assessment averages switch</li>