Merge pull request #8 from zsjy/dev

Dev
This commit is contained in:
mjking 2024-04-27 07:58:26 +08:00 committed by GitHub
commit d754603968
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 14 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{
"name": "halo-theme-dream2.0-plus",
"version": "1.1.0",
"version": "1.1.1",
"description": "梦之城,童话梦境,动漫类型博客主题。",
"main": "index.js",
"author": "nineya",

View File

@ -28,6 +28,7 @@
margin-right: 10px;
&-list {
display: block !important;
position: absolute;
bottom: 40px;
right: 50%;

View File

@ -126,7 +126,9 @@ $(document).on('pjax:success', async function (event, data, status, xhr, options
const $currentTarget = $($.parseHTML(data, document, true))
const $head = $('head')
$head.find('meta').remove()
$head.find('link[rel="canonical"]').remove()
$head.append($currentTarget.filter('meta'))
$head.append($currentTarget.filter('link[rel="canonical"]'))
$currentTarget.filter('link[data-pjax]').each(function () {
let href = $(this).attr('href')
if (!cssLoadCompletes.has(href)) {
@ -213,6 +215,6 @@ $(document).on('pjax:end', function (event, xhr, options) {
}
})
$(document).on('pjax:popstate', function () {
$(document).on('pjax:popstate', function (event) {
console.log('pjax:popstate')
})

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{const i=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),l=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},c=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");l.has(o)?c(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),l.add(o),window.DProgress&&DProgress.inc(),c(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),c(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not(data-not-pjax)",o=>{$.pjax.click(o,".column-main",{scrollTo:"/"!==o.currentTarget.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,s){s=s.serialNumber;if(console.log("pjax:success sn = "+s),window.pjaxSerialNumber===s){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const a=$($.parseHTML(e,document,!0)),r=$("head");r.find("meta").remove(),r.append(a.filter("meta")),a.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(r.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){i.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=a.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");l.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),l.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{c(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{c(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===s&&(window.journalPjax&&window.journalPjax(s),window.postPjax&&window.postPjax(s),commonContext.initTimeCount(),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,s){console.log(`pjax:error sn = ${s.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),commonContext.initTimeCount(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(){console.log("pjax:popstate")})})();
(()=>{const i=new Set($('link[href*=".css"]').map((o,n)=>$(n).attr("href")).get()),l=new Set($('script[src*=".js"]').map((o,n)=>$(n).attr("src")).get()),n=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},c=(n,e,t)=>{if(e>=n.length)t&&t();else{let o=$(n[e]).attr("src");l.has(o)?c(n,e+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),l.add(o),window.DProgress&&DProgress.inc(),c(n,e+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),c(n,e+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not(data-not-pjax)",o=>{$.pjax.click(o,".column-main",{scrollTo:"/"!==o.currentTarget.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,fragment:".column-main",serialNumber:n(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:0,fragment:".column-main",serialNumber:n(),timeout:8e3})}),$(document).on("pjax:click",function(o,n){console.log("------------------------"),console.log("pjax:click sn = "+n.serialNumber)}),$(document).on("pjax:beforeSend",function(o,n,e){console.log("pjax:beforeSend sn = "+e.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,n,e){console.log("pjax:start sn = "+e.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,n,e){console.log("pjax:send sn = "+e.serialNumber)}),$(document).on("pjax:clicked",function(o,n){console.log("pjax:clicked sn = "+n.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,n,e){console.log("pjax:beforeReplace sn = "+e.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,n,e,t,a){a=a.serialNumber;if(console.log("pjax:success sn = "+a),window.pjaxSerialNumber===a){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const s=$($.parseHTML(n,document,!0)),r=$("head");r.find("meta").remove(),r.find('link[rel="canonical"]').remove(),r.append(s.filter("meta")),r.append(s.filter('link[rel="canonical"]')),s.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(r.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){i.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=s.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");l.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),l.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{c(o.filter("[defer]"),0)});let n=o.filter(":not([async]):not([defer])");0<n.length&&await new Promise(o=>{c(n,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===a&&(window.journalPjax&&window.journalPjax(a),window.postPjax&&window.postPjax(a),commonContext.initTimeCount(),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,n,e){console.log("pjax:timeout sn = "+e.serialNumber)}),$(document).on("pjax:error",function(o,n,e,t,a){console.log(`pjax:error sn = ${a.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,n,e,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,n,e){console.log("pjax:end sn = "+e.serialNumber),null==n&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),commonContext.initTimeCount(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(o){console.log("pjax:popstate")})})();

View File

@ -12,18 +12,18 @@ th:with="description=${isPost ? post != null ? post.status.excerpt : singlePage
<th:block th:if="${theme.config.basic_info.social_media}">
<meta property="og:type" content="website">
<meta property="og:title" th:content="${site.title}">
<meta property="og:url" th:content="${#strings.startsWith(canonical,'http') ? canonical : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + canonical)}">
<meta property="og:url" th:content="${#strings.isEmpty(canonical) ? '' : #strings.startsWith(canonical,'http') ? canonical : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + canonical)}">
<meta property="og:site_name" th:content="${title}">
<meta property="og:description" th:content="${description}">
<meta property="og:locale" content="zh">
<meta property="og:image" th:content="${#strings.startsWith(site.favicon,'http') ? site.favicon : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + site.favicon)}">
<meta property="og:image" th:content="${#strings.isEmpty(site.favicon) ? '' : #strings.startsWith(site.favicon,'http') ? site.favicon : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + site.favicon)}">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" th:content="${title}">
<meta name="twitter:description" th:content="${description}">
<meta name="twitter:image" th:content="${#strings.startsWith(site.favicon,'http') ? site.favicon : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + site.favicon)}">
<meta name="twitter:image" th:content="${#strings.isEmpty(site.favicon) ? '' : #strings.startsWith(site.favicon,'http') ? site.favicon : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + site.favicon)}">
</th:block>
<link rel="canonical" th:href="${#strings.startsWith(canonical,'http') ? canonical : (#strings.endsWith(canonical,'/') ? #strings.substringBefore(site.url, '/') : site.url + canonical)}"/>
<link rel="canonical" th:href="${#strings.isEmpty(canonical) ? '' : #strings.startsWith(canonical,'http') ? canonical : (#strings.endsWith(canonical,'/') ? #strings.substringBefore(site.url, '/') : site.url + canonical)}"/>
<link rel="preload stylesheet" as="style" th:href="@{/assets/css/theme.min.css(mew=${theme.spec.version})}">
<link rel="preload stylesheet" as="style" th:href="@{/assets/lib/remixicon@4.2.0/remixicon.min.css}">

View File

@ -5,7 +5,7 @@
<button th:if="${donate}" class="donate" type="button">
<i class="ri-bank-card-line"></i>
<span>打赏</span>
<div class="donate-list" th:if="${theme.config.post.post_donate_style == 'donate_style_poster'}">
<div class="donate-list" style="display: none;" th:if="${theme.config.post.post_donate_style == 'donate_style_poster'}">
<ol>
<li th:if="${!#strings.isEmpty(theme.config.post.donate_wechat)}"><img
th:src="${theme.config.post.donate_wechat}" alt="微信捐赠"></li>
@ -14,7 +14,7 @@
</ol>
</div>
<div class="donate-list" th:if="${theme.config.post.post_donate_style == 'donate_style_qr'}">
<div class="donate-list" style="display: none;" th:if="${theme.config.post.post_donate_style == 'donate_style_qr'}">
<ol>
<li th:if="${!#strings.isEmpty(theme.config.post.donate_wechat)}">
<div class="qr-code">

View File

@ -28,6 +28,6 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.1.0
version: 1.1.1
# 最低支持的 Halo 版本
require: ">=2.12.0"