alpha
Этот коммит содержится в:
32
js/batch.js
Обычный файл
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
поставляемый
Обычный файл
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()});
|
Ссылка в новой задаче
Block a user