'+result.page+'/'+result.total+'
',
success:function(){
var timer = setInterval(function(){
$.get("/wp-content/plugins/proofreading/api.php?type=getlen", {domain:domain}, function (result) {
result = JSON.parse(result);
if(result.leng == 0){
clearInterval(timer);
$(".layui-progress-bar").css("width",result.prent);
$(".layui-progress-text").html("完成");
}else{
$(".layui-progress-bar").css("width",result.prent);
$(".layui-progress-text").html(result.page+"/"+result.total);
}
})
},3000)
}
});
}
})
})
$(".save-language").unbind("click").bind("click", function () {
let language_all = [];
let language_choose = [];
let link_type = $('select[name=link_type]').find('option:selected').val()
let is_start = $('input.is_start').is(':checked') ? 1 : 2;
let is_open_customer_proofreading = $('input.is_open_customer_proofreading').is(':checked') ? 1 : 2;
$("input[name=check_box_choose]:checkbox").each(function () {
let value = $(this).parents(".language-flag").attr("data-value");
if (true === $(this).is(":checked")) {
language_choose.push(value)
}
language_all.push(value)
})
let data = {
language_all: language_all,
language_choose: language_choose,
link_type: link_type,
is_start: is_start,
is_open_customer_proofreading: is_open_customer_proofreading
}
$.post("/wp-content/plugins/proofreading/api.php?type=chooseLanguage", data, function (result) {
result = JSON.parse(result);
if (parseInt(result.status) === 1) {
layer.msg(result.msg, {icon: 1, shade: [0.3, "#393D49"], shadeClose: true, time: 1000})
} else {
layer.msg(result.msg, {icon: 5, shade: [0.3, "#393D49"], shadeClose: true, time: 1000})
}
})
})
// 输入密码页面样式
$('#confirm').unbind('click').bind('click', function() {
let password = $('input[name=password]').val()
if (!password || password.length < 6) {
layer.msg('请输入至少6位数的密码!', {icon: 5, shade: [0.3, '#393D49'], shadeClose: true, time: 1000})
return false;
}
$.post('/wp-content/plugins/proofreading/api.php?type=changePassword', {password: password}, function (result) {
result = JSON.parse(result);
if (parseInt(result.status) === 1) {
layer.msg(result.msg, {icon: 1, shade: [0.3, '#393D49'], shadeClose: true, time: 1000})
} else {
layer.msg(result.msg, {icon: 5, shade: [0.3, '#393D49'], shadeClose: true, time: 1000})
}
})
})
$("#id_select2_demo1").select2();
$("#id_select2_demo2").select2();
$("#clear-bakfile").click(function(){
let path = $('select[name=path]').val()
let language = $('select[name=language]').val()
layer.confirm('清空较对缓存后较对文本将不会保留,确认清空较对缓存吗?',{
btn:['确定','取消'],
cancel:function(index, layero){
console.log('关闭x号');
}
},function () {
layer.close(layer.index);
$.post('/wp-content/plugins/proofreading/api.php?type=clearPFilebak',{path:path,language:language}, function (result) {
result = JSON.parse(result);
layer.msg(result.msg, {icon: parseInt(result.status) === 1 ? 1 : 5, shade: [0.3, '#393D49'], shadeClose: true, time: 1000})
})
},function(){
console.log(22);
});
})
$('.pages-title-tab > li').unbind('click').bind('click', function () {
let id = $(this).attr('id');
var domain = $(this).attr('domain');
let index = $(this).index()
if (id !== 'clear-cache') {
$(this).addClass('active').siblings('li').removeClass('active')
$('.tab-button-list >ul > li').eq(index).addClass('active').siblings('li').removeClass('active')
$('.nav_information_items_wrap > li').eq(index).addClass('active').siblings('li').removeClass('active')
if(id == "trans"){
}
} else {
$.post('/wp-content/plugins/proofreading/api.php?type=clearPagesCache', function (result) {
result = JSON.parse(result);
layer.msg(result.msg, {icon: parseInt(result.status) === 1 ? 1 : 5, shade: [0.3, '#393D49'], shadeClose: true, time: 1000})
})
}
})
})