进行了一些小修复

This commit is contained in:
kate522 committed 2026-08-26 19:51:31 +08:00
1 parent 02cbff1ddf
commit fbada8bd6a
20 files changed
+294 -191

No files matched your search

@@ -6,8 +6,6 @@ export const featureSchema = {
defaults: {
feature_pdf_export: false,
feature_print: true,
feature_word_count: true,
feature_reading_time: true,
},
groups: [
{
@@ -16,8 +14,6 @@ export const featureSchema = {
icon: 'fa fas fa-wrench',
fields: [
{ key: 'feature_print', label: '打印文章', type: 'switch', default: true },
{ key: 'feature_word_count', label: '字数统计', type: 'switch', default: true },
{ key: 'feature_reading_time', label: '预计阅读时间', type: 'switch', default: true },
{ key: 'feature_pdf_export', label: 'PDF 导出', type: 'switch', default: false, help: '实验性功能' },
],
},
+19 -18
View File
@@ -336,22 +336,6 @@ body.single main.container {
box-sizing: border-box;
}
/* Reading facts below the author row. */
.article-reading-meta {
display: flex;
flex-wrap: wrap;
gap: 8px 14px;
margin: 12px 0 2px;
color: var(--muted-color, #777);
font-size: 12px;
}
.article-reading-meta span {
display: inline-flex;
align-items: center;
gap: 5px;
}
/* source: assets/css/frontend/single-post/content.css */
/* ========== Single Post ========== */
@@ -1332,10 +1316,24 @@ html.dark .post-drop-meta__item:hover {
color: var(--key-color, #333);
}
.article-header .article-avatar .relative {
.article-header .article-avatar .single-meta-row {
margin-top: 20px;
position: relative;
min-height: 1px;
min-height: 28px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.article-header .article-avatar .single-meta-row > .line-form-line {
bottom: 50%;
}
.article-header .article-avatar .single-meta-row > .single-metabox {
position: relative;
inset: auto;
transform: none;
z-index: 1;
}
.single-metabox {
@@ -1368,6 +1366,9 @@ html.dark .post-drop-meta__item:hover {
.single-metabox .post-drop-meta {
position: relative;
display: inline-block;
--this-size: 1.73em;
--this-color: var(--meta-color);
--this-bg: var(--body-bg-color, #f5f5f5);
}
.single-metabox.cover-meta {
+1 -1
View File
@@ -1 +1 @@
.relative{position:relative}.flex{display:flex}.flex.ac,.ac{align-items:center}.flex.jc,.jc{justify-content:center}.flex.jsb,.jsb{justify-content:space-between}.flex.at,.at{align-items:flex-start}.flex.ae,.ae{align-items:flex-end}.flex0{flex:0 0 auto}.flex1{flex:1 1 auto;min-width:0}.flex.column{flex-direction:column}.flex.wrap{flex-wrap:wrap}.flex.flex-row,.flex-row{flex-direction:row}.flex.jse,.jse{justify-content:space-evenly}.flex.jsa,.jsa{justify-content:space-around}.flex>.flex1,.flex .flex1{flex:1;overflow:hidden;min-width:0}.relative-h{position:relative;height:100%}.padding-10{padding:10px}.font-bold{font-weight:700}.mt6{margin-top:6px}.gutters-5{margin:-5px}.gutters-5>*{padding:5px}@media(max-width:767px){.flex.flex-row.flex-col-sm-2{flex-wrap:wrap}.flex.flex-row.flex-col-sm-2>*{flex-basis:50%}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.abs-right{position:absolute;right:0;top:0}.abs-center{position:absolute;left:0;width:100%;top:50%;right:.7em;transform:translateY(-50%);z-index:1}.abs-center.left-top,.abs-center.right-top{transform:unset;top:0}.abs-center.right-top{left:auto;width:auto;text-align:right}.abs-center.left-top{text-align:left}.abs-center.conter-bottom,.abs-center.conter-conter{text-align:center}.abs-center.right-top,.abs-center.right-bottom,.abs-center.right-conter{text-align:right}.abs-center.conter-bottom,.abs-center.right-bottom,.abs-center.left-bottom{top:auto;transform:unset;bottom:0}.abs-center.left-bottom{left:0;right:auto;text-align:left}.abs-center.right-bottom,.abs-center.right-conter{left:auto;right:0;text-align:right}.graphic,.page-cover{text-shadow:0 0 5px rgba(0,0,0,.2);--main-color: #fff;color:#fff;position:relative;overflow:hidden;box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08));padding:0 0 70%;border-radius:var(--main-radius, var(--radius, 8px))}.graphic>.fit-cover,.graphic>img.fit-cover{position:absolute;width:100%;height:100%;object-fit:cover;inset:0}.fit-cover{object-fit:cover;max-width:100%}.title-h-left{position:relative;padding-bottom:8px}.title-h-left:before{transition:.4s;transform-origin:left;position:absolute;content:"";width:40px;height:3px;background:var(--theme-color, var(--focus-color, #f04494));left:0;bottom:3px;border-radius:5px;box-shadow:1px 1px 3px -1px var(--theme-color, var(--focus-color, #f04494))}.line-form-line,.line-form-line:before{position:absolute;bottom:0;left:0;height:1px;width:100%;transition:.8s;background:var(--main-border-color, rgba(50, 50, 50, .06))}.line-form-line:before{content:"";width:0;background:var(--focus-color, #f04494)}.avatar-img{position:relative;display:inline-block;flex-shrink:0;--this-size: 38px;width:var(--this-size);height:var(--this-size)}.avatar-img .avatar,.avatar-img img{width:100%;height:100%;border-radius:50%;object-fit:cover}.avatar-lg{--this-size: 80px}.avatar-md{--this-size: 55px}.avatar-mini{--this-size: 20px}.shrink0{flex-shrink:0}.opacity8{opacity:.8}.muted-color{color:var(--muted-color, var(--color-ink-3))}.muted-2-color{color:var(--muted-2-color, var(--color-ink-4))}.muted-3-color{color:var(--muted-3-color, #b1b1b1)}.muted-4-color{color:var(--muted-4-color, #d2d2d2)}.text-center{text-align:center}.em09{font-size:.9em}.em12{font-size:1.2em}.px12-sm{font-size:12px}.ml3{margin-left:3px}.ml6{margin-left:6px}.ml10{margin-left:10px}.mr3{margin-right:3px}.mr6{margin-right:6px}.mt10{margin-top:10px}.mt20{margin-top:20px}.mb10{margin-bottom:10px}.mb20{margin-bottom:20px}.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.text-ellipsis-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}.main-bg{background-color:var(--main-bg-color, var(--surface-1))}.separator{position:relative;letter-spacing:.08em}.icon-circle+.icon-circle:before{content:"·";display:inline-block;margin:0 .45em;opacity:.55}.article-avatar name,.article-avatar .name,.user-name{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:100%}.pull-right{float:right}.pull-left{float:left}body.single main.container .content-layout{display:block;min-width:0}body.single main.container .content-layout>*{min-width:0;max-width:100%}body.single main.container .content-layout>.breadcrumb,body.single main.container .content-layout>ul.breadcrumb,body.single main.container .content-layout>.breadcrumb-nav,body.single main.container .content-layout>.breadcrumbs-wrap{position:relative;z-index:1;margin-top:0;margin-bottom:12px;padding-top:2px}body.single .sidebar .aksrt-panel,body.single .sidebar .widget{margin-bottom:15px}body.single main.container{box-sizing:border-box}.article-reading-meta{display:flex;flex-wrap:wrap;gap:8px 14px;margin:12px 0 2px;color:var(--muted-color, #777);font-size:12px}.article-reading-meta span{display:inline-flex;align-items:center;gap:5px}.article,article.article.box-body,.article.main-bg.box-body{padding:0 30px;overflow:hidden}@media(max-width:767px){.article,article.artiLine truncated
.relative{position:relative}.flex{display:flex}.flex.ac,.ac{align-items:center}.flex.jc,.jc{justify-content:center}.flex.jsb,.jsb{justify-content:space-between}.flex.at,.at{align-items:flex-start}.flex.ae,.ae{align-items:flex-end}.flex0{flex:0 0 auto}.flex1{flex:1 1 auto;min-width:0}.flex.column{flex-direction:column}.flex.wrap{flex-wrap:wrap}.flex.flex-row,.flex-row{flex-direction:row}.flex.jse,.jse{justify-content:space-evenly}.flex.jsa,.jsa{justify-content:space-around}.flex>.flex1,.flex .flex1{flex:1;overflow:hidden;min-width:0}.relative-h{position:relative;height:100%}.padding-10{padding:10px}.font-bold{font-weight:700}.mt6{margin-top:6px}.gutters-5{margin:-5px}.gutters-5>*{padding:5px}@media(max-width:767px){.flex.flex-row.flex-col-sm-2{flex-wrap:wrap}.flex.flex-row.flex-col-sm-2>*{flex-basis:50%}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.abs-right{position:absolute;right:0;top:0}.abs-center{position:absolute;left:0;width:100%;top:50%;right:.7em;transform:translateY(-50%);z-index:1}.abs-center.left-top,.abs-center.right-top{transform:unset;top:0}.abs-center.right-top{left:auto;width:auto;text-align:right}.abs-center.left-top{text-align:left}.abs-center.conter-bottom,.abs-center.conter-conter{text-align:center}.abs-center.right-top,.abs-center.right-bottom,.abs-center.right-conter{text-align:right}.abs-center.conter-bottom,.abs-center.right-bottom,.abs-center.left-bottom{top:auto;transform:unset;bottom:0}.abs-center.left-bottom{left:0;right:auto;text-align:left}.abs-center.right-bottom,.abs-center.right-conter{left:auto;right:0;text-align:right}.graphic,.page-cover{text-shadow:0 0 5px rgba(0,0,0,.2);--main-color: #fff;color:#fff;position:relative;overflow:hidden;box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08));padding:0 0 70%;border-radius:var(--main-radius, var(--radius, 8px))}.graphic>.fit-cover,.graphic>img.fit-cover{position:absolute;width:100%;height:100%;object-fit:cover;inset:0}.fit-cover{object-fit:cover;max-width:100%}.title-h-left{position:relative;padding-bottom:8px}.title-h-left:before{transition:.4s;transform-origin:left;position:absolute;content:"";width:40px;height:3px;background:var(--theme-color, var(--focus-color, #f04494));left:0;bottom:3px;border-radius:5px;box-shadow:1px 1px 3px -1px var(--theme-color, var(--focus-color, #f04494))}.line-form-line,.line-form-line:before{position:absolute;bottom:0;left:0;height:1px;width:100%;transition:.8s;background:var(--main-border-color, rgba(50, 50, 50, .06))}.line-form-line:before{content:"";width:0;background:var(--focus-color, #f04494)}.avatar-img{position:relative;display:inline-block;flex-shrink:0;--this-size: 38px;width:var(--this-size);height:var(--this-size)}.avatar-img .avatar,.avatar-img img{width:100%;height:100%;border-radius:50%;object-fit:cover}.avatar-lg{--this-size: 80px}.avatar-md{--this-size: 55px}.avatar-mini{--this-size: 20px}.shrink0{flex-shrink:0}.opacity8{opacity:.8}.muted-color{color:var(--muted-color, var(--color-ink-3))}.muted-2-color{color:var(--muted-2-color, var(--color-ink-4))}.muted-3-color{color:var(--muted-3-color, #b1b1b1)}.muted-4-color{color:var(--muted-4-color, #d2d2d2)}.text-center{text-align:center}.em09{font-size:.9em}.em12{font-size:1.2em}.px12-sm{font-size:12px}.ml3{margin-left:3px}.ml6{margin-left:6px}.ml10{margin-left:10px}.mr3{margin-right:3px}.mr6{margin-right:6px}.mt10{margin-top:10px}.mt20{margin-top:20px}.mb10{margin-bottom:10px}.mb20{margin-bottom:20px}.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.text-ellipsis-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}.main-bg{background-color:var(--main-bg-color, var(--surface-1))}.separator{position:relative;letter-spacing:.08em}.icon-circle+.icon-circle:before{content:"·";display:inline-block;margin:0 .45em;opacity:.55}.article-avatar name,.article-avatar .name,.user-name{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:100%}.pull-right{float:right}.pull-left{float:left}body.single main.container .content-layout{display:block;min-width:0}body.single main.container .content-layout>*{min-width:0;max-width:100%}body.single main.container .content-layout>.breadcrumb,body.single main.container .content-layout>ul.breadcrumb,body.single main.container .content-layout>.breadcrumb-nav,body.single main.container .content-layout>.breadcrumbs-wrap{position:relative;z-index:1;margin-top:0;margin-bottom:12px;padding-top:2px}body.single .sidebar .aksrt-panel,body.single .sidebar .widget{margin-bottom:15px}body.single main.container{box-sizing:border-box}.article,article.article.box-body,.article.main-bg.box-body{padding:0 30px;overflow:hidden}@media(max-width:767px){.article,article.article.box-body,.article.main-bg.box-body{padding:0 15px}.article-header .article-title{font-size:18px}}.entry-header,.article-header{margin-bottom:10px;padding-bottom:0;border-bottom:none;background:tranLine truncated
+7
View File
@@ -91,6 +91,13 @@
border-top: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.08));
}
.newposts-editor .aksrt-submit-word-count {
float: right;
margin-right: 24px;
color: var(--muted-color, #777);
line-height: 24px;
}
.newposts-editor .mce-toolbar .mce-btn-group .mce-btn,
.newposts-editor .qt-dfw {
margin: 4px;
@@ -576,10 +576,24 @@ html.dark .post-drop-meta__item:hover {
color: var(--key-color, #333);
}
.article-header .article-avatar .relative {
.article-header .article-avatar .single-meta-row {
margin-top: 20px;
position: relative;
min-height: 1px;
min-height: 28px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.article-header .article-avatar .single-meta-row > .line-form-line {
bottom: 50%;
}
.article-header .article-avatar .single-meta-row > .single-metabox {
position: relative;
inset: auto;
transform: none;
z-index: 1;
}
.single-metabox {
@@ -612,6 +626,9 @@ html.dark .post-drop-meta__item:hover {
.single-metabox .post-drop-meta {
position: relative;
display: inline-block;
--this-size: 1.73em;
--this-color: var(--meta-color);
--this-bg: var(--body-bg-color, #f5f5f5);
}
.single-metabox.cover-meta {
-16
View File
@@ -34,19 +34,3 @@ body.single .sidebar .widget {
body.single main.container {
box-sizing: border-box;
}
/* Reading facts below the author row. */
.article-reading-meta {
display: flex;
flex-wrap: wrap;
gap: 8px 14px;
margin: 12px 0 2px;
color: var(--muted-color, #777);
font-size: 12px;
}
.article-reading-meta span {
display: inline-flex;
align-items: center;
gap: 5px;
}
+69
View File
@@ -1921,6 +1921,74 @@ tbquire.config({
});
}
var postMetaDocumentEventsBound = false;
function setPostMetaMenuState(menuRoot, open) {
var toggle = menuRoot.querySelector(".post-drop-meta__toggle");
var menu = menuRoot.querySelector(".post-drop-meta__menu");
if (!toggle || !menu) return;
menuRoot.classList.toggle("is-open", open);
toggle.setAttribute("aria-expanded", open ? "true" : "false");
menu.setAttribute("aria-hidden", open ? "false" : "true");
}
function closePostMetaMenus(except, restoreFocus) {
document.querySelectorAll(".post-drop-meta.is-open").forEach(function (menuRoot) {
if (menuRoot === except) return;
var toggle = menuRoot.querySelector(".post-drop-meta__toggle");
setPostMetaMenuState(menuRoot, false);
if (restoreFocus && toggle) toggle.focus();
});
}
function initPostMetaMenus(root) {
var scope = root || document;
var menuRoots = [];
if (scope.nodeType === 1 && scope.matches(".post-drop-meta")) {
menuRoots.push(scope);
}
scope.querySelectorAll(".post-drop-meta").forEach(function (menuRoot) {
menuRoots.push(menuRoot);
});
menuRoots.forEach(function (menuRoot) {
var toggle = menuRoot.querySelector(".post-drop-meta__toggle");
var menu = menuRoot.querySelector(".post-drop-meta__menu");
if (!toggle || !menu || toggle.dataset.postMetaMenuBound) return;
toggle.dataset.postMetaMenuBound = "1";
setPostMetaMenuState(menuRoot, false);
toggle.addEventListener("click", function () {
var open = !menuRoot.classList.contains("is-open");
closePostMetaMenus(menuRoot, false);
setPostMetaMenuState(menuRoot, open);
});
menu.addEventListener("click", function (event) {
if (event.target.closest(".post-drop-meta__item")) {
setPostMetaMenuState(menuRoot, false);
}
});
});
if (menuRoots.length && !postMetaDocumentEventsBound) {
postMetaDocumentEventsBound = true;
document.addEventListener("click", function (event) {
if (!event.target.closest(".post-drop-meta")) {
closePostMetaMenus(null, false);
}
});
document.addEventListener("keydown", function (event) {
if (event.key === "Escape") {
closePostMetaMenus(null, true);
}
});
}
}
function getBaseStatCount(statName) {
var statEl = document.querySelector('[data-stat-count="' + statName + '"][data-base-count]');
return statEl ? (parseInt(statEl.dataset.baseCount, 10) || 0) : 0;
@@ -2104,6 +2172,7 @@ tbquire.config({
window.AksrtFrontend.register("aksrt-search-clear", function () { initSearchClear(); });
window.AksrtFrontend.register("aksrt-article-tools", function () { initArticleTools(); });
window.AksrtFrontend.register("aksrt-post-meta-menus", function (root) { initPostMetaMenus(root); });
window.AksrtFrontend.register("aksrt-password-toggles", function (root) { initPasswordToggles(root); });
window.AksrtFrontend.register("aksrt-interaction-bar", function (root) { initInteractionBar(root); });
})();
+69
View File
@@ -78,6 +78,74 @@
});
}
var postMetaDocumentEventsBound = false;
function setPostMetaMenuState(menuRoot, open) {
var toggle = menuRoot.querySelector(".post-drop-meta__toggle");
var menu = menuRoot.querySelector(".post-drop-meta__menu");
if (!toggle || !menu) return;
menuRoot.classList.toggle("is-open", open);
toggle.setAttribute("aria-expanded", open ? "true" : "false");
menu.setAttribute("aria-hidden", open ? "false" : "true");
}
function closePostMetaMenus(except, restoreFocus) {
document.querySelectorAll(".post-drop-meta.is-open").forEach(function (menuRoot) {
if (menuRoot === except) return;
var toggle = menuRoot.querySelector(".post-drop-meta__toggle");
setPostMetaMenuState(menuRoot, false);
if (restoreFocus && toggle) toggle.focus();
});
}
function initPostMetaMenus(root) {
var scope = root || document;
var menuRoots = [];
if (scope.nodeType === 1 && scope.matches(".post-drop-meta")) {
menuRoots.push(scope);
}
scope.querySelectorAll(".post-drop-meta").forEach(function (menuRoot) {
menuRoots.push(menuRoot);
});
menuRoots.forEach(function (menuRoot) {
var toggle = menuRoot.querySelector(".post-drop-meta__toggle");
var menu = menuRoot.querySelector(".post-drop-meta__menu");
if (!toggle || !menu || toggle.dataset.postMetaMenuBound) return;
toggle.dataset.postMetaMenuBound = "1";
setPostMetaMenuState(menuRoot, false);
toggle.addEventListener("click", function () {
var open = !menuRoot.classList.contains("is-open");
closePostMetaMenus(menuRoot, false);
setPostMetaMenuState(menuRoot, open);
});
menu.addEventListener("click", function (event) {
if (event.target.closest(".post-drop-meta__item")) {
setPostMetaMenuState(menuRoot, false);
}
});
});
if (menuRoots.length && !postMetaDocumentEventsBound) {
postMetaDocumentEventsBound = true;
document.addEventListener("click", function (event) {
if (!event.target.closest(".post-drop-meta")) {
closePostMetaMenus(null, false);
}
});
document.addEventListener("keydown", function (event) {
if (event.key === "Escape") {
closePostMetaMenus(null, true);
}
});
}
}
function getBaseStatCount(statName) {
var statEl = document.querySelector('[data-stat-count="' + statName + '"][data-base-count]');
return statEl ? (parseInt(statEl.dataset.baseCount, 10) || 0) : 0;
@@ -261,6 +329,7 @@
window.AksrtFrontend.register("aksrt-search-clear", function () { initSearchClear(); });
window.AksrtFrontend.register("aksrt-article-tools", function () { initArticleTools(); });
window.AksrtFrontend.register("aksrt-post-meta-menus", function (root) { initPostMetaMenus(root); });
window.AksrtFrontend.register("aksrt-password-toggles", function (root) { initPasswordToggles(root); });
window.AksrtFrontend.register("aksrt-interaction-bar", function (root) { initInteractionBar(root); });
})();
+35
View File
@@ -531,6 +531,39 @@
});
}
function bindCharacterCount(editor) {
var counter = null;
function getCounter() {
var container = editor.getContainer();
var statusbar = container && container.querySelector('.mce-statusbar .mce-container-body');
if (!statusbar) {
return null;
}
counter = counter || statusbar.querySelector('[data-submit-word-count]');
if (!counter) {
counter = document.createElement('span');
counter.className = 'mce-wordcount aksrt-submit-word-count';
counter.setAttribute('data-submit-word-count', '');
counter.setAttribute('aria-live', 'polite');
statusbar.appendChild(counter);
}
return counter;
}
function updateCount() {
var count = String((editor.getBody() && editor.getBody().textContent) || '')
.replace(/\s+/g, '').length;
var element = getCounter();
if (element) {
element.textContent = '字数:' + count;
}
}
editor.on('init SetContent input keyup change Undo Redo', updateCount);
}
function openCodeModal(editor) {
var selected = editor.dom.getParent(editor.selection.getNode(), 'pre.enlighter-pre');
var code = selected ? selected.querySelector('code') : null;
@@ -591,6 +624,8 @@
}
window.tinymce.PluginManager.add('aksrt_editor_tools', function (editor) {
bindCharacterCount(editor);
if (editorCfg.canUploadImage) {
editor.addButton('aksrt_image', {
text: '',
-49
View File
@@ -3,7 +3,6 @@
*
* 提供前台编辑页面的增强功能:
* - 自动保存草稿
* - 字数统计
* - 标签建议
* - 快捷键支持
*
@@ -27,8 +26,6 @@
contentSelector: 'textarea[name="content"], textarea[name="topic_content"]',
tagsSelector: 'input[name="tags"], input[name="topic_tags"]',
autoSaveInterval: 30000, // 30秒
maxTitleLength: 200,
maxContentLength: 100000,
draftKey: '',
}, options || {});
@@ -47,9 +44,6 @@
this.contentTextarea = this.form.querySelector(this.options.contentSelector);
this.tagsInput = this.form.querySelector(this.options.tagsSelector);
// 字数统计
this.initWordCount();
// 自动保存草稿
this.initAutoSave();
@@ -73,49 +67,6 @@
});
};
PageEdit.prototype.initWordCount = function () {
var self = this;
// 创建字数统计显示
this.wordCountEl = document.createElement('div');
this.wordCountEl.className = 'aksrt-page-edit__word-count';
if (this.titleInput) {
var titleCount = document.createElement('span');
titleCount.className = 'aksrt-page-edit__title-count';
this.titleInput.parentNode.appendChild(titleCount);
this.titleInput.addEventListener('input', function () {
var len = self.titleInput.value.length;
titleCount.textContent = len + '/' + self.options.maxTitleLength;
titleCount.classList.toggle('aksrt-page-edit__count--warn', len > self.options.maxTitleLength * 0.9);
titleCount.classList.toggle('aksrt-page-edit__count--error', len > self.options.maxTitleLength);
});
}
if (this.contentTextarea) {
this.contentTextarea.parentNode.appendChild(this.wordCountEl);
this.updateWordCount();
this.contentTextarea.addEventListener('input', function () {
self.updateWordCount();
});
}
};
PageEdit.prototype.updateWordCount = function () {
if (!this.contentTextarea || !this.wordCountEl) return;
var text = this.contentTextarea.value;
var chars = text.length;
var words = text.trim() ? text.trim().split(/\s+/).length : 0;
var chinese = (text.match(/[一-鿿]/g) || []).length;
this.wordCountEl.textContent = '字数: ' + chars + ' | 词数: ' + words + ' | 中文: ' + chinese;
this.wordCountEl.classList.toggle('aksrt-page-edit__count--warn', chars > this.options.maxContentLength * 0.9);
this.wordCountEl.classList.toggle('aksrt-page-edit__count--error', chars > this.options.maxContentLength);
};
PageEdit.prototype.initAutoSave = function () {
var self = this;