HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/proc/self/cwd/wp-content/plugins/convertplug/framework/lib/fields/switch/switch.js
/* eslint-env jquery */
jQuery(document).ready(function ($) {
	jQuery(document).on('click', '.smile-switch-btn', function () {
		if (jQuery('#mailchimp-list').val() !== undefined) {
			// Conflict with Connects MailChimp Switch for Group Selection.
			return;
		}
		const id = jQuery(this).data('id');
		const value = jQuery(this)
			.parents('.switch-wrapper')
			.find('#' + id)
			.val();

		if (value === 1 || value === '1') {
			jQuery(this)
				.parents('.switch-wrapper')
				.find('#' + id)
				.attr('value', '0');
		} else {
			jQuery(this)
				.parents('.switch-wrapper')
				.find('#' + id)
				.attr('value', '1');
		}
		jQuery(this)
			.parents('.switch-wrapper')
			.find('.smile-switch-input')
			.trigger('change');
		$(document).trigger('smile-switch-change', [id]);
	});
});