Current File : /home/pacjaorg/www/kmm/media/plg_system_stats/js/stats-message-es5.min.js |
(function(){"use strict";/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @since 3.5.0
*/Joomla=window.Joomla||{},function(r,e){var p={input:["type","name","value"],"joomla-alert":["type","dismiss","role"],button:["type"],table:[],tbody:[],thead:[],caption:[],th:["scope"],tr:[],td:[]},u=function(s){var a=e.getElementById("system-message-container"),n=a.querySelector(".js-pstats-alert"),i=a.querySelector("#js-pstats-data-details");e.addEventListener("click",function(t){t.target.classList.contains("js-pstats-btn-details")&&(t.preventDefault(),i.classList.toggle("d-none"))}),e.addEventListener("click",function(t){t.target.classList.contains("js-pstats-btn-allow-always")&&(t.preventDefault(),n.close(),s({plugin:"sendAlways"}))}),e.addEventListener("click",function(t){t.target.classList.contains("js-pstats-btn-allow-never")&&(t.preventDefault(),n.close(),s({plugin:"sendNever"}))})},v=function c(s){var a=s===void 0?{}:s,n=a.plugin,i=n===void 0?"sendStats":n,t="index.php?option=com_ajax&group=system&plugin="+i+"&format=raw",d=e.getElementById("system-message-container");r.request({url:t,headers:{"Content-Type":"application/json"},onSuccess:function(o){try{var l=JSON.parse(o);l&&l.html&&(d.insertAdjacentHTML("beforeend",r.sanitizeHtml(l.html,p)),d.querySelector(".js-pstats-alert").classList.remove("hidden"),u(c))}catch(g){throw new Error(g)}},onError:function(o){r.renderMessages({error:[o.response]})}})};e.addEventListener("DOMContentLoaded",function(){v()})}(Joomla,document)})();