tbfine(function(){return{init:function(){!function(t){function i(i,e){t.ajax({type:"POST",url:TBUI.uri+"/action/log.php",data:i,dataType:"json",success:function(t){t.msg&&n(t.msg,t.error),t.error||e&&e(t)}})}function n(i,n){if(!i)return!1;s&&clearTimeout(s),t(".sign-tips").css("background-color",n?"#FF5E52":"#07C160").html(i).animate({height:29},220),s=setTimeout(function(){t(".sign-tips").animate({height:0},220)},5e3)}var e='\t\t\t<div class="sign">\t\t\t    <div class="sign-mask"></div>\t\t\t    <div class="container">\t\t\t        <a href="javascript:;" class="close-link signclose-loader"><i class="fa fa-close"></i></a>\t\t\t        <div class="sign-tips"></div>\t\t\t        <form id="sign-in">  \t\t\t            <h3><small class="signup-loader">切换注册</small>登录</h3>\t\t\t            <h6>\t\t\t                <label for="inputEmail">用户名或邮箱</label>\t\t\t                <input type="text" name="username" class="form-control" id="inputEmail" placeholder="用户名或邮箱">\t\t\t            </h6>\t\t\t            <h6>\t\t\t                <label for="inputPassword">密码</label>\t\t\t                <input type="password" name="password" class="form-control" id="inputPassword" placeholder="登录密码">\t\t\t            </h6>\t\t\t            <div class="sign-submit">\t\t\t                <input type="button" class="btn btn-primary signinsubmit-loader" name="submit" value="登录" id="site_login">  \t\t\t                <input type="hidden" name="action" value="signin">\t\t\t                <label><input type="checkbox" checked="checked" name="remember" value="forever">记住我</label>\t\t\t            </div>'+(TBUI.url_rp?'<div class="sign-info"><a href="'+TBUI.url_rp+'">找回密码？</a></div>':"")+'</form>\t\t\t        <form id="sign-up"> \t\t\t            <h3><small class="signin-loader">切换登录</small>注册</h3>\t\t\t            <h6>\t\t\t                <label for="inputName">昵称</label>\t\t\t                <input type="text" name="name" class="form-control" id="inputName" placeholder="设置昵称">\t\t\t            </h6>\t\t\t            <h6>\t\t\t                <label for="inputEmail2">邮箱</label>\t\t\t                <input type="email" name="email" class="form-control" id="inputEmail2" placeholder="邮箱">\t\t\t            </h6>\t\t\t            <div class="sign-submit">\t\t\t                <input type="button" class="btn btn-primary btn-block signupsubmit-loader" name="submit" value="快速注册" id="site_register">  \t\t\t                <input type="hidden" name="action" value="signup">  \t\t\t            </div>\t\t\t        </form>\t\t\t    </div>\t\t\t</div>\t\t';TBUI.bd.append(e),t("#issignshow").length&&(TBUI.bd.addClass("sign-show"),setTimeout(function(){t("#sign-in").show().find("input:first").focus()},300),t("#sign-up").hide()),t(".signin-loader").on("click",function(){TBUI.bd.addClass("sign-show"),setTimeout(function(){t("#sign-in").show().find("input:first").focus()},300),t("#sign-up").hide()}),t(".signup-loader").on("click",function(){TBUI.bd.addClass("sign-show"),setTimeout(function(){t("#sign-up").show().find("input:first").focus()},300),t("#sign-in").hide()}),t(".signclose-loader").on("click",function(){TBUI.bd.removeClass("sign-show")}),t(".sign-mask").on("click",function(){TBUI.bd.removeClass("sign-show")}),t(".sign form").keydown(function(i){13==((i=i||event).which||i.keyCode)&&t(this).find(".signinsubmit-loader,.signupsubmit-loader").trigger("click")}),t(".signinsubmit-loader").on("click",function(){var e=t(this).parent().parent().serializeObject();e.action&&(e.password.length<6?n("密码太短，至少6位",1):TBUI.captcha&&TBUI.captcha_appid?tbquire(["qcaptcha"],function(){TBUI.cpt=new TencentCaptcha(document.getElementById("site_login"),TBUI.captcha_appid,function(t){0===t.ret&&(e.ticket=t.ticket,e.randstr=t.randstr,i(e,function(t){location.reload()}))}),TBUI.cpt.show()}):i(e,function(t){setTimeout(function(){location.reload()},1500)}))}),t(".signupsubmit-loader").on("click",function(){var e=t(this).parent().parent().serializeObject();e.action&&(/^[a-zA-Z\d_]{3,20}$/.test(e.name)?TBUI.is_mail(e.email)?TBUI.captcha&&TBUI.captcha_appid?tbquire(["qcaptcha"],function(){TBUI.cpt=new TencentCaptcha(document.getElementById("site_register"),TBUI.captcha_appid,function(t){0===t.ret&&(e.ticket=t.ticket,e.randstr=t.randstr,i(e,function(t){t.goto&&(location.href=t.goto)}))}),TBUI.cpt.show()}):i(e,function(t){t.goto&&(location.href=t.goto)}):n("邮箱格式错误",1):n("昵称是以字母数字下划线组合的3-20位字符",1))});var s}(jQuery)}}});