⬆️ vditor

This commit is contained in:
Van
2019-11-05 12:08:07 +08:00
parent 21c902d4c8
commit e55e26fdb7
70 changed files with 45 additions and 69 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
var Skin={init:function(){Util.initPjax()},initArticle:function(){page.share();var l=$(".vditor-reset [id^=b3_solo_h]"),s=$(".article__toc"),c=$(".article__progress");1===s.length&&(876<$(window).width()?$(".post__toc").css("left",$(".article .item__content").offset().left+$(".article .item__content").outerWidth()-80):$(".post__toc a").click(function(){$(".post__toc").hide()})),s.find("a").click(function(t){var o=$(this).attr("href");return window.location.hash=o,$(window).scrollTop($(o).offset().top-60),t.preventDefault(),t.stopPropagation(),!1}),$(window).unbind("scroll").scroll(function(t){if(0===c.length)return!1;if(c.attr("value",parseInt($(window).scrollTop())).attr("max",parseInt($("body").outerHeight()-$(window).height())),236<$(window).scrollTop()?$(".article__top").css("top",0):$(".article__top").css("top",-61),0===$(".article__toc li").length)return!1;876<$(window).width()&&(975<$(window).scrollTop()&&$(window).scrollTop()<$(".article").outerHeight()+100?$(".post__toc").show():$(".post__toc").hide());var o=[];l.each(function(t){o.push({id:this.id,offsetTop:$(this).offset().top})});for(var i=$(window).scrollTop(),e=0,r=o.length;e<r;e++)if(i<o[e].offsetTop-61){s.find("li").removeClass("current");var n=0<e?e-1:0;s.find('a[href="#'+o[n].id+'"]').parent().addClass("current");break}i>=o[o.length-1].offsetTop-61&&(s.find("li").removeClass("current"),s.find("li:last").addClass("current"))}),$(window).scroll()}};Skin.init();
var Skin={init:function(){Util.initPjax()},initArticle:function(){page.share();var t=$(".vditor-reset [id^=b3_solo_h]"),o=$(".article__toc"),i=$(".article__progress");1===o.length&&($(window).width()>876?$(".post__toc").css("left",$(".article .item__content").offset().left+$(".article .item__content").outerWidth()-80):$(".post__toc a").click((function(){$(".post__toc").hide()}))),o.find("a").click((function(t){var o=$(this).attr("href");return window.location.hash=o,$(window).scrollTop($(o).offset().top-60),t.preventDefault(),t.stopPropagation(),!1})),$(window).unbind("scroll").scroll((function(e){if(0===i.length)return!1;if(i.attr("value",parseInt($(window).scrollTop())).attr("max",parseInt($("body").outerHeight()-$(window).height())),$(window).scrollTop()>236?$(".article__top").css("top",0):$(".article__top").css("top",-61),0===$(".article__toc li").length)return!1;$(window).width()>876&&($(window).scrollTop()>975&&$(window).scrollTop()<$(".article").outerHeight()+100?$(".post__toc").show():$(".post__toc").hide());var r=[];t.each((function(t){r.push({id:this.id,offsetTop:$(this).offset().top})}));for(var n=$(window).scrollTop(),l=0,s=r.length;l<s;l++)if(n<r[l].offsetTop-61){o.find("li").removeClass("current");var c=l>0?l-1:0;o.find('a[href="#'+r[c].id+'"]').parent().addClass("current");break}n>=r[r.length-1].offsetTop-61&&(o.find("li").removeClass("current"),o.find("li:last").addClass("current"))})),$(window).scroll()}};Skin.init();