Files
liceo-ariosto/media/plg_system_schedulerunner/js/run-schedule.min.js
2025-06-17 11:53:18 +02:00

1 line
513 B
JavaScript

if(!window.Joomla)throw new Error("Joomla API was not properly initialised");const initScheduler=()=>{const e=Joomla.getOptions("plg_system_schedulerunner"),t=Joomla.getOptions("system.paths"),o=1e3*(e&&e.interval?parseInt(e.interval,10):300),n=`${t?`${t.root}/index.php`:window.location.pathname}?option=com_ajax&format=raw&plugin=RunSchedulerLazy&group=system`;setInterval((()=>fetch(n,{method:"GET"})),o),fetch(n,{method:"GET"})};(e=>{e.addEventListener("DOMContentLoaded",(()=>{initScheduler()}))})(document);