1*7e8ea635SAtari911# DokuWiki Calendar Plugin — Project History 2*7e8ea635SAtari911 3*7e8ea635SAtari911**Version 6.6.0** — Complete development history from v1.0 through v6.6.0. 4*7e8ea635SAtari911 5*7e8ea635SAtari911--- 6*7e8ea635SAtari911 7*7e8ea635SAtari911## Origins (v1.0–v4.x) 8*7e8ea635SAtari911 9*7e8ea635SAtari911The Calendar Plugin started as a basic DokuWiki calendar allowing users to add, edit, and delete events on specific dates within wiki pages. Events were stored as JSON files in DokuWiki's `data/meta/calendar/` directory, organized by month (`YYYY-MM.json`). Early versions established the core architecture: a `syntax.php` parser for `{{calendar}}` wiki markup, an `action.php` AJAX handler for event CRUD operations, and a `style.css` for layout. 10*7e8ea635SAtari911 11*7e8ea635SAtari911Key milestones in the early versions included namespace support (events scoped to wiki namespaces), multi-day events, task/checkbox support, event descriptions with wiki markup rendering, and a basic admin panel for management. 12*7e8ea635SAtari911 13*7e8ea635SAtari911--- 14*7e8ea635SAtari911 15*7e8ea635SAtari911## v5.0–v5.4: Feature Expansion 16*7e8ea635SAtari911 17*7e8ea635SAtari911### Sidebar Widget & Event Lists 18*7e8ea635SAtari911- `{{eventlist sidebar}}` — compact week-grid widget for DokuWiki sidebars showing today, tomorrow, and upcoming events 19*7e8ea635SAtari911- `{{eventpanel}}` — standalone scrollable event list 20*7e8ea635SAtari911- `{{eventlist range=N}}` — upcoming events for the next N days 21*7e8ea635SAtari911- `{{eventlist compact}}` — minimal event listing 22*7e8ea635SAtari911 23*7e8ea635SAtari911### Recurring Events 24*7e8ea635SAtari911- Events can be marked as recurring with a `recurring: true` flag and `recurringId` 25*7e8ea635SAtari911- Admin panel section for viewing and managing recurring series 26*7e8ea635SAtari911 27*7e8ea635SAtari911### Outlook Sync 28*7e8ea635SAtari911- Two-way sync with Microsoft Outlook calendars via `sync_outlook.php` 29*7e8ea635SAtari911- OAuth2 authentication flow, configurable sync intervals 30*7e8ea635SAtari911- Admin configuration panel for credentials and sync settings 31*7e8ea635SAtari911 32*7e8ea635SAtari911### Conflict Detection 33*7e8ea635SAtari911- Overlapping events on the same date/time flagged with ⚠️ badge 34*7e8ea635SAtari911- Tooltip showing conflicting event details 35*7e8ea635SAtari911 36*7e8ea635SAtari911### Admin Panel 37*7e8ea635SAtari911- Full admin interface at Admin → Calendar Management 38*7e8ea635SAtari911- Tabs: Overview, Settings, Manage, Sync, About 39*7e8ea635SAtari911- Event statistics, namespace management, import/export, cleanup tools 40*7e8ea635SAtari911 41*7e8ea635SAtari911--- 42*7e8ea635SAtari911 43*7e8ea635SAtari911## v5.5–v5.5.x: CSS Refactor 44*7e8ea635SAtari911 45*7e8ea635SAtari911Complete refactoring of the styling system from hardcoded colors to CSS custom properties (variables). Introduced the semantic color system with variables like `--text-primary`, `--text-bright`, `--text-dim`, `--bg-main`, `--cell-bg`, `--cell-today-bg`, `--border-main`, `--border-color`, etc. This laid the groundwork for the theming system. 46*7e8ea635SAtari911 47*7e8ea635SAtari911--- 48*7e8ea635SAtari911 49*7e8ea635SAtari911## v6.0.0: GitHub Publication & Theme System 50*7e8ea635SAtari911 51*7e8ea635SAtari911### Five Visual Themes 52*7e8ea635SAtari9111. **Matrix** — Dark background, bright green text, green glow effects, monospace feel 53*7e8ea635SAtari9112. **Purple** — Dark background, purple accents, violet glow 54*7e8ea635SAtari9113. **Pink** — Dark background, hot pink accents, heart today indicator with pulse animation, firework button hover effects 55*7e8ea635SAtari9114. **Professional** — Clean light theme, blue accents, no glow 56*7e8ea635SAtari9115. **Wiki** — Inherits colors from the active DokuWiki template (reads `__text__`, `__background__`, `__link__`, `__border__`, etc. from `tpl_style.ini`) 57*7e8ea635SAtari911 58*7e8ea635SAtari911### Theme Architecture 59*7e8ea635SAtari911- PHP reads theme setting from `calendar_theme.txt` 60*7e8ea635SAtari911- `getThemeStyles()` returns a color array per theme 61*7e8ea635SAtari911- CSS variables injected inline into calendar, sidebar, and eventlist containers 62*7e8ea635SAtari911- Wiki theme dynamically reads DokuWiki template style variables at render time 63*7e8ea635SAtari911 64*7e8ea635SAtari911--- 65*7e8ea635SAtari911 66*7e8ea635SAtari911## v6.0.1–v6.0.9: Text, Badge & Glow Theming 67*7e8ea635SAtari911 68*7e8ea635SAtari911Progressive theming of every UI element: 69*7e8ea635SAtari911 70*7e8ea635SAtari911- **v6.0.1–v6.0.3**: Header text, day numbers, event titles, meta text, descriptions all converted from hardcoded colors to CSS variables 71*7e8ea635SAtari911- **v6.0.4–v6.0.5**: Event panel (clicked-day detail view) fully themed — header, event items, descriptions, time displays, action buttons 72*7e8ea635SAtari911- **v6.0.6**: Calendar header month/year, month picker, event list items, completed/past event states, scrollbars, namespace filter indicator 73*7e8ea635SAtari911- **v6.0.7**: All badges (TODAY, namespace, conflict ⚠️), conflict tooltips, month picker buttons, header hover states 74*7e8ea635SAtari911- **v6.0.8**: Links themed with `.cal-link` class, text glow consistency across dark themes, pink glow intensity toned down 75*7e8ea635SAtari911- **v6.0.9**: Form input text visibility on dark themes, cell hover effects, button hover/active states, glow values fine-tuned 76*7e8ea635SAtari911 77*7e8ea635SAtari911--- 78*7e8ea635SAtari911 79*7e8ea635SAtari911## v6.1.0–v6.1.6: Interactive Elements & Dark Reader 80*7e8ea635SAtari911 81*7e8ea635SAtari911- **v6.1.0**: Today indicator (filled circle like Google Calendar), themed button hover/click with brightness filters, custom checkbox styling with theme accent colors, form input placeholder text 82*7e8ea635SAtari911- **v6.1.1**: Complete CSS variable audit — 41 remaining hardcoded colors converted 83*7e8ea635SAtari911- **v6.1.2–v6.1.5**: Section header theming (Today/Tomorrow/Important), semantic color variables (`--pastdue-color`, `--tomorrow-bg`), pink heart today indicator and firework effects, all-theme checkbox glow 84*7e8ea635SAtari911- **v6.1.6**: System tooltips themed using `style.setProperty` with `!important` 85*7e8ea635SAtari911 86*7e8ea635SAtari911--- 87*7e8ea635SAtari911 88*7e8ea635SAtari911## v6.2.0–v6.2.6: Dark Reader Compatibility 89*7e8ea635SAtari911 90*7e8ea635SAtari911The Dark Reader browser extension was aggressively overriding theme colors, making dark themes unreadable. The solution evolved through several approaches: 91*7e8ea635SAtari911 92*7e8ea635SAtari911- **v6.2.0–v6.2.1**: Initial Dark Reader protection attempts using meta tags and `data-darkreader-mode` 93*7e8ea635SAtari911- **v6.2.2–v6.2.6**: Final approach — targeted inline `!important` styles and `-webkit-text-fill-color` overrides on specific elements. No page-wide locks, no filter manipulation. Protected: section headers, badges, event text, day numbers, nav buttons, status bars, tooltips, color indicator bars 94*7e8ea635SAtari911- Wiki theme intentionally left unlocked so Dark Reader can adjust it (since wiki theme is already light-friendly) 95*7e8ea635SAtari911 96*7e8ea635SAtari911--- 97*7e8ea635SAtari911 98*7e8ea635SAtari911## v6.3.0: Consolidated Dark Reader Release 99*7e8ea635SAtari911 100*7e8ea635SAtari911Merged all Dark Reader compatibility work into a single stable release. Full protection for all three dark themes across calendar, sidebar widget, and eventlist. Wiki theme headers/badges unlocked for Dark Reader mapping. 101*7e8ea635SAtari911 102*7e8ea635SAtari911--- 103*7e8ea635SAtari911 104*7e8ea635SAtari911## v6.3.1–v6.3.9: Wiki Theme Refinement 105*7e8ea635SAtari911 106*7e8ea635SAtari911Fine-tuning the Wiki theme to correctly inherit DokuWiki template colors: 107*7e8ea635SAtari911 108*7e8ea635SAtari911- **v6.3.1**: Eventlist containers receive theme class and CSS variable injection 109*7e8ea635SAtari911- **v6.3.2**: Fixed caching — added `$renderer->nocache()` so theme changes take effect immediately 110*7e8ea635SAtari911- **v6.3.3**: Section header text uses template's `__text__` instead of hardcoded white 111*7e8ea635SAtari911- **v6.3.4**: Border/accent color remapping — `border` maps to `__border__`, `text_bright` to `__link__` 112*7e8ea635SAtari911- **v6.3.5**: Allowed Dark Reader to freely adjust wiki theme headers 113*7e8ea635SAtari911- **v6.3.6–v6.3.7**: Checkbox border color from template's `__border__`, fixed shorthand override 114*7e8ea635SAtari911- **v6.3.8**: Button and section header colors from template palette 115*7e8ea635SAtari911- **v6.3.9**: Section bar fallback color fix 116*7e8ea635SAtari911 117*7e8ea635SAtari911--- 118*7e8ea635SAtari911 119*7e8ea635SAtari911## v6.4.0–v6.4.4: Wiki Theme Polish 120*7e8ea635SAtari911 121*7e8ea635SAtari911- **v6.4.0**: Section bar uses `background` div instead of `border-left` so Dark Reader maps colors identically 122*7e8ea635SAtari911- **v6.4.1**: Event highlight uses template's `__background_alt__` instead of hardcoded blue 123*7e8ea635SAtari911- **v6.4.2–v6.4.3**: Day headers (SMTWTFS) use `__background_neu__` and `__text__` 124*7e8ea635SAtari911- **v6.4.4**: Past events toggle background uses `__background_neu__` 125*7e8ea635SAtari911 126*7e8ea635SAtari911--- 127*7e8ea635SAtari911 128*7e8ea635SAtari911## v6.4.5: Admin Version History Overhaul 129*7e8ea635SAtari911 130*7e8ea635SAtari911- Replaced all purple accents with green in the version history viewer 131*7e8ea635SAtari911- Enhanced changelog parser to handle `###` subsection headers and plain bullets 132*7e8ea635SAtari911- Added "Current Release" button that jumps to the card matching the running version 133*7e8ea635SAtari911- Running version card shows green "RUNNING" badge 134*7e8ea635SAtari911 135*7e8ea635SAtari911--- 136*7e8ea635SAtari911 137*7e8ea635SAtari911## v6.4.6: Recurring Events Rescan & Detection Improvements 138*7e8ea635SAtari911 139*7e8ea635SAtari911- Added green " Rescan" button to refresh recurring events table via AJAX 140*7e8ea635SAtari911- Rewrote detection logic: two-phase approach (flagged events first, then pattern detection) 141*7e8ea635SAtari911- New "Source" column: ️ Flagged vs Detected 142*7e8ea635SAtari911- Median interval for robust pattern detection (Daily, Weekly, Bi-weekly, Monthly, Quarterly, Semi-annual, Yearly, custom) 143*7e8ea635SAtari911- Recursive namespace scanning, date deduplication, alphabetical sorting 144*7e8ea635SAtari911 145*7e8ea635SAtari911--- 146*7e8ea635SAtari911 147*7e8ea635SAtari911## v6.4.7: Recurring Events Management Controls 148*7e8ea635SAtari911 149*7e8ea635SAtari911Added an orange "Manage" button per series opening a comprehensive dialog with five operations: 150*7e8ea635SAtari911 151*7e8ea635SAtari9111. ** Extend Series** — Add N future occurrences at a chosen interval, using the last event as a template 152*7e8ea635SAtari9112. **✂️ Trim Past Events** — Remove occurrences before a cutoff date 153*7e8ea635SAtari9113. ** Change Pattern** — Respace future events to a new interval (past untouched) 154*7e8ea635SAtari9114. ** Change Start Date** — Shift all occurrences by offset between old and new start 155*7e8ea635SAtari9115. **⏸ Pause/Resume** — Toggle ⏸ prefix on future events 156*7e8ea635SAtari911 157*7e8ea635SAtari911All operations are AJAX-powered with inline status messages. 158*7e8ea635SAtari911 159*7e8ea635SAtari911--- 160*7e8ea635SAtari911 161*7e8ea635SAtari911## v6.4.8–v6.4.9: Bug Fixes 162*7e8ea635SAtari911 163*7e8ea635SAtari911- **v6.4.8**: Fixed PHP parse error — JS template literals (`${...}`) inside PHP echo blocks caused parse failures. Rewrote manage dialog using string concatenation. 164*7e8ea635SAtari911- **v6.4.9**: Fixed recurring edit/delete returning "0 changes" — root cause was directory path mismatch between event's namespace field and filesystem location. Both handlers now search ALL calendar directories recursively via `findCalendarDirs()`. 165*7e8ea635SAtari911 166*7e8ea635SAtari911--- 167*7e8ea635SAtari911 168*7e8ea635SAtari911## v6.5.0–v6.5.1: Bulk Trim All Past Recurring 169*7e8ea635SAtari911 170*7e8ea635SAtari911- Red "✂️ Trim All Past" button in recurring events section header 171*7e8ea635SAtari911- Removes all past recurring event occurrences across every namespace in one click 172*7e8ea635SAtari911- Only events with `recurring` or `recurringId` flag are removed 173*7e8ea635SAtari911- Dry-run count shown in confirmation dialog before deletion 174*7e8ea635SAtari911 175*7e8ea635SAtari911--- 176*7e8ea635SAtari911 177*7e8ea635SAtari911## v6.5.2–v6.5.6: Namespace Cleanup & AJAX Routing Fix 178*7e8ea635SAtari911 179*7e8ea635SAtari911- **v6.5.2**: " Cleanup" button to remove empty namespace calendar folders 180*7e8ea635SAtari911 - Dry-run scan shows exactly what will be removed 181*7e8ea635SAtari911 - Removes empty calendar directories and empty parent namespace directories 182*7e8ea635SAtari911 - Root calendar directory is never removed 183*7e8ea635SAtari911- **v6.5.3–v6.5.4**: Fixed PHP parse errors caused by unescaped single quotes in JS within PHP echo blocks. Added `adminColors` JS object for theme-aware runtime colors. 184*7e8ea635SAtari911- **v6.5.5**: Fixed "Unknown action" error — AJAX calls route through `action.php`, not `admin.php`. Added `routeToAdmin()` bridge in `action.php` and public `handleAjaxAction()` in `admin.php`. Moved cleanup button inline next to "➕ New Namespace". 185*7e8ea635SAtari911- **v6.5.6**: Cleanup results now display as standard message banner at page top instead of inline. Fixed button text flash. 186*7e8ea635SAtari911 187*7e8ea635SAtari911--- 188*7e8ea635SAtari911 189*7e8ea635SAtari911## v6.6.0: Package Cleanup 190*7e8ea635SAtari911 191*7e8ea635SAtari911- Removed all auxiliary documentation files (.md/.txt) except README.md 192*7e8ea635SAtari911- Consolidated project history into this document 193*7e8ea635SAtari911- Clean package containing only essential plugin files 194*7e8ea635SAtari911 195*7e8ea635SAtari911--- 196*7e8ea635SAtari911 197*7e8ea635SAtari911## Architecture Summary 198*7e8ea635SAtari911 199*7e8ea635SAtari911### Files 200*7e8ea635SAtari911| File | Purpose | 201*7e8ea635SAtari911|------|---------| 202*7e8ea635SAtari911| `plugin.info.txt` | DokuWiki plugin metadata | 203*7e8ea635SAtari911| `syntax.php` | Wiki markup parser — renders `{{calendar}}`, `{{eventlist}}`, `{{eventpanel}}` | 204*7e8ea635SAtari911| `action.php` | AJAX handlers for event CRUD, month loading, task toggling, admin action routing | 205*7e8ea635SAtari911| `admin.php` | Full admin panel — settings, namespace management, recurring events, statistics, import/export, version history | 206*7e8ea635SAtari911| `style.css` | All CSS with theme-aware custom properties, Dark Reader protection, responsive design | 207*7e8ea635SAtari911| `calendar-main.js` | Client-side calendar rendering, event dialogs, drag-and-drop, month navigation | 208*7e8ea635SAtari911| `script.js` | Minimal bootstrap loader | 209*7e8ea635SAtari911| `sync_outlook.php` | Outlook calendar sync via Microsoft Graph API | 210*7e8ea635SAtari911| `sync_config.php` | Sync configuration management | 211*7e8ea635SAtari911| `get_system_stats.php` | System statistics endpoint | 212*7e8ea635SAtari911| `check_syntax.sh` | PHP syntax validation helper | 213*7e8ea635SAtari911 214*7e8ea635SAtari911### Data Storage 215*7e8ea635SAtari911- Events stored as JSON in `data/meta/[namespace]/calendar/YYYY-MM.json` 216*7e8ea635SAtari911- Theme setting in `data/meta/calendar_theme.txt` 217*7e8ea635SAtari911- Sync credentials in `data/meta/calendar_sync_config.json` 218*7e8ea635SAtari911 219*7e8ea635SAtari911### Theme System 220*7e8ea635SAtari911- 5 themes: Matrix, Purple, Pink, Professional, Wiki 221*7e8ea635SAtari911- Colors defined in `getThemeStyles()` PHP method 222*7e8ea635SAtari911- Injected as CSS custom properties at render time 223*7e8ea635SAtari911- Wiki theme reads from DokuWiki template's `style.ini` 224*7e8ea635SAtari911- Dark Reader compatibility via targeted `!important` overrides 225*7e8ea635SAtari911 226*7e8ea635SAtari911### Admin Panel Capabilities 227*7e8ea635SAtari911- **Overview**: Event statistics, calendar health, system info 228*7e8ea635SAtari911- **Settings**: Theme selection, display options, sync configuration 229*7e8ea635SAtari911- **Manage**: Namespace explorer (drag-and-drop event moving, bulk actions), recurring event management (edit, manage, delete, extend, trim, pause, change pattern/start date, bulk trim past, rescan), namespace cleanup 230*7e8ea635SAtari911- **Sync**: Outlook sync status, manual sync trigger, log viewer 231*7e8ea635SAtari911- **About**: Version history viewer with changelog browser 232*7e8ea635SAtari911 233*7e8ea635SAtari911--- 234*7e8ea635SAtari911 235*7e8ea635SAtari911*This document covers the complete development from initial creation through version 6.6.0.* 236