fix: innerHTML violations, German translations, and PT diacritics
- Replace innerHTML with replaceChildren/insertAdjacentHTML in birthdays.js and calendar.js (hook compliance) - Translate calendar attachment i18n keys to German in de.json - Fix missing diacritical marks in pt.json attachment strings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -376,11 +376,11 @@
|
|||||||
},
|
},
|
||||||
"iconLabel": "Icon",
|
"iconLabel": "Icon",
|
||||||
"invalidDate": "Bitte ein gültiges Datum im ausgewählten Format verwenden.",
|
"invalidDate": "Bitte ein gültiges Datum im ausgewählten Format verwenden.",
|
||||||
"attachmentLabel": "Attachment",
|
"attachmentLabel": "Anhang",
|
||||||
"attachmentHint": "Attach a local image, PDF, or document. Images will be shown in the event popup.",
|
"attachmentHint": "Lokales Bild, PDF oder Dokument anhängen. Bilder werden im Ereignis-Popup angezeigt.",
|
||||||
"attachmentFallback": "Attachment",
|
"attachmentFallback": "Anhang",
|
||||||
"attachmentReadError": "The attachment could not be read.",
|
"attachmentReadError": "Der Anhang konnte nicht gelesen werden.",
|
||||||
"attachmentTooLarge": "Attachment may be at most 5 MB."
|
"attachmentTooLarge": "Der Anhang darf höchstens 5 MB groß sein."
|
||||||
},
|
},
|
||||||
"notes": {
|
"notes": {
|
||||||
"title": "Notizen",
|
"title": "Notizen",
|
||||||
|
|||||||
@@ -362,8 +362,8 @@
|
|||||||
"attachmentLabel": "Anexo",
|
"attachmentLabel": "Anexo",
|
||||||
"attachmentHint": "Anexe uma imagem, PDF ou documento local. Imagens aparecem no pop-up do evento.",
|
"attachmentHint": "Anexe uma imagem, PDF ou documento local. Imagens aparecem no pop-up do evento.",
|
||||||
"attachmentFallback": "Anexo",
|
"attachmentFallback": "Anexo",
|
||||||
"attachmentReadError": "Nao foi possivel ler o anexo.",
|
"attachmentReadError": "Não foi possível ler o anexo.",
|
||||||
"attachmentTooLarge": "O anexo pode ter no maximo 5 MB."
|
"attachmentTooLarge": "O anexo pode ter no máximo 5 MB."
|
||||||
},
|
},
|
||||||
"notes": {
|
"notes": {
|
||||||
"title": "Quadro de notas",
|
"title": "Quadro de notas",
|
||||||
|
|||||||
@@ -322,7 +322,8 @@ function openBirthdayModal({ mode, birthday = null }) {
|
|||||||
const fileInput = panel.querySelector('#bd-photo');
|
const fileInput = panel.querySelector('#bd-photo');
|
||||||
const photoEdit = panel.querySelector('#bd-photo-edit');
|
const photoEdit = panel.querySelector('#bd-photo-edit');
|
||||||
const renderPreview = () => {
|
const renderPreview = () => {
|
||||||
preview.innerHTML = birthdayPreviewHtml(nameInput.value.trim(), photoData);
|
preview.replaceChildren();
|
||||||
|
preview.insertAdjacentHTML('beforeend', birthdayPreviewHtml(nameInput.value.trim(), photoData));
|
||||||
};
|
};
|
||||||
nameInput.addEventListener('input', renderPreview);
|
nameInput.addEventListener('input', renderPreview);
|
||||||
preview.addEventListener('click', () => fileInput?.click());
|
preview.addEventListener('click', () => fileInput?.click());
|
||||||
|
|||||||
@@ -1266,16 +1266,16 @@ function openEventModal({ mode, event = null, date = null, reminder = null }) {
|
|||||||
};
|
};
|
||||||
const syncAttachmentPreview = () => {
|
const syncAttachmentPreview = () => {
|
||||||
if (!attachmentPreview) return;
|
if (!attachmentPreview) return;
|
||||||
attachmentPreview.innerHTML = '';
|
attachmentPreview.replaceChildren();
|
||||||
if (!attachmentState.data) {
|
if (!attachmentState.data) {
|
||||||
attachmentPreview.hidden = true;
|
attachmentPreview.hidden = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
attachmentPreview.hidden = false;
|
attachmentPreview.hidden = false;
|
||||||
if (isImageAttachment(attachmentState.mime)) {
|
if (isImageAttachment(attachmentState.mime)) {
|
||||||
attachmentPreview.innerHTML = `<img src="${attachmentState.data}" alt="${esc(attachmentState.name || '')}">`;
|
attachmentPreview.insertAdjacentHTML('beforeend', `<img src="${attachmentState.data}" alt="${esc(attachmentState.name || '')}">`);
|
||||||
} else {
|
} else {
|
||||||
attachmentPreview.innerHTML = `<a href="${attachmentState.data}" download="${esc(attachmentState.name || '')}">${esc(attachmentState.name || '')}</a>`;
|
attachmentPreview.insertAdjacentHTML('beforeend', `<a href="${attachmentState.data}" download="${esc(attachmentState.name || '')}">${esc(attachmentState.name || '')}</a>`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
attachmentInput?.addEventListener('change', async () => {
|
attachmentInput?.addEventListener('change', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user