Этот коммит содержится в:
2015-06-05 22:26:11 +03:00
родитель 0599ff94da
Коммит 6cdf38a236
7 изменённых файлов: 281 добавлений и 1 удалений

32
js/batch.js Обычный файл
Просмотреть файл

@@ -0,0 +1,32 @@
jQuery(document).ready(function($) {
var batch_progress = function (percent){
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();
});

1
js/batch.min.js поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1 @@
jQuery(document).ready(function(a){function b(){a.post(ajaxurl+"?action=batch_operations&id="+batch_id,function(d){"finish"==d["do"]?(c(d.percent),a(".batch-message").html(d.message).delay(1500).queue(function(){a(location).attr("href",successful_page),a(this).dequeue()})):(a(".batch-message").html(d.message),c(d.percent),b())})}var c=function(b){return a(".batch-progress > span").animate({width:b+"%"},600)};b()});