1(function ($, shortcodes) { 2 let initialized = false; 3 4 function tryInitialize() { 5 if (initialized || typeof homerunnerMountMultiCalendar !== "function") { 6 return; 7 } 8 9 shortcodes.forEach(function (shortcode) { 10 homerunnerMountMultiCalendar(shortcode.selector, shortcode.config); 11 }); 12 13 initialized = true; 14 } 15 16 // Try multiple times with different triggers 17 $(document).ready(tryInitialize); 18 $(window).on("load", tryInitialize); 19 20 // Polling fallback 21 let attempts = 0; 22 const maxAttempts = 50; // 5 seconds max 23 24 function pollForFunction() { 25 if (attempts >= maxAttempts || initialized) { 26 return; 27 } 28 29 attempts++; 30 31 if (typeof homerunnerMountMultiCalendar === "function") { 32 tryInitialize(); 33 } else { 34 setTimeout(pollForFunction, 100); 35 } 36 } 37 38 // Start polling 39 setTimeout(pollForFunction, 100); 40})(jQuery, window.homerunner_multicalendar_shortcodes || []);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.