From a66a3c0198ccd11cfc09f6529cc256989c085531 Mon Sep 17 00:00:00 2001 From: deepzz0 Date: Sat, 22 Apr 2017 10:47:01 +0800 Subject: [PATCH] update disqus.js->disqus_921d24.js --- views/st_blog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/st_blog.js b/views/st_blog.js index 9175226..a7b2b34 100644 --- a/views/st_blog.js +++ b/views/st_blog.js @@ -1,3 +1,3 @@ {{define "blog_js"}} -var stringProto=String.prototype;stringProto.stripTags=function(){return this.replace(/<[^>]*>/gi,"")},stringProto.decode4Html=function(){var t=document.createElement("div");return t.innerHTML=this.stripTags(),t.childNodes[0]?t.childNodes[0].nodeValue||"":""},stringProto.queryUrl=function(t){var a=this.replace(/^[^?=]*\?/gi,"").split("#")[0],e={};return a.replace(/(^|&)([^&=]+)=([^&]*)/g,function(t,a,n,i){try{n=decodeURIComponent(n)}catch(o){}try{i=decodeURIComponent(i)}catch(o){}n in e?e[n] instanceof Array?e[n].push(i):e[n]=[e[n],i]:e[n]=/\[\]$/.test(n)?[i]:i}),t?e[t]:e},function(t){t.disqus_shortname="deepzz",$.each(["CURRENT_PAGE","CDN_DOMAIN"],function(a,e){t[e]="";var n=$("#"+e);n&&(t[e]=n.val())})}(this),function(t){function a(a){var e,n,i={selector:null,height:200};i=$.extend(i,a),e=i.height,n=function(){var a=$(t).scrollTop(),n=$(t).height()+a;$(i.selector).find("img[data-src]").each(function(){var t=$(this);setTimeout(function(){var i,o=t.offset(),s=t.height();o.top>n+e||o.top+s'),e.insertAfter(i)),o.html().split("\n").length>3&&o.prop("className").indexOf("language")>-1)){switch(n=o.prop("className").replace("language-","").toUpperCase()){case"XML":n="HTML";break;case"SHELL":n="BASH"}$(''+n+"").insertBefore(o)}}),$(".entry-content input.runcode").each(function(){var a=$(this);a.click(function(a){var e,n,i;a.preventDefault(),e=$("#"+$(this).data("id")).html().stripTags().decode4Html(),n=t.open("","_preview",""),i=n.document,i.open(),i.write(e),i.close()})}),$(".entry-content > pre code").each(function(i,block){hljs.highlightBlock(block)})})}(this),function(){$(function(){$(".entry-content img[data-replace]").each(function(){var t=$(this);t.click(function(){var a,e,n,i,o=1000*(t.data("dur")||20);t.css("cursor")&&(a="/static/img/blank.gif",e=t.prop("src"),n=t.data("replace"),t.prop("src",a),t.css("cursor",""),i=new Image,i.onload=function(){t.prop("src",n),setTimeout(function(){t.prop("src",e),t.css("cursor","pointer")},o)},i.src=n)}),t.css("cursor","pointer")})})}(this),function(t){var a=function(){var t=[],a="comment_type";return{addService:function(a){t.push(a)},clear:function(){localStorage.removeItem(a)},init:function(e){var n,i,o,s;return t.length?e.length?(n=e.data("url")||location.href,i=e.data("identifier"),n&&i?(o=function(s){var r,c=t[s];c&&(r=$("
").prop("id",c.id),e.append(r),c.init(r,n,i),c.check(function(t){t?(r.hide(),o(++s)):(c.load(),localStorage[a]=s)},r,n,i))},s=0,localStorage.comment_type&&(s=parseInt(localStorage[a],10)||0),s=Math.min(t.length-1,s),s=Math.max(s,0),void o(s)):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=new Image,n=setTimeout(function(){e.onerror=e.onload=null,a(1)},2500);e.onerror=function(){clearTimeout(n),a(2)},e.onload=function(){clearTimeout(n),a(0)},e.src="https://disqus.com/favicon.ico?"+ +new Date,t.__disqus_img=e},load:function(){if(!a){a=!0;var e=this;t.disqus_config=function(){this.page.url=e.url,this.page.identifier=e.identifier},$.ajax({url:t.CDN_DOMAIN+"/static/js/disqus_a9d3fd.js",dataType:"script",cache:!0})}},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){var a=function(){var a=!1,e=function(a,e){var n=!1,i="",o=function(a){var e='
  • '+(a.url?'':'')+'
    '+a.message+'
    • ';return e},s=function(t){for(;t.length;){var e=[];t.forEach(function(t){var n=t.parent,i=a.find('ul[data-id="'+n+'"]');return i.length?void i.append(o(t)):void e.push(t)}),t=e}},r=function(t){var n="";n=t.comments.length?'':'

      没有找到任何评论数据~

      ',a.attr("data-thread",t.thread),a.attr("data-identifier",e),a.html(n)},c=function(){if(!n){n=!0;var o;o=i?"/disqus/"+e+"/"+encodeURIComponent(i):"/disqus/"+e,$.get(o,{},function(e){var o;n=!1,e&&0==e.errno?(i?s(e.data.comments):(r(e.data),s(e.data.comments),$(t).trigger("hashchange","scrollIntoView")),o=a.find(".load-more a"),e.data.next?o.removeClass("busy"):o.hide(),i=e.data.next,$(t).trigger("scroll")):a.html('

      获取数据失败,请稍后再试!

      ')})}};a.on("click",".load-more a",function(t){t.preventDefault(),$(this).addClass("busy"),c()}).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(e){var n,i,o,s,r,c,l,d,u;e.preventDefault(),n=a.data("identifier"),i=a.data("thread"),o=$(this).data("next"),s=$(this).data("id"),r=420,c=520,l=t.screen.width-r/2,d=t.screen.height-c/2,u=[n,i,s,o].join("|"),t.open("/disqus/form/"+encodeURIComponent(u)+"/","_create_post","width="+r+",height="+c+",location=1,status=1,resizable=1,scrollbars=1,left="+l+",top="+d)}),$(t).on("hashchange",function(e,n){var i,o=location.hash.match(/#comment\-(\d+)/);o&&(i=a.find("#post-"+o[1]),i.length&&(a.find(".post-content.target").removeClass("target"),i.find("> .post-content").addClass("target"),n&&$(t).scrollTop(i.offset().top-90)))}),/(iPhone|Android)/.test(navigator.userAgent)&&a.addClass("mobile"),c()};return{id:"simple_thread",check:function(t){t(0)},load:function(){a||(a=!0,e(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"st.deepzz.com"==e?void (location.href=location.href.replace(/(https?:\/\/[^\/]+)\//i,"//deepzz.com/")):(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); +var stringProto=String.prototype;stringProto.stripTags=function(){return this.replace(/<[^>]*>/gi,"")},stringProto.decode4Html=function(){var t=document.createElement("div");return t.innerHTML=this.stripTags(),t.childNodes[0]?t.childNodes[0].nodeValue||"":""},stringProto.queryUrl=function(t){var a=this.replace(/^[^?=]*\?/gi,"").split("#")[0],e={};return a.replace(/(^|&)([^&=]+)=([^&]*)/g,function(t,a,n,i){try{n=decodeURIComponent(n)}catch(o){}try{i=decodeURIComponent(i)}catch(o){}n in e?e[n] instanceof Array?e[n].push(i):e[n]=[e[n],i]:e[n]=/\[\]$/.test(n)?[i]:i}),t?e[t]:e},function(t){t.disqus_shortname="deepzz",$.each(["CURRENT_PAGE","CDN_DOMAIN"],function(a,e){t[e]="";var n=$("#"+e);n&&(t[e]=n.val())})}(this),function(t){function a(a){var e,n,i={selector:null,height:200};i=$.extend(i,a),e=i.height,n=function(){var a=$(t).scrollTop(),n=$(t).height()+a;$(i.selector).find("img[data-src]").each(function(){var t=$(this);setTimeout(function(){var i,o=t.offset(),s=t.height();o.top>n+e||o.top+s'),e.insertAfter(i)),o.html().split("\n").length>3&&o.prop("className").indexOf("language")>-1)){switch(n=o.prop("className").replace("language-","").toUpperCase()){case"XML":n="HTML";break;case"SHELL":n="BASH"}$(''+n+"").insertBefore(o)}}),$(".entry-content input.runcode").each(function(){var a=$(this);a.click(function(a){var e,n,i;a.preventDefault(),e=$("#"+$(this).data("id")).html().stripTags().decode4Html(),n=t.open("","_preview",""),i=n.document,i.open(),i.write(e),i.close()})}),$(".entry-content > pre code").each(function(i,block){hljs.highlightBlock(block)})})}(this),function(){$(function(){$(".entry-content img[data-replace]").each(function(){var t=$(this);t.click(function(){var a,e,n,i,o=1000*(t.data("dur")||20);t.css("cursor")&&(a="/static/img/blank.gif",e=t.prop("src"),n=t.data("replace"),t.prop("src",a),t.css("cursor",""),i=new Image,i.onload=function(){t.prop("src",n),setTimeout(function(){t.prop("src",e),t.css("cursor","pointer")},o)},i.src=n)}),t.css("cursor","pointer")})})}(this),function(t){var a=function(){var t=[],a="comment_type";return{addService:function(a){t.push(a)},clear:function(){localStorage.removeItem(a)},init:function(e){var n,i,o,s;return t.length?e.length?(n=e.data("url")||location.href,i=e.data("identifier"),n&&i?(o=function(s){var r,c=t[s];c&&(r=$("
      ").prop("id",c.id),e.append(r),c.init(r,n,i),c.check(function(t){t?(r.hide(),o(++s)):(c.load(),localStorage[a]=s)},r,n,i))},s=0,localStorage.comment_type&&(s=parseInt(localStorage[a],10)||0),s=Math.min(t.length-1,s),s=Math.max(s,0),void o(s)):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=new Image,n=setTimeout(function(){e.onerror=e.onload=null,a(1)},2500);e.onerror=function(){clearTimeout(n),a(2)},e.onload=function(){clearTimeout(n),a(0)},e.src="https://disqus.com/favicon.ico?"+ +new Date,t.__disqus_img=e},load:function(){if(!a){a=!0;var e=this;t.disqus_config=function(){this.page.url=e.url,this.page.identifier=e.identifier},$.ajax({url:t.CDN_DOMAIN+"/static/js/disqus_921d24.js",dataType:"script",cache:!0})}},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){var a=function(){var a=!1,e=function(a,e){var n=!1,i="",o=function(a){var e='
    • '+(a.url?'':'')+'
      '+a.message+'
      • ';return e},s=function(t){for(;t.length;){var e=[];t.forEach(function(t){var n=t.parent,i=a.find('ul[data-id="'+n+'"]');return i.length?void i.append(o(t)):void e.push(t)}),t=e}},r=function(t){var n="";n=t.comments.length?'':'

        没有找到任何评论数据~

        ',a.attr("data-thread",t.thread),a.attr("data-identifier",e),a.html(n)},c=function(){if(!n){n=!0;var o;o=i?"/disqus/"+e+"/"+encodeURIComponent(i):"/disqus/"+e,$.get(o,{},function(e){var o;n=!1,e&&0==e.errno?(i?s(e.data.comments):(r(e.data),s(e.data.comments),$(t).trigger("hashchange","scrollIntoView")),o=a.find(".load-more a"),e.data.next?o.removeClass("busy"):o.hide(),i=e.data.next,$(t).trigger("scroll")):a.html('

        获取数据失败,请稍后再试!

        ')})}};a.on("click",".load-more a",function(t){t.preventDefault(),$(this).addClass("busy"),c()}).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(e){var n,i,o,s,r,c,l,d,u;e.preventDefault(),n=a.data("identifier"),i=a.data("thread"),o=$(this).data("next"),s=$(this).data("id"),r=420,c=520,l=t.screen.width-r/2,d=t.screen.height-c/2,u=[n,i,s,o].join("|"),t.open("/disqus/form/"+encodeURIComponent(u)+"/","_create_post","width="+r+",height="+c+",location=1,status=1,resizable=1,scrollbars=1,left="+l+",top="+d)}),$(t).on("hashchange",function(e,n){var i,o=location.hash.match(/#comment\-(\d+)/);o&&(i=a.find("#post-"+o[1]),i.length&&(a.find(".post-content.target").removeClass("target"),i.find("> .post-content").addClass("target"),n&&$(t).scrollTop(i.offset().top-90)))}),/(iPhone|Android)/.test(navigator.userAgent)&&a.addClass("mobile"),c()};return{id:"simple_thread",check:function(t){t(0)},load:function(){a||(a=!0,e(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"st.deepzz.com"==e?void (location.href=location.href.replace(/(https?:\/\/[^\/]+)\//i,"//deepzz.com/")):(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}}