CoreFiles by mySites.guru
keepalive-uncompressed.js47 lines, 1,235 bytes, from Joomla_3.9.21-Stable-Full_Package.zip
Raw History Compare with 3.9.20
md5
a66f385992bee3d38959624b1d6f2cb2
sha1
0dc1d1fd47efa259d9102d0acd57c08e8bded240
sha256
05c76bf08edbd4a6bb90bd69bd37a34143810f2c292ada75ab5a9ffa83ab9be1
/**
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

/**
 * Keepalive javascript behavior
 *
 * Used for keeping the session alive
 *
 * @package  Joomla
 * @since    3.7.0
 */
!(function(){
	'use strict';

	document.addEventListener('DOMContentLoaded', function() {

		var keepaliveOptions  = Joomla.getOptions('system.keepalive'),
		    keepaliveUri      = keepaliveOptions && keepaliveOptions.uri ? keepaliveOptions.uri.replace(/&/g, '&') : '',
		    keepaliveInterval = keepaliveOptions && keepaliveOptions.interval ? keepaliveOptions.interval : 45 * 1000;

		// Fallback in case no keepalive uri was found.
		if (keepaliveUri === '')
		{
			var systemPaths = Joomla.getOptions('system.paths');

			keepaliveUri = (systemPaths ? systemPaths.root + '/index.php' : window.location.pathname) + '?option=com_ajax&format=json';
		}

		window.setInterval(function() {
			Joomla.request({
				url: keepaliveUri,
				onSuccess: function(response, xhr)
				{
					// Do nothing
				},
				onError: function(xhr)
				{
					// Do nothing
				}
			});
		}, keepaliveInterval);

	});

})(window, document, Joomla);

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.