This commit is contained in:
Zan
2025-11-29 18:42:54 +01:00
parent de59809872
commit e171ce93b6
2 changed files with 13 additions and 1 deletions

View File

@@ -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';

View File

@@ -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>