CoreFiles by mySites.guru
keepalive-uncompressed.js39 lines, 950 bytes, from Joomla_3.7.2-Stable-Full_Package.zip
Raw History Compare with 3.7.1
md5
6d54d7e334b70bdb977fddf00997f889
sha1
de11b19ba75eab4b9a0bd989dd608cee8b7fe30e
sha256
a90af98e9e23f63e11516fb519948257c488bf88534562838457da8454908efb
/**
 * @copyright   Copyright (C) 2005 - 2017 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.uri ? keepaliveOptions.uri.replace(/&/g, '&') : window.location.pathname,
		    keepaliveInterval = keepaliveOptions.interval ? keepaliveOptions.interval : 45 * 1000;

		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 14 releases, Joomla 3.7.0-alpha2 to 3.7.2. See them all, or every version of this file.