|
@@ -12,7 +12,7 @@ export function toTime(t: number): string {
|
|
|
const minutes = (t - 3600 * hours) / 60;
|
|
const minutes = (t - 3600 * hours) / 60;
|
|
|
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(
|
|
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(
|
|
|
2,
|
|
2,
|
|
|
- "0",
|
|
|
|
|
|
|
+ "0"
|
|
|
)}`;
|
|
)}`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -47,7 +47,7 @@ export function openURLInNewWindow(url: string) {
|
|
|
window.open(
|
|
window.open(
|
|
|
url,
|
|
url,
|
|
|
"_blank",
|
|
"_blank",
|
|
|
- "resizable=yes, scrollbars=yes, titlebar=yes, width=800, height=600",
|
|
|
|
|
|
|
+ "resizable=yes, scrollbars=yes, titlebar=yes, width=800, height=600"
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -59,7 +59,7 @@ export const contextClassRe = /^\dK/;
|
|
|
export function classesPDFLink(
|
|
export function classesPDFLink(
|
|
|
cls: TaughtClass | HistoricClassEntry,
|
|
cls: TaughtClass | HistoricClassEntry,
|
|
|
semester: string | null = null,
|
|
semester: string | null = null,
|
|
|
- version: string | null = null,
|
|
|
|
|
|
|
+ version: string | null = null
|
|
|
): string {
|
|
): string {
|
|
|
let semesterFolder;
|
|
let semesterFolder;
|
|
|
let semVerFolder;
|
|
let semVerFolder;
|
|
@@ -92,7 +92,7 @@ export function getSemVerFolder(semester: string, version: string): string {
|
|
|
|
|
|
|
|
export function addRemoveClassTitle(
|
|
export function addRemoveClassTitle(
|
|
|
module: Module | null,
|
|
module: Module | null,
|
|
|
- isChosen: boolean,
|
|
|
|
|
|
|
+ isChosen: boolean
|
|
|
): string {
|
|
): string {
|
|
|
if (module?.hasCompleted) return "Modul bereits bestanden";
|
|
if (module?.hasCompleted) return "Modul bereits bestanden";
|
|
|
if (module?.maxAttemptsReached)
|
|
if (module?.maxAttemptsReached)
|
|
@@ -120,19 +120,6 @@ export function matchesOneOf(list1: any[], list2: any[]): boolean {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const MAX_ATTEMPT_COUNT = 2;
|
|
export const MAX_ATTEMPT_COUNT = 2;
|
|
|
-
|
|
|
|
|
-// TODO: Set externally
|
|
|
|
|
-export const URLS = {
|
|
|
|
|
- GITLAB_REPO: "https://example.com",
|
|
|
|
|
- GITLAB_REPO_TICKET: "https://example.com",
|
|
|
|
|
- MODULE_SIGNUP: "https://example.com",
|
|
|
|
|
- STUDENTHUB: "https://example.com",
|
|
|
|
|
- ALL_TIMETABLES: "https://example.com",
|
|
|
|
|
- ADDITIONAL_MODULE_INFORMATION: "https://example.com",
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-export const SCHOOL_NAME = "<TODO>";
|
|
|
|
|
-
|
|
|
|
|
export const MinFullNameSearchLength = 4;
|
|
export const MinFullNameSearchLength = 4;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -168,7 +155,7 @@ export function parsePDFVersion(versionStr: string | null): {
|
|
|
|
|
|
|
|
export function samePDFVersion(
|
|
export function samePDFVersion(
|
|
|
vers1: string | null,
|
|
vers1: string | null,
|
|
|
- vers2: string | null,
|
|
|
|
|
|
|
+ vers2: string | null
|
|
|
): boolean {
|
|
): boolean {
|
|
|
const parsed1 = parsePDFVersion(vers1);
|
|
const parsed1 = parsePDFVersion(vers1);
|
|
|
const parsed2 = parsePDFVersion(vers2);
|
|
const parsed2 = parsePDFVersion(vers2);
|
|
@@ -180,14 +167,14 @@ export function samePDFVersion(
|
|
|
|
|
|
|
|
export function semesterVersionString(
|
|
export function semesterVersionString(
|
|
|
semester: string,
|
|
semester: string,
|
|
|
- version: string,
|
|
|
|
|
|
|
+ version: string
|
|
|
): string {
|
|
): string {
|
|
|
return `${semester}|${version}`;
|
|
return `${semester}|${version}`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export function semesterVersionStringC(
|
|
export function semesterVersionStringC(
|
|
|
semVer: SemesterVersion | null,
|
|
semVer: SemesterVersion | null,
|
|
|
- versionIdx = 0,
|
|
|
|
|
|
|
+ versionIdx = 0
|
|
|
): string | null {
|
|
): string | null {
|
|
|
if (semVer == null) return null;
|
|
if (semVer == null) return null;
|
|
|
return `${semVer.semester}|${semVer.versions[versionIdx]}`;
|
|
return `${semVer.semester}|${semVer.versions[versionIdx]}`;
|