Fix: Apply latest phpcbf formatting fixes

This commit is contained in:
2025-04-18 18:01:52 +01:00
parent 93412896e8
commit 275958bfdb
5 changed files with 371 additions and 347 deletions

View File

@@ -71,7 +71,8 @@
$submitButton.prop( 'disabled', true ).addClass( 'loading' );
// Send AJAX request
$.ajax({
$.ajax(
{
url: wpstData.ajaxUrl,
type: 'POST',
data: {
@@ -93,7 +94,8 @@
// Re-enable submit button and remove loading state
$submitButton.prop( 'disabled', false ).removeClass( 'loading' );
}
});
}
);
},
/**
@@ -109,17 +111,25 @@
$( '.wpst-notices' ).html( $notice );
// Automatically remove notice after 5 seconds
setTimeout(function() {
$notice.fadeOut(300, function() {
setTimeout(
function () {
$notice.fadeOut(
300,
function () {
$( this ).remove();
});
}, 5000);
}
);
},
5000
);
}
};
// Initialize when document is ready
$(document).ready(function() {
$( document ).ready(
function () {
WPSTAdmin.init();
});
}
);
})( jQuery );

View File

@@ -41,11 +41,15 @@
// Close modal when clicking on the close button or outside the modal
this.$modal.on( 'click', '.wpst-modal-close', this.closeModal.bind( this ) );
$(document).on('click', '.wpst-modal', function(e) {
$( document ).on(
'click',
'.wpst-modal',
function (e) {
if ($( e.target ).hasClass( 'wpst-modal' )) {
WPSTUpdateSourceSelector.closeModal();
}
});
}
);
// Select source option
this.$modal.on( 'click', '.wpst-source-option', this.selectSource.bind( this ) );
@@ -105,7 +109,8 @@
$saveButton.prop( 'disabled', true ).html( '<span class="wpst-loading"></span> Saving...' );
// Send AJAX request
$.ajax({
$.ajax(
{
url: wpstModalData.ajaxUrl,
type: 'POST',
data: {
@@ -118,9 +123,12 @@
WPSTUpdateSourceSelector.showMessage( 'success', response.data.message );
// Close modal after a short delay
setTimeout(function() {
setTimeout(
function () {
WPSTUpdateSourceSelector.closeModal();
}, 1500);
},
1500
);
} else {
WPSTUpdateSourceSelector.showMessage( 'error', response.data.message );
}
@@ -132,7 +140,8 @@
// Reset button state
$saveButton.prop( 'disabled', false ).text( wpstModalData.i18n.confirm );
}
});
}
);
},
/**
@@ -149,16 +158,21 @@
// Hide message after a delay for success messages
if (type === 'success') {
setTimeout(function() {
setTimeout(
function () {
$message.fadeOut( 300 );
}, 3000);
},
3000
);
}
}
};
// Initialize when document is ready
$(document).ready(function() {
$( document ).ready(
function () {
WPSTUpdateSourceSelector.init();
});
}
);
})( jQuery );