CoreFiles by mySites.guru
keepalive-uncompressed.js47 lines, 1,269 bytes, from Joomla_3.10.0-alpha9-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha8
md5
e638fbaaf3b28fdd3b8c2d42dd45f20e
sha1
3a009d1fff143ad4e4614ed2ab4402ad5fc11e5b
sha256
7b5826164cfc3fad560c5beb8ba0076346edd4ac8097fedd63e91c6221b53879
/**
 * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
 * @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(/&amp;/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 8 releases, Joomla 3.10.0-alpha4 to 3.10.0-rc2. See them all, or every version of this file.