HEX
Server: Apache
System: Linux web5.visualcom.es 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: ensaco.es (10019)
PHP: 8.3.32
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/ensaco.es/httpdocs/wp-content/plugins/bb-plugin/js/fl-builder-admin-usage.js
(function( $ ) {

	/**
	 * Enable/Disable usage stats helper.
	 *
	 * @since 2.1
	 */
	var FLBuilderUsage = {

		init: function() {
			FLBuilderUsage._fadeToggle()
			FLBuilderUsage._enableClick()
			FLBuilderUsage._disableClick()
		},
		_fadeToggle: function() {
			$( 'a.stats-info' ).click( function( e ) {
				e.preventDefault();
				$( '.stats-info-data' ).fadeToggle()
			})
		},
		_enableClick: function() {
			$( '.buttons span.enable-stats' ).click( function( e ) {

				nonce = $(this).closest('.buttons').find('#_wpnonce').val()

				data = {
					'action'  : 'fl_usage_toggle',
					'enable'  : 1,
					'_wpnonce': nonce
				}
				FLBuilderUsage._doAjax( data )
			})
		},
		_disableClick: function() {
			$( '.buttons span.disable-stats' ).click( function( e ) {

				nonce = $(this).closest('.buttons').find('#_wpnonce').val()

				data = {
					'action'  : 'fl_usage_toggle',
					'enable'  : 0,
					'_wpnonce': nonce
				}
				FLBuilderUsage._doAjax( data )
			})
		},
		_doAjax: function( data ) {
			$.post(ajaxurl, data, function(response) {
				FLBuilderUsage._close()
			});
		},

		_close: function() {
			$( '.fl-usage').closest('.notice').fadeToggle()
		}
	};

	$( function() {
		FLBuilderUsage.init();
	});

})( jQuery );