Current File : /home/pacjaorg/.trash/media.1/plg_quickicon_privacycheck/js/privacycheck.min.js |
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/(e=>{const u=()=>{const r=Joomla.getOptions("js-privacy-check"),p=r.plg_quickicon_privacycheck_ajax_url,_=r.plg_quickicon_privacycheck_url,t=r.plg_quickicon_privacycheck_text,n=e.getElementById("plg_quickicon_privacycheck"),s=n.querySelector("span.j-links-link");Joomla.enqueueRequest({url:p,method:"GET",promise:!0}).then(E=>{const g=E.responseText,o=JSON.parse(g);if(o.data.number_urgent_requests){const i=e.createElement("span");i.classList.add("badge","text-dark","bg-light"),i.textContent=o.data.number_urgent_requests,s.textContent=`${t.REQUESTFOUND} `,s.appendChild(i),n.classList.add("danger");const l=e.createElement("span");l.classList.add("label","label-important"),l.textContent=`${t.REQUESTFOUND_MESSAGE.replace("%s",o.data.number_urgent_requests)} `;const a=e.createElement("button");a.classList.add("btn","btn-primary","btn-sm"),a.setAttribute("onclick",`document.location='${_}'`),a.textContent=t.REQUESTFOUND_BUTTON;const c=e.createElement("div");c.classList.add("alert","alert-error","alert-joomlaupdate"),c.appendChild(l),c.appendChild(a);const d=e.querySelector("#system-message-container");d.insertBefore(c,d.firstChild)}else n.classList.add("success"),s.textContent=t.NOREQUEST}).catch(()=>{n.classList.add("danger"),s.textContent=t.ERROR})};window.addEventListener("load",()=>setTimeout(u,360))})(document);