mirror of
https://github.com/QwIT-Development/firka-extension.git
synced 2026-06-12 03:41:39 +02:00
Online ora
This commit is contained in:
1
icons/contact.svg
Normal file
1
icons/contact.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 3.223a9.003 9.003 0 0 0-5.605 13.592L3 21l4.185-1.395A9.003 9.003 0 0 0 20.777 14m0-4A9.01 9.01 0 0 0 14 3.223M17 12a5 5 0 0 0-5-5m1 5a1 1 0 0 0-1-1"/></svg>
|
||||
|
After Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
@@ -655,16 +655,28 @@
|
||||
lesson.testInfo
|
||||
? (() => {
|
||||
const testType = lesson.testId ? testTypeMap[lesson.testId] : null;
|
||||
if (testType === "KONTAKT ÓRA") {
|
||||
return "";
|
||||
}
|
||||
const isKontaktOra = testType === "KONTAKT ÓRA";
|
||||
const isProjektOra = testType === "PROJEKT ÓRA";
|
||||
const indicatorClass = isProjektOra ? "homework-indicator" : "test-indicator";
|
||||
const iconPath = isProjektOra ? "icons/online.svg" : "icons/assigment.svg";
|
||||
const titleText = isProjektOra ? "Online óra" : LanguageManager.t("timetable.test_indicator");
|
||||
let indicatorClass = "test-indicator";
|
||||
let iconPath = "icons/assigment.svg";
|
||||
let titleText = LanguageManager.t("timetable.test_indicator");
|
||||
let altText = "Teszt";
|
||||
|
||||
if (isKontaktOra) {
|
||||
indicatorClass = "homework-indicator";
|
||||
iconPath = "icons/contact.svg";
|
||||
titleText = "Kontakt óra";
|
||||
altText = "Kontakt óra";
|
||||
} else if (isProjektOra) {
|
||||
indicatorClass = "homework-indicator";
|
||||
iconPath = "icons/project.svg";
|
||||
titleText = "Projekt óra";
|
||||
altText = "Projekt óra";
|
||||
}
|
||||
|
||||
return `
|
||||
<span class="lesson-indicator ${indicatorClass}" title="${titleText}">
|
||||
<img src="${chrome.runtime.getURL(iconPath)}" alt="${isProjektOra ? 'Online óra' : 'Teszt'}" style="width: 20px; height: 20px;">
|
||||
<img src="${chrome.runtime.getURL(iconPath)}" alt="${altText}" style="width: 20px; height: 20px;">
|
||||
</span>
|
||||
`;
|
||||
})()
|
||||
@@ -1252,20 +1264,35 @@
|
||||
|
||||
const isKontaktOra = testDetails && testDetails.type === "KONTAKT ÓRA";
|
||||
const isProjektOra = testDetails && testDetails.type === "PROJEKT ÓRA";
|
||||
const isSpecialType = isKontaktOra || isProjektOra;
|
||||
|
||||
if (!isKontaktOra) {
|
||||
const testSection = document.createElement('div');
|
||||
testSection.className = isProjektOra ? 'modal-section homework-section' : 'modal-section test-section';
|
||||
testSection.className = isSpecialType ? 'modal-section homework-section' : 'modal-section test-section';
|
||||
|
||||
const testH4 = document.createElement('h4');
|
||||
const testIcon = document.createElement('img');
|
||||
testIcon.src = chrome.runtime.getURL(isProjektOra ? 'icons/online.svg' : 'icons/assigment.svg');
|
||||
testIcon.alt = isProjektOra ? 'Online óra' : 'Teszt';
|
||||
|
||||
let iconPath = 'icons/assigment.svg';
|
||||
let sectionTitle = LanguageManager.t('timetable.test_indicator');
|
||||
let altText = 'Teszt';
|
||||
|
||||
if (isKontaktOra) {
|
||||
iconPath = 'icons/contact.svg';
|
||||
sectionTitle = 'Kontakt óra';
|
||||
altText = 'Kontakt óra';
|
||||
} else if (isProjektOra) {
|
||||
iconPath = 'icons/project.svg';
|
||||
sectionTitle = 'Projekt óra';
|
||||
altText = 'Projekt óra';
|
||||
}
|
||||
|
||||
testIcon.src = chrome.runtime.getURL(iconPath);
|
||||
testIcon.alt = altText;
|
||||
testIcon.style.width = '20px';
|
||||
testIcon.style.height = '20px';
|
||||
testH4.appendChild(testIcon);
|
||||
testH4.appendChild(document.createTextNode(isProjektOra ? 'Online óra' : LanguageManager.t('timetable.test_indicator')));
|
||||
if (isProjektOra) {
|
||||
testH4.appendChild(document.createTextNode(sectionTitle));
|
||||
if (isSpecialType) {
|
||||
testH4.style.color = 'var(--accent-accent)';
|
||||
}
|
||||
|
||||
@@ -1438,7 +1465,6 @@
|
||||
testSection.appendChild(testContent);
|
||||
body.appendChild(testSection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const lessonKey = getLessonKey(lesson);
|
||||
|
||||
Reference in New Issue
Block a user