- md5
- 53688790256212bd8c508fa9aa5ee3ae
- sha1
- 05905b716d319209ee8ec49db62e8ab1f8fb6dcb
- sha256
- f04fbce7054c6cacf8d5f45bf65aa900231bf66050cf764aae164fefb3df96e6
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/
/**
* @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
(() => {
'use strict'; // Add a listener on content loaded to initiate the check
document.addEventListener('DOMContentLoaded', () => {
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 = text;
});
}
};
Joomla.request({
url: options.ajaxUrl,
method: 'GET',
data: '',
perform: true,
onSuccess: response => {
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'));
}
},
onError: () => {
// An error occurred
update('danger', Joomla.Text._('PLG_QUICKICON_EXTENSIONUPDATE_ERROR'));
}
});
}
});
})();
No other release has this exact content. See every version of this file.