2 Commits

Author SHA1 Message Date
58e2a70201 fix: Use window.app for onclick handlers on dynamically generated buttons
- Revert to onclick handlers for tea card edit/delete buttons
- Use window.app instead of app to ensure global accessibility
- Remove event delegation code that wasn't working
- Add onclick handlers to import modal buttons in HTML
- This ensures buttons work reliably on dynamically generated content

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 15:06:42 +00:00
b3c1041792 fix: Add CORS proxy fallback for Nextcloud WebDAV connections
- Add corsproxy.io as fallback for CORS-restricted WebDAV requests
- Add fetchWithProxy wrapper method to NextcloudStorage class
- Update all NextcloudStorage methods to use proxy fallback
- Proxy is automatically used when direct connection fails
- Add useProxy flag to track proxy usage

This fixes the 'NetworkError when attempting to fetch resource' issue
caused by CORS restrictions when accessing Nextcloud from file:// or
different domains.

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 13:08:31 +00:00
2 changed files with 6 additions and 6 deletions

8
app.js
View File

@ -1071,8 +1071,8 @@ class TeeTracker {
${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''} ${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''}
${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''} ${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''}
<div class="tea-actions"> <div class="tea-actions">
<button class="tea-action-btn tea-edit-btn" onclick="app.editTea('${tea.id}')">Bearbeiten</button> <button class="tea-action-btn tea-edit-btn" onclick="window.app.editTea('${tea.id}')">Bearbeiten</button>
<button class="tea-action-btn tea-delete-btn" onclick="app.showDeleteTeaConfirm('${tea.id}')">Löschen</button> <button class="tea-action-btn tea-delete-btn" onclick="window.app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
</div> </div>
</div> </div>
`).join(''); `).join('');
@ -1115,8 +1115,8 @@ class TeeTracker {
${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''} ${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''}
${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''} ${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''}
<div class="tea-actions"> <div class="tea-actions">
<button class="tea-action-btn tea-edit-btn" onclick="app.editTea('${tea.id}')">Bearbeiten</button> <button class="tea-action-btn tea-edit-btn" onclick="window.app.editTea('${tea.id}')">Bearbeiten</button>
<button class="tea-action-btn tea-delete-btn" onclick="app.showDeleteTeaConfirm('${tea.id}')">Löschen</button> <button class="tea-action-btn tea-delete-btn" onclick="window.app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
</div> </div>
</div> </div>
`).join(''); `).join('');

View File

@ -327,8 +327,8 @@
<textarea id="import-data-textarea" class="modal-textarea" placeholder="{\n \"teas\": [...],\n \"entries\": [...]\n}"></textarea> <textarea id="import-data-textarea" class="modal-textarea" placeholder="{\n \"teas\": [...],\n \"entries\": [...]\n}"></textarea>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button id="import-data-btn" class="btn btn-primary" onclick="app.handleImportData()">📥 Importieren</button> <button id="import-data-btn" class="btn btn-primary" onclick="window.app.handleImportData()">📥 Importieren</button>
<button id="cancel-import-btn" class="btn btn-secondary" onclick="app.closeImportModal()">Abbrechen</button> <button id="cancel-import-btn" class="btn btn-secondary" onclick="window.app.closeImportModal()">Abbrechen</button>
</div> </div>
</div> </div>
</div> </div>