HEX
Server: Apache
System: Linux linplesk41.pumo.com.tw 3.10.0-962.3.2.lve1.5.27.el7.x86_64 #1 SMP Sat Nov 30 02:18:52 EST 2019 x86_64
User: rajlaw (10192)
PHP: 7.4.24
Disabled: phpinfo,passthru,exec,shell_exec,system,popen,proc_open,proc_close,show_source,pcntl_exec,escapeshellcmd,proc_get_status,proc_nice,proc_terminate,escapeshellarg
Upload Files
File: /home/httpd/vhosts/rajlaw.com.tw/httpdocs/wp-content/plugins/wp-rss-aggregator/v4/js/admin-help.js
jQuery( document ).ready( function($) {

	showError = function(error) {
		console.log('Error: ', error);
		$('#support-error').html(error);
		$('#support-error').css('color', 'red');
	};


	$('#send-message-btn').click(function() {
		var formElements = $("form :input"),
			button = $(this),
			origButtonLabel = button.attr('value'),
			params = {
				action: 'wprss_ajax_send_premium_support'
			};

		$(this).attr('value', wprss_admin_help.sending);

		formElements.each(function(id) {
			var input = $(this);

			if (input.attr('type') === 'checkbox') {
				params[input.attr('name')] = input.is(':checked');
			} else {
				params[input.attr('name')] = input.val();
			}
		});

		$.ajax({
			url: ajaxurl,
			dataType: 'json',
			data: params
		}).then(function(response, textStatus, jqXHR) {
			button.attr('value', origButtonLabel);

			// There was an error.
			if (response.error !== undefined) {
				// If the backend failed to send the message, replace the customer's message
				// with the one we appended the log and sys info to.
				if (response.message !== undefined) {
					$('[name="support-message"]').val(response.message);
				}

				showError(response.error);
			} else {
				$('#support-error').html(wprss_admin_help['sent-ok']);
				$('#support-error').css('color', 'green');

				formElements.parents('form').get(0).reset();
			}

			return response;
		}, function(error) {
			button.attr('value', origButtonLabel);

			showError(error);
		});
	});

});