HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: /home/honghock/public_html/wp-content/plugins/admin-notices-manager/assets/js/admin/settings.js
(function ($, window) {

	window.anm_settings = window.anm_settings || {};

	window.anm_settings.select_appropriate_radio = function (e) {
		if (0 === $(e.target).val().length) {
			$(e.target).closest('fieldset').find('input[type="radio"]').first().prop('checked', true);
		} else {
			$(e.target).prevAll('label').first().find('input[type="radio"]').prop('checked', true);
		}
	};

	window.anm_settings.append_select2_events = function (select2obj) {
		select2obj.on('select2:select', window.anm_settings.select_appropriate_radio)
			.on('select2:unselect', window.anm_settings.select_appropriate_radio)
			.on('change', window.anm_settings.select_appropriate_radio);
	};

	jQuery(document).on('click', '#anm-purge-btn', function (e) {
		e.preventDefault();
		var nonce = jQuery(this).attr('data-nonce');

		jQuery.ajax({
			type: 'POST',
			dataType: 'json',
			url: anm_settings.ajaxurl,
			data: {
				action: 'anm_purge_notices',
				nonce: nonce
			},
			complete: function (data) {
				$('#anm-notice-purged-text').not('.visible').addClass('visible');
				setTimeout(function () {
					$('#anm-notice-purged-text.visible').removeClass('visible');
				}, 2000);
			}
		})
	});

}(jQuery, window));