Merge pull request #23 from zsjy/dev

Dev
This commit is contained in:
mjking 2024-07-18 12:51:02 +08:00 committed by GitHub
commit b2dc9e99dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 37 additions and 6 deletions

View File

@ -1154,7 +1154,7 @@ spec:
label: "搜索页面-无搜索结果提示语"
language: html
value: '没有搜索结果'
height: 160px
height: 240px
help: '搜索页面-无搜索结果提示语,支持 HTML 格式。'
- group: enhance
label: '增强功能'

View File

@ -36,6 +36,15 @@ lit-toast-container, halo-contact-form-toast-container {
filter: grayscale(1) !important;
}
.qmsg.qmsg-wrapper {
color: #333 !important;
top: 60px !important;
}
.qmsg .qmsg-content {
background: var(--light-z) !important;
}
.navbar-above {
&.animation {
@ -5244,7 +5253,7 @@ button.swiper-pagination-bullet {
i {
color: #fff;
font-size: 1.2rem;
font-size: 18px;
}
}

File diff suppressed because one or more lines are too long

View File

@ -75,6 +75,7 @@
DreamConfig["gray_mode"] = [[${theme.config.enhance.gray_mode_group.enable_gray_mode}]];
DreamConfig["gray_mode_start_time"] = [[${theme.config.enhance.gray_mode_group.gray_mode_start_time}]];
DreamConfig["gray_mode_end_time"] = [[${theme.config.enhance.gray_mode_group.gray_mode_end_time}]];
DreamConfig["pjax_state"] = [[${theme.config.enhance.enable_pjax}]];
/** 配置分享方式 */
let post_share = []
for (let share of [[${theme.config.post.custom_post_share}]]) {

View File

@ -9,15 +9,36 @@
<div>[[${#strings.replace(title, ' - ' + site.title, '')}]]</div>
</div>
<div class="search-box">
<form class="search-form-inner" method="get" action="/search" role="search" data-pjax>
<script th:inline="javascript">
$(function () {
var searchForm = document.getElementById('halo-search-form')
searchForm.addEventListener('submit', function (event) {
var searchInput = document.getElementById('halo-search-form-text-input')
var query = searchInput.value.trim()
if (!query || query.startsWith('*')) {
// 阻止表单提交
event.preventDefault()
// 显示错误信息
Qmsg.warning(!query ? '请输入搜索内容' : '搜索内容不能以 * 开头')
return
}
if(DreamConfig.pjax_state) {
// 阻止表单提交
event.preventDefault()
searchForm.setAttribute('data-pjax', '')
}
})
})
</script>
<form id="halo-search-form" class="search-form-inner" method="get" action="/search" role="search">
<input
id="halo-search-form-text-input"
class="text-input"
type="search"
name="keyword"
th:title="${theme.config.page_config.search.search_placeholder}"
th:placeholder="${theme.config.page_config.search.search_placeholder}"
th:value="${searchResult.keyword}"
required
/>
<button class="search-form-btn" th:title="${theme.config.page_config.search.search_btn_title}" type="submit">
<i class="ri-search-line"></i>

View File

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