/** PTNovelSearch-v4.1.2 LPPL License By http://www.ptcms.com/ */
 ;!function(t){var e={},a=function(t){var e=this;e.config=$.extend({title:"",content:"内容",shadeClose:!0,anim:!0},t),e.show()},n=0;t.PTDialogData={timer:{},end:{}},a.prototype.show=function(){var t=this,e=t.config;t.id="ptm-alert"+n;var a=function(){var t="object"==typeof e.title;return e.title?'<p class="ptm-alert-title" style="'+(t?e.title[1]:"")+'">'+(t?e.title[0]:e.title)+"</p>":""}(),i=function(){var t="";return e.okval&&(t=e.cancelval?'<a class="ptm-alert-btn-ok">'+e.okval+"</a>":'<a class="ptm-alert-btn-ok" style="margin:0 20%">'+e.okval+"</a>"),e.cancelval&&(t='<a class="ptm-alert-btn-cancel">'+e.cancelval+"</a>"+t),t?t='<div class="ptm-alert-btn">'+t+"</div>":e.time=e.time?e.time:2,t}(),o=function(){return'<p class="ptm-alert-content">'+e.content+"</p>"}(),s='<div class="ptm-alert-shade '+t.id+'"></div><div class="ptm-alert-box '+t.id+'" data-index="'+n+'">'+a+o+i+"</div>";$("body").append(s);var c=t.elem=$("#"+t.id)[0];setTimeout(function(){e.success&&e.success($("."+t.id))},1e3*e.time),t.index=n++,t.action(e,c)},a.prototype.action=function(t,e){var a=this;t.time&&(PTDialogData.timer[a.index]=setTimeout(function(){$ptm.alert.close(a.index)},1e3*t.time)),$(".ptm-alert-btn-ok",e).on("click",function(){t.okfunc&&t.okfunc(),$ptm.alert.close(a.index)}),$(".ptm-alert-btn-cancel",e).on("click",function(){t.cancelfunc&&t.cancelfunc(),$ptm.alert.close(a.index)}),$(".ptm-alert-shade",e).on("click",function(){$ptm.alert.close(a.index)}),t.end&&(PTDialogData.end[a.index]=t.end)},e.range=function(t,e){var a,n,i,o,s,c=null,l=function(){o=t.attr("max"),s=t.attr("min"),a=Math.abs(o-s),n=t[0].offsetLeft,i=t.width()-28,t.after('<div class="ptm-range-tip ptm-hide">'+t.val()+"</div>");var e=i/a*Math.abs(t.val()-s);t.next().css("left",n+e-11+"px"),t.on("change",function(){m()}),t.on("touchmove",function(){m()}),t.on("touchend",function(){d()})},m=function(){t.next().removeClass("ptm-hide");var o=i/a*Math.abs(t.val()-s);t.next().css("left",n+o-11+"px"),t.next().text(t.val()),e(t.val())},d=function(){c&&clearTimeout(c),c=setTimeout(function(){t.next().addClass("ptm-hide")},1500)};l()},e.alert={open:function(t){return t=t?t:{},new a(t)},close:function(t){var e=$(".ptm-alert"+t);e&&(e.remove(),clearTimeout(PTDialogData.timer[t]),delete PTDialogData.timer[t],"function"==typeof PTDialogData.end[t]&&PTDialogData.end[t](),delete PTDialogData.end[t])},closeAll:function(){for(var t=$(".ptm-alert-box"),e=0,a=t.length;e<a;e++)layer.close(0|t[0].data("index"))}},e.toast=function(t){var e=t?t:"加载中...",a='<div class="ptm-toast"><div class="ptm-toast-area"><p class="ptm-toast-content">'+e+"</p></div></div>";$(".ptm-toast").remove(),$("body").append(a),$(".ptm-toast").fadeIn(300),setTimeout(function(){$(".ptm-toast").fadeOut(300)},1500)},e.loading={open:function(t){var e=t?t:"加载中...",a='<div class="ptm-loading-toast"><div class="ptm-loading-area"><p class="ptm-loading-content"><i class="ptm-loading-anim"></i>'+e+"</p></div></div>";$(".ptm-loading-toast").remove(),$("body").append(a),$(".ptm-loading-toast").show(300)},close:function(){$(".ptm-loading-toast").hide(300),$(".ptm-loading-toast").remove()}},e.tab=function(t,e){$(t).on("click",function(){$(this).addClass("active").siblings().removeClass("active"),$(e).eq($(this).index()).addClass("active").siblings().removeClass("active")})},e.actionsheet={open:function(){var t=$(".ptm-actionsheet-mask"),e=$(".ptm-actionsheet");e.addClass("ptm-actionsheet-toggle"),t.show().addClass("ptm-actionsheet-mask-toggle").click(function(){$ptm.actionsheet.close()}),$("#actionsheet_cancel").click(function(){$ptm.actionsheet.close()}),e.unbind("transitionend").unbind("webkitTransitionEnd")},close:function(){var t=($(".ptm-actionsheet-mask"),$(".ptm-actionsheet"));t.removeClass("ptm-actionsheet-toggle"),$(".ptm-actionsheet-mask").removeClass("ptm-actionsheet-mask-toggle"),t.on("transitionend",function(){$(".ptm-actionsheet-mask").hide()}).on("webkitTransitionEnd",function(){$(".ptm-actionsheet-mask").hide()})}},t.$ptm=e}(window,$);