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