Packaged project.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.3 KiB

$((function(){const t="#kratos-blog-post .row";function o(){$(this).pjax_reload(),OriginTitile=document.title}function e(e,l){$.ajax({url:e,beforeSend:function(){history.replaceState({url:location.href,title:document.title,html:$(document).find(t).html()},document.title,location.href),$("body,html").animate({scrollTop:theTop},600),NProgress.start()},success:function(o){void 0===$(o).find(t).html()?location.href=e:$(t).html($(o).find(t).html()),document.title=$(o).filter("title").text(),l&&window.history.pushState({url:e,title:$(o).filter("title").text(),html:$(o).find(t).html()},$(o).filter("title").text(),e)},complete:function(){window.load=o(),NProgress.done();const t=e.match(/\#.+$/);t&&$("body,html").animate({scrollTop:$(t[0]).offset().top-40},600)},timeout:6e3,error:function(){location.href=e}})}theTop=notMobile?$("#kratos-blog-post").offset().top-40:0,window.addEventListener("popstate",(function(l){l.state&&(document.title=l.state.title||document.title,$("body,html").animate({scrollTop:theTop},600),void 0===l.state.html?e(l.state.url,!1):$(t).html(l.state.html),window.load=o())})),$(document).on("click","a[target!=_blank][rel!=gallery][class!=toc-link]",(function(){const t=$(this).attr("href");return void 0===t||(!!t.includes("javascript:")||(e(decodeURI(t),!0),!1))}))}));