Überarbeitung: HTML-Templates aus Repo entfernt, Plugin verbessert
- HTML-Vorlagen werden separat verteilt (nicht mehr im Plugin-Repo) - background.js: insertText API für korrekte Darstellung im Composer - background.js: automatischer Wechsel zu HTML-Modus bei Plain-Text - Options-Seite: komplett überarbeitetes UI mit Hotel-Branding - Popup: deutsches UI, gestylte Template-Auswahl - Notifications auf Deutsch - Fertige XPI im Repo
This commit is contained in:
@@ -57,11 +57,11 @@ function renderTemplates(templates) {
|
||||
const item = document.createElement('div');
|
||||
item.className = 'template-item';
|
||||
item.innerHTML = `
|
||||
<input type="checkbox" class="template-checkbox" data-id="${template.id}" style="margin-right: 10px;">
|
||||
<input type="checkbox" class="template-checkbox" data-id="${template.id}">
|
||||
<span class="template-name">${template.name}</span>
|
||||
<div>
|
||||
<button data-id="${template.id}" class="edit-btn">Edit</button>
|
||||
<button data-id="${template.id}" class="delete-btn">Delete</button>
|
||||
<div class="template-actions">
|
||||
<button data-id="${template.id}" class="edit-btn">Bearbeiten</button>
|
||||
<button data-id="${template.id}" class="delete-btn">Löschen</button>
|
||||
</div>
|
||||
`;
|
||||
templateList.appendChild(item);
|
||||
@@ -109,7 +109,7 @@ templateForm.addEventListener('submit', async (e) => {
|
||||
* Deletes a template
|
||||
*/
|
||||
async function handleDelete(e) {
|
||||
if (!confirm('Are you sure you want to delete this template?')) {
|
||||
if (!confirm('Diese Vorlage wirklich löschen?')) {
|
||||
return;
|
||||
}
|
||||
const idToDelete = e.target.dataset.id;
|
||||
@@ -136,8 +136,8 @@ async function handleEdit(e) {
|
||||
document.getElementById('template-content').value = template.content;
|
||||
|
||||
// Update UI to signal editing
|
||||
formLegend.textContent = 'Edit Template';
|
||||
saveButton.textContent = 'Update Template';
|
||||
formLegend.textContent = 'Vorlage bearbeiten';
|
||||
saveButton.textContent = 'Aktualisieren';
|
||||
cancelButton.style.display = 'inline';
|
||||
|
||||
// Scroll to the top of the form
|
||||
@@ -152,8 +152,8 @@ function resetForm() {
|
||||
templateForm.reset();
|
||||
document.getElementById('template-id').value = '';
|
||||
|
||||
formLegend.textContent = 'Add New Template';
|
||||
saveButton.textContent = 'Save Template';
|
||||
formLegend.textContent = 'Neue Vorlage erstellen';
|
||||
saveButton.textContent = 'Speichern';
|
||||
cancelButton.style.display = 'none';
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ document.getElementById('import-button').addEventListener('click', async () => {
|
||||
await saveTemplates(templates);
|
||||
renderTemplates(templates);
|
||||
|
||||
statusEl.textContent = `${importCount} Template(s) importiert!`;
|
||||
statusEl.textContent = `${importCount} Vorlage(n) importiert!`;
|
||||
statusEl.style.color = 'green';
|
||||
statusEl.style.display = 'inline';
|
||||
fileInput.value = '';
|
||||
|
||||
Reference in New Issue
Block a user