diff --git a/assets/js/joe.post_page.js b/assets/js/joe.post_page.js index 6ba665c..e795e54 100644 --- a/assets/js/joe.post_page.js +++ b/assets/js/joe.post_page.js @@ -153,6 +153,7 @@ document.addEventListener('DOMContentLoaded', () => { type: 'POST', data: { cid, + protectCID: cid, protectPassword }, dataType: 'text', diff --git a/assets/js/joe.post_page.min.js b/assets/js/joe.post_page.min.js index 1afd340..dccd681 100644 --- a/assets/js/joe.post_page.min.js +++ b/assets/js/joe.post_page.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{const e=e=>window.btoa(unescape(encodeURIComponent(e))),t=e=>decodeURIComponent(escape(window.atob(e))),a=$(".joe_detail").attr("data-cid");$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_record",site:window.location.href},success(e){if(e.data&&"已收录"===e.data)$("#Joe_Baidu_Record").css("color","#67C23A"),$("#Joe_Baidu_Record").html("已收录");else if(Joe.BAIDU_PUSH){$("#Joe_Baidu_Record").html('未收录,推送中...');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_push",domain:window.location.protocol+"//"+window.location.hostname,url:encodeURI(window.location.href)},success(e){e.data.error?$("#Joe_Baidu_Record").html('推送失败,请检查!'):$("#Joe_Baidu_Record").html('推送成功!')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`未收录,提交收录`)}}}),Prism.highlightAll(),$("pre[class*='language-']").each(function(e,t){let a=$(t).find("code[class*='language-']").text(),o=$('');new ClipboardJS(o[0],{text:()=>a}).on("success",()=>Qmsg.success("复制成功!")),$(t).append(o)}),$(".joe_detail__article img:not(img.owo_image)").each(function(){$(this).wrap($(``))}),$(".joe_detail__article a:not(.joe_detail__article-anote)").each(function(){$(this).attr({target:"_blank",rel:"noopener noreferrer nofollow"})});{let o=localStorage.getItem(e("views"))?JSON.parse(t(localStorage.getItem(e("views")))):[];const i=o.includes(a);i||$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_views",cid:a},success(t){if(1!==t.code)return;$("#Joe_Article_Views").html(`${t.data.views} 阅读`),o.push(a);const i=e("views"),s=e(JSON.stringify(o));localStorage.setItem(i,s)}})}{let o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];o.includes(a)?$(".joe_detail__agree .icon-1").addClass("active"):$(".joe_detail__agree .icon-2").addClass("active");let i=!1;$(".joe_detail__agree .icon").on("click",function(){if(i)return;i=!0,o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];let s=o.includes(a);$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_agree",cid:a,type:s?"disagree":"agree"},success(t){if(1!==t.code)return;if($(".joe_detail__agree .text").html(t.data.agree),s){const e=o.findIndex(e=>e===a);o.splice(e,1),$(".joe_detail__agree .icon-1").removeClass("active"),$(".joe_detail__agree .icon-2").addClass("active"),$(".joe_detail__agree .icon").removeClass("active")}else o.push(a),$(".joe_detail__agree .icon-2").removeClass("active"),$(".joe_detail__agree .icon-1").addClass("active"),$(".joe_detail__agree .icon").addClass("active");const i=e("agree"),l=e(JSON.stringify(o));localStorage.setItem(i,l)},complete(){i=!1}})})}{let e=!1;$(".joe_detail__article-protected").on("submit",function(t){t.preventDefault();const o=$(this).attr("action")+"&time="+ +new Date,i=$(this).find('input[type="password"]').val();if(""===i.trim())return Qmsg.info("请输入访问密码!");e||(e=!0,$.ajax({url:o,type:"POST",data:{cid:a,protectPassword:i},dataType:"text",success(t){let a=[],o="";a=$(t).contents(),Array.from(a).forEach(e=>{"container"===e.parentNode.className&&(o=e)}),/Joe/.test(t)?location.reload():(Qmsg.warning(o.textContent.trim()||""),e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))}}))})}if($(".joe_detail__article-video").length>0){const e=$(".joe_detail__article-video .play iframe").attr("data-player");$(".joe_detail__article-video .episodes .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active");const t=$(this).attr("data-src");$(".joe_detail__article-video .play iframe").attr({src:e+t})}),$(".joe_detail__article-video .episodes .item").first().click()}$(".joe_detail__operate-share").length&&($(".joe_detail__operate-share > svg").on("click",e=>{e.stopPropagation(),$(".joe_detail__operate-share").toggleClass("active")}),$(document).on("click",()=>$(".joe_detail__operate-share").removeClass("active")))}),window.addEventListener("load",function(){{const e=new URLSearchParams(location.search).get("scroll");if(e){const t=$(".joe_header").height();let a=null;if(a=$("#"+e).length>0?$("#"+e):$("."+e),a&&a.length>0){const e=a.offset().top-t-15;window.scrollTo({top:e,behavior:"smooth"})}}}}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{const e=e=>window.btoa(unescape(encodeURIComponent(e))),t=e=>decodeURIComponent(escape(window.atob(e))),a=$(".joe_detail").attr("data-cid");$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_record",site:window.location.href},success(e){if(e.data&&"已收录"===e.data)$("#Joe_Baidu_Record").css("color","#67C23A"),$("#Joe_Baidu_Record").html("已收录");else if(Joe.BAIDU_PUSH){$("#Joe_Baidu_Record").html('未收录,推送中...');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_push",domain:window.location.protocol+"//"+window.location.hostname,url:encodeURI(window.location.href)},success(e){e.data.error?$("#Joe_Baidu_Record").html('推送失败,请检查!'):$("#Joe_Baidu_Record").html('推送成功!')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`未收录,提交收录`)}}}),Prism.highlightAll(),$("pre[class*='language-']").each(function(e,t){let a=$(t).find("code[class*='language-']").text(),o=$('');new ClipboardJS(o[0],{text:()=>a}).on("success",()=>Qmsg.success("复制成功!")),$(t).append(o)}),$(".joe_detail__article img:not(img.owo_image)").each(function(){$(this).wrap($(``))}),$(".joe_detail__article a:not(.joe_detail__article-anote)").each(function(){$(this).attr({target:"_blank",rel:"noopener noreferrer nofollow"})});{let o=localStorage.getItem(e("views"))?JSON.parse(t(localStorage.getItem(e("views")))):[];const i=o.includes(a);i||$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_views",cid:a},success(t){if(1!==t.code)return;$("#Joe_Article_Views").html(`${t.data.views} 阅读`),o.push(a);const i=e("views"),s=e(JSON.stringify(o));localStorage.setItem(i,s)}})}{let o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];o.includes(a)?$(".joe_detail__agree .icon-1").addClass("active"):$(".joe_detail__agree .icon-2").addClass("active");let i=!1;$(".joe_detail__agree .icon").on("click",function(){if(i)return;i=!0,o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];let s=o.includes(a);$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_agree",cid:a,type:s?"disagree":"agree"},success(t){if(1!==t.code)return;if($(".joe_detail__agree .text").html(t.data.agree),s){const e=o.findIndex(e=>e===a);o.splice(e,1),$(".joe_detail__agree .icon-1").removeClass("active"),$(".joe_detail__agree .icon-2").addClass("active"),$(".joe_detail__agree .icon").removeClass("active")}else o.push(a),$(".joe_detail__agree .icon-2").removeClass("active"),$(".joe_detail__agree .icon-1").addClass("active"),$(".joe_detail__agree .icon").addClass("active");const i=e("agree"),l=e(JSON.stringify(o));localStorage.setItem(i,l)},complete(){i=!1}})})}{let e=!1;$(".joe_detail__article-protected").on("submit",function(t){t.preventDefault();const o=$(this).attr("action")+"&time="+ +new Date,i=$(this).find('input[type="password"]').val();if(""===i.trim())return Qmsg.info("请输入访问密码!");e||(e=!0,$.ajax({url:o,type:"POST",data:{cid:a,protectCID:a,protectPassword:i},dataType:"text",success(t){let a=[],o="";a=$(t).contents(),Array.from(a).forEach(e=>{"container"===e.parentNode.className&&(o=e)}),/Joe/.test(t)?location.reload():(Qmsg.warning(o.textContent.trim()||""),e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))}}))})}if($(".joe_detail__article-video").length>0){const e=$(".joe_detail__article-video .play iframe").attr("data-player");$(".joe_detail__article-video .episodes .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active");const t=$(this).attr("data-src");$(".joe_detail__article-video .play iframe").attr({src:e+t})}),$(".joe_detail__article-video .episodes .item").first().click()}$(".joe_detail__operate-share").length&&($(".joe_detail__operate-share > svg").on("click",e=>{e.stopPropagation(),$(".joe_detail__operate-share").toggleClass("active")}),$(document).on("click",()=>$(".joe_detail__operate-share").removeClass("active")))}),window.addEventListener("load",function(){{const e=new URLSearchParams(location.search).get("scroll");if(e){const t=$(".joe_header").height();let a=null;if(a=$("#"+e).length>0?$("#"+e):$("."+e),a&&a.length>0){const e=a.offset().top-t-15;window.scrollTo({top:e,behavior:"smooth"})}}}}); \ No newline at end of file diff --git a/census.php b/census.php index bf14d43..b6d95d1 100644 --- a/census.php +++ b/census.php @@ -16,7 +16,7 @@ need('public/include.php'); ?> - + diff --git a/core/function.php b/core/function.php index c7bb1d9..e35d734 100644 --- a/core/function.php +++ b/core/function.php @@ -2,7 +2,7 @@ /* 获取主题当前版本号 */ function _getVersion() { - return "7.2.9"; + return "7.3.0"; }; /* 判断是否是手机 */ diff --git a/friends.php b/friends.php index ce70579..7ffe99c 100644 --- a/friends.php +++ b/friends.php @@ -21,7 +21,7 @@ - + diff --git a/functions.php b/functions.php index cc57a60..4885dbe 100644 --- a/functions.php +++ b/functions.php @@ -1041,7 +1041,7 @@ function themeConfig($form) '//cdn.jsdelivr.net/npm/prism-theme-one-light-dark@1.0.4/prism-onedark.min.css' => 'prism-onedark', '//cdn.jsdelivr.net/npm/prism-theme-one-dark@1.0.0/prism-onedark.min.css' => 'prism-onedark2', ), - 'on', + '//cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism.min.css', '选择一款您喜欢的代码高亮样式', '介绍:用于修改代码块的高亮风格
其他:如果您有其他样式,可通过源代码修改此项,引入您的自定义样式链接' diff --git a/leaving.php b/leaving.php index d03f986..d02f175 100644 --- a/leaving.php +++ b/leaving.php @@ -15,7 +15,7 @@ need('public/include.php'); ?> - + diff --git a/package.json b/package.json index 4a7e089..860c623 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typecho-joe-next", - "version": "7.2.9", + "version": "7.3.0", "description": "A Theme Of Typecho", "main": "index.php", "keywords": [ diff --git a/page.php b/page.php index f554a8e..3061263 100644 --- a/page.php +++ b/page.php @@ -10,7 +10,7 @@ - + diff --git a/post.php b/post.php index 7f0c898..df80ec8 100644 --- a/post.php +++ b/post.php @@ -11,7 +11,7 @@ - +