- md5
- f852a5d5d4010d6d572181f0d34a913e
- sha1
- c766688838b379c24f44a290afb5fe2000fcbc30
- sha256
- 4b35644d9eb6609b84e9fb2ec927d01a44aa115bd1772a2238871fc9120cfaad
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/
/**
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @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 badge-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'));
}
});
}
});
})();
The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.