xref: /plugin/calendar/script.js (revision 96df7d3e9a825dddf459ab1ee6077a9886837f17)
1/**
2 * DokuWiki Compact Calendar Plugin
3 *
4 * This file dynamically loads calendar-main.js which contains the actual functionality.
5 * This approach avoids DokuWiki's automatic file concatenation which was causing conflicts.
6 */
7
8(function() {
9    // Check if calendar-main.js functions are already loaded
10    if (typeof window.showConflictTooltip === 'function') {
11        return; // Already loaded, don't load again
12    }
13
14    // Dynamically load calendar-main.js
15    var script = document.createElement('script');
16    script.type = 'text/javascript';
17
18    // Get the base path from DOKU_BASE or derive from this script's location
19    var base = (typeof DOKU_BASE !== 'undefined') ? DOKU_BASE : '/';
20    script.src = base + 'lib/plugins/calendar/calendar-main.js';
21
22    // Add cache buster to ensure fresh load
23    script.src += '?v=' + Date.now();
24
25    document.head.appendChild(script);
26})();
27