Update app.js
This commit is contained in:
1 parent
5a03c56ff4
commit
3108dfc4cd
1 file changed
+8
-17
@@ -25,18 +25,15 @@ function renderNav() {
|
|||||||
async function loadForumName() {
|
async function loadForumName() {
|
||||||
try {
|
try {
|
||||||
const data = await API.getSettings();
|
const data = await API.getSettings();
|
||||||
// 数据库有值就用数据库的,否则用 'Forumlify'
|
if (data.forum_name && data.forum_name.trim()) {
|
||||||
const name = data.forum_name || 'Forumlify';
|
const name = data.forum_name.trim();
|
||||||
document.getElementById('forumName').textContent = name;
|
document.getElementById('forumName').textContent = name;
|
||||||
document.title = name;
|
document.title = name;
|
||||||
const titleEl = document.getElementById('pageTitle');
|
const titleEl = document.getElementById('pageTitle');
|
||||||
if (titleEl) titleEl.textContent = name;
|
if (titleEl) titleEl.textContent = name;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const name = 'Forumlify';
|
// 保留 config.js 的默认值,什么都不做
|
||||||
document.getElementById('forumName').textContent = name;
|
|
||||||
document.title = name;
|
|
||||||
const titleEl = document.getElementById('pageTitle');
|
|
||||||
if (titleEl) titleEl.textContent = name;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -962,8 +959,6 @@ function openImageViewer(imageUrl) {
|
|||||||
async function init() {
|
async function init() {
|
||||||
applyTheme();
|
applyTheme();
|
||||||
|
|
||||||
document.getElementById('forumName').textContent = 'Forumlify';
|
|
||||||
|
|
||||||
refreshCaptcha('reg');
|
refreshCaptcha('reg');
|
||||||
refreshCaptcha('post');
|
refreshCaptcha('post');
|
||||||
refreshCaptcha('reply');
|
refreshCaptcha('reply');
|
||||||
@@ -1267,9 +1262,5 @@ async function init() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 加载完成,隐藏 loading 动画
|
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', init);
|
document.addEventListener('DOMContentLoaded', init);
|
||||||
// 强制隐藏加载动画(无论 init 是否执行)
|
|
||||||
|
|
||||||
Reference in new issue
Block a user