From 2854d4c1a5f14a0450dae8c147ecdfb140839ae6 Mon Sep 17 00:00:00 2001 From: nineya Date: Sat, 15 Jul 2023 17:50:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(comment):=20=E4=BF=AE=E5=A4=8D=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/common.js | 2 +- templates/assets/js/common.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/common.js b/src/js/common.js index 6dd4c83..08c2823 100644 --- a/src/js/common.js +++ b/src/js/common.js @@ -412,7 +412,7 @@ const commonContext = { let target = $(this).attr('data-target') let id = $(this).attr('data-id') CommentWidget.init( - `.widget-comment[data-id=${id}][data-target=${target}]`, + `.widget-comment[data-id='${id}'][data-target='${target}']`, '/plugins/PluginCommentWidget/assets/static/style.css', { group: 'content.halo.run', diff --git a/templates/assets/js/common.min.js b/templates/assets/js/common.min.js index 95f79ed..10422e0 100644 --- a/templates/assets/js/common.min.js +++ b/templates/assets/js/common.min.js @@ -1 +1 @@ -(()=>{window.encrypt=e=>window.btoa(unescape(encodeURIComponent(e))),window.decrypt=e=>decodeURIComponent(escape(window.atob(e)));const t={initWidget(){var e=$(".columns .column-right"),t=$(".columns .column-right-shadow");if(e.length&&t.length&&!t[0].children.length)for(const a of e[0].children)t[0].append(a.cloneNode(!0))},initTocAndNotice(){var e=location["pathname"],t=(window.tocPjax&&window.tocPjax(),0===$(".widget.toc .card-content ul").length),e="toc"===DreamConfig.notice_show_mode&&!t||"index"===DreamConfig.notice_show_mode&&"/"!==e;t?$(".widget.toc,.action-toc").addClass("is-hidden-all"):$(".widget.toc,.action-toc").removeClass("is-hidden-all"),e?$(".widget.notice").addClass("is-hidden-all"):$(".widget.notice").removeClass("is-hidden-all")},initBanner(){const i=$(".banner-info-desc");if(0!==i.length){const o=i.text();i.text("");let t,a="",n=!0;const s=function(){var e=a.length;n&&e
${this.alt&&DreamConfig.show_img_name?`

${this.alt}

`:""}`)})},initMode(){let t=localStorage.getItem("night")||!1;const a=e=>{e?document.documentElement.classList.add("night"):document.documentElement.classList.remove("night"),localStorage.setItem("night",e),t=e};$("#toggle-mode").on("click",()=>a("true"!==t.toString())),"system"===DreamConfig.default_theme&&window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>a(e.matches))},initNavbar(){var t=$(".navbar-nav a"),e=$(".panel-side-menu .link");let a=0;var{href:n,pathname:i}=location;if(i&&"/"!==i)for(let e=0;e$(this).addClass("active"),()=>$(this).removeClass("active")):($(this).on("click",function(e){e.stopPropagation(),$(this).toggleClass("active"),$(document).one("click",()=>$(this).removeClass("active")),e.stopPropagation()}),a.on("click",e=>e.stopPropagation()))})},initScroll(){let i=0;document.addEventListener("scroll",()=>{var e=$(document).scrollTop(),t=(a=(t=e)>i,i=t,a),a=$("body"),n=$(".actions");50e.preventDefault),$(".navbar .toc-content").on("click",function(e){e.stopPropagation(),$("html").removeClass("disable-scroll"),$(".navbar-mask").removeClass("active slideout"),$(".navbar-slideout").removeClass("active slideout-toc")})},sideMenuMobile(){$(".navbar-slideout-menu .current").parents(".panel-body").show().siblings(".panel").addClass("in"),$(".navbar-slideout-menu .panel").on("click",function(e){e.stopPropagation();var e=$(this),t=e.parent().parent();t.find(".panel").not(e).removeClass("in"),t.find(".panel-body").not(e.siblings(".panel-body")).stop().hide("fast"),e.toggleClass("in").siblings(".panel-body").stop().toggle("fast")})},initEvent(){var e=$("body");function a(e){var e=$(e),t=e.attr("data-close");return t&&""!==t.trim()?e.closest(t.trim()):e}e.on("click",".click-close",function(e){e.stopPropagation(),a(this).remove()}),e.on("click",".click-animation-close",function(e){e.stopPropagation();let t=a(this);t.addClass("close-animation"),setTimeout(()=>t.remove(),300)})},offscreenTip(){if(!Utils.isMobile()&&(DreamConfig.document_hidden_title||DreamConfig.document_visible_title)){const t=document.title;let e=null;document.addEventListener("visibilitychange",function(){document.hidden?(DreamConfig.document_hidden_title&&(document.title=DreamConfig.document_hidden_title),clearTimeout(e)):(document.title=DreamConfig.document_visible_title||t,DreamConfig.document_visible_title&&(e=setTimeout(function(){document.title=t},2e3)))})}},initCarousel(){window.Swiper&&new Swiper(".swiper",{loop:!0,parallax:!0,effect:"slide",spaceBetween:10,speed:600,autoplay:{delay:3e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},pagination:{el:".swiper-pagination",clickable:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})},sparkInput(){const a=DreamConfig.spark_input_content&&DreamConfig.spark_input_content.filter(e=>0sparkInput(t,[t.innerText,...a]))})},loveTime(){let l=$(".love .love-time");if(0!==l.length){var e=l.attr("data-time");if(/^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/.test(e)){const c=new Date,d=new Date(e);setInterval(function(){c.setTime(c.getTime()+1e3);var e=parseInt((c-d)/1e3),t=e%60,a=(e=parseInt(e/60))%60;let n=(e=parseInt(e/60))%24,i=parseInt(e/24),o=0,s=d.getFullYear(),r=c.getFullYear();for(;s${i}天${n}${a}${t}秒`},1e3)}else o.innerText=DreamConfig.website_time}},initComment(){window.CommentWidget&&$(".widget-comment").each(function(e,t){var a=$(this).attr("data-target"),n=$(this).attr("data-id");CommentWidget.init(`.widget-comment[data-id=${n}][data-target=${a}]`,"/plugins/PluginCommentWidget/assets/static/style.css",{group:"content.halo.run",kind:a,name:n,colorScheme:window.dataTheme})})},initEffects(){Utils.isMobile()||(DreamConfig.cursor_move&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/move/${DreamConfig.cursor_move}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.cursor_click&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/click/${DreamConfig.cursor_click}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.enable_live2d&&Utils.cachedScript(DreamConfig.theme_base+"/js/autoload.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_sakura_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/sakura.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_universe_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/universe.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_circle_magic_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/circleMagic.min.js?mew="+DreamConfig.theme_version))},loadMaintain(){DreamConfig.enable_baidu_push&&Utils.baiduPush(),DreamConfig.enable_toutiao_push&&Utils.toutiaoPush()},showThemeVersion(){window.logger(`%c页面加载耗时:${Math.round(performance.now())}ms | Theme By Dream `+DreamConfig.theme_version,"color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px")}};window.commonContext=t;{const a=["initCarousel","sparkInput","websiteTime","initComment"],n=["initEffects","loadMaintain","showThemeVersion"];Object.keys(t).forEach(e=>!a.includes(e)&&!n.includes(e)&&t[e]()),document.addEventListener("DOMContentLoaded",function(){$("html").addClass("loaded"),a.forEach(e=>t[e]&&t[e]())}),window.addEventListener("load",function(){n.forEach(e=>t[e]&&t[e]()),$("html").addClass("ready")})}})(); \ No newline at end of file +(()=>{window.encrypt=e=>window.btoa(unescape(encodeURIComponent(e))),window.decrypt=e=>decodeURIComponent(escape(window.atob(e)));const t={initWidget(){var e=$(".columns .column-right"),t=$(".columns .column-right-shadow");if(e.length&&t.length&&!t[0].children.length)for(const a of e[0].children)t[0].append(a.cloneNode(!0))},initTocAndNotice(){var e=location["pathname"],t=(window.tocPjax&&window.tocPjax(),0===$(".widget.toc .card-content ul").length),e="toc"===DreamConfig.notice_show_mode&&!t||"index"===DreamConfig.notice_show_mode&&"/"!==e;t?$(".widget.toc,.action-toc").addClass("is-hidden-all"):$(".widget.toc,.action-toc").removeClass("is-hidden-all"),e?$(".widget.notice").addClass("is-hidden-all"):$(".widget.notice").removeClass("is-hidden-all")},initBanner(){const i=$(".banner-info-desc");if(0!==i.length){const o=i.text();i.text("");let t,a="",n=!0;const s=function(){var e=a.length;n&&e
${this.alt&&DreamConfig.show_img_name?`

${this.alt}

`:""}`)})},initMode(){let t=localStorage.getItem("night")||!1;const a=e=>{e?document.documentElement.classList.add("night"):document.documentElement.classList.remove("night"),localStorage.setItem("night",e),t=e};$("#toggle-mode").on("click",()=>a("true"!==t.toString())),"system"===DreamConfig.default_theme&&window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>a(e.matches))},initNavbar(){var t=$(".navbar-nav a"),e=$(".panel-side-menu .link");let a=0;var{href:n,pathname:i}=location;if(i&&"/"!==i)for(let e=0;e$(this).addClass("active"),()=>$(this).removeClass("active")):($(this).on("click",function(e){e.stopPropagation(),$(this).toggleClass("active"),$(document).one("click",()=>$(this).removeClass("active")),e.stopPropagation()}),a.on("click",e=>e.stopPropagation()))})},initScroll(){let i=0;document.addEventListener("scroll",()=>{var e=$(document).scrollTop(),t=(a=(t=e)>i,i=t,a),a=$("body"),n=$(".actions");50e.preventDefault),$(".navbar .toc-content").on("click",function(e){e.stopPropagation(),$("html").removeClass("disable-scroll"),$(".navbar-mask").removeClass("active slideout"),$(".navbar-slideout").removeClass("active slideout-toc")})},sideMenuMobile(){$(".navbar-slideout-menu .current").parents(".panel-body").show().siblings(".panel").addClass("in"),$(".navbar-slideout-menu .panel").on("click",function(e){e.stopPropagation();var e=$(this),t=e.parent().parent();t.find(".panel").not(e).removeClass("in"),t.find(".panel-body").not(e.siblings(".panel-body")).stop().hide("fast"),e.toggleClass("in").siblings(".panel-body").stop().toggle("fast")})},initEvent(){var e=$("body");function a(e){var e=$(e),t=e.attr("data-close");return t&&""!==t.trim()?e.closest(t.trim()):e}e.on("click",".click-close",function(e){e.stopPropagation(),a(this).remove()}),e.on("click",".click-animation-close",function(e){e.stopPropagation();let t=a(this);t.addClass("close-animation"),setTimeout(()=>t.remove(),300)})},offscreenTip(){if(!Utils.isMobile()&&(DreamConfig.document_hidden_title||DreamConfig.document_visible_title)){const t=document.title;let e=null;document.addEventListener("visibilitychange",function(){document.hidden?(DreamConfig.document_hidden_title&&(document.title=DreamConfig.document_hidden_title),clearTimeout(e)):(document.title=DreamConfig.document_visible_title||t,DreamConfig.document_visible_title&&(e=setTimeout(function(){document.title=t},2e3)))})}},initCarousel(){window.Swiper&&new Swiper(".swiper",{loop:!0,parallax:!0,effect:"slide",spaceBetween:10,speed:600,autoplay:{delay:3e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},pagination:{el:".swiper-pagination",clickable:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})},sparkInput(){const a=DreamConfig.spark_input_content&&DreamConfig.spark_input_content.filter(e=>0sparkInput(t,[t.innerText,...a]))})},loveTime(){let l=$(".love .love-time");if(0!==l.length){var e=l.attr("data-time");if(/^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/.test(e)){const c=new Date,d=new Date(e);setInterval(function(){c.setTime(c.getTime()+1e3);var e=parseInt((c-d)/1e3),t=e%60,a=(e=parseInt(e/60))%60;let n=(e=parseInt(e/60))%24,i=parseInt(e/24),o=0,s=d.getFullYear(),r=c.getFullYear();for(;s${i}天${n}${a}${t}秒`},1e3)}else o.innerText=DreamConfig.website_time}},initComment(){window.CommentWidget&&$(".widget-comment").each(function(e,t){var a=$(this).attr("data-target"),n=$(this).attr("data-id");CommentWidget.init(`.widget-comment[data-id='${n}'][data-target='${a}']`,"/plugins/PluginCommentWidget/assets/static/style.css",{group:"content.halo.run",kind:a,name:n,colorScheme:window.dataTheme})})},initEffects(){Utils.isMobile()||(DreamConfig.cursor_move&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/move/${DreamConfig.cursor_move}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.cursor_click&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/click/${DreamConfig.cursor_click}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.enable_live2d&&Utils.cachedScript(DreamConfig.theme_base+"/js/autoload.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_sakura_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/sakura.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_universe_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/universe.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_circle_magic_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/circleMagic.min.js?mew="+DreamConfig.theme_version))},loadMaintain(){DreamConfig.enable_baidu_push&&Utils.baiduPush(),DreamConfig.enable_toutiao_push&&Utils.toutiaoPush()},showThemeVersion(){window.logger(`%c页面加载耗时:${Math.round(performance.now())}ms | Theme By Dream `+DreamConfig.theme_version,"color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px")}};window.commonContext=t;{const a=["initCarousel","sparkInput","websiteTime","initComment"],n=["initEffects","loadMaintain","showThemeVersion"];Object.keys(t).forEach(e=>!a.includes(e)&&!n.includes(e)&&t[e]()),document.addEventListener("DOMContentLoaded",function(){$("html").addClass("loaded"),a.forEach(e=>t[e]&&t[e]())}),window.addEventListener("load",function(){n.forEach(e=>t[e]&&t[e]()),$("html").addClass("ready")})}})(); \ No newline at end of file From 7e6ea9151a53aed266da130baa28bee551ec02bf Mon Sep 17 00:00:00 2001 From: nineya Date: Sun, 16 Jul 2023 20:05:00 +0800 Subject: [PATCH 2/3] feat(custom): custom style --- .github/ISSUE_TEMPLATE/custom_config.yml | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/custom_config.yml diff --git a/.github/ISSUE_TEMPLATE/custom_config.yml b/.github/ISSUE_TEMPLATE/custom_config.yml new file mode 100644 index 0000000..18beecb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom_config.yml @@ -0,0 +1,35 @@ +name: 定制化配置 +description: 提交定制化配置疑问 +title: 'custom:' +labels: [custom] +body: + - type: markdown + id: preface + attributes: + value: "你好!感谢你为 Dream 提交定制化配置建议。在开始之前,我们非常推荐阅读一遍[《开源最佳实践》](https://github.com/LinuxSuRen/open-source-best-practice),这会在很大程度上提高我们彼此的效率。" + - type: markdown + id: environment + attributes: + value: "## 环境信息" + - type: input + id: dream-version + validations: + required: false + attributes: + label: "你当前使用的 Dream 版本" + description: "可以在主题 `theme.yaml` 文件中找到。" + - type: markdown + id: details + attributes: + value: "## 详细信息" + - type: textarea + id: description + attributes: + label: "描述一下此定制化内容" + validations: + required: true + - type: textarea + id: additional-information + attributes: + label: "补充信息" + description: "如果你还有其他需要提供的信息或解决思路,可以在这里填写。" From 238a442081df49d77e1a2a0c2779ed7c85c35d86 Mon Sep 17 00:00:00 2001 From: nineya Date: Sun, 16 Jul 2023 20:48:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?build(version):=20=E5=8F=91=E5=B8=831.0.4?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- theme.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 018b87d..831eee0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "halo-theme-dream2.0", - "version": "1.0.3", + "version": "1.0.4", "description": "梦之城,童话梦境,动漫类型博客主题。", "main": "index.js", "author": "nineya", diff --git a/theme.yaml b/theme.yaml index 022a7bd..dcef47a 100644 --- a/theme.yaml +++ b/theme.yaml @@ -22,6 +22,6 @@ spec: settingName: theme-dream-setting configMapName: theme-dream-configMap # 版本号 - version: 1.0.3 + version: 1.0.4 # 最低支持的 Halo 版本 require: ">=2.0.0" \ No newline at end of file