This commit is contained in:
Van 2019-03-26 08:21:33 +08:00
parent 04be872d8c
commit e9cf230aba
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
12 changed files with 12 additions and 12 deletions

View File

@ -1 +1 @@
var Skin={_initCommon:function(i){var n=$("header .banner"),t=$("header .navbar");$(window).scroll(function(){if(125<$(window).scrollTop()?i.show():i.hide(),$(window).width()<701)return!1;$(window).scrollTop()>n.height()?(t.addClass("pin"),$(".main-wrap").parent().css("margin-top","81px"),$(".article__toc").css("position","fixed")):(t.removeClass("pin"),$(".main-wrap").parent().css("margin-top","0"),$(".article__toc").css("position","inherit"))}),$(window).scroll()},init:function(){this._initCommon($(".icon-up")),$(".navbar nav a").each(function(){this.href===location.href&&(this.className="current")}),$(".responsive .list a").each(function(){this.href===location.href&&$(this).parent().addClass("current")}),$(".responsive .icon-list").click(function(){$(".responsive .list").slideToggle()})},initToc:function(){var n=$(".article__toc");if(0===n.length)return!1;n.css({width:n.parent().width(),position:"fixed",left:n.parent().offset().left}).find("a").click(function(){n.find("li").removeClass("toc--current"),$(this).parent().addClass("toc--current");var i=$(this).attr("href");setTimeout(function(){$(window).scrollTop($(i).offset().top-60)})})}};$(document).ready(function(){Util.init(),Skin.init()});
var Skin={_initCommon:function(i){var n=$("header .banner"),t=$("header .navbar");$(window).scroll(function(){if(125<$(window).scrollTop()?i.show():i.hide(),$(window).width()<701)return!1;$(window).scrollTop()>n.height()?(t.addClass("pin"),$(".main-wrap").parent().css("margin-top","81px"),$(".article__toc").css("position","fixed")):(t.removeClass("pin"),$(".main-wrap").parent().css("margin-top","0"),$(".article__toc").css("position","inherit"))}),$(window).scroll()},init:function(){this._initCommon($(".icon-up")),$(".navbar nav a").each(function(){this.href===location.href&&(this.className="current")}),$(".responsive .list a").each(function(){this.href===location.href&&$(this).parent().addClass("current")}),$(".responsive .icon-list").click(function(){$(".responsive .list").slideToggle()})},initToc:function(){var n=$(".article__toc");if(0===n.length)return!1;n.css({width:n.parent().width(),left:n.parent().offset().left}).find("a").click(function(){n.find("li").removeClass("toc--current"),$(this).parent().addClass("toc--current");var i=$(this).attr("href");setTimeout(function(){$(window).scrollTop($(i).offset().top-60)})})}};$(document).ready(function(){Skin.init()});

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
var Finding={init:function(){Util.killIE(),this._initToc(),this.share(),$(".scroll-down").click(function(t){t.preventDefault();var n=$(this),i=$("html, body"),o=!!n.attr("data-offset")&&n.attr("data-offset"),a=parseInt(o);i.stop(!0,!1).animate({scrollTop:$(this.hash).offset().top+a},500)}),$("body").append('<a class="icon-gotop fn-none" href="javascript:Util.goTop()"></a><span class="menu-button icon-menu"><span class="word">Menu</span></span>'),$(".menu-button").click(function(t){t.stopPropagation(),$("body").toggleClass("nav-opened nav-closed")}),$(window).scroll(function(){$(window).scrollTop()>$(".main-header").height()?$(".icon-gotop").show():$(".icon-gotop").hide()})},_initToc:function(){if(0===$(".article__toc li").length)return $(".nav .icon-list").hide(),void $(".nav .icon-sitemap").click();$(".nav ul:first").after($(".article__toc")),500<$(window).width()&&$("body").toggleClass("nav-opened nav-closed"),$(".nav .icon-list").show(),Finding.tabNav("toc");var s=$(".vditor-reset [id^=b3_solo_h]"),l=$(".article__toc");$(window).scroll(function(t){if(0===$(".article__toc li").length)return!1;var n=[];s.each(function(t){n.push({id:this.id,offsetTop:this.offsetTop})});for(var i=$(window).scrollTop(),o=0,a=n.length;o<a;o++)if(i<n[o].offsetTop+280){l.find("li").removeClass("current");var e=0<o?o-1:0;l.find('a[href="#'+n[e].id+'"]').parent().addClass("current");break}i>=n[n.length-1].offsetTop+280&&(l.find("li").removeClass("current"),l.find("li:last").addClass("current"))}),$(window).scroll()},tabNav:function(t){$(".nav .current").removeClass("current"),"toc"===t?($(".nav ul:first, .nav .count").hide(),$(".nav ul:last").show(),$(".icon-list").addClass("current")):($(".nav ul:first, .nav .count").show(),$(".nav ul:last").hide(),$(".icon-sitemap").addClass("current"))},share:function(){var t=$(".share"),n=t.find(".icon-wechat"),i=n.data("url"),o=n.data("avatar"),a=encodeURIComponent(n.data("title")+" - "+n.data("blogtitle")),e=encodeURIComponent(i),s={};s.weibo="http://v.t.sina.com.cn/share/share.php?title="+a+"&url="+e+"&pic="+o,s.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+e+"&sharesource=qzone&title="+a+"&pics="+o,s.twitter="https://twitter.com/intent/tweet?status="+a+" "+e,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===n.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){n.qrcode({width:128,height:128,text:i})}}):n.find("canvas").slideToggle(),!1):void window.open(s[t],"_blank","top=100,left=200,width=648,height=618")})}};Finding.init();
var Finding={init:function(){Util.killIE(),this._initToc(),this.share(),$(".scroll-down").click(function(t){t.preventDefault();var n=$(this),e=$("html, body"),o=!!n.attr("data-offset")&&n.attr("data-offset"),i=parseInt(o);e.stop(!0,!1).animate({scrollTop:$(this.hash).offset().top+i},500)}),$("body").append('<a class="icon-gotop fn-none" href="javascript:Util.goTop()"></a><span class="menu-button icon-menu"><span class="word">Menu</span></span>'),$(".menu-button").click(function(t){t.stopPropagation(),$("body").toggleClass("nav-opened nav-closed")}),$(window).scroll(function(){$(window).scrollTop()>$(".main-header").height()?$(".icon-gotop").show():$(".icon-gotop").hide()})},_initToc:function(){0!==$(".article__toc li").length&&500<$(window).width()&&$("body").toggleClass("nav-opened nav-closed")},share:function(){var t=$(".share"),n=t.find(".icon-wechat"),e=n.data("url"),o=n.data("avatar"),i=encodeURIComponent(n.data("title")+" - "+n.data("blogtitle")),a=encodeURIComponent(e),s={};s.weibo="http://v.t.sina.com.cn/share/share.php?title="+i+"&url="+a+"&pic="+o,s.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+a+"&sharesource=qzone&title="+i+"&pics="+o,s.twitter="https://twitter.com/intent/tweet?status="+i+" "+a,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===n.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){n.qrcode({width:128,height:128,text:e})}}):n.find("canvas").slideToggle(),!1):void window.open(s[t],"_blank","top=100,left=200,width=648,height=618")})}};Finding.init();

View File

@ -28,7 +28,7 @@
*/
var Skin = {
init: function () {
const $article__toc = $('.article__toc')
var $article__toc = $('.article__toc')
$(window).scroll(function () {
if ($article__toc.length === 1) {
if ($('.article__bottom').offset().top < $(window).scrollTop()) {

View File

@ -1 +1 @@
var Skin={init:function(){$(window).scroll(function(){0!==$("#headerNav").length&&(64<$(window).scrollTop()?($("#headerNav").addClass("header__nav--fixed"),$(".main").css("margin-top","100px")):($("#headerNav").removeClass("header__nav--fixed"),$(".main").css("margin-top","50px")))}),$(window).scroll(),Util.initPjax(function(){Util.parseMarkdown(),Util.isArticlePage(location.href)&&($("#articleSideShare .article__code").qrcode||$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0}))})},initTags:function(){for(var t=$("#tags"),e=t.find(".tag"),i=parseInt(e.first().data("count")),a=Math.ceil(i/5),o=0;o<e.length;o++)for(var s=parseInt($(e[o]).data("count")),n=0;n<5;n++)if(n*a<s&&s<=(n+1)*a){e[o].className="tag tag__level"+n;break}t.html(e.get().sort(function(t,e){var i=$(t).text().toLowerCase(),a=$(e).text().toLowerCase();return i.localeCompare(a)}))},initArticle:function(){if(0!==$("#articleShare").length){Skin._share("#articleShare"),Skin._share("#articleSideShare"),Skin._share("#articleBottomShare");var i=$(".post__side");$(window).height()>=$(".post").height()&&i.css("opacity",1),i.css("left",($(".post").offset().left-20)/2-27+"px");var a=($(window).height()-249)/2+125,o=$(window).scrollTop();$(window).scroll(function(){if(0!==$("#articleShare").length){var t=$(window).scrollTop(),e=$(".article__bottom").offset().top;65<t?(i.css("opacity",1),0<o-t?($(".header").addClass("header--fixed").css({top:"0"}),$(".main").css("padding-top","64px"),$(window).height()<=$(".post").height()&&t<e-$(window).height()&&$(".article__toolbar").css({bottom:0,opacity:1})):o-t<0&&($(".header").css({top:"-64px"}).removeClass("header--fixed"),$(".main").css("padding-top","0"),$(".article__toolbar").css({bottom:"-44px",opacity:0}))):($(window).height()<=$(".post").height()&&i.css("opacity",0),$(".header").removeClass("header--fixed").css("top","-64px"),$(".main").css("padding-top","0")),t>e-$(window).height()?e<$(window).height()?i.css({position:"absolute",top:e-125+"px"}):i.css({position:"absolute",top:e-a+"px"}):i.css({position:"fixed",top:"50%"}),o=t}}),$(window).scroll()}},_share:function(t){var e=$(t),i=e.find(".article__code"),a=i.data("url"),o=i.data("avatar"),s=encodeURIComponent(i.data("title")+" - "+i.data("blogtitle")),n=encodeURIComponent(a),r={};r.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+s+"&url="+n+"&pic="+o,r.weibo="http://v.t.sina.com.cn/share/share.php?title="+s+"&url="+n+"&pic="+o,r.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+n+"&sharesource=qzone&title="+s+"&pics="+o,r.twitter="https://twitter.com/intent/tweet?status="+s+" "+n,e.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===i.find("canvas").length?i.qrcode({width:128,height:128,text:a}):i.slideToggle(),!1):void window.open(r[t],"_blank","top=100,left=200,width=648,height=618")})}};Skin.init();
var Skin={init:function(){var t=$(".article__toc");$(window).scroll(function(){1===t.length&&($(".article__bottom").offset().top<$(window).scrollTop()?t.hide():t.show()),0!==$("#headerNav").length&&(64<$(window).scrollTop()?($("#headerNav").addClass("header__nav--fixed"),$(".main").css("margin-top","100px")):($("#headerNav").removeClass("header__nav--fixed"),$(".main").css("margin-top","50px")))}),$(window).scroll(),Util.initPjax(function(){Util.parseMarkdown(),Util.isArticlePage(location.href)&&($("#articleSideShare .article__code").qrcode||$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0})),Skin.initToc()}),Skin.initToc()},initTags:function(){for(var t=$("#tags"),e=t.find(".tag"),i=parseInt(e.first().data("count")),o=Math.ceil(i/5),a=0;a<e.length;a++)for(var n=parseInt($(e[a]).data("count")),s=0;s<5;s++)if(s*o<n&&n<=(s+1)*o){e[a].className="tag tag__level"+s;break}t.html(e.get().sort(function(t,e){var i=$(t).text().toLowerCase(),o=$(e).text().toLowerCase();return i.localeCompare(o)}))},initArticle:function(){if(0!==$("#articleShare").length){Skin._share("#articleShare"),Skin._share("#articleSideShare"),Skin._share("#articleBottomShare");var i=$(".post__side");$(window).height()>=$(".post").height()&&i.css("opacity",1),i.css("left",($(".post").offset().left-20)/2-27+"px");var o=($(window).height()-249)/2+125,a=$(window).scrollTop();$(window).scroll(function(){if(0!==$("#articleShare").length){var t=$(window).scrollTop(),e=$(".article__bottom").offset().top;65<t?(i.css("opacity",1),0<a-t?($(".header").addClass("header--fixed").css({top:"0"}),$(".main").css("padding-top","64px"),$(window).height()<=$(".post").height()&&t<e-$(window).height()&&$(".article__toolbar").css({bottom:0,opacity:1})):a-t<0&&($(".header").css({top:"-64px"}).removeClass("header--fixed"),$(".main").css("padding-top","0"),$(".article__toolbar").css({bottom:"-44px",opacity:0}))):($(window).height()<=$(".post").height()&&i.css("opacity",0),$(".header").removeClass("header--fixed").css("top","-64px"),$(".main").css("padding-top","0")),t>e-$(window).height()?e<$(window).height()?i.css({position:"absolute",top:e-125+"px"}):i.css({position:"absolute",top:e-o+"px"}):i.css({position:"fixed",top:"50%"}),a=t}}),$(window).scroll()}},_share:function(t){var e=$(t),i=e.find(".article__code"),o=i.data("url"),a=i.data("avatar"),n=encodeURIComponent(i.data("title")+" - "+i.data("blogtitle")),s=encodeURIComponent(o),r={};r.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+n+"&url="+s+"&pic="+a,r.weibo="http://v.t.sina.com.cn/share/share.php?title="+n+"&url="+s+"&pic="+a,r.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+s+"&sharesource=qzone&title="+n+"&pics="+a,r.twitter="https://twitter.com/intent/tweet?status="+n+" "+s,e.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===i.find("canvas").length?i.qrcode({width:128,height:128,text:o}):i.slideToggle(),!1):void window.open(r[t],"_blank","top=100,left=200,width=648,height=618")})},initToc:function(){0!==$(".article__toc").length&&1e3<$(window).width()?$(".article__toc").animate({left:$(".post").outerWidth()+$(".post").offset().left+"px"},600):$(".article__toc").hide()}};Skin.init();

View File

@ -1 +1 @@
var goTop=function(e){e=e||.1;var a=$(window).scrollTop(),t=1+e;if(window.scrollTo(0,Math.floor(a/t)),0<a){var n="goTop("+e+")";window.setTimeout(n,16)}},collapseArchive=function(e,a){var t=!0;"collapse-ico"===e.className?(e.className="expand-ico",t=!1):e.className="collapse-ico",$("#archiveSide li").each(function(){$(this).data("year")===a&&(t?$(this).show():$(this).hide())})},getArticle=function(t,e){var n=$("#abstract"+e),o=$("#content"+e);return""===o.html()?$.ajax({url:"/get-article-content?id="+e,type:"GET",dataType:"html",beforeSend:function(){n.css("background","url(/skins/neoease/images/ajax-loader.gif) no-repeat scroll center center transparent")},success:function(e,a){t.className="collapse-ico",o.html(e),n.hide().css("background","none"),o.fadeIn("slow")}}):"expand-ico"===t.className?(n.hide(),o.fadeIn(),t.className="collapse-ico"):(o.hide(),n.fadeIn(),t.className="expand-ico"),!1},goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)};$(document).ready(function(){$(window).scroll(function(){var e=$(window).scrollTop();if(182<e){var a=$(window).height(),t=e+a-21;$("body").height()-58<=e+a&&(t=$(".footer").offset().top-21),$("#goTop").fadeIn("slow").css("top",t)}else $("#goTop").hide()});var t=(new Date).getFullYear(),n=t;$("#archiveSide li").each(function(e){var a=$(this);a.data("year")!==t&&$(this).hide(),n!==a.data("year")&&(n=a.data("year"),a.before("<li class='archive-year'><div onclick='collapseArchive(this, "+n+")' class='expand-ico'>"+n+"&nbsp;年</div></li>"))}),$(".recent-comments .expand-ico").click(function(){"expand-ico"===this.className?($(this).parent().next().css({height:"auto","white-space":"normal"}),this.className="collapse-ico"):($(this).parent().next().animate({height:"18px"},function(){$(this).css("white-space","nowrap")}),this.className="expand-ico")}),$(".nav ul li").each(function(){$(this).find("a").attr("href")===Label.servePath+location.pathname?$(this).addClass("current"):/\/[0-9]+$/.test(location.pathname)&&($(".nav ul li")[0].className="current")}),Util.setTopBar(),Util.replaceSideEm($(".recent-comments-content")),Util.buildTags("tagsSide"),$(".recent-comments .recent-comments-main").each(function(){$(this).find(".recent-comments-content>a").height()<30?$(this).find(".expand-ico").remove():$(this).find(".expand-ico").parent().next().css({"white-space":"nowrap"})})});
var goTop=function(e){e=e||.1;var a=$(window).scrollTop(),t=1+e;if(window.scrollTo(0,Math.floor(a/t)),0<a){var n="goTop("+e+")";window.setTimeout(n,16)}},collapseArchive=function(e,a){var t=!0;"collapse-ico"===e.className?(e.className="expand-ico",t=!1):e.className="collapse-ico",$("#archiveSide li").each(function(){$(this).data("year")===a&&(t?$(this).show():$(this).hide())})},getArticle=function(t,e){var n=$("#abstract"+e),i=$("#content"+e);return""===i.html()?$.ajax({url:"/get-article-content?id="+e,type:"GET",dataType:"html",beforeSend:function(){n.css("background","url(/skins/neoease/images/ajax-loader.gif) no-repeat scroll center center transparent")},success:function(e,a){t.className="collapse-ico",i.html(e),n.hide().css("background","none"),i.fadeIn("slow"),Util.parseLanguage(),Util.parseMarkdown()}}):"expand-ico"===t.className?(n.hide(),i.fadeIn(),t.className="collapse-ico"):(i.hide(),n.fadeIn(),t.className="expand-ico"),!1},goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)};$(document).ready(function(){$(window).scroll(function(){var e=$(window).scrollTop();if(182<e){var a=$(window).height(),t=e+a-21;$("body").height()-58<=e+a&&(t=$(".footer").offset().top-21),$("#goTop").fadeIn("slow").css("top",t)}else $("#goTop").hide()});var t=(new Date).getFullYear(),n=t;$("#archiveSide li").each(function(e){var a=$(this);a.data("year")!==t&&$(this).hide(),n!==a.data("year")&&(n=a.data("year"),a.before("<li class='archive-year'><div onclick='collapseArchive(this, "+n+")' class='expand-ico'>"+n+"&nbsp;年</div></li>"))}),$(".recent-comments .expand-ico").click(function(){"expand-ico"===this.className?($(this).parent().next().css({height:"auto","white-space":"normal"}),this.className="collapse-ico"):($(this).parent().next().animate({height:"18px"},function(){$(this).css("white-space","nowrap")}),this.className="expand-ico")}),$(".nav ul li").each(function(){$(this).find("a").attr("href")===Label.servePath+location.pathname?$(this).addClass("current"):/\/[0-9]+$/.test(location.pathname)&&($(".nav ul li")[0].className="current")}),Util.setTopBar(),Util.replaceSideEm($(".recent-comments-content")),Util.buildTags("tagsSide"),$(".recent-comments .recent-comments-main").each(function(){$(this).find(".recent-comments-content>a").height()<30?$(this).find(".expand-ico").remove():$(this).find(".expand-ico").parent().next().css({"white-space":"nowrap"})})});

View File

@ -1 +1 @@
var Skin={init:function(){new Headroom($("header")[0],{tolerance:0,offset:70,classes:{initial:"header",pinned:"header--down",unpinned:"header--up",top:"header",notTop:"header",bottom:"header",notBottom:"header"}}).init(),Util.initPjax(function(){0===$(".post__fix").length?$("body").addClass("body--gray"):$("body").removeClass("body--gray"),$(".header__nav a").each(function(){$(".header__nav a").removeClass("current"),this.href===location.href&&(this.className="current")})}),$(".header__nav a").each(function(){this.href===location.href&&(this.className="current")}).click(function(){$(".header__nav a").removeClass("current"),this.href===location.href&&(this.className="current")})},_initToc:function(){0===$(".vditor-reset .article__toc li").length||$(window).width()<746?$(".post__toc .article__toc").remove():($(".post__toc").html($(".article__toc")).css("left",$(".post").offset().left+$(".post").outerWidth()),$(window).scroll(function(){72<$(window).scrollTop()?$(".post__toc").show():$(".post__toc").hide()}),$(window).scroll())},_initShare:function(){var t=$(".post__share"),e=t.find(".post__code"),o=e.data("url"),i=e.data("avatar"),n=encodeURIComponent(e.data("title")+" - "+e.data("blogtitle")),a=encodeURIComponent(o),s={};s.weibo="http://v.t.sina.com.cn/share/share.php?title="+n+"&url="+a+"&pic="+i,s.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+a+"&sharesource=qzone&title="+n+"&pics="+i,s.twitter="https://twitter.com/intent/tweet?status="+n+" "+a,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===e.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){e.qrcode({width:128,height:128,text:o})}}):e.find("canvas").slideToggle(),!1):void window.open(s[t],"_blank","top=100,left=200,width=648,height=618")})},initArticle:function(){new Headroom($(".post__fix")[0],{tolerance:0,offset:48,classes:{initial:"post__fix",pinned:"post__fix--pinned",unpinned:"post__fix--unpinned",top:"post__fix",notTop:"post__fix",bottom:"post__fix",notBottom:"post__fix"}}).init(),Skin._initShare(),Skin._initToc()}};Skin.init();
var Skin={init:function(){new Headroom($("header")[0],{tolerance:0,offset:70,classes:{initial:"header",pinned:"header--down",unpinned:"header--up",top:"header",notTop:"header",bottom:"header",notBottom:"header"}}).init(),Util.initPjax(function(){0===$(".post__fix").length?$("body").addClass("body--gray"):$("body").removeClass("body--gray"),$(".header__nav a").each(function(){$(".header__nav a").removeClass("current"),this.href===location.href&&(this.className="current")}),Skin._initToc()}),$(".header__nav a").each(function(){this.href===location.href&&(this.className="current")}).click(function(){$(".header__nav a").removeClass("current"),this.href===location.href&&(this.className="current")})},_initToc:function(){if(0!==$(".article__toc").length){$(".post__toc").css("left",$(".post").offset().left+$(".post").outerWidth());var s=$(".vditor-reset [id^=b3_solo_h]"),r=$(".article__toc");$(window).unbind("scroll").scroll(function(t){if(0===$(".article__toc li").length)return!1;if(72<$(window).scrollTop()){$(".post__toc").show();var e=[];s.each(function(t){e.push({id:this.id,offsetTop:this.offsetTop})});for(var i=$(window).scrollTop(),n=0,o=e.length;n<o;n++)if(i<e[n].offsetTop-20){r.find("li").removeClass("current");var a=0<n?n-1:0;r.find('a[href="#'+e[a].id+'"]').parent().addClass("current");break}i>=e[e.length-1].offsetTop-20&&(r.find("li").removeClass("current"),r.find("li:last").addClass("current"))}else $(".post__toc").hide()}),$(window).scroll()}},_initShare:function(){var t=$(".post__share"),e=t.find(".post__code"),i=e.data("url"),n=e.data("avatar"),o=encodeURIComponent(e.data("title")+" - "+e.data("blogtitle")),a=encodeURIComponent(i),s={};s.weibo="http://v.t.sina.com.cn/share/share.php?title="+o+"&url="+a+"&pic="+n,s.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+a+"&sharesource=qzone&title="+o+"&pics="+n,s.twitter="https://twitter.com/intent/tweet?status="+o+" "+a,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===e.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){e.qrcode({width:128,height:128,text:i})}}):e.find("canvas").slideToggle(),!1):void window.open(s[t],"_blank","top=100,left=200,width=648,height=618")})},initArticle:function(){new Headroom($(".post__fix")[0],{tolerance:0,offset:48,classes:{initial:"post__fix",pinned:"post__fix--pinned",unpinned:"post__fix--unpinned",top:"post__fix",notTop:"post__fix",bottom:"post__fix",notBottom:"post__fix"}}).init(),Skin._initShare(),Skin._initToc()}};Skin.init();

View File

@ -1 +1 @@
var MetroHot={headerH:$("#header").height()+30+($("#header > div").get(1)?30:0),responsiveType:"large",goTranslate:function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},init:function(){var e="";$("#admin a").each(function(){-1<$(this).attr("href").indexOf("/logout")&&(e=$(this).attr("href"))}),$("#logout, .logout").attr("href",e),$(".header .title, .navigation").mouseover(function(){$(".navigation").show()}).mouseout(function(){$(".navigation").hide()}),$(".header .title").click(function(){window.location.href=Label.servePath});var t=$("#top > span").first().text();$(".online-count .text").append(t.substr(1,t.length));var i=$("#admin").data("login");if(i?($(".user .text").html($("#admin > span").text()),$(".login, .register, #login, #register, .logout, .settings").hide()):$(".login, .register, .user, .clear, .logout, .settings, #logout, #settings").hide(),1===$("#dynamic").length)return $(window).scroll(function(){$(window).scrollTop()>MetroHot.headerH?$("#goTop").fadeIn("slow"):$("#goTop").hide()}).click(function(e){"title"!==e.target.className&&"title"!==e.target.parentElement.className&&$(".navigation").slideUp()}),void $("body").css("min-height","inherit");$("#login, .login").attr("href",$("#admin > a").first().attr("href")),$(window).scroll(function(){var e=$(window).scrollTop();e>MetroHot.headerH?i?$(".logout, .settings").show():$(".login, .register").show():i?$(".logout, .settings").hide():$(".login, .register").hide(),e>MetroHot.headerH?$("#goTop").fadeIn("slow"):$("#goTop").hide(),$(".side > div").height()<620?e>MetroHot.headerH?$(".side > div").css({position:"fixed",top:"0px",width:"240px"}):$(".side > div").css("position","static"):e+$(window).height()>$(".side > div").height()+MetroHot.headerH?$(".side > div").css({position:"fixed",top:"auto",bottom:"10px",width:"240px"}):$(".side > div").css("position","static")}).click(function(e){"title"!==e.target.className&&"title"!==e.target.parentElement.className&&$(".navigation").slideUp()}).resize(function(){var e=window.innerWidth,t="large";460<e&&e<=860?t="mid":window<460&&(t="small"),MetroHot.responsiveType!==t&&($(window).scroll(),MetroHot.responsiveType)}),$(window).scroll()},loadImg:function(e){e.style.marginTop=(220-e.height)/2+"px"},share:function(){var e=$(".share .text"),t=e.find(".icon-wechat"),i=t.data("url"),a=t.data("avatar"),o=encodeURIComponent(t.data("title")+" - "+t.data("blogtitle")),r=encodeURIComponent(i),n={};n.weibo="http://v.t.sina.com.cn/share/share.php?title="+o+"&url="+r+"&pic="+a,n.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+r+"&sharesource=qzone&title="+o+"&pics="+a,n.twitter="https://twitter.com/intent/tweet?status="+o+" "+r,e.find("span").click(function(){var e=$(this).data("type");if(e)return"wechat"===e?(0===t.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){t.qrcode({width:111,height:111,text:i})}}):t.find("canvas").slideToggle(),!1):void window.open(n[e],"_blank","top=100,left=200,width=648,height=618")})},loadRandomArticles:function(){$.ajax({url:Label.servePath+"/articles/random",type:"POST",success:function(e,t){var i=e.randomArticles;if(i&&0!==i.length){for(var a="",o=0;o<i.length&&o<5;o++){var r=i[o],n=r.articleTitle;a+="<li><a rel='nofollow' title='"+n+"' href='"+Label.servePath+r.articlePermalink+"'>"+n+"</a></li>"}var l="<ul>"+a+"</ul>";$("#randomArticles .text").append(l)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(e){$.ajax({url:Label.servePath+"/article/id/"+e+"/relevant/articles",type:"GET",success:function(e,t){var i=e.relevantArticles;if(i&&0!==i.length){for(var a="",o=0;o<i.length&&o<5;o++){var r=i[o],n=r.articleTitle;a+="<li><a rel='nofollow' title='"+n+"' href='"+Label.servePath+r.articlePermalink+"'>"+n+"</a></li>"}var l="<ul>"+a+"</ul>";$("#relevantArticles .text").append(l)}else $("#relevantArticles").remove()},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(e){var t=this.tips;try{$.ajax({url:"http://rhythm.b3log.org:80/get-articles-by-tags.do?tags="+e+"&blogHost="+t.blogHost+"&paginationPageSize="+t.externalRelevantArticlesDisplayCount,type:"GET",cache:!0,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(e,t){var i=e.articles;if(i&&0!==i.length){for(var a="",o=0;o<i.length&&o<5;o++){var r=i[o],n=r.articleTitle;a+="<li><a rel='nofollow' title='"+n+"' target='_blank' href='"+r.articlePermalink+"'>"+n+"</a></li>"}var l="<ul>"+a+"</ul>";$("#externalRelevantArticles .text").append(l)}else $("#externalRelevantArticles").remove()}})}catch(e){$("#externalRelevantArticles").remove()}},goCmt:function(){$("html, body").animate({scrollTop:$(".comment-disabled").get(0).offsetTop})}};MetroHot.init(),0<$(".article-header").length&&MetroHot.share();
var MetroHot={headerH:$("#header").height()+30+($("#header > div").get(1)?30:0),responsiveType:"large",goTranslate:function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},init:function(){var e="";$("#admin a").each(function(){-1<$(this).attr("href").indexOf("/logout")&&(e=$(this).attr("href"))}),$("#logout, .logout").attr("href",e),$(".header .title, .navigation").mouseover(function(){$(".navigation").show()}).mouseout(function(){$(".navigation").hide()}),$(".header .title").click(function(){window.location.href=Label.servePath});var t=$("#top > span").first().text();if($(".online-count .text").append(t.substr(1,t.length)),1===$("#dynamic").length)return $(window).scroll(function(){$(window).scrollTop()>MetroHot.headerH?$("#goTop").fadeIn("slow"):$("#goTop").hide()}).click(function(e){"title"!==e.target.className&&"title"!==e.target.parentElement.className&&$(".navigation").slideUp()}),void $("body").css("min-height","inherit");$(window).scroll(function(){$(window).scrollTop()>MetroHot.headerH?$("#goTop").fadeIn("slow"):$("#goTop").hide()}).click(function(e){"title"!==e.target.className&&"title"!==e.target.parentElement.className&&$(".navigation").slideUp()}).resize(function(){var e=window.innerWidth,t="large";460<e&&e<=860?t="mid":window<460&&(t="small"),MetroHot.responsiveType!==t&&($(window).scroll(),MetroHot.responsiveType)}),$(window).scroll()},loadImg:function(e){e.style.marginTop=(220-e.height)/2+"px"},share:function(){var e=$(".share .text"),t=e.find(".icon-wechat"),a=t.data("url"),n=t.data("avatar"),i=encodeURIComponent(t.data("title")+" - "+t.data("blogtitle")),l=encodeURIComponent(a),r={};r.weibo="http://v.t.sina.com.cn/share/share.php?title="+i+"&url="+l+"&pic="+n,r.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+l+"&sharesource=qzone&title="+i+"&pics="+n,r.twitter="https://twitter.com/intent/tweet?status="+i+" "+l,e.find("span").click(function(){var e=$(this).data("type");if(e)return"wechat"===e?(0===t.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){t.qrcode({width:111,height:111,text:a})}}):t.find("canvas").slideToggle(),!1):void window.open(r[e],"_blank","top=100,left=200,width=648,height=618")})},loadRandomArticles:function(){$.ajax({url:Label.servePath+"/articles/random",type:"POST",success:function(e,t){var a=e.randomArticles;if(a&&0!==a.length){for(var n="",i=0;i<a.length&&i<5;i++){var l=a[i],r=l.articleTitle;n+="<li><a rel='nofollow' title='"+r+"' href='"+Label.servePath+l.articlePermalink+"'>"+r+"</a></li>"}var o="<ul>"+n+"</ul>";$("#randomArticles .text").append(o)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(e){$.ajax({url:Label.servePath+"/article/id/"+e+"/relevant/articles",type:"GET",success:function(e,t){var a=e.relevantArticles;if(a&&0!==a.length){for(var n="",i=0;i<a.length&&i<5;i++){var l=a[i],r=l.articleTitle;n+="<li><a rel='nofollow' title='"+r+"' href='"+Label.servePath+l.articlePermalink+"'>"+r+"</a></li>"}var o="<ul>"+n+"</ul>";$("#relevantArticles .text").append(o)}else $("#relevantArticles").remove()},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(e){var t=this.tips;try{$.ajax({url:"http://rhythm.b3log.org:80/get-articles-by-tags.do?tags="+e+"&blogHost="+t.blogHost+"&paginationPageSize="+t.externalRelevantArticlesDisplayCount,type:"GET",cache:!0,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(e,t){var a=e.articles;if(a&&0!==a.length){for(var n="",i=0;i<a.length&&i<5;i++){var l=a[i],r=l.articleTitle;n+="<li><a rel='nofollow' title='"+r+"' target='_blank' href='"+l.articlePermalink+"'>"+r+"</a></li>"}var o="<ul>"+n+"</ul>";$("#externalRelevantArticles .text").append(o)}else $("#externalRelevantArticles").remove()}})}catch(e){$("#externalRelevantArticles").remove()}},goCmt:function(){$("html, body").animate({scrollTop:$(".comment-disabled").get(0).offsetTop})}};MetroHot.init(),0<$(".article-header").length&&MetroHot.share();

2
next/js/next.min.js vendored
View File

@ -1 +1 @@
var NexT={init:function(){$(".sidebar-toggle").click(function(){var i=$(".sidebar");$(this).hasClass("sidebar-active")?($(this).removeClass("sidebar-active"),$("body").animate({"padding-right":0}),i.animate({right:-320}),i.find("section").css("opacity",0)):($(this).addClass("sidebar-active"),$("body").animate({"padding-right":320}),i.animate({right:0},function(){i.find("section:first").animate({opacity:1})}))}),$(".site-nav-toggle").click(function(){$(".site-nav").slideToggle()}),$(document).ready(function(){setTimeout(function(){$(".logo-wrap").css("opacity",1),$(".logo-line-before i").animate({left:"0"},function(){$(".site-title").css("opacity",1).animate({top:0},function(){$(".menu").css("opacity",1).animate({"margin-top":"15px"}),$(".main").css("opacity",1).animate({top:"0"},function(){0<$(".article__toc li").length&&1e3<$(window).width()&&$(".sidebar-toggle").click()})})}),$(".logo-line-after i").animate({right:"0"})},500)})},initArticle:function(){if(0<$(".article__toc li").length&&1e3<$(window).width()){$(".sidebar-toggle").addClass("has-toc");var i='<ul><li class="current" data-tab="toc">'+Label.tocLabel+'</li><li data-tab="site">'+Label.siteViewLabel+"</li></ul><section></section>";$(".sidebar").prepend(i);var t=$(".sidebar section:first").html($(".article__toc")),a=$(".sidebar section:last");t.height($(window).height()-90),$(".sidebar > ul > li").click(function(){"toc"===$(this).data("tab")?a.animate({opacity:"0",top:"-50px"},300,function(){t.show().css("top","-50px"),t.animate({opacity:"1",top:"0"},300)}):t.animate({opacity:"0",top:"-50px"},300,function(){t.hide().css("top","-50px"),a.animate({opacity:"1",top:"0"},300)}),$(".sidebar > ul > li").removeClass("current"),$(this).addClass("current")}),this.initToc()}},initToc:function(){var n=$(".vditor-reset [id^=b3_solo_h]"),l=$(".article__toc");$(window).scroll(function(i){if(0===$(".article__toc li").length)return!1;var t=[];n.each(function(i){t.push({id:this.id,offsetTop:this.offsetTop})});for(var a=$(window).scrollTop(),e=0,o=t.length;e<o;e++)if(a<t[e].offsetTop+200){l.find("li").removeClass("current");var s=0<e?e-1:0;l.find('a[href="#'+t[s].id+'"]').parent().addClass("current");break}a>=t[t.length-1].offsetTop+200&&(l.find("li").removeClass("current"),l.find("li:last").addClass("current"))}),$(window).scroll()}};NexT.init();
var NexT={init:function(){$(".sidebar-toggle").click(function(){var i=$(".sidebar");$(this).hasClass("sidebar-active")?($(this).removeClass("sidebar-active"),$("body").animate({"padding-right":0}),i.animate({right:-320}),i.find("section").css("opacity",0)):($(this).addClass("sidebar-active"),$("body").animate({"padding-right":320}),i.animate({right:0},function(){i.find("section:first").animate({opacity:1})}))}),$(".site-nav-toggle").click(function(){$(".site-nav").slideToggle()}),$(document).ready(function(){setTimeout(function(){$(".logo-wrap").css("opacity",1),$(".logo-line-before i").animate({left:"0"},function(){$(".site-title").css("opacity",1).animate({top:0},function(){$(".menu").css("opacity",1).animate({"margin-top":"15px"}),$(".main").css("opacity",1).animate({top:"0"},function(){0<$(".article__toc li").length&&1e3<$(window).width()&&$(".sidebar-toggle").click()})})}),$(".logo-line-after i").animate({right:"0"})},500)})},initArticle:function(){0<$(".article__toc li").length&&1e3<$(window).width()&&($(".sidebar-toggle").addClass("has-toc"),this.initToc())},initToc:function(){var s=$(".vditor-reset [id^=b3_solo_h]"),c=$(".article__toc");$(window).scroll(function(i){if(0===$(".article__toc li").length)return!1;var t=[];s.each(function(i){t.push({id:this.id,offsetTop:this.offsetTop})});for(var e=$(window).scrollTop(),n=0,a=t.length;n<a;n++)if(e<t[n].offsetTop+200){c.find("li").removeClass("current");var o=0<n?n-1:0;c.find('a[href="#'+t[o].id+'"]').parent().addClass("current");break}e>=t[t.length-1].offsetTop+200&&(c.find("li").removeClass("current"),c.find("li:last").addClass("current"))}),$(window).scroll()}};NexT.init();

View File

@ -1 +1 @@
var Skin={_initCommon:function(e){$(window).scroll(function(){125<$(window).scrollTop()?e.show():e.hide(),0<$(".side .article__toc").length&&(50<$(window).scrollTop()?$(".side").css("position","fixed"):$(".side").css("position","initial"))})},_initAnimation:function(){if(!("IntersectionObserver"in window))return $(".item").addClass("item--active"),!1;window.imageIntersectionObserver?window.imageIntersectionObserver.disconnect():window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)$(e.target).addClass("item--active");else{if(1===$(e.target).closest(".side").length||1===$(e.target).closest("#articlePage").length||768<$(e.target).outerHeight())return;$(e.target).removeClass("item--active")}})}),$(".item").each(function(){window.imageIntersectionObserver.observe(this)})},init:function(){Util.initPjax(function(){Skin._initAnimation(),0===$("#articlePage").length&&$(".article__toc").closest(".module").remove()}),Skin._initAnimation(),this._initCommon($(".icon__up")),$(".header__nav a, .header__m a").each(function(){this.href===location.href&&(this.className="current")}).click(function(){$(".header__nav a, .header__m a").removeClass("current"),this.className="current",$(".header__m .module__list").hide()}),$(".header__logo").click(function(){$(".header__nav a, .header__m a").removeClass("current")})},_initArticleCommon:function(){if(768<$(window).width()){if(0===$("#articlePage .article__toc li").length)return $(".side .article__toc").closest(".module").remove(),void $(".side").css({height:"auto",position:"initial"});$("#articlePage").width($(".main").width()-310),0===$(".side .article__toc").length&&$(".side").prepend('<div class="module"><div class="module__list"></div></div>').css({right:($(window).width()-$(".main").width())/2,position:"fixed",overflow:"auto",height:$(window).height()-30,top:30}),$(".side .module:eq(0) .module__list").html($(".article__toc")),$(window).scroll(),$(".side").scrollTop(0)}else{if(0===$("#articlePage .article__toc li").length)return void $(".header__m .icon__list").hide().next().hide();$(".header__m .icon__list").show().next().html($(".article__toc")),$(".article__toc a").click(function(){$(this).closest(".module__list").hide()})}},initArticle:function(){this._initArticleCommon(),setTimeout(function(){0===$("#externalRelevantArticlesWrap li").length&&($("#externalRelevantArticlesWrap").next().remove(),$("#externalRelevantArticlesWrap").remove()),0===$("#relevantArticlesWrap li").length&&($("#relevantArticlesWrap").prev().remove(),$("#relevantArticlesWrap").remove()),0===$("#randomArticlesWrap li").length&&($("#randomArticlesWrap").prev().remove(),$("#randomArticlesWrap").remove())},1e3)}};Skin.init();
var Skin={_initCommon:function(e){$(window).scroll(function(){125<$(window).scrollTop()?e.show():e.hide(),0<$(".side .article__toc").length&&768<$(window).width()&&(50<$(window).scrollTop()?$(".side").css("position","fixed"):$(".side").css("position","initial"))})},_initAnimation:function(){if(!("IntersectionObserver"in window))return $(".item").addClass("item--active"),!1;window.imageIntersectionObserver?window.imageIntersectionObserver.disconnect():window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)$(e.target).addClass("item--active");else{if(1===$(e.target).closest(".side").length||1===$(e.target).closest("#articlePage").length||768<$(e.target).outerHeight())return;$(e.target).removeClass("item--active")}})}),$(".item").each(function(){window.imageIntersectionObserver.observe(this)})},init:function(){Util.initPjax(function(){Skin._initAnimation()}),Skin._initAnimation(),this._initCommon($(".icon__up")),$(".header__nav a, .header__m a").each(function(){this.href===location.href&&(this.className="current")}).click(function(){$(".header__nav a, .header__m a").removeClass("current"),this.className="current",$(".header__m .module__list").hide()}),$(".header__logo").click(function(){$(".header__nav a, .header__m a").removeClass("current")})},_initArticleCommon:function(){if(768<$(window).width()){if(0===$(".article__toc li").length)return void $(".side").css({height:"auto",position:"initial"});$("#articlePage").width($(".main").width()-310),$(".side").css({right:($(window).width()-$(".main").width())/2,position:"fixed",overflow:"auto",height:$(window).height()-30,top:30}),$(window).scroll(),$(".side").scrollTop(0)}},initArticle:function(){this._initArticleCommon(),setTimeout(function(){0===$("#externalRelevantArticlesWrap li").length&&($("#externalRelevantArticlesWrap").next().remove(),$("#externalRelevantArticlesWrap").remove()),0===$("#relevantArticlesWrap li").length&&($("#relevantArticlesWrap").prev().remove(),$("#relevantArticlesWrap").remove()),0===$("#randomArticlesWrap li").length&&($("#randomArticlesWrap").prev().remove(),$("#randomArticlesWrap").remove())},1e3)}};Skin.init();

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
var Yilia={init:function(){Util.killIE(),this._initToc(),this.resetTags(),$(window).scroll(function(){0<$("article").length&&0===$("article.post").length&&$("article:not(.show)").each(function(){$(this).offset().top<=$(window).scrollTop()+$(window).height()-$(this).height()/7&&$(this).addClass("show")}),$(window).scrollTop()>$(window).height()?$(".icon-goup").show():$(".icon-goup").hide(),1===$("article.post").length&&$("article.post").addClass("show")}),$(window).scroll()},_initToc:function(){if(0===$(".article__toc li").length)return!1;$(".side footer").after('<div class="toc"><a onclick="$(\'.side .toc\').hide();" href="javascript:void(0)" class="close">X</a></div>'),$(".side .toc a").after($(".article__toc")),$(".side .toc-btn").show()},resetTags:function(){$("a.tag").each(function(t){$(this).addClass("color"+Math.ceil(4*Math.random()))})},share:function(){var t=$(".share .fn-right"),i=t.find(".icon-wechat"),e=i.data("url"),o=i.data("avatar"),a=encodeURIComponent(i.data("title")+" - "+i.data("blogtitle")),s=encodeURIComponent(e),n={};n.weibo="http://v.t.sina.com.cn/share/share.php?title="+a+"&url="+s+"&pic="+o,n.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+s+"&sharesource=qzone&title="+a+"&pics="+o,n.twitter="https://twitter.com/intent/tweet?status="+a+" "+s,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===i.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){i.qrcode({width:128,height:128,text:e})}}):i.find("canvas").slideToggle(),!1):void window.open(n[t],"_blank","top=100,left=200,width=648,height=618")})}};Yilia.init();
var Yilia={init:function(){Util.killIE(),this._initToc(),this.resetTags(),$(window).scroll(function(){0<$("article").length&&0===$("article.post").length&&$("article:not(.show)").each(function(){$(this).offset().top<=$(window).scrollTop()+$(window).height()-$(this).height()/7&&$(this).addClass("show")}),$(window).scrollTop()>$(window).height()?$(".icon-goup").show():$(".icon-goup").hide(),1===$("article.post").length&&$("article.post").addClass("show")}),$(window).scroll()},_initToc:function(){if(0===$(".article__toc li").length)return!1;$(".side .toc-btn").show()},resetTags:function(){$("a.tag").each(function(t){$(this).addClass("color"+Math.ceil(4*Math.random()))})},share:function(){var t=$(".share .fn-right"),i=t.find(".icon-wechat"),e=i.data("url"),n=i.data("avatar"),o=encodeURIComponent(i.data("title")+" - "+i.data("blogtitle")),a=encodeURIComponent(e),s={};s.weibo="http://v.t.sina.com.cn/share/share.php?title="+o+"&url="+a+"&pic="+n,s.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+a+"&sharesource=qzone&title="+o+"&pics="+n,s.twitter="https://twitter.com/intent/tweet?status="+o+" "+a,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===i.find("canvas").length?$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){i.qrcode({width:128,height:128,text:e})}}):i.find("canvas").slideToggle(),!1):void window.open(s[t],"_blank","top=100,left=200,width=648,height=618")})}};Yilia.init();