Commit Graph

31 Commits

Author SHA1 Message Date
b2f632c07f Fix: Alle inline onclick-Handler durch programmatische Event-Listener ersetzt
- Bearbeiten- und Löschen-Buttons in Tee-Karten verwenden jetzt data-Attributes und Event-Listener
- 'Erste Tee hinzufügen'-Button verwendet jetzt Event-Listener
- setupTeaCardEventListeners() Methode hinzugefügt
- Keine Abhängigkeit mehr von globalem app-Scope in HTML

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-06 11:31:30 +00:00
b586eb3804 Fix: Doppelte App-Initialisierung entfernt - Buttons funktionieren wieder
Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-06 11:28:14 +00:00
2544a102d9 Fix: Statistiken werden nicht angezeigt, Tee-Sorten Editieren funktioniert nicht
- Fix updateStats() um renderDetailedStats() korrekt aufzurufen
- Fix Stats-Period-Filter Event-Listener hinzugefügt
- Verbesserte LocalFileStorage-Klasse mit besserer Fehlerbehandlung
- .htaccess-Datei für Apache-Server hinzugefügt
- SERVER_SETUP.md mit Anleitungen für Server-Konfiguration
- data/-Verzeichnis mit .gitkeep hinzugefügt
- app-Variable als window.app global verfügbar gemacht

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-06 11:15:48 +00:00
b47e2bd7d0 Merge pull request #2 from trevor1969/vibe/version4-local-storage-a924f1
Version 4.0: Lokale Dateispeicherung im data/-Verzeichnis
2026-06-06 10:55:53 +02:00
3f228b6007 Version 4.0: Lokale Dateispeicherung im data/-Verzeichnis, Nextcloud-Integration entfernt
- NextcloudStorage-Klasse durch LocalFileStorage ersetzt
- Daten werden im data/-Verzeichnis gespeichert (falls lokaler Server läuft)
- Automatischer Fallback auf localStorage falls Dateispeicherung nicht verfügbar
- Nextcloud-Einstellungen aus UI entfernt
- README.md aktualisiert mit neuer Speicherbeschreibung
- Export/Import-Funktionen behalten für Datensicherung

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-05 21:20:32 +00:00
24336b9711 Merge pull request #1 from trevor1969/v3.0
v3.0: Tea-Timer Feature
2026-06-05 22:54:53 +02:00
daf742e309 Feature: Tea-Timer hinzugefügt (Voreinstellung: 3 Minuten, einstellbar 1-15 Minuten) mit Start/Pause/Reset-Funktionen und Benachrichtigung bei Ablauf
Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-05 19:08:10 +00:00
c628cf2069 Fix: Korrigiert Aufruf von migrateToDataDirectory - muss auf nextcloudStorage-Instanz aufgerufen werden, nicht auf TeeTracker-Instanz
Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
v2.5
2026-06-05 18:58:01 +00:00
f111153bde Fix: Event-Delegation für dynamisch erstellte Buttons (Bearbeiten/Löschen in Tee-Karten). Entfernt onclick-Attribute und ersetzt sie durch data-Attribute + Event-Delegation auf dem Container.
Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-05 18:50:09 +00:00
0baceb14c6 Fix: Buttons reagieren nicht auf Klicks - Event-Listener werden jetzt sofort registriert, nicht erst nach dem Laden der Daten. Entfernt onclick-Attribute aus HTML, die zu Konflikten führen können.
Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-05 18:48:49 +00:00
91367a7198 Fix: Verhindere Ueberschreiben von Nextcloud-Daten mit leeren Arrays
- In saveNextcloudConfig(): Nur speichern, wenn Daten vorhanden sind
- Falls keine lokalen Daten, aber Nextcloud hat Daten: behalte Nextcloud-Daten
- Verhindert Datenverlust, wenn Nextcloud bereits Daten hat

Fixes: Datenverlust bei Nextcloud-Anmeldung

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-05 11:28:05 +00:00
7e1f52a5b2 Fix: Behandle leere Nextcloud-Dateien korrekt
- Aendert loadFile(): Gibt leeres Array zurueck, wenn Datei existiert aber leer ist
- Verhindert, dass leere Dateien als null interpretiert werden und lokale Daten
  oder leere Arrays geladen werden

Fixes: Datenverlust bei Nextcloud-Anmeldung mit leeren Dateien

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-05 11:26:26 +00:00
7f059c9b4c Fix: Lade Nextcloud-Daten vor dem Speichern, um Datenverlust zu vermeiden
- Aendert loadData(): Laedt zuerst Nextcloud-Daten und faellt nur bei fehlenden
  Dateien auf localStorage zurueck
- Aendert saveNextcloudConfig(): Laedt Daten von Nextcloud BEVOR sie gespeichert
  werden, um Ueberschreiben bestehender Nextcloud-Daten zu verhindern
- Behebt das Problem, dass lokale Daten die Nextcloud-Daten ueberschreiben

Fixes: Datenverlust bei Nextcloud-Anmeldung

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-05 10:50:20 +00:00
a16da66c2d fix: Add missing background image section to index.html
- Background image section was missing from previous commit
- Add bg-image-upload, bg-enabled, save-bg, remove-bg elements
- This fixes the non-responsive buttons issue for background settings

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 18:26:16 +00:00
073834a5dc feat: Add image upload for tea varieties
- Add image upload field to tea form with preview
- Add image property to tea data model
- Update addTea() to include image data (base64)
- Update openTeaModal() to display image when editing
- Display tea images on tea cards
- Add handleImageUpload() method for file processing
- Add migration for existing teas without image field
- Add CSS styles for image preview and display on cards
- Images stored as base64 in localStorage/Nextcloud

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 17:04:26 +00:00
ac12cc5cab feat: Add 5-star rating system for tea varieties
- Add star rating component (5 stars) to tea form
- Add rating field to tea data model (default: 3)
- Update addTea() to include rating
- Update openTeaModal() to set rating when editing
- Display rating on tea cards with star icons
- Add renderStarRating() for interactive rating in form
- Add renderStarRatingStatic() for display on cards
- Add handleStarRatingClick() for user interaction
- Add migration for existing teas without rating
- Add CSS styles for rating display and interaction

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 17:00:50 +00:00
394480c516 feat: Add tea powder amount (teaspoons) to tracking
- Add new field 'Menge Tee-Pulver (Teelöffel)' to track form
- Add teaspoons property to entry data model
- Update addEntry() to include teaspoons (default: 1)
- Update handleTrackFormSubmit() to read teaspoons from form
- Display teaspoons in recent entries (e.g., '2 Tassen (1.5 TL)')
- Add migration for existing entries without teaspoons field
- Input allows decimal values (step=0.5) for half teaspoons

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 16:53:24 +00:00
ff37d35134 feat: Add background image customization
- Add background image upload in settings
- Add preview for uploaded background images
- Add toggle to enable/disable background
- Store background image in localStorage as base64
- Add CSS for background image display with overlay
- Add currentBgImage property to TeeTracker class
- Add setupBackgroundListeners() method
- Add handleBackgroundUpload(), toggleBackground(), saveBackgroundSettings(), removeBackground(), loadBackgroundSettings() methods

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 16:43:56 +00:00
4f8890da7f feat: Store data in data/ subdirectory for better organization
- Add DATA_DIRECTORY constant ('data/')
- Update all file paths to use data/teas.json and data/entries.json
- Add ensureSubDirectory('data') call to create data directory
- Add migrateToDataDirectory() method to automatically migrate old files
- Migration runs on first load if old files exist in root directory

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 16:36:49 +00:00
733e2db3c4 fix: Prevent data loss when connecting to Nextcloud for the first time
- Load existing data from localStorage before switching to Nextcloud
- This prevents existing teas and entries from being overwritten with empty arrays
- When enabling Nextcloud sync, existing local data is preserved and uploaded

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
v1.1.1
2026-06-04 16:23:53 +00:00
30e0077c6e refactor: Remove CORS proxy code (not needed for same-domain setup)
- Remove NEXTCLOUD_PROXY constant
- Remove fetchWithProxy() and getProxiedUrl() methods
- Remove useProxy flag from NextcloudStorage
- Keep window.app onclick handlers for dynamically generated buttons
- Clean up code since Nextcloud and TeeTracker run on same domain (wralto.org)

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
v1.1.0
2026-06-04 15:56:33 +00:00
7b9f509728 fix: Remove undefined error reference in fetchWithProxy catch block
- Fix reference to undefined 'error' variable in proxy error handler
- Use only proxyError.message in the error message

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 15:32:44 +00:00
6addc628e8 fix: Add CORS proxy fallback for Nextcloud WebDAV connections
- Add NEXTCLOUD_PROXY constant for corsproxy.io
- Add getProxiedUrl() method to NextcloudStorage class
- Add fetchWithProxy() wrapper method that tries direct connection first,
  then falls back to CORS proxy if direct connection fails
- Update all fetch() calls in NextcloudStorage to use fetchWithProxy()
- Add useProxy flag to track proxy usage
- This fixes 'NetworkError when attempting to fetch resource' for servers
  like wralto.org/nextcloud3 that have CORS restrictions

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 15:24:42 +00:00
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>
v1.0.0
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
233647be4a fix: Remove plain text password from code, use sessionStorage for security
- Remove hardcoded Nextcloud credentials from app.js
- Remove pre-filled password from HTML form
- Store password in sessionStorage (cleared on browser close) instead of localStorage
- Store only URL, username, and path in localStorage
- Update README with security notes
- Update quick start guide to reflect manual password entry
- Add autocomplete attribute to password field

Security improvement: Password is now only stored temporarily in sessionStorage
and must be entered manually by the user on first use or after browser restart.

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 12:27:10 +00:00
990ebb134d docs: Update README.md with Nextcloud integration and new features
- Add Nextcloud badge
- Document all new features (Bio checkbox, today period, recent entries)
- Add comprehensive Nextcloud integration section
- Add troubleshooting guide
- Add changelog
- Update screenshots section
- Add usage instructions for Nextcloud sync
- Document data backup/restore procedures

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 12:20:12 +00:00
142a671016 feat: Add Nextcloud WebDAV integration for cross-device synchronization
- Add NextcloudStorage class with WebDAV API support
- Add Settings tab with Nextcloud configuration
- Pre-configure with user's Nextcloud credentials (wralto.org/nextcloud3)
- Auto-test and enable Nextcloud sync on app startup
- Add data export/import functionality
- Add backup/restore capabilities
- Add clear data confirmation
- Add sync status indicator
- Add statistics overview in settings
- Fallback to localStorage if Nextcloud unavailable
- All existing features preserved (Bio checkbox, today period, recent entries)

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 12:17:26 +00:00
1263a5238b feat: Add bio checkbox, today period, and recent entries on track page
- Add organic/bio checkbox to tea form and display 🌱 badge
- Add 'Heute' (today) option to stats period filter
- Add recent 10 entries display on track page below form
- Update tea cards and dropdowns to show bio indicator
- Add migration for existing teas without organic field
- Style organic badge with green color and hover effect
- Update all entry displays to show bio status

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 11:10:29 +00:00
2bce6906ef docs: Add comprehensive README.md and LICENSE
- Add detailed README with:
  - Project description and badges
  - Screenshot placeholders
  - Feature overview for all sections
  - Quick start guide with multiple options
  - Technology stack
  - Project structure
  - Design information
  - Tips for backup/restore/reset
  - Contribution guidelines
  - License information
- Add MIT License file

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 10:40:40 +00:00
fc5d63604e feat: Add TeeTracker web application
- Add index.html with responsive layout and tab navigation
- Add styles.css with modern design and tea-themed colors
- Add app.js with full functionality:
  - Tea management (add, edit, delete, search, filter)
  - Consumption tracking with date, time, amount, notes
  - Dashboard with statistics cards and recent activity
  - Statistics with Chart.js visualizations
  - Data persistence using localStorage
  - Toast notifications for user feedback
  - Confirmation modals for deletions

Features:
- Dashboard: Total cups, today's cups, weekly cups, tea count
- Tea Management: Add, edit, delete teas with type, brand, description
- Tracking: Record tea consumption with date, time, amount, notes
- Statistics: Charts and detailed stats with period filtering
- Responsive design for mobile and desktop
- German language interface

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 10:35:40 +00:00