- md5
- f42a28a8e3b1570ce70b9251bd31c66d
- sha1
- 3b2fe6a0d93e5e7165c7d62c607ba2cbe156ac45
- sha256
- e09094654535cda2d7611dfe108ef2fcd42cf7dc7247042a9089b4cf28503a0d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
/**
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* stats javascript behavior
*
* To allow users to accept & configure stats sending
*
* @package Joomla
* @since 3.5.0
* @version 1.0
*/
(function ($) {
$(document).ready(function () {
var ajaxData = {
'option' : 'com_ajax',
'group' : 'system',
'plugin' : 'renderStatsMessage',
'format' : 'raw'
},
messageContainer = $('#system-message-container');
/**
* Initialise events for the message container
*
* @return void
*/
function initStatsEvents()
{
var globalContainer = messageContainer.find('.js-pstats-alert'),
detailsContainer = messageContainer.find('.js-pstats-data-details');
// Show details about the information being sent
messageContainer.on('click', '.js-pstats-btn-details', function(e){
detailsContainer.toggle(200);
e.preventDefault();
});
// Always allow
messageContainer.on('click', '.js-pstats-btn-allow-always', function(e){
// Remove message
globalContainer.hide(200);
detailsContainer.remove();
ajaxData.plugin = 'sendAlways';
$.getJSON('index.php', ajaxData, function(response){});
e.preventDefault();
});
// Allow once
messageContainer.on('click', '.js-pstats-btn-allow-once', function(e){
// Remove message
globalContainer.hide(200);
detailsContainer.remove();
ajaxData.plugin = 'sendOnce';
$.getJSON('index.php', ajaxData, function(response){});
e.preventDefault();
});
// Never allow
messageContainer.on('click', '.js-pstats-btn-allow-never', function(e){
// Remove message
globalContainer.hide(200);
detailsContainer.remove();
ajaxData.plugin = 'sendNever';
$.getJSON('index.php', ajaxData, function(response){});
e.preventDefault();
});
}
ajaxData.plugin = 'sendStats';
$.getJSON('index.php', ajaxData, function(response){
if (response && response.html) {
messageContainer
.append(response.html)
.find('.js-pstats-alert').show(200);
initStatsEvents();
}
});
});
})(jQuery);
The same content is in 30 releases, Joomla 3.9.15-rc to 3.10.0-alpha1. See them all, or every version of this file.