Skip to content

Commit

Permalink
增加自定义html内容,音乐播放器属性增强
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsoftking committed Dec 21, 2024
1 parent 97ed93e commit 7274702
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1644,3 +1644,10 @@ spec:
label: "内嵌JS(body)"
placeholder: 请输入 JS 代码内容
help: '填入JS代码,无需script标签,将插入body标签尾部。'
- $formkit: code
language: html
height: 45px
name: inline_body_html
label: "内嵌Html内容(body)"
placeholder: 请输入 Html 代码内容
help: '填入Html代码,将插入body标签尾部,用于自定义显示一段Html内容,注意:Html内容默认会在页脚下方,请注意设置样式避免页脚出现样式问题。'
5 changes: 4 additions & 1 deletion src/js/mew-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ document.addEventListener('DOMContentLoaded', () => {
}
// eslint-disable-next-line no-async-promise-executor
new Promise(async (resolve) => {
if (this.hasAttribute('song')) {
if (this.hasAttribute('meetingApi')) {
this.options.audio = await fetch(this.getAttribute('meetingApi'))
.then((response) => response.json())
} else if (this.hasAttribute('song')) {
this.options.audio = await fetch(
'https://api.i-meto.com/meting/api?server=netease&type=song&id=' +
this.getAttribute('song')
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/js/mew-custom.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions templates/common/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<th:block th:replace="~{common/actions}"/>
<th:block th:replace="~{common/footer}"/>
<th:block th:replace="~{common/scripts}"/>
<th:block th:utext="${theme.config.custom.inline_body_html}"></th:block>
</body>
</th:block>
</th:block>
Expand Down
2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.3.3.beta10
version: 1.3.3.beta11
# 最低支持的 Halo 版本
require: ">=2.20.0"
# 许可
Expand Down

0 comments on commit 7274702

Please sign in to comment.