").prop("id",l.id),t.append(c),l.init(c,o,r),l.check(function(t){t?(c.hide(),s(++i)):(l.load(),localStorage[n]=i,a.currentServer=l)},c,o,r))},c=0,localStorage.comment_type&&(c=parseInt(localStorage[n],10)||0),c=Math.min(e.length-1,c),c=Math.max(c,0),void s(c)):void alert("没有找到评论所需标记!")):void alert("没有找到评论容器!"):void alert("没有找到可用的服务!")}}}();t.TotalThread=a}(this),function(t){var a=function(){var a=!1;return{id:"disqus_thread",check:function(a){var e,n,i=["https://c.disquscdn.com/favicon.ico","https://disqus.com/favicon.ico"],o=0,r=0,s=function(){o==i.length&&a(r==o?0:1)};for(t.__disqus_img=[],e=function(a){var e=new Image,n=setTimeout(function(){e.onerror=e.onload=null,o++,s()},2500);e.onerror=function(){clearTimeout(n),o++,s()},e.onload=function(){clearTimeout(n),o++,r++,s()},e.src=i[a]+"?"+ +new Date,t.__disqus_img[a]=e},n=0;n
注:如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理。"),this.elThread=t,this.url=a,this.identifier=e}}}();t.TotalThread.addService(a)}(this),function(t){var a=function(){var e=!1,n=function(e,n){var i,o,r=!1,s="",c=function(a){var e='
'+(a.url?'
![]()
':'
![]()
')+'
';return e},l=function(t){for(;t.length;){var a=[];t.forEach(function(t){var n=t.parent,i=e.find('ul[data-id="'+n+'"]');return i.length?void i.append(c(t)):void a.push(t)}),t=a}},d=function(a){var n=parseInt(a.parent,10),i=e.find('ul[data-id="'+n+'"]');i.prepend(c(a)),e.find(".no-result").hide(),$(t).trigger("scroll"),$(t).trigger("hashchange","scrollIntoView")};a.insertItem=d,i=function(t){var a='
';e.attr("data-thread",t.thread),e.attr("data-identifier",n),e.html(a),t.comments.length||e.find(".thread-post-list").append('
本文目前还没有人评论~
')},o=function(){if(!r){r=!0;var a;a=s?"/disqus/"+n+"/"+encodeURIComponent(s):"/disqus/"+n,$.get(a,{},function(a){var n;r=!1,a&&0==a.errno?(s?l(a.data.comments):(i(a.data),l(a.data.comments),$(t).trigger("hashchange","scrollIntoView")),n=e.find(".load-more a"),a.data.next?n.removeClass("busy"):n.hide(),s=a.data.next,$(t).trigger("scroll")):e.html('
获取数据失败,请稍后再试!
')})}},e.on("click",".load-more a",function(t){t.preventDefault(),$(this).addClass("busy"),o()}).on("click","a.time-ago",function(t){t.preventDefault(),location.hash="comment-"+$(this).data("id")}).on("click","a.reload",function(a){a.preventDefault(),t.TotalThread.clear(),location.hash="comments",location.reload()}).on("click","a.reply, button.create-post",function(a){var n,i,o,r,s,c,l,d,u;a.preventDefault(),n=e.data("identifier"),i=e.data("thread"),o=$(this).data("next"),r=$(this).data("id"),s=420,c=520,l=t.screen.width-s/2,d=t.screen.height-c/2,u=[n,i,r,o].join("|"),t.open("/disqus/form/"+encodeURIComponent(u)+"/","_create_post","width="+s+",height="+c+",location=1,status=1,resizable=1,scrollbars=1,left="+l+",top="+d)}),$(t).on("hashchange",function(a,n){var i,o=location.hash.match(/#comment\-(\d+)/);o&&(i=e.find("#post-"+o[1]),i.length&&(e.find(".post-content.target").removeClass("target"),i.find("> .post-content").addClass("target"),n&&$(t).scrollTop(i.offset().top-90)))}),/(iPhone|Android)/.test(navigator.userAgent)&&e.addClass("mobile"),o()};return{id:"simple_thread",check:function(t){t(0)},load:function(){e||(e=!0,n(this.elThread,this.identifier))},init:function(t,a,e){t.html("评论基础模式加载中...
注:本模式仅支持最基本的评论功能,如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理。"),this.elThread=t,this.url=a,this.identifier=e}}}();t.TotalThread.addService(a)}(this),function(t,a){var e=a.domain;return"{{.Qiniu.Domain}}"==e?void (location.href=location.href.replace(/(https?:\/\/[^\/]+)\//i,"//{{.Domain}}")):(function(){var t,a=location.search.queryUrl();"1"==a.clear_ls&&(delete a.clear_ls,t=$.param(a),setTimeout(function(){t?location.search=$.param(a):location.href=location.href.replace(/\?.*$/,"")},300))}(),void $(function(){lazyLoad({selector:"#content",height:100}),function(){var t=$("#content"),a=t.find("img"),e=t.width();a.each(function(){var t=$(this),a=0|t.attr("width"),n=0|t.attr("height"),i=t.prop("complete");a>e&&t.attr("height",Math.ceil(n/a*e)),t.prop("src")&&(i?t.addClass("loaded"):t.on("load",function(){t.addClass("loaded")}))})}(),function(){if("search-post"==CURRENT_PAGE){var t=$("#keyword");t.val()||t.focus()}}(),function(){var a=$(".total_thread");a.length&&setTimeout(function(){/ #comment - \d + $ /.test(location.hash)&&$("#comments").get(0).scrollIntoView();var e=setInterval(function(){var n=a.offset().top,i=$(t).scrollTop();Math.abs(n-i)<1000&&(clearTimeout(e),t.TotalThread.init(a))},150)},250)}()}))}(this,document);
{{end}}