This repository has been archived on 2022-08-01. You can view files and clone it, but cannot push or open issues or pull requests.
Oldphaloskepsis/plugins/jetpack/modules/contact-form/js/grunion-admin.js

30 lines
941 B
JavaScript
Raw Normal View History

2017-01-12 23:10:07 +00:00
/* 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 );
}
}
);
}
} );