first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,59 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(() => {
// Ajax call to get the update status of the installed extensions
const fetchUpdate = () => {
if (Joomla.getOptions('js-extensions-update')) {
const options = Joomla.getOptions('js-extensions-update');
const update = (type, text) => {
const link = document.getElementById('plg_quickicon_extensionupdate');
const linkSpans = [].slice.call(link.querySelectorAll('span.j-links-link'));
if (link) {
link.classList.add(type);
}
if (linkSpans.length) {
linkSpans.forEach(span => {
span.innerHTML = Joomla.sanitizeHtml(text);
});
}
};
/**
* DO NOT use fetch() for QuickIcon requests. They must be queued.
*
* @see https://github.com/joomla/joomla-cms/issues/38001
*/
Joomla.enqueueRequest({
url: options.ajaxUrl,
method: 'GET',
promise: true
}).then(xhr => {
const response = xhr.responseText;
const updateInfoList = JSON.parse(response);
if (Array.isArray(updateInfoList)) {
if (updateInfoList.length === 0) {
// No updates
update('success', Joomla.Text._('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE'));
} else {
update('danger', Joomla.Text._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND').replace('%s', `<span class="badge text-dark bg-light">${updateInfoList.length}</span>`));
}
} else {
// An error occurred
update('danger', Joomla.Text._('PLG_QUICKICON_EXTENSIONUPDATE_ERROR'));
}
}).catch(() => {
// An error occurred
update('danger', Joomla.Text._('PLG_QUICKICON_EXTENSIONUPDATE_ERROR'));
});
}
};
// Give some times to the layout and other scripts to settle their stuff
window.addEventListener('load', () => {
setTimeout(fetchUpdate, 330);
});
})();

View File

@ -0,0 +1 @@
(()=>{const e=()=>{if(Joomla.getOptions("js-extensions-update")){const e=Joomla.getOptions("js-extensions-update"),t=(e,t)=>{const s=document.getElementById("plg_quickicon_extensionupdate"),n=[].slice.call(s.querySelectorAll("span.j-links-link"));s&&s.classList.add(e),n.length&&n.forEach((e=>{e.innerHTML=Joomla.sanitizeHtml(t)}))};Joomla.enqueueRequest({url:e.ajaxUrl,method:"GET",promise:!0}).then((e=>{const s=e.responseText,n=JSON.parse(s);Array.isArray(n)?0===n.length?t("success",Joomla.Text._("PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE")):t("danger",Joomla.Text._("PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND").replace("%s",`<span class="badge text-dark bg-light">${n.length}</span>`)):t("danger",Joomla.Text._("PLG_QUICKICON_EXTENSIONUPDATE_ERROR"))})).catch((()=>{t("danger",Joomla.Text._("PLG_QUICKICON_EXTENSIONUPDATE_ERROR"))}))}};window.addEventListener("load",(()=>{setTimeout(e,330)}))})();