2015-06-05 19:26:11 +00:00
|
|
|
jQuery(document).ready(function($) {
|
|
|
|
var batch_progress = function (percent){
|
2015-06-09 13:11:49 +00:00
|
|
|
$(".batch-percent").html(percent + "%");
|
2015-06-05 19:26:11 +00:00
|
|
|
return $(".batch-progress > span").animate({ width: percent + "%" }, 600);
|
|
|
|
};
|
|
|
|
|
|
|
|
function batch_process(){
|
|
|
|
$.post(
|
|
|
|
ajaxurl+'?action=batch_operations&id='+batch_id,
|
|
|
|
function(data){
|
|
|
|
if (data['do']=='finish')
|
|
|
|
{
|
|
|
|
|
|
|
|
batch_progress(data['percent']);
|
|
|
|
$('.batch-message').html(data['message']).delay(1500).queue(function () {
|
|
|
|
$(location).attr('href',successful_page);
|
|
|
|
$(this).dequeue();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$('.batch-message').html(data['message']);
|
|
|
|
batch_progress(data['percent']);
|
|
|
|
batch_process()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
batch_process();
|
|
|
|
|
|
|
|
});
|