/*! handsome 2020-08-15 */ var handsome_ajax={init:function(){this.login_ajax(),this.initAndPjax_Complete()},pjax_complete:function(){this.initAndPjax_Complete()},initAndPjax_Complete:function(){this.password_post_ajax()},login_ajax:function(){function a(){$("#login-submit").attr("disabled",!1).fadeTo("",1)}$("#Login_form").submit(function(){if($(this).hasClass("banLogin"))return location.reload(),!1;$("#login-submit").attr("disabled",!0).fadeTo("slow",.5);var b=$("#navbar-login-user").val(),c=$("#navbar-login-password").val();return""==b?($.message({title:LocalConst.LOGIN_TITLE,message:LocalConst.LOGIN_USERNAME_INFO,type:"warning"}),$("#navbar-login-user").focus(),a(),!1):""==c?($.message({title:LocalConst.LOGIN_TITLE,message:LocalConst.LOGIN_PASSWORD_INFO,type:"warning"}),$("#navbar-login-password").focus(),a(),!1):($("#login-submit").addClass("active"),$("#spin-login").addClass("show inline"),$.ajax({url:$(this).attr("action"),type:$(this).attr("method"),data:$(this).serializeArray(),error:function(){return $.message({title:LocalConst.LOGIN_TITLE,message:LocalConst.LOGIN_SUBMIT_ERROR,type:"error"}),a(),!1},success:function(b){b=$.parseHTML(b),$("#login-submit").removeClass("active"),$("#spin-login").removeClass("show inline");try{if($("#Logged-in",b).length<=0)return $.message({title:LocalConst.LOGIN_TITLE,message:LocalConst.LOGIN_SUBMIT_INFO,type:"error"}),a(),!1;b=$("#easyLogin",b).html(),$("#easyLogin").html(b),$.message({title:LocalConst.LOGIN_TITLE,message:LocalConst.LOGIN_SUBMIT_SUCCESS+' '+LocalConst.CLICK_TO_REFRESH+"",type:"success"})}catch(a){alert("按下F12,查看输出错误信息")}}}),!1)})},password_post_ajax:function(){$("#post-content").delegate("form.protected","submit",function(){return $.ajax({url:$(this).attr("action"),type:$(this).attr("method"),data:$(this).serializeArray(),error:function(a){try{if($("#post-content",data).length<=0)return $.message({title:"提交通知",message:LocalConst.SUBMIT_PASSWORD_INFO,type:"warning"}),!1;window.location.reload()}catch(a){window.location.reload(),console.log(a)}},success:function(a){try{if($("#post-content",a).length<=0)return $.message({title:"提交通知",message:LocalConst.SUBMIT_PASSWORD_INFO,type:"warning"}),!1;window.location.reload()}catch(a){console.log(a),window.location.reload()}}}),!1})}};const handsome_basics={init:function(){this.nav_handle(),this.searchTips(),this.initAndPjax_Complete()},pjax_complete:function(){this.initAndPjax_Complete()},initAndPjax_Complete:function(){},nav_handle:function(){var a=navigator.userAgent;a.indexOf("Safari")>-1&&a.indexOf("Chrome")<1&&$("#left_footer").addClass("hide"),$(document).on("click","[ui-toggle-class]",function(a){a.preventDefault();var b=$(a.target);b.attr("ui-toggle-class")||(b=b.closest("[ui-toggle-class]"));var c=b.attr("ui-toggle-class").split(","),d=b.attr("target")&&b.attr("target").split(",")||Array(b),e=0;$.each(c,function(a,b){var f=d[d.length&&e];$(f).toggleClass(c[a]),e++}),b.toggleClass("active")}),$(document).on("click","[data-toggle-class]",function(a){a.preventDefault();var b=$(this),c=b.data("toggle-class"),d={};$.each(c.split(","),function(){var a=$.trim(this);if(a){var b=a.split("="),c=b[0],e=b[1];d[c]=e}}),$.each(d,function(a,b){$(a).toggleClass(b)})});var b;$(document).on("click","[ui-nav] a .parent_name",function(a){var b=document.createElement("a");b.setAttribute("href",$(this).parent("a").attr("href")),document.body.appendChild(b),b.click()}),$(document).on("click","[ui-nav] a,[ui-nav-fold] a",function(a){b&&b.trigger("mouseleave.nav");var c=$(this);if(c.parent().siblings(".active").toggleClass("active"),c.next().is("ul")&&c.parent().toggleClass("active")&&a.preventDefault(),$(".app-aside-fix").length>0&&$(window).width()>768){var d,c=$(a.target),e=$(window).height();c.is("a")&&c.next().is(".child-nav")&&(b=c.parent().parent()),$(".app-aside-folded").length&&b&&(d=b.position().top,d+b.height()>=e&&b.css("bottom","50px"),d+150>e&&b.css("bottom",e-d-50).css("top","auto")),$(".app-aside-dock").length&&$(window).width()>991&&(console.log("重新计算:click"),console.log("height:"+b.height()+"w_h:"+e+"end:"+(e-115)),120+b.height()>=e?(console.log("height:"+b.height()+"w_h:"+e+"end:"+(e-115)),b.height(e-120)):(console.log("height:"+b.height()+"w_h:"+e+"end:"+(e-115)),b.css("height","auto")))}c.next().is("ul")||$(window).width()<768&&$(".off-screen").removeClass("show off-screen")});var c=!0;$(document).on("mouseenter","[ui-nav] a",function(a){if($(document).on("mouseenter",".app-aside>ul.nav",function(a){c=!0}),$(document).on("mouseleave",".app-aside>ul.nav",function(a){c=!1}),b&&b.trigger("mouseleave.nav"),$("> .nav",$(".app-aside")).remove(),$(".app-aside-fix").length&&!($(window).width()<768)){var d,e=$(a.target),f=$(window).height();!e.is("a")&&(e=e.closest("a")),e.next().is("ul")&&(b=e.next(),$(".app-aside-folded").length&&(e.parent().addClass("active"),b.appendTo(".app-aside"),d=e.parent().position().top,b.css("top",d),b.attr("ui-nav-fold",""),d+b.height()>f&&b.css("bottom","50px"),d+150>f&&b.css("bottom",f-d-50).css("top","auto"),b.on("mouseleave.nav",function(a){c||(b.appendTo(e.parent()),b.off("mouseleave.nav").css("top","auto").css("bottom","auto"),e.parent().removeClass("active"),c=!1)}),$(".smart").length&&$('