HEX
Server: Microsoft-IIS/10.0
System: Windows NT WIN8095 10.0 build 20348 (Windows Server 2016) AMD64
User: kytoffice-001 (0)
PHP: 7.4.30
Disabled: exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,show_source
Upload Files
File: h:/root/home/kytoffice-001/www/expresstinou/wp-content/plugins/so-widgets-bundle/admin/admin.js
/* globals jQuery, soWidgetsAdmin */

jQuery( function( $ ){

	$( '.so-widget-toggle-active button' ).on( 'click', function() {
		var $$ = $(this),
			s = $$.data('status'),
			$w = $$.closest('.so-widget');

		if(s) {
			$w.addClass('so-widget-is-active').removeClass('so-widget-is-inactive');
		}
		else {
			$w.removeClass('so-widget-is-active').addClass('so-widget-is-inactive');
		}

		// Lets send an ajax request.
		$.post(
			soWidgetsAdmin.toggleUrl,
			{
				'widget' : $w.data('id'),
				'active' : s
			},
			function(data){
				// $sw.find('.dashicons-yes').clearQueue().fadeIn('fast').delay(750).fadeOut('fast');
			}
		);

	} );

	//  Fill in the missing header images
	$('.so-widget-banner').each( function(){
		var $$ = $(this),
			$img = $$.find('img');

		if( !$img.length ) {
			// Create an SVG image as a placeholder icon
			var pattern = Trianglify({
				width: 128,
				height: 128,
				variance : 1,
				cell_size: 32,
				seed: $$.data('seed')
			});

			$$.append( pattern.svg() );
		}
		else {
			if( $img.width() > 128 ) {
				// Deal with wide banner images
				$img.css( 'margin-left', - ( $img.width() - 128 ) / 2 + 'px' );
			}
		}
	} );

	// Lets implement the search
	var widgetSearch = function(){
		var q = $(this).val().toLowerCase();

		if( q === '' ) {
			$('.so-widget-wrap').show();
		}
		else {
			$('.so-widget').each( function(){
				var $$ = $(this);

				if( $$.find('h3').html().toLowerCase().indexOf(q) > -1 ) {
					$$.parent().show();
				}
				else {
					$$.parent().hide();
				}
			} );
		}
	};
	$('#sow-widget-search input').on( {
		keyup: widgetSearch,
		search: widgetSearch
	});

	$( window ).on( 'resize', function() {
		var $descriptions = $('.so-widget-text').css('height', 'auto');
		var largestHeight = 0;

		$descriptions.each(function () {
			largestHeight = Math.max(largestHeight, $(this).height()  );
		});

		$descriptions.each(function () {
			$( this ).css( 'height', largestHeight + "px" );
		});

	} ).trigger( 'resize' );

	// Handle the tabs
	$( '#sow-widgets-page .page-nav a' ).on( 'click', function( e ) {
		e.preventDefault();
		var $$ = $(this);
		var href = $$.attr('href');

		var $li = $$.closest('li');
		$('#sow-widgets-page .page-nav li').not($li).removeClass('active');
		$li.addClass('active');

		switch( href ) {
			case '#all' :
				$('.so-widget-wrap').show();
				break;

			case '#enabled' :
				$('.so-widget-wrap').hide();
				$('.so-widget-wrap .so-widget-is-active').each(function(){ $(this).closest('.so-widget-wrap').show(); });
				$('.so-widget-wrap .so-widget-is-inactive').each(function(){ $(this).closest('.so-widget-wrap').hide(); });
				break;

			case '#disabled' :
				$('.so-widget-wrap .so-widget-is-active').each(function(){ $(this).closest('.so-widget-wrap').hide(); });
				$('.so-widget-wrap .so-widget-is-inactive').each(function(){ $(this).closest('.so-widget-wrap').show(); });
				break;
		}

		$( window ).trigger( 'resize' );
	});

	// Enable css3 animations on the widgets list
	$('#widgets-list').addClass('so-animated');

	// Handle the dialog
	var dialog = $('#sow-settings-dialog');

	$( '#widgets-list .so-widget-settings' ).on( 'click', function( e ) {
		var $$ = $(this);
		e.preventDefault();

		$content = dialog.find( '.so-content' );
		$content
			.empty()
			.addClass('so-loading')

		$.get( $$.data( 'form-url' ), function( form ) {
			$content
				.html( form )
				.removeClass( 'so-loading' );
		} );

		dialog.show();
	} );

	dialog.find( '.so-close' ).on( 'click', function( e ) {
		e.preventDefault();
		dialog.hide();
	} );

	dialog.find( '.so-save' ).on( 'click', function( e ) {
		e.preventDefault();

		var $$ = $( this );
		$$.prop( 'disabled', true );

		dialog.find( 'form' ).on( 'submit', function() {
			$$.prop( 'disabled', false );
			dialog.hide();
		} ).trigger( 'submit' );
	} );

	// Enable all widget settings button after the save iframe has loaded.
	$('#so-widget-settings-save').on( 'load', function() {
		$( '#widgets-list .so-widget-settings' ).prop( 'disabled', false );
	} );

	// Automatically open settings modal based on hash
	if( window.location.hash && window.location.hash.substring(0, 10) === '#settings-' ) {
		var openSettingsId = window.location.hash.substring(10);
		$('div[data-id="' + openSettingsId +  '"] button.so-widget-settings').trigger( 'click' );
	}

} );