- md5
- 2c13d2f773a0c1f30177404a99b761af
- sha1
- bb9f2d52e3ffc06e314ace7d4c8377f5d20fc1d6
- sha256
- 4f064e327e4d9d0228f54f5cf3439d2140214aa973cf5f5147a1ac80f9671c19
if(!window.Joomla)throw new Error("Joomla API was not properly initialised");const initRunner=()=>{const e=Joomla.getOptions("system.paths"),o=`${e?`${e.base}/index.php`:window.location.pathname}?option=com_ajax&format=json&plugin=RunSchedulerTest&group=system&id=%d`,t=document.getElementById("scheduler-test-modal"),a=`\n <h4 class="scheduler-headline">${Joomla.Text._("COM_SCHEDULER_TEST_RUN_TASK")}</h4>\n <div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_STATUS_STARTED")}</div>\n <div class="mt-3 text-center"><span class="fa fa-spinner fa-spin fa-lg"></span></div>\n `,d=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2");t.addEventListener("show.bs.modal",(e=>{const n=e.relatedTarget,r=parseInt(n.dataset.id,10),{title:l}=n.dataset;t.querySelector(".modal-title").innerHTML=Joomla.Text._("COM_SCHEDULER_TEST_RUN_TITLE").replace("%d",r),t.querySelector(".modal-body > div").innerHTML=a.replace("%s",l),Joomla.request({url:o.replace("%d",r.toString()),onSuccess:(e,o)=>{[].slice.call(t.querySelectorAll(".modal-body > div > div")).forEach((e=>{e.parentNode.removeChild(e)}));const a=JSON.parse(e);if(a&&a.success&&a.data){if(t.querySelector(".modal-body > div").innerHTML+=`<div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_STATUS_COMPLETED")}</div>`,a.data.duration>0&&(t.querySelector(".modal-body > div").innerHTML+=`<div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_DURATION").replace("%s",a.data.duration.toFixed(2))}</div>`),a.data.output){const e=Joomla.sanitizeHtml(a.data.output,null,d);t.querySelector(".modal-body > div").innerHTML+=`<div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_OUTPUT").replace("%s",e)}</div>`}}else t.querySelector(".modal-body > div").innerHTML+=`<div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_STATUS_TERMINATED")}</div>`,t.querySelector(".modal-body > div").innerHTML+=`<div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_OUTPUT").replace("%s",Joomla.Text._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",o.status))}</div>`},onError:e=>{t.querySelector(".modal-body > div").innerHTML+=`<div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_STATUS_TERMINATED")}</div>`;const o=Joomla.ajaxErrorsMessages(e);t.querySelector(".modal-body > div").innerHTML+=`<div>${Joomla.Text._("COM_SCHEDULER_TEST_RUN_OUTPUT").replace("%s",o.error)}</div>`}})})),t.addEventListener("hidden.bs.modal",(()=>{window.location.href=`${e?`${e.base}/index.php`:window.location.pathname}?option=com_scheduler&view=tasks`})),document.removeEventListener("DOMContentLoaded",initRunner)};document.addEventListener("DOMContentLoaded",initRunner);
The same content is in 3 releases, Joomla 4.1.0-beta1 to 4.1.0-beta3. See them all, or every version of this file.