This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Omphaloskepsis/plugins/jetpack/modules/contact-form/js/grunion-admin.js
2018-03-21 18:19:20 +00:00

30 lines
941 B
JavaScript

/* global ajaxurl */
jQuery( function ( $ ) {
$( document ).on( 'click', '#jetpack-check-feedback-spam:not(.button-disabled)', function( e ) {
e.preventDefault();
$( '#jetpack-check-feedback-spam:not(.button-disabled)' ).addClass( 'button-disabled' );
$( '.jetpack-check-feedback-spam-spinner' ).addClass( 'spinner' ).show();
grunion_check_for_spam( 0, 100 );
} );
function grunion_check_for_spam( offset, limit ) {
$.post(
ajaxurl,
{
'action' : 'grunion_recheck_queue',
'offset' : offset,
'limit' : limit
},
function ( result ) {
if ( result.processed < limit ) {
window.location.reload();
}
else {
grunion_check_for_spam( offset + limit, limit );
}
}
);
}
} );