- md5
- 32a666d2eed75ae4c35c8647269b723e
- sha1
- 48369aee415c69a11c28fc85c760f5ed425b74b6
- sha256
- 0624d5b165d4a9083d22ded372da36724061aeac9dcfa7b823157ca7902ff6f8
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
/**
* 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 - 2019 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 Joomla
*/
((document, Joomla) => {
'use strict';
const checkForJoomlaUpdates = () => {
if (Joomla.getOptions('js-extensions-update')) {
const options = Joomla.getOptions('js-joomla-update');
const update = (type, text) => {
const link = document.getElementById('plg_quickicon_joomlaupdate');
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_JOOMLAUPDATE_UPTODATE'));
} else {
const updateInfo = updateInfoList.shift();
if (updateInfo.version !== options.version) {
update('danger', Joomla.Text._('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND').replace('%s', "<span class=\"badge badge-light\"> \u200E ".concat(updateInfo.version, "</span>")));
} else {
update('success', Joomla.Text._('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE'));
}
}
} else {
// An error occurred
update('danger', Joomla.Text._('PLG_QUICKICON_JOOMLAUPDATE_ERROR'));
}
},
onError: () => {
// An error occurred
update('danger', Joomla.Text._('PLG_QUICKICON_JOOMLAUPDATE_ERROR'));
}
});
}
};
const onBoot = () => {
if (!Joomla || typeof Joomla.getOptions !== 'function' || !Joomla.getOptions('js-joomla-update')) {
throw new Error('Script is not properly initialised');
}
setTimeout(checkForJoomlaUpdates, 2000); // Cleanup
document.removeEventListener('DOMContentLoaded', onBoot);
}; // Initialize
document.addEventListener('DOMContentLoaded', onBoot);
})(document, Joomla);
The same content is in 4 releases, Joomla 4.0.0-alpha9 to 4.0.0-alpha12. See them all, or every version of this file.