This commit is contained in:
Van 2019-02-28 00:06:32 +08:00
parent 3d6b54c138
commit 07afe0956f
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
27 changed files with 365 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
var Finding={init:function(){Util.killIE(),this._initToc(),$(".scroll-down").click(function(t){t.preventDefault();var n=$(this),o=$("html, body"),i=!!n.attr("data-offset")&&n.attr("data-offset"),e=parseInt(i);o.stop(!0,!1).animate({scrollTop:$(this.hash).offset().top+e},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===$(".b3-solo-list li").length)return $(".nav .icon-list").hide(),void $(".nav .icon-sitemap").click();$(".nav ul:first").after($(".b3-solo-list")),$("body").toggleClass("nav-opened nav-closed"),$(".nav .icon-list").show(),Finding.tabNav("toc");var a=$(".content-reset [id^=b3_solo_h]"),l=$(".b3-solo-list");$(window).scroll(function(t){if(0===$(".b3-solo-list li").length)return!1;var n=[];a.each(function(t){n.push({id:this.id,offsetTop:this.offsetTop})});for(var o=$(window).scrollTop(),i=0,e=n.length;i<e;i++)if(o<n[i].offsetTop+280){l.find("li").removeClass("current");var s=0<i?i-1:0;l.find('a[href="#'+n[s].id+'"]').parent().addClass("current");break}o>=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(){$(".share span").click(function(){var t=$(this).data("type"),n=encodeURIComponent($("title").text()),o=$(".post-title a").attr("href")?$(".post-title a").attr("href"):location,i=$(".post-content img:eq(0)").attr("src"),e={};e.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+n+"&url="+o+"&pic="+i,e.weibo="http://v.t.sina.com.cn/share/share.php?title="+n+"&url="+o+"&pic="+i,e.google="https://plus.google.com/share?url="+o,e.twitter="https://twitter.com/intent/tweet?status="+n+" "+o,window.open(e[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),o=$("html, body"),i=!!n.attr("data-offset")&&n.attr("data-offset"),a=parseInt(i);o.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===$(".b3-solo-list li").length)return $(".nav .icon-list").hide(),void $(".nav .icon-sitemap").click();$(".nav ul:first").after($(".b3-solo-list")),$("body").toggleClass("nav-opened nav-closed"),$(".nav .icon-list").show(),Finding.tabNav("toc");var s=$(".content-reset [id^=b3_solo_h]"),l=$(".b3-solo-list");$(window).scroll(function(t){if(0===$(".b3-solo-list li").length)return!1;var n=[];s.each(function(t){n.push({id:this.id,offsetTop:this.offsetTop})});for(var o=$(window).scrollTop(),i=0,a=n.length;i<a;i++)if(o<n[i].offsetTop+280){l.find("li").removeClass("current");var e=0<i?i-1:0;l.find('a[href="#'+n[e].id+'"]').parent().addClass("current");break}o>=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"),o=n.data("url"),i=n.data("avatar"),a=encodeURIComponent(n.data("title")+" - "+n.data("blogtitle")),e=encodeURIComponent(o),s={};s.weibo="http://v.t.sina.com.cn/share/share.php?title="+a+"&url="+e+"&pic="+i,s.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+e+"&sharesource=qzone&title="+a+"&pics="+i,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:latkeConfig.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0,success:function(){n.qrcode({width:128,height:128,text:o})}}):n.find("canvas").slideToggle(),!1):void window.open(s[t],"_blank","top=100,left=200,width=648,height=618")})}};Finding.init();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
var Skin={init:function(){$("body").on("click",".content-reset img",function(){window.open(this.src)}),$(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:latkeConfig.staticServePath+"/skins/Medium/js/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.google="https://plus.google.com/share?url="+n,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(){$("body").on("click",".content-reset img",function(){window.open(this.src)}),$(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:latkeConfig.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 n=parseInt($(e[o]).data("count")),s=0;s<5;s++)if(s*a<n&&n<=(s+1)*a){e[o].className="tag tag__level"+s;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"),n=encodeURIComponent(i.data("title")+" - "+i.data("blogtitle")),s=encodeURIComponent(a),r={};r.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+n+"&url="+s+"&pic="+o,r.weibo="http://v.t.sina.com.cn/share/share.php?title="+n+"&url="+s+"&pic="+o,r.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+s+"&sharesource=qzone&title="+n+"&pics="+o,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:a}):i.slideToggle(),!1):void window.open(r[t],"_blank","top=100,left=200,width=648,height=618")})}};Skin.init();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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")})}),$("body").on("click",".content-reset img",function(){window.open(this.src)}),$(".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===$(".content-reset .b3-solo-list li").length||$(window).width()<768?$(".post__toc .b3-solo-list").remove():($(".post__toc").html($(".b3-solo-list")).css("left",$(".post").offset().left+$(".post").outerWidth()),$(window).scroll(function(){72<$(window).scrollTop()?$(".post__toc").show():$(".post__toc").hide()}))},_initShare:function(){var t=$(".post__share"),e=t.find(".post__code"),o=e.data("url"),n=e.data("avatar"),i=encodeURIComponent(e.data("title")+" - "+e.data("blogtitle")),s=encodeURIComponent(o),a={};a.weibo="http://v.t.sina.com.cn/share/share.php?title="+i+"&url="+s+"&pic="+n,a.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+s+"&sharesource=qzone&title="+i+"&pics="+n,a.twitter="https://twitter.com/intent/tweet?status="+i+" "+s,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===e.find("canvas").length?$.ajax({method:"GET",url:latkeConfig.staticServePath+"/skins/Pinghsu/js/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(a[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")})}),$("body").on("click",".content-reset img",function(){window.open(this.src)}),$(".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===$(".content-reset .b3-solo-list li").length||$(window).width()<746?$(".post__toc .b3-solo-list").remove():($(".post__toc").html($(".b3-solo-list")).css("left",$(".post").offset().left+$(".post").outerWidth()),$(window).scroll(function(){72<$(window).scrollTop()?$(".post__toc").show():$(".post__toc").hide()}))},_initShare:function(){var t=$(".post__share"),e=t.find(".post__code"),o=e.data("url"),n=e.data("avatar"),i=encodeURIComponent(e.data("title")+" - "+e.data("blogtitle")),a=encodeURIComponent(o),s={};s.weibo="http://v.t.sina.com.cn/share/share.php?title="+i+"&url="+a+"&pic="+n,s.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+a+"&sharesource=qzone&title="+i+"&pics="+n,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===e.find("canvas").length?$.ajax({method:"GET",url:latkeConfig.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();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,9 +20,10 @@
* skin favoutite style
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 2.0.0.0, Feb 21, 2019
* @version 2.1.0.0, Feb 28, 2019
*/
@import "../../../scss/reset";
@import "../../../scss/reset-content";
@import "vditor/src/assets/scss/classic";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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 t="";$("#admin a").each(function(){-1<$(this).attr("href").indexOf("/logout")&&(t=$(this).attr("href"))}),$("#logout, .logout").attr("href",t),$(".header .title, .navigation").mouseover(function(){$(".navigation").show()}).mouseout(function(){$(".navigation").hide()}),$(".header .title").click(function(){window.location.href=latkeConfig.servePath});var e=$("#top > span").first().text();$(".online-count .text").append(e.substr(1,e.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(t){"title"!==t.target.className&&"title"!==t.target.parentElement.className&&$(".navigation").slideUp()}),void $("body").css("min-height","inherit");$("#login, .login").attr("href",$("#admin > a").first().attr("href")),$(window).scroll(function(){var t=$(window).scrollTop();t>MetroHot.headerH?i?$(".logout, .settings").show():$(".login, .register").show():i?$(".logout, .settings").hide():$(".login, .register").hide(),t>MetroHot.headerH?$("#goTop").fadeIn("slow"):$("#goTop").hide(),$(".side > div").height()<620?t>MetroHot.headerH?$(".side > div").css({position:"fixed",top:"0px",width:"240px"}):$(".side > div").css("position","static"):t+$(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(t){"title"!==t.target.className&&"title"!==t.target.parentElement.className&&$(".navigation").slideUp()}).resize(function(){var t=window.innerWidth,e="large";460<t&&t<=860?e="mid":window<460&&(e="small"),MetroHot.responsiveType!==e&&($(window).scroll(),MetroHot.responsiveType)}),$(window).scroll()},initArticleList:function(){$(".article-list .article-abstract").each(function(){var t=$(this),e=t.find("img");0<e.length&&(t.addClass("article-image"),e.hide(),t.before("<img onload='MetroHot.loadImg(this);' src='"+$(e[0]).attr("src")+"'/>"))})},loadImg:function(t){t.style.marginTop=(220-t.height)/2+"px"},share:function(){var t=encodeURIComponent($("title").text()),e=window.location.href,i=$(".content-reset img").attr("src"),o={};o.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+t+"&url="+e+"&pic="+i,o.sina="http://v.t.sina.com.cn/share/share.php?title="+t+"&url="+e+"&pic="+i,o.google="https://plus.google.com/share?url="+e,o.twitter="https://twitter.com/intent/tweet?status="+t+" "+e,$(".share span").click(function(){var t=$(this).attr("title").toLowerCase();window.open(o[t],"_blank","top=100,left=200,width=648,height=618")})},loadRandomArticles:function(){$.ajax({url:latkeConfig.servePath+"/articles/random",type:"POST",success:function(t,e){var i=t.randomArticles;if(i&&0!==i.length){for(var o="",r=0;r<i.length&&r<5;r++){var a=i[r],n=a.articleTitle;o+="<li><a rel='nofollow' title='"+n+"' href='"+latkeConfig.servePath+a.articlePermalink+"'>"+n+"</a></li>"}var l="<ul>"+o+"</ul>";$("#randomArticles .text").append(l)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(t){$.ajax({url:latkeConfig.servePath+"/article/id/"+t+"/relevant/articles",type:"GET",success:function(t,e){var i=t.relevantArticles;if(i&&0!==i.length){for(var o="",r=0;r<i.length&&r<5;r++){var a=i[r],n=a.articleTitle;o+="<li><a rel='nofollow' title='"+n+"' href='"+latkeConfig.servePath+a.articlePermalink+"'>"+n+"</a></li>"}var l="<ul>"+o+"</ul>";$("#relevantArticles .text").append(l)}else $("#relevantArticles").remove()},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(t){var e=this.tips;try{$.ajax({url:"http://rhythm.b3log.org:80/get-articles-by-tags.do?tags="+t+"&blogHost="+e.blogHost+"&paginationPageSize="+e.externalRelevantArticlesDisplayCount,type:"GET",cache:!0,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(t,e){var i=t.articles;if(i&&0!==i.length){for(var o="",r=0;r<i.length&&r<5;r++){var a=i[r],n=a.articleTitle;o+="<li><a rel='nofollow' title='"+n+"' target='_blank' href='"+a.articlePermalink+"'>"+n+"</a></li>"}var l="<ul>"+o+"</ul>";$("#externalRelevantArticles .text").append(l)}else $("#externalRelevantArticles").remove()}})}catch(t){$("#externalRelevantArticles").remove()}},goCmt:function(){$("html, body").animate({scrollTop:$(".comment-disabled").get(0).offsetTop})}};MetroHot.init(),Util.killIE(),0<$(".article-header").length?MetroHot.share():MetroHot.initArticleList();
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=latkeConfig.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"),o=t.data("avatar"),a=encodeURIComponent(t.data("title")+" - "+t.data("blogtitle")),n=encodeURIComponent(i),r={};r.weibo="http://v.t.sina.com.cn/share/share.php?title="+a+"&url="+n+"&pic="+o,r.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+n+"&sharesource=qzone&title="+a+"&pics="+o,r.twitter="https://twitter.com/intent/tweet?status="+a+" "+n,e.find("span").click(function(){var e=$(this).data("type");if(e)return"wechat"===e?(0===t.find("canvas").length?$.ajax({method:"GET",url:latkeConfig.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(r[e],"_blank","top=100,left=200,width=648,height=618")})},loadRandomArticles:function(){$.ajax({url:latkeConfig.servePath+"/articles/random",type:"POST",success:function(e,t){var i=e.randomArticles;if(i&&0!==i.length){for(var o="",a=0;a<i.length&&a<5;a++){var n=i[a],r=n.articleTitle;o+="<li><a rel='nofollow' title='"+r+"' href='"+latkeConfig.servePath+n.articlePermalink+"'>"+r+"</a></li>"}var l="<ul>"+o+"</ul>";$("#randomArticles .text").append(l)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(e){$.ajax({url:latkeConfig.servePath+"/article/id/"+e+"/relevant/articles",type:"GET",success:function(e,t){var i=e.relevantArticles;if(i&&0!==i.length){for(var o="",a=0;a<i.length&&a<5;a++){var n=i[a],r=n.articleTitle;o+="<li><a rel='nofollow' title='"+r+"' href='"+latkeConfig.servePath+n.articlePermalink+"'>"+r+"</a></li>"}var l="<ul>"+o+"</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 o="",a=0;a<i.length&&a<5;a++){var n=i[a],r=n.articleTitle;o+="<li><a rel='nofollow' title='"+r+"' target='_blank' href='"+n.articlePermalink+"'>"+r+"</a></li>"}var l="<ul>"+o+"</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(),Util.killIE(),0<$(".article-header").length&&MetroHot.share();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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===$(".b3-solo-list 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($(".b3-solo-list")),$(".side .toc-btn").show()},resetTags:function(){$("a.tag").each(function(t){$(this).addClass("color"+Math.ceil(4*Math.random()))})},share:function(){$(".share span").click(function(){var t=$(this).data("type"),i=encodeURIComponent($("title").text()),o=$(".post-title a").attr("href")?$(".post-title a").attr("href"):location,e=$(".post-content img:eq(0)").attr("src"),s={};s.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+i+"&url="+o+"&pic="+e,s.weibo="http://v.t.sina.com.cn/share/share.php?title="+i+"&url="+o+"&pic="+e,s.google="https://plus.google.com/share?url="+o,s.twitter="https://twitter.com/intent/tweet?status="+i+" "+o,window.open(s[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===$(".b3-solo-list 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($(".b3-solo-list")),$(".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:latkeConfig.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();