mirror of
https://github.com/QwIT-Development/firka-extension.git
synced 2026-06-12 03:41:39 +02:00
Fixes
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
(() => {
|
||||
async function waitForTranslations() {
|
||||
let attempts = 0;
|
||||
const maxAttempts = 200;
|
||||
while (
|
||||
(typeof window.LanguageManager === 'undefined') ||
|
||||
(window.LanguageManager && window.LanguageManager.t('navigation.dashboard') === 'navigation.dashboard')
|
||||
) {
|
||||
if (attempts++ > maxAttempts) break;
|
||||
await new Promise(resolve => setTimeout(resolve, 50));
|
||||
}
|
||||
}
|
||||
function formatDate(dateString) {
|
||||
if (!dateString) {
|
||||
return 'Ismeretlen dátum';
|
||||
@@ -264,6 +275,7 @@
|
||||
|
||||
async function transformMessagesPage() {
|
||||
try {
|
||||
await waitForTranslations();
|
||||
document.body.innerHTML = '';
|
||||
const kretaContainer = document.createElement('div');
|
||||
kretaContainer.className = 'kreta-container';
|
||||
|
||||
@@ -53,7 +53,7 @@ const createTemplate = {
|
||||
<img src="${chrome.runtime.getURL("icons/absences-" + (location.pathname == "/Hianyzas/Hianyzasok" ? "active" : "inactive") + ".svg")}" alt="${LanguageManager.t("navigation.absences")}">
|
||||
${LanguageManager.t("navigation.absences")}
|
||||
</a>
|
||||
<a href="https://eugyintezes.e-kreta.hu/api/bff/login" data-page="messages" class="nav-item ${location.pathname == "/uzenetek" ? "active" : ""}">
|
||||
<a href="https://eugyintezes.e-kreta.hu/api/bff/login" data-page="messages" class="nav-item ${location.pathname == "/" ? "active" : ""}">
|
||||
<img src="${chrome.runtime.getURL("icons/messages-" + (location.pathname == "/uzenetek" ? "active" : "inactive") + ".svg")}" alt="${LanguageManager.t("navigation.messages")}">
|
||||
${LanguageManager.t("navigation.messages")}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user