Improve page scripts configuration files.

This commit is contained in:
凡梦星尘
2022-07-22 17:16:34 +08:00
parent a9ff14d312
commit 31f6e21671
15 changed files with 198 additions and 138 deletions

View File

@@ -1,8 +1,8 @@
document.addEventListener('DOMContentLoaded', () => {
const element = '.waline-container';
if (!NexT.CONFIG.comments.enable
|| !NexT.CONFIG.waline
if (!NexT.CONFIG.page.comments
|| !NexT.CONFIG.page.waline
|| !NexT.utils.checkDOMExist(element)) return;
const {
@@ -13,13 +13,13 @@ document.addEventListener('DOMContentLoaded', () => {
requiredmeta,
serverurl,
wordlimit
} = NexT.CONFIG.waline.config;
} = NexT.CONFIG.page.waline.cfg;
const waline_css = NexT.utils.getCDNResource(NexT.CONFIG.waline.css);
const waline_css = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.css);
NexT.utils.getStyle(waline_css, null);
const waline_js = NexT.utils.getCDNResource(NexT.CONFIG.waline.js);
const waline_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.js);
const locale = {
placeholder: placeholder
@@ -39,7 +39,7 @@ document.addEventListener('DOMContentLoaded', () => {
wordLimit : wordlimit,
requiredMeta : requiredmeta,
serverURL : serverurl,
lang : NexT.CONFIG.lang,
lang : NexT.CONFIG.page.lang,
dark : "auto"
});