新版搜索界面添加没有搜索结果提示语,需要保存一次主题配置

This commit is contained in:
mjsoftware 2024-07-12 16:14:21 +08:00
parent 0245808297
commit 7e62a1a612
7 changed files with 37 additions and 16 deletions

13
package-lock.json generated
View File

@ -1,15 +1,14 @@
{
"name": "halo-theme-dream2.0-plus",
"version": "1.0.2",
"version": "1.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "halo-theme-dream2.0-plus",
"version": "1.0.2",
"version": "1.2.1",
"license": "MIT",
"dependencies": {
"highlight.js": "^11.9.0",
"html2canvas": "^1.4.1",
"qrcode": "^1.5.1"
},
@ -5146,14 +5145,6 @@
"node": ">= 0.4"
}
},
"node_modules/highlight.js": {
"version": "11.9.0",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz",
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==",
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/homedir-polyfill": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",

View File

@ -695,7 +695,7 @@ spec:
- $formkit: code
name: content
language: html
height: 150px
height: 160px
label: 侧边栏内容
placeholder: 请输入 HTML 内容
help: '非必填,仅在侧边栏类型为公告、广告、自定义时生效。'
@ -1147,6 +1147,15 @@ spec:
label: 新标签页
- value: _self
label: 当前窗口
- $formkit: code
if: $get(search_enable).value
name: search_empty_tips
validation: required
label: "搜索页面-无搜索结果提示语"
language: html
value: '没有搜索结果'
height: 160px
help: '搜索页面-无搜索结果提示语,支持 HTML 格式。'
- group: enhance
label: '增强功能'
formSchema:

View File

@ -5263,6 +5263,22 @@ button.swiper-pagination-bullet {
}
}
.result-empty {
width: 100%;
min-height: 10rem;
padding: 1rem;
font-size: 1.2rem;
display: flex;
justify-content: center;
align-items: center;
color: var(--main);
&-tips {
max-width: 60%;
margin: 0;
}
}
b {
color: var(--light-z);
background: var(--theme);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{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")})})();
(()=>{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},n=o=>"/"!==o.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,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:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:n(o.currentTarget),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,a){a=a.serialNumber;if(console.log("pjax:success sn = "+a),window.pjaxSerialNumber===a){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const r=$($.parseHTML(e,document,!0)),s=$("head");s.find("meta").remove(),s.find('link[rel="canonical"]').remove(),s.append(r.filter("meta")),s.append(r.filter('link[rel="canonical"]')),r.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(s.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=r.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===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,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,a){console.log(`pjax:error sn = ${a.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(o){console.log("pjax:popstate")})})();

View File

@ -24,7 +24,7 @@
</form>
</div>
</div>
<div class="widget card search" th:each="hit : ${searchResult.hits}">
<div th:if="${searchResult.hits.size() > 0}" class="widget card search" th:each="hit : ${searchResult.hits}">
<a th:href="${hit.permalink}" th:target="${theme.config.page_config.search.search_target}" >
<div class="card-content main">
<h2 class="title" th:utext="${hit.title}"></h2>
@ -37,5 +37,10 @@
</div>
</a>
</div>
<div th:unless="${searchResult.hits.size() > 0}" class="widget card search" >
<div class="result-empty">
<div class="result-empty-tips" th:utext="${theme.config.page_config.search.search_empty_tips}"></div>
</div>
</div>
</th:block>
</th:block>

View File

@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.2.6
version: 1.2.6.1
# 最低支持的 Halo 版本
require: ">=2.15.0"
# 许可