Update app.js
This commit is contained in:
1 parent
3108dfc4cd
commit
427d1cb624
1 file changed
+8
-4
@@ -25,15 +25,17 @@ function renderNav() {
|
|||||||
async function loadForumName() {
|
async function loadForumName() {
|
||||||
try {
|
try {
|
||||||
const data = await API.getSettings();
|
const data = await API.getSettings();
|
||||||
if (data.forum_name && data.forum_name.trim()) {
|
const name = data.forum_name || CONFIG.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) {
|
||||||
// 保留 config.js 的默认值,什么都不做
|
const name = CONFIG.FORUM_NAME || 'Forumlify';
|
||||||
|
document.getElementById('forumName').textContent = name;
|
||||||
|
document.title = name;
|
||||||
|
const titleEl = document.getElementById('pageTitle');
|
||||||
|
if (titleEl) titleEl.textContent = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -959,6 +961,8 @@ function openImageViewer(imageUrl) {
|
|||||||
async function init() {
|
async function init() {
|
||||||
applyTheme();
|
applyTheme();
|
||||||
|
|
||||||
|
document.getElementById('forumName').textContent = CONFIG.FORUM_NAME || 'Forumlify';
|
||||||
|
|
||||||
refreshCaptcha('reg');
|
refreshCaptcha('reg');
|
||||||
refreshCaptcha('post');
|
refreshCaptcha('post');
|
||||||
refreshCaptcha('reply');
|
refreshCaptcha('reply');
|
||||||
|
|||||||
Reference in new issue
Block a user