diff --git a/Finding/js/Finding.js b/Finding/js/Finding.js index d680d60..531b7e6 100644 --- a/Finding/js/Finding.js +++ b/Finding/js/Finding.js @@ -19,7 +19,7 @@ * @fileoverview util and every page should be used. * * @author Liyuan Li - * @version 1.1.0.0, Oct 13, 2016 + * @version 1.1.1.0, Sep 21, 2018 */ /** @@ -116,11 +116,11 @@ var Finding = { tabNav: function (type) { $('.nav .current').removeClass('current'); if (type === 'toc') { - $('.nav ul:first').hide(); + $('.nav ul:first, .nav .count').hide(); $('.nav ul:last').show(); $('.icon-list').addClass('current'); } else { - $('.nav ul:first').show(); + $('.nav ul:first, .nav .count').show(); $('.nav ul:last').hide(); $('.icon-sitemap').addClass('current'); } diff --git a/Finding/js/Finding.min.js b/Finding/js/Finding.min.js index 988594c..72c4530 100644 --- a/Finding/js/Finding.min.js +++ b/Finding/js/Finding.min.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -var Finding={init:function(){Util.killIE(),this._initToc(),$(".scroll-down").click(function(t){t.preventDefault();var o=$(this),n=$("html, body"),i=!!o.attr("data-offset")&&o.attr("data-offset"),e=parseInt(i);n.stop(!0,!1).animate({scrollTop:$(this.hash).offset().top+e},500)}),$("body").append('Menu'),$(".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 t=$(".article-body [id^=b3_solo_h]"),o=$(".b3-solo-list");$(window).scroll(function(n){if(0===$(".b3-solo-list li").length)return!1;var i=[];t.each(function(t){i.push({id:this.id,offsetTop:this.offsetTop})});for(var e=$(window).scrollTop(),s=0,a=i.length;s0?s-1:0;o.find('a[href="#'+i[l].id+'"]').parent().addClass("current");break}e>=i[i.length-1].offsetTop+280&&(o.find("li").removeClass("current"),o.find("li:last").addClass("current"))}),$(window).scroll()},tabNav:function(t){$(".nav .current").removeClass("current"),"toc"===t?($(".nav ul:first").hide(),$(".nav ul:last").show(),$(".icon-list").addClass("current")):($(".nav ul:first").show(),$(".nav ul:last").hide(),$(".icon-sitemap").addClass("current"))},share:function(){$(".share span").click(function(){var t=$(this).data("type"),o=encodeURIComponent($("title").text()),n=$(".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="+o+"&url="+n+"&pic="+i,e.weibo="http://v.t.sina.com.cn/share/share.php?title="+o+"&url="+n+"&pic="+i,e.google="https://plus.google.com/share?url="+n,e.twitter="https://twitter.com/intent/tweet?status="+o+" "+n,window.open(e[t],"_blank","top=100,left=200,width=648,height=618")})}};Finding.init(); \ No newline at end of file +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('Menu'),$(".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 t=$(".article-body [id^=b3_solo_h]"),n=$(".b3-solo-list");$(window).scroll(function(o){if(0===$(".b3-solo-list li").length)return!1;var i=[];t.each(function(t){i.push({id:this.id,offsetTop:this.offsetTop})});for(var e=$(window).scrollTop(),s=0,a=i.length;s0?s-1:0;n.find('a[href="#'+i[l].id+'"]').parent().addClass("current");break}e>=i[i.length-1].offsetTop+280&&(n.find("li").removeClass("current"),n.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(); \ No newline at end of file