CoreFiles by mySites.guru
keepalive-uncompressed.js47 lines, 1,235 bytes, from Joomla_3.8.13-Stable-Full_Package.zip
Raw History Compare with 3.8.12
md5
a8b6b4be6da2a0c2474818a2629549c6
sha1
4f2db25dab3ad28dbeef80beddc31c2db2a8823e
sha256
48e6db5ce2606ef08d176ed4c021c8ebe2544aed7021feb24c957168146787f4
/**
 * @copyright   Copyright (C) 2005 - 2018 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 29 releases, Joomla 3.8.4-rc to 3.9.1. See them all, or every version of this file.