CoreFiles by mySites.guru
sendtestmail-uncompressed.js51 lines, 1,589 bytes, from Joomla_3.6.0-Stable-Full_Package.zip
Raw History Compare with 3.5.1
md5
0f79821940de3ed71f540db897df306e
sha1
11bf7c5f5de8d289dfcc8f9fdf4b4946500bf29e
sha256
287bc3356b48fc00aeeec26b3c098158f176e595f02b5635bdc8667f903171e7
/**
 * @package         Joomla.JavaScript
 * @copyright       Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license         GNU General Public License version 2 or later; see LICENSE.txt
 */

/**
 * Calls the sending process of the config class
 */
jQuery(document).ready(function ($)
{
	$('#sendtestmail').click(function ()
	{
		var email_data = {
			smtpauth  : $('input[name="jform[smtpauth]"]:checked').val(),
			smtpuser  : $('input[name="jform[smtpuser]"]').val(),
			smtppass  : $('input[name="jform[smtppass]"]').val(),
			smtphost  : $('input[name="jform[smtphost]"]').val(),
			smtpsecure: $('select[name="jform[smtpsecure]"]').val(),
			smtpport  : $('input[name="jform[smtpport]"]').val(),
			mailfrom  : $('input[name="jform[mailfrom]"]').val(),
			fromname  : $('input[name="jform[fromname]"]').val(),
			mailer    : $('select[name="jform[mailer]"]').val(),
			mailonline: $('input[name="jform[mailonline]"]:checked').val()
		};

		// Remove js messages, if they exist.
		Joomla.removeMessages();

		$.ajax({
			method: "POST",
			url: document.getElementById('sendtestmail').getAttribute('data-ajaxuri'),
			data: email_data,
			dataType: "json"
		})
		.fail(function (jqXHR, textStatus, error) {
			Joomla.renderMessages(Joomla.ajaxErrorsMessages(jqXHR, textStatus, error));

			window.scrollTo(0, 0);
		})
		.done(function (response) {
			// Render messages, if any.
			if (typeof response.messages == 'object' && response.messages !== null)
			{
				Joomla.renderMessages(response.messages);

				window.scrollTo(0, 0);
			}
		});
	});
});

The same content is in 3 releases, Joomla 3.6.0-rc to 3.6.0. See them all, or every version of this file.