This commit is contained in:
Gitea
2022-03-30 09:13:50 +08:00
parent 15dfc6576b
commit 557aa3c555
179 changed files with 6115 additions and 4092 deletions

View File

@@ -71,6 +71,42 @@ $(document).ready(function (e) {
$(this).attr('href', $(this).attr('href')+hash);
});
}
//无刷新切换状态
$('.switch').on("click",".fa-toggle-on",function(){
$.get($(this).parent(".switch").attr("href"))
$(this).addClass("fa-toggle-off");
$(this).removeClass("fa-toggle-on");
return false;
})
$('.switch').on("click",".fa-toggle-off",function(){
$.get($(this).parent(".switch").attr("href"))
$(this).addClass("fa-toggle-on");
$(this).removeClass("fa-toggle-off");
return false;
})
$('.ajaxlink').on("click",function(){
var url=$(this).attr("href");
$.ajax({
type: 'GET',
url: url,
dataType: 'json',
data: {},
success: function (response, status) {
alert(response.data);
if(response.tourl!=""){
location.href=response.tourl;
}
},
error:function(xhr,status,error){
alert('返回数据异常!');
}
});
return false;
})
})