document.body.oncopy=function(){if(set.isusercenter==1){return}var t=window.getSelection().toString();if(set.reprint.open==1){if(set.reprint.copylenopen==1){if(t.length>set.reprint.copylen){addarelt("复制内容太长,禁止复制","erro");event.preventDefault();return false}else{copyaddurl(t)}}else{copyaddurl(t)}}};function copyaddurl(t){if(set.reprint.addurl==0){addarelt(set.reprint.msg,"succ")}else{if(t.length>100){addarelt(set.reprint.msg,"succ");JScopyText(t+"\n 【来源:"+set.reprint.siteurl+",转载请注明】")}else{addarelt(set.reprint.msg,"succ")}}}$(document).scroll(function(){var t=$(document).scrollTop();var e=$(window).height();var o=$(document).height();if(t>100){$(".go-top-plane").addClass("go-top-plane-show")}else{$(".go-top-plane").removeClass("go-top-plane-show")}if(o-(t+e)<=100){}if(o==t+e){}});function mobile_menuclick(t,e){$(".user-menu .sub-menu").css("visibility","hidden");$(".user-menu .sub-menu").css("opacity","0");if($(e).parent().find(".sub-menu").css("visibility")=="hidden"){$(e).parent().find(".sub-menu").css("opacity","1");$(e).parent().find(".sub-menu").css("visibility","visible")}else if($(e).parent().parent().find(".user-sub-menu").css("visibility")=="hidden"){$(e).parent().parent().find(".sub-menu").css("opacity","1");$(e).parent().parent().find(".sub-menu").css("visibility","visible")}t.stopPropagation()}$(document).ready(function(){$(".menu-mobile .menu-item-has-children").append('
');$(".menu-mobile .menu-item-has-children>a").css("display"," inline-block");$(".menu-mobile .menu-item-has-children").click(function(){let t=$(this).children(".mobile-m-dropdown");t.children().toggleClass("m-dropdown-show-i");$(this).children(".sub-menu").slideToggle();return false});$(".menu-mobile a").click(function(){window.location.href=$(this).attr("href");return false});$(".go-top-plane").click(function(){$("html,body").animate({scrollTop:"0px"},500)});$(".drawer-menu-list").click(function(t){$(".user-menu .sub-menu").css("visibility","hidden");$(".user-menu .sub-menu").css("opacity","0");$(".user-menu .sub-menu").removeClass("sub-menu-hide");$(".user-menu .sub-menu").removeClass("sub-menu-show");t.stopPropagation()});$(".tag-cloud-link").each(function(){var t=["#67C23A","#E6A23C","#F56C6C","#909399","#CC9966","#FF6666","#99CCFF","#FF9999","#CC6633"];var e=t[Math.floor(Math.random()*t.length)];$(this).css("background-color",e)});if(set.module.imglightbox==1){if(set.is_page==true||set.is_single==true){var t=$(".post-content-content").find("img").not(".c-downbtn-icon").not(".post-end-tools").not(".link-icon").not(".corepress-url-dh-icon img");for(var o=0;o'+s+"")}}$.fancybox.defaults.buttons=["close"];$('a[href*=".jpg"],a[href*=".webp"],a[href*=".ico"],a[href*=".svg"], a[href*=".jpeg"], a[href*=".png"], a[href*=".gif"], a[href*=".bmp"]').fancybox({})}}if(set.is_single==1||set.is_page==1){if(set.corepress_post_meta.catalog==1){var o=0;var s="";$(".post-content h2,.post-content h3").each(function(){var t=$(this)[0].tagName.toLowerCase();console.log();if($(this).parent().attr("class")=="zd-plane-content"){return}$(this).attr("catalog","catalog-"+t+"-"+o);var e="go_catalog('catalog-"+t+"-"+o+"','"+t+"')";s=s+'

'+$(this).html()+"

";o++});$("#post-catalog-list").html(s);set_catalog_position();$("#post-catalog").css("visibility","visible");$("#post-catalog").css("opacity","1");if($(".post-content h2").length==0&&$(".post-content h3").length==0){$("#post-catalog").css("visibility","hidden")}}if(set.has_corepress_video==true){const l=new Plyr(".corepress-video",{i18n:{restart:"重播",play:"播放",pause:"暂停",speed:"速度",normal:"正常",quality:"质量"}})}}$("img").lazyload({effect:"fadeIn"});if(set.module.imglazyload==1){endloadhtml()}if(set.theme.loadbar==1){NProgress.done()}if(set.is_home==true){if(set.index.linksicon==1){var a=$(".frinds-links-list").children("li");for(let t=0;t `)}setTimeout(function(){endloadhtml()},1e3)}}});function endloadhtml(){$("img.frinds-links-icon").lazyload({effect:"fadeIn"})}$(window).resize(function(){set_catalog_position()});$(document).scroll(function(){if($("#post-catalog").css("visibility")!="visible"){return}$(".post-content h2[catalog],.post-content h3[catalog]").each(function(){var t=this.getBoundingClientRect().y;if(t<100&&t>0){var e=$(this).attr("catalog");set_catalog_css();$("p[catalog="+e+"]").addClass("catalog-hover");return}})});function close_show(t){if(t==1){$("#post-catalog").removeClass("post-catalog-hide");$("#post-catalog-bar").css("visibility","hidden")}else{$("#post-catalog").addClass("post-catalog-hide");$("#post-catalog-bar").css("visibility","visible")}}function set_catalog_css(){$("p[catalog]").removeClass("catalog-hover")}function set_catalog_position(){if(set.is_page==true||set.is_single==true){if(set.theme.sidebar_position==1){if($(".post-info").length==0||$(".post-content-body").length==0){return}var t=$(".post-info").offset().left;$("#post-catalog").css("left",t-200+"px");var e=$(".post-content-body").offset().left;$("#post-catalog-bar").css("left",e-$("#post-catalog-bar").innerWidth()+"px")}else{var t=$(".post-info").offset().left;t=t+$(".post-info")[0].getBoundingClientRect().width;$("#post-catalog").css("left",t+40+"px");var e=$(".post-content-body").offset().left+$(".post-content-body").innerWidth();$("#post-catalog-bar").css("left",e+"px");$("#post-catalog-bar").removeClass("post-catalog-bar-left-minborder");$("#post-catalog-bar").addClass("post-catalog-bar-right-minborder")}}}function go_catalog(t,e){var o=$(e+"[catalog="+t+"]").offset().top;$("html, body").animate({scrollTop:o-60},500)}function widget_sentence_load(t,o){$.get(set.ajaxurl,{action:"corepress_get_widget_sentence",type:t},function(t){var e=JSON.parse(t);if(e.code==200){$(o).html("

"+e.data+"

")}else{$(o).html("

句子加载失败

")}})}