Files
2024-12-17 17:34:10 +01:00

5 lines
1.0 KiB
JavaScript

/**
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((e,t)=>{if(!e)throw new Error("core.js was not properly initialised");e.finderIndexer=()=>{const i="index.php?option=com_finder&task=indexer.debug&tmpl=component&format=json",s=`&${t.getElementById("finder-indexer-token").getAttribute("name")}=1`;e.debugIndexing=()=>{const a=new URLSearchParams(Array.from(new FormData(t.getElementById("debug-form")))).toString();e.request({url:`${i}${s}&${a}`,method:"GET",data:"",perform:!0,headers:{"Content-Type":"application/x-www-form-urlencoded"},onSuccess:n=>{const r=t.getElementById("indexer-output"),d={fieldset:[],legend:[],dl:["class"],dt:["class"],dd:["class"]};try{const o=JSON.parse(n);r.innerHTML=e.sanitizeHtml(o.rendered,d)}catch{r.innerHTML=e.sanitizeHtml(n,d)}},onError:n=>{const r=t.getElementById("indexer-output");r.innerHTML=n.response}})}}})(Joomla,document),document.addEventListener("DOMContentLoaded",()=>{window.Indexer=Joomla.finderIndexer()});