diff --git a/assets/admin/src/schema/sections/post-list/comment.js b/assets/admin/src/schema/sections/post-list/comment.js index bf672280..aac10c7d 100644 --- a/assets/admin/src/schema/sections/post-list/comment.js +++ b/assets/admin/src/schema/sections/post-list/comment.js @@ -23,6 +23,10 @@ export const commentSchema = { comment_hot_threshold: 10, comment_quick_s: true, comment_city_s: true, + comment_city_type: 'province_city', + comment_quick_often: '不错,学习了 +感谢分享 +期待更新', comment_author_tag: true, comment_corderby: true, comment_empty_text: '暂无评论,来做第一个评论的人吧~', @@ -83,6 +87,14 @@ export const commentSchema = { { key: 'comment_like_s', label: '评论点赞', type: 'switch', default: true }, { key: 'comment_quick_s', label: '快捷回复', type: 'switch', default: true }, { key: 'comment_city_s', label: '评论城市', type: 'switch', default: true }, + { key: 'comment_city_type', label: '城市显示格式', type: 'radio', default: 'province_city', options: [ + { label: '省份+城市', value: 'province_city' }, + { label: '仅省份', value: 'province' }, + { label: '国家+省份', value: 'country_province' }, + ], dependsOn: { key: 'comment_city_s', value: true } }, + { key: 'comment_quick_often', label: '快捷回复短语', type: 'textarea', default: '不错,学习了 +感谢分享 +期待更新', help: '每行一条', dependsOn: { key: 'comment_quick_s', value: true } }, { key: 'comment_author_tag', label: '作者标签', type: 'switch', default: true }, { key: 'comment_corderby', label: '评论排序切换', type: 'switch', default: true, help: '前台显示最新/最早/最热切换按钮' }, ], diff --git a/assets/css/frontend/comments.css b/assets/css/frontend/comments.css index 37527bc7..aa95ba3b 100644 --- a/assets/css/frontend/comments.css +++ b/assets/css/frontend/comments.css @@ -1,784 +1,4 @@ -/* ============================================================ - * AKSRT Comments — v4.0 Zibll-Inspired - * - * 功能: - * - 评论表单(头像 + 输入框 + 操作栏) - * - 评论列表(嵌套回复 + 头像 + 时间) - * - 排序/过滤栏 - * - 空状态 - * - 移动端固定底部输入框(可选) - * ============================================================ */ - -/* ============================================================ - * 评论区容器 - * ============================================================ */ -.comments-area { - margin: 0; - padding: 0; - /* 对齐 zibll: 45px */ - --aksrt-comment-avatar: 45px; - --aksrt-comment-avatar-form: 45px; - --aksrt-comment-indent: 48px; -} - -/* 评论标题 */ -.comments-header { - margin-bottom: 16px; -} - -.comments-title { - font-size: 1rem; - font-weight: 700; - margin: 0; - display: flex; - align-items: center; - gap: 8px; - color: var(--color-ink); -} - -.comments-title i { - color: var(--color-primary); - font-size: 16px; -} - -.comments-count { - font-size: 0.8125rem; - font-weight: 400; - color: var(--color-ink-4); -} - -/* ============================================================ - * 登录提示 - * ============================================================ */ -.comment-login-prompt { - margin-bottom: 20px; -} - -.comment-login-prompt__inner { - display: flex; - align-items: center; - gap: 12px; - padding: 16px 18px; - border-radius: var(--main-radius, var(--radius, 8px)); - background: var(--surface-1); - border: none; - box-shadow: var(--shadow-sm); - font-size: 14px; - color: var(--color-ink-4); -} - -.comment-login-prompt__inner i { - font-size: 16px; - color: var(--color-ink-4); -} - -.comment-login-prompt__btns { - margin-left: auto; - display: flex; - gap: 8px; -} - -/* ============================================================ - * 评论表单 - * ============================================================ */ -.comment-respond { - margin-bottom: 20px; -} - -.comment-form__inner { - display: flex; - gap: 10px; - align-items: flex-start; -} - -.comment-form__avatar { - flex-shrink: 0; -} - -.comment-form__avatar img { - width: var(--aksrt-comment-avatar-form); - height: var(--aksrt-comment-avatar-form); - border-radius: 50%; - object-fit: cover; -} - -.comment-form__avatar-placeholder { - width: var(--aksrt-comment-avatar-form); - height: var(--aksrt-comment-avatar-form); - border-radius: 50%; - background: var(--surface-3); - display: flex; - align-items: center; - justify-content: center; - color: var(--color-ink-4); -} - -.comment-form__body { - flex: 1; - min-width: 0; -} - -.comment-form__reply-info { - font-size: 0.8125rem; - color: var(--color-ink-4); - margin-bottom: 8px; - display: flex; - align-items: center; - gap: 8px; -} - -.comment-form__cancel-reply { - color: var(--color-error, #ef4444); - font-size: 12px; -} - -.comment-form__textarea { - width: 100%; - min-height: 96px; - resize: vertical; - border-radius: 10px; - border: 1px solid var(--color-line); - padding: 12px 14px; - font-size: 14px; - background: var(--surface-4, var(--main-bg-color, var(--surface-1))); - color: var(--color-ink); - transition: border-color 0.2s ease, box-shadow 0.2s ease; -} - -.comment-form__textarea:focus { - outline: none; - border-color: var(--color-primary); - box-shadow: 0 0 0 3px var(--color-primary-soft); -} - -.comment-form__actions { - display: flex; - align-items: center; - justify-content: space-between; - margin-top: 10px; - gap: 8px; -} - -.comment-form__tools { - display: flex; - gap: 8px; -} - -.comment-form__submit-area { - display: flex; - align-items: center; - gap: 8px; - margin-left: auto; - flex-wrap: wrap; - justify-content: flex-end; -} - -.comment-form__guest { - display: flex; - flex-direction: column; - align-items: flex-end; - gap: 6px; -} - -.comment-form__guest-toggle { - background: none; - border: 0; - padding: 0; - cursor: pointer; - color: var(--muted-color, #8b9198); - white-space: nowrap; -} - -.comment-form__guest-toggle:hover, -.comment-form__guest-toggle[aria-expanded="true"] { - color: var(--focus-color, #f04494); -} - -.comment-form__guest-fields { - display: flex; - gap: 6px; - align-items: center; - max-height: 0; - overflow: hidden; - opacity: 0; - transition: max-height 0.2s ease, opacity 0.15s ease; -} - -.comment-form__guest-fields.is-open, -.comment-form__guest-fields:not([hidden]) { - max-height: 48px; - opacity: 1; -} - -.comment-form__guest-field { - width: 110px; - height: 30px; - font-size: 12px; - padding: 0 8px; -} - -.comt-box .comt-textarea, -.comt-box #comment { - min-height: 72px; - padding: 10px 12px; - border-radius: 8px; - font-size: 13px; - line-height: 1.5; - margin-bottom: 6px; -} - -.comt-ctrl { - display: flex; - align-items: center; - gap: 8px; - flex-wrap: wrap; -} - -.comment-form__submit { - height: 30px; - padding: 0 12px; - font-size: 13px; -} - -.comment-form__submit { - display: inline-flex; - align-items: center; - gap: 6px; -} - -/* ============================================================ - * 排序/过滤栏 - * ============================================================ */ -.comment-filter { - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 0; - margin-bottom: 12px; - border-bottom: 1px solid var(--color-line); -} - -.comment-filter__tabs { - display: flex; - list-style: none; - margin: 0; - padding: 0; - gap: 4px; -} - -.comment-filter__tabs li a { - display: inline-block; - padding: 4px 12px; - border-radius: 4px; - font-size: 13px; - font-weight: 500; - color: var(--color-ink-4); - text-decoration: none; - transition: background 0.15s ease, color 0.15s ease; -} - -.comment-filter__tabs li a:hover { - background: var(--surface-3); - color: var(--color-ink); -} - -.comment-filter__tabs li.active a { - background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); - color: var(--color-primary); - font-weight: 600; -} - -/* Zibll-compatible class names used by aksrt-comments.php */ -.comment-order-box { - display: flex; - list-style: none; - margin: 0; - padding: 0; - gap: 4px; -} -.comment-order-box li a, -.comment-order-box .comment-orderby { - display: inline-block; - padding: 4px 12px; - border-radius: 4px; - font-size: 13px; - font-weight: 500; - color: var(--color-ink-4); - text-decoration: none; - transition: background 0.15s ease, color 0.15s ease; -} -.comment-order-box li a:hover, -.comment-order-box .comment-orderby:hover { - background: var(--surface-3); - color: var(--color-ink); -} -.comment-order-box li.active a, -.comment-order-box li.active .comment-orderby { - background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); - color: var(--color-primary); - font-weight: 600; -} -.btn-only-author, -.comment-author-filter { - display: inline-flex; - align-items: center; - padding: 4px 12px; - border-radius: 999px; - border: 1px solid var(--color-line); - background: var(--surface-1); - color: var(--color-ink-3); - font-size: 12px; - font-weight: 600; - text-decoration: none; - transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; -} -.btn-only-author:hover, -.comment-author-filter:hover { - border-color: var(--color-primary); - color: var(--color-primary); -} -.btn-only-author.active, -.comment-author-filter.active { - border-color: var(--color-primary); - background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); - color: var(--color-primary); -} - -/* ============================================================ - * 评论列表 - * ============================================================ */ -.comment-list { - list-style: none; - margin: 0; - padding: 0; -} - -.comment-list .comment { - padding: 16px 0; - border-bottom: 1px solid var(--color-line); -} - -.comment-list .comment:last-child { - border-bottom: none; -} - -/* 嵌套回复 — 对齐 zibll: 86px 缩进 + 灰色背景 */ -.comment-list .children { - list-style: none; - margin: 0; - margin-left: 86px; -} - -.comment-list .children .comment { - padding: 14px 16px; - background: var(--surface-4, rgba(0, 0, 0, 0.03)); - border: 1px solid var(--color-line-soft); - border-radius: var(--radius-lg); -} - -/* 深层嵌套缩进递减 */ -.comment-list .children .children { - margin-left: 13px; -} - -/* 评论项内部结构(由 aksrt_comment_callback 渲染) */ -.aksrt-comment__body { - display: flex; - gap: 12px; -} - -.aksrt-comment__avatar { - flex-shrink: 0; -} - -.aksrt-comment__avatar img { - width: var(--aksrt-comment-avatar); - height: var(--aksrt-comment-avatar); - border-radius: 50%; - object-fit: cover; - margin-right: 20px; -} - -.aksrt-comment__content { - flex: 1; - min-width: 0; -} - -.aksrt-comment__header { - display: flex; - align-items: center; - gap: 8px; - margin-bottom: 6px; - flex-wrap: wrap; -} - -.aksrt-comment__author { - font-weight: 600; - font-size: 14px; - color: var(--color-ink); -} - -.aksrt-comment__author a { - color: inherit; -} - -.aksrt-comment__author a:hover { - color: var(--color-primary); -} - -.aksrt-comment__badge { - font-size: 10px; - padding: 1px 6px; - border-radius: 3px; - background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); - color: var(--color-primary); - font-weight: 500; -} - -.aksrt-comment__time { - font-size: 12px; - color: var(--color-ink-4); -} - -.aksrt-comment__text { - font-size: 14px; - line-height: 1.6; - color: var(--color-ink); - margin: 0 0 8px; - word-wrap: break-word; - white-space: pre-wrap; -} - -/* 对齐 zibll: 评论内图片限制 */ -.aksrt-comment__text img:not(.smilie-icon) { - max-width: 260px; - max-height: 350px; -} - -.aksrt-comment__text p { - margin: 0 0 8px; -} - -.aksrt-comment__text p:last-child { - margin-bottom: 0; -} - -.aksrt-comment__actions { - display: flex; - gap: 12px; - font-size: 12px; -} - -.aksrt-comment__actions a, -.aksrt-comment__actions button { - color: var(--color-ink-4); - background: none; - border: none; - padding: 0; - cursor: pointer; - font-size: 12px; - display: inline-flex; - align-items: center; - gap: 4px; - transition: color 0.15s ease; -} - -.aksrt-comment__actions a:hover, -.aksrt-comment__actions button:hover { - color: var(--color-primary); -} - -/* 嵌套回复中的头像更小 */ -/* 对齐 zibll: 嵌套头像 26px */ -.children .aksrt-comment__avatar img { - width: 26px; - height: 26px; - margin-right: 6px; - vertical-align: 2px; -} - -/* ============================================================ - * 空状态 - * ============================================================ */ -.comments-empty { - text-align: center; - padding: 40px 20px; -} - -.comments-empty__icon { - font-size: 48px; - color: var(--color-ink-4); - opacity: 0.4; - margin-bottom: 12px; -} - -.comments-empty__text { - font-size: 1rem; - font-weight: 600; - color: var(--color-ink-4); - margin: 0 0 4px; -} - -.comments-empty__hint { - font-size: 0.8125rem; - color: var(--color-ink-4); - margin: 0; -} - -.comments-closed { - text-align: center; - font-size: 14px; - color: var(--color-ink-4); - padding: 20px; -} - -/* ============================================================ - * 评论分页 - * ============================================================ */ -.comment-pagination { - text-align: center; - padding: 16px 0; -} - -/* ============================================================ - * 移动端适配 - * ============================================================ */ -@media (max-width: 767px) { - .comment-form__inner { - flex-direction: column; - gap: 8px; - } - - .comment-form__avatar { - display: none; - } - - .comment-form__submit-area { - flex-wrap: wrap; - } - - .comment-form__guest-field { - width: 100%; - } - - .comment-list .children { - margin-left: 0; - } - - .children .aksrt-comment__avatar img { - width: 36px; - height: 36px; - } - - /* 移动端评论输入吸底 — 模仿 zibll mobile-fixed */ - .comment-respond.comment-form--mobile-fixed { - position: fixed; - bottom: 0; - left: 0; - right: 0; - z-index: var(--z-sticky, 200); - background: var(--surface-1); - border-top: 1px solid var(--color-line); - box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08); - padding: 12px 16px; - padding-bottom: max(12px, env(safe-area-inset-bottom)); - } - - .comment-respond.comment-form--mobile-fixed .comment-form__textarea { - min-height: 44px; - max-height: 120px; - } - - .comment-respond.comment-form--mobile-fixed .comment-form__submit-area { - margin-top: 8px; - } - - /* 当评论区可见时隐藏吸底输入框 */ - .comment-respond.comment-form--mobile-fixed.is-visible { - display: none; - } -} - -/* ============================================================ - * 暗色模式 - * ============================================================ */ -html.dark .comment-form__textarea, -body.dark-theme .comment-form__textarea { - background: var(--surface-2); - border-color: var(--color-line); -} - -.theme-dark .comment-login-prompt__inner, -html.dark .comment-login-prompt__inner, -body.dark-theme .comment-login-prompt__inner { - background: var(--surface-1); -} - -/* ============================================================ - * 评论操作按钮(编辑/删除/审核) - * ============================================================ */ -.aksrt-comment-actions { - display: flex; - align-items: center; - gap: 8px; - margin-top: 8px; -} - -.aksrt-comment-action-btn { - display: inline-flex; - align-items: center; - gap: 4px; - padding: 3px 10px; - border: 1px solid var(--color-line, rgba(50, 50, 50, 0.1)); - border-radius: var(--radius, 8px); - background: var(--surface-1, #fff); - color: var(--color-ink-3, #777); - font-size: 12px; - font-weight: 500; - cursor: pointer; - transition: all 0.15s ease; -} - -.aksrt-comment-action-btn:hover { - border-color: var(--color-primary); - color: var(--color-primary); - background: var(--color-primary-soft, rgba(240, 68, 148, 0.08)); -} - -.aksrt-comment-action-btn--danger:hover { - border-color: var(--color-error); - color: var(--color-error); - background: rgba(239, 68, 68, 0.08); -} - -.aksrt-comment-action-btn--success:hover { - border-color: var(--color-success); - color: var(--color-success); - background: rgba(16, 185, 129, 0.08); -} - -.aksrt-comment-edit-form { - margin: 8px 0; -} - -.aksrt-comment-edit-textarea { - width: 100%; - min-height: 80px; - padding: 8px 12px; - border: 1px solid var(--color-line, #ddd); - border-radius: var(--radius, 8px); - font-size: 14px; - font-family: var(--font-body); - color: var(--color-ink); - background: var(--surface-1, #fff); - resize: vertical; - transition: border-color 0.15s; -} - -.aksrt-comment-edit-textarea:focus { - outline: none; - border-color: var(--color-primary); -} - -/* ============================================================ - * 评论互动:点赞 / 置顶 / 内联管理动作(统一合同) - * 这些动作均渲染在 .aksrt-comment__actions 内,复用其文字链按钮样式, - * 仅补充点赞激活态、置顶徽章与危险/成功色提示。 - * ============================================================ */ -.aksrt-comment__like.is-active, -.aksrt-comment__like.is-active i { - color: var(--color-primary); -} - -.aksrt-comment__like-count { - font-variant-numeric: tabular-nums; -} - -.aksrt-comment__action--danger:hover { - color: var(--color-error, #ef4444); -} - -.aksrt-comment__action--success:hover { - color: var(--color-success, #10b981); -} - -/* 置顶徽章 */ -.aksrt-comment__badge--pinned { - background: var(--color-warning-soft, rgba(245, 158, 11, 0.14)); - color: var(--color-warning, #d97706); - display: inline-flex; - align-items: center; - gap: 3px; -} - -/* 置顶评论容器高亮 */ -.aksrt-comment--pinned > .aksrt-comment__body { - position: relative; -} - -.comment-list .comment.aksrt-comment--pinned { - background: var(--color-warning-soft, rgba(245, 158, 11, 0.06)); - border-radius: var(--radius, 8px); - padding-left: 12px; - padding-right: 12px; -} - -/* zibll compat: emoji icon forced 30px */ -.comment-content .smilie-icon, -.comment-form .smilie-icon { - width: 30px !important; -} - -/* zibll compat: code block in comments */ -.comment-content .enlighter-default { - margin-bottom: 0; - opacity: 0.9; -} - - -/* Identity chips + 神评 */ -.aksrt-identity-chip { - display: inline-flex; - align-items: center; - gap: 3px; - vertical-align: middle; - max-width: 9em; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.aksrt-identity-chip--comment { - font-size: 11px; - padding: 0 6px; -} -.medal-icon.img-icon, -.aksrt-identity-medal { - display: inline-block; - width: 1.35em; - height: 1.35em; - object-fit: contain; - vertical-align: middle; - margin-left: 4px; -} -.aksrt-identity-medal--comment { - width: 1.15em; - height: 1.15em; -} -.aksrt-identity-medal.is-wear { - outline: 1px solid rgba(245, 158, 11, 0.45); - border-radius: 3px; -} -.aksrt-comment__badge--hot { - color: #ea580c; - background: rgba(234, 88, 12, 0.1); - border-radius: 999px; - padding: 0 6px; - margin-left: 4px; - font-size: 11px; -} -.aksrt-comment__header .author-box { - display: flex; - flex-wrap: wrap; - align-items: center; - gap: 4px; -} +/* AKSRT comments aggregator */ +@import url("./comments/shell.css"); +@import url("./comments/mobile-item.css"); +@import url("./comment-tools.css"); diff --git a/assets/css/frontend/comments/mobile-item.css b/assets/css/frontend/comments/mobile-item.css new file mode 100644 index 00000000..705ed394 --- /dev/null +++ b/assets/css/frontend/comments/mobile-item.css @@ -0,0 +1,89 @@ +/* Zibll 1:1 FixedInput / virtual-input / item chrome */ +.virtual-input { display: none; } +@media (max-width: 767.98px) { + .virtual-input { + display: flex; align-items: center; gap: 10px; + padding: 10px 12px; margin-bottom: 12px; border-radius: 999px; + background: var(--surface-1, #fff); + box-shadow: var(--shadow-sm, 0 1px 4px rgba(0,0,0,.06)); + cursor: pointer; + } + .virtual-input .avatar-img { width: 32px; height: 32px; border-radius: 50%; } + .virtual-input .simulation { flex: 1; color: var(--color-ink-4, #999); font-size: 13px; } + #respond.mobile-fixed { + position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; + background: var(--surface-1, #fff); + border-radius: 12px 12px 0 0; + box-shadow: 0 -8px 28px rgba(0,0,0,.12); + padding: 12px 14px max(12px, env(safe-area-inset-bottom)); + transform: translateY(110%); transition: transform .25s ease; + max-height: 85vh; overflow: auto; + } + #respond.mobile-fixed.show { transform: translateY(0); } + #respond.mobile-fixed .fixed-body { + position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: -1; + opacity: 0; pointer-events: none; transition: opacity .2s ease; + } + #respond.mobile-fixed.show .fixed-body { opacity: 1; pointer-events: auto; } + #respond.mobile-fixed .comt-title { display: none; } +} +.comment-header .author-box { display: flex; align-items: center; gap: 8px; width: 100%; } +.comment-header .author-box name, +.comment-header .author-box .flex1 { flex: 1; min-width: 0; } +.comment-header .aksrt-comment__like, +.comment-header .action-comment-like { + margin-left: auto; display: inline-flex; align-items: center; gap: 4px; + color: var(--color-ink-3, #888); text-decoration: none; font-size: 13px; +} +.comment-header .aksrt-comment__like.is-active { color: var(--color-primary, #2060ef); } +.comt-meta { + display: flex; flex-wrap: wrap; align-items: center; gap: 8px; + font-size: 12px; margin-top: 6px; +} +.comt-meta .reply-link a, .comt-meta .comment-reply-link { color: var(--color-ink-3, #777); } +.comment-action-dropdown .dropdown-menu { min-width: 140px; padding: 6px 0; } +.comment-action-dropdown .dropdown-menu a { + display: block; padding: 6px 14px; color: var(--color-ink, #333); + text-decoration: none; font-size: 13px; +} +.comment-action-dropdown .dropdown-menu a:hover { background: var(--surface-2, #f5f5f5); } +.smilie-icon { width: 30px; height: 30px; vertical-align: -8px; display: inline-block; } +.comment-inline-img, .comment-content .box-img { + max-width: 260px; max-height: 350px; border-radius: 6px; display: block; margin: 6px 0; +} +.comment-code { + background: var(--surface-2, #f6f8fa); padding: 10px 12px; border-radius: 6px; + overflow: auto; font-size: 12px; +} +.commentlist .children { margin-left: 86px; padding-left: 0; list-style: none; } +.commentlist .children .children { margin-left: 23px; } +.commentlist .children .comt-avatar, +.commentlist .children .avatar-img.comt-avatar { width: 26px !important; height: 26px !important; } +.input-expand-wrap { display: inline-block; position: relative; } +.input-expand-wrap .dropdown-menu, +.input-expand-wrap .dropdown-smilie { + display: none; position: absolute; bottom: 100%; left: 0; z-index: 20; + background: var(--surface-1, #fff); box-shadow: 0 6px 24px rgba(0,0,0,.12); + border-radius: 8px; padding: 8px; +} +.input-expand-wrap.open > .dropdown-menu, +.input-expand-wrap.open .dropdown-smilie, +.dropup.open > .dropdown-menu { display: block; } +.dropdown-smilie { + display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; + max-width: 280px; max-height: 200px; overflow: auto; +} +.dropdown-smilie a img { width: 28px; height: 28px; } +.quick-reply-item { + display: block; padding: 6px 10px; color: var(--color-ink, #333); + text-decoration: none; font-size: 13px; +} +.quick-reply-item:hover { background: var(--surface-2, #f5f5f5); } +.comt-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; } +.comt-tips-left { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1; } +.comt-tips-right { margin-left: auto; display: flex; align-items: center; gap: 8px; } +#comments .comt-title { width: 90px; } +#comments .comt-title .comt-avatar img, +#comments .comt-avatar .avatar-img { width: 60px; height: 60px; border-radius: 50%; } +#comments .comt-box #comment { min-height: 88px; resize: vertical; } +@media (min-width: 768px) { .hide-pc { display: none !important; } } diff --git a/assets/css/frontend/comments/shell.css b/assets/css/frontend/comments/shell.css new file mode 100644 index 00000000..37527bc7 --- /dev/null +++ b/assets/css/frontend/comments/shell.css @@ -0,0 +1,784 @@ +/* ============================================================ + * AKSRT Comments — v4.0 Zibll-Inspired + * + * 功能: + * - 评论表单(头像 + 输入框 + 操作栏) + * - 评论列表(嵌套回复 + 头像 + 时间) + * - 排序/过滤栏 + * - 空状态 + * - 移动端固定底部输入框(可选) + * ============================================================ */ + +/* ============================================================ + * 评论区容器 + * ============================================================ */ +.comments-area { + margin: 0; + padding: 0; + /* 对齐 zibll: 45px */ + --aksrt-comment-avatar: 45px; + --aksrt-comment-avatar-form: 45px; + --aksrt-comment-indent: 48px; +} + +/* 评论标题 */ +.comments-header { + margin-bottom: 16px; +} + +.comments-title { + font-size: 1rem; + font-weight: 700; + margin: 0; + display: flex; + align-items: center; + gap: 8px; + color: var(--color-ink); +} + +.comments-title i { + color: var(--color-primary); + font-size: 16px; +} + +.comments-count { + font-size: 0.8125rem; + font-weight: 400; + color: var(--color-ink-4); +} + +/* ============================================================ + * 登录提示 + * ============================================================ */ +.comment-login-prompt { + margin-bottom: 20px; +} + +.comment-login-prompt__inner { + display: flex; + align-items: center; + gap: 12px; + padding: 16px 18px; + border-radius: var(--main-radius, var(--radius, 8px)); + background: var(--surface-1); + border: none; + box-shadow: var(--shadow-sm); + font-size: 14px; + color: var(--color-ink-4); +} + +.comment-login-prompt__inner i { + font-size: 16px; + color: var(--color-ink-4); +} + +.comment-login-prompt__btns { + margin-left: auto; + display: flex; + gap: 8px; +} + +/* ============================================================ + * 评论表单 + * ============================================================ */ +.comment-respond { + margin-bottom: 20px; +} + +.comment-form__inner { + display: flex; + gap: 10px; + align-items: flex-start; +} + +.comment-form__avatar { + flex-shrink: 0; +} + +.comment-form__avatar img { + width: var(--aksrt-comment-avatar-form); + height: var(--aksrt-comment-avatar-form); + border-radius: 50%; + object-fit: cover; +} + +.comment-form__avatar-placeholder { + width: var(--aksrt-comment-avatar-form); + height: var(--aksrt-comment-avatar-form); + border-radius: 50%; + background: var(--surface-3); + display: flex; + align-items: center; + justify-content: center; + color: var(--color-ink-4); +} + +.comment-form__body { + flex: 1; + min-width: 0; +} + +.comment-form__reply-info { + font-size: 0.8125rem; + color: var(--color-ink-4); + margin-bottom: 8px; + display: flex; + align-items: center; + gap: 8px; +} + +.comment-form__cancel-reply { + color: var(--color-error, #ef4444); + font-size: 12px; +} + +.comment-form__textarea { + width: 100%; + min-height: 96px; + resize: vertical; + border-radius: 10px; + border: 1px solid var(--color-line); + padding: 12px 14px; + font-size: 14px; + background: var(--surface-4, var(--main-bg-color, var(--surface-1))); + color: var(--color-ink); + transition: border-color 0.2s ease, box-shadow 0.2s ease; +} + +.comment-form__textarea:focus { + outline: none; + border-color: var(--color-primary); + box-shadow: 0 0 0 3px var(--color-primary-soft); +} + +.comment-form__actions { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 10px; + gap: 8px; +} + +.comment-form__tools { + display: flex; + gap: 8px; +} + +.comment-form__submit-area { + display: flex; + align-items: center; + gap: 8px; + margin-left: auto; + flex-wrap: wrap; + justify-content: flex-end; +} + +.comment-form__guest { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 6px; +} + +.comment-form__guest-toggle { + background: none; + border: 0; + padding: 0; + cursor: pointer; + color: var(--muted-color, #8b9198); + white-space: nowrap; +} + +.comment-form__guest-toggle:hover, +.comment-form__guest-toggle[aria-expanded="true"] { + color: var(--focus-color, #f04494); +} + +.comment-form__guest-fields { + display: flex; + gap: 6px; + align-items: center; + max-height: 0; + overflow: hidden; + opacity: 0; + transition: max-height 0.2s ease, opacity 0.15s ease; +} + +.comment-form__guest-fields.is-open, +.comment-form__guest-fields:not([hidden]) { + max-height: 48px; + opacity: 1; +} + +.comment-form__guest-field { + width: 110px; + height: 30px; + font-size: 12px; + padding: 0 8px; +} + +.comt-box .comt-textarea, +.comt-box #comment { + min-height: 72px; + padding: 10px 12px; + border-radius: 8px; + font-size: 13px; + line-height: 1.5; + margin-bottom: 6px; +} + +.comt-ctrl { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; +} + +.comment-form__submit { + height: 30px; + padding: 0 12px; + font-size: 13px; +} + +.comment-form__submit { + display: inline-flex; + align-items: center; + gap: 6px; +} + +/* ============================================================ + * 排序/过滤栏 + * ============================================================ */ +.comment-filter { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 0; + margin-bottom: 12px; + border-bottom: 1px solid var(--color-line); +} + +.comment-filter__tabs { + display: flex; + list-style: none; + margin: 0; + padding: 0; + gap: 4px; +} + +.comment-filter__tabs li a { + display: inline-block; + padding: 4px 12px; + border-radius: 4px; + font-size: 13px; + font-weight: 500; + color: var(--color-ink-4); + text-decoration: none; + transition: background 0.15s ease, color 0.15s ease; +} + +.comment-filter__tabs li a:hover { + background: var(--surface-3); + color: var(--color-ink); +} + +.comment-filter__tabs li.active a { + background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); + color: var(--color-primary); + font-weight: 600; +} + +/* Zibll-compatible class names used by aksrt-comments.php */ +.comment-order-box { + display: flex; + list-style: none; + margin: 0; + padding: 0; + gap: 4px; +} +.comment-order-box li a, +.comment-order-box .comment-orderby { + display: inline-block; + padding: 4px 12px; + border-radius: 4px; + font-size: 13px; + font-weight: 500; + color: var(--color-ink-4); + text-decoration: none; + transition: background 0.15s ease, color 0.15s ease; +} +.comment-order-box li a:hover, +.comment-order-box .comment-orderby:hover { + background: var(--surface-3); + color: var(--color-ink); +} +.comment-order-box li.active a, +.comment-order-box li.active .comment-orderby { + background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); + color: var(--color-primary); + font-weight: 600; +} +.btn-only-author, +.comment-author-filter { + display: inline-flex; + align-items: center; + padding: 4px 12px; + border-radius: 999px; + border: 1px solid var(--color-line); + background: var(--surface-1); + color: var(--color-ink-3); + font-size: 12px; + font-weight: 600; + text-decoration: none; + transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; +} +.btn-only-author:hover, +.comment-author-filter:hover { + border-color: var(--color-primary); + color: var(--color-primary); +} +.btn-only-author.active, +.comment-author-filter.active { + border-color: var(--color-primary); + background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); + color: var(--color-primary); +} + +/* ============================================================ + * 评论列表 + * ============================================================ */ +.comment-list { + list-style: none; + margin: 0; + padding: 0; +} + +.comment-list .comment { + padding: 16px 0; + border-bottom: 1px solid var(--color-line); +} + +.comment-list .comment:last-child { + border-bottom: none; +} + +/* 嵌套回复 — 对齐 zibll: 86px 缩进 + 灰色背景 */ +.comment-list .children { + list-style: none; + margin: 0; + margin-left: 86px; +} + +.comment-list .children .comment { + padding: 14px 16px; + background: var(--surface-4, rgba(0, 0, 0, 0.03)); + border: 1px solid var(--color-line-soft); + border-radius: var(--radius-lg); +} + +/* 深层嵌套缩进递减 */ +.comment-list .children .children { + margin-left: 13px; +} + +/* 评论项内部结构(由 aksrt_comment_callback 渲染) */ +.aksrt-comment__body { + display: flex; + gap: 12px; +} + +.aksrt-comment__avatar { + flex-shrink: 0; +} + +.aksrt-comment__avatar img { + width: var(--aksrt-comment-avatar); + height: var(--aksrt-comment-avatar); + border-radius: 50%; + object-fit: cover; + margin-right: 20px; +} + +.aksrt-comment__content { + flex: 1; + min-width: 0; +} + +.aksrt-comment__header { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 6px; + flex-wrap: wrap; +} + +.aksrt-comment__author { + font-weight: 600; + font-size: 14px; + color: var(--color-ink); +} + +.aksrt-comment__author a { + color: inherit; +} + +.aksrt-comment__author a:hover { + color: var(--color-primary); +} + +.aksrt-comment__badge { + font-size: 10px; + padding: 1px 6px; + border-radius: 3px; + background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); + color: var(--color-primary); + font-weight: 500; +} + +.aksrt-comment__time { + font-size: 12px; + color: var(--color-ink-4); +} + +.aksrt-comment__text { + font-size: 14px; + line-height: 1.6; + color: var(--color-ink); + margin: 0 0 8px; + word-wrap: break-word; + white-space: pre-wrap; +} + +/* 对齐 zibll: 评论内图片限制 */ +.aksrt-comment__text img:not(.smilie-icon) { + max-width: 260px; + max-height: 350px; +} + +.aksrt-comment__text p { + margin: 0 0 8px; +} + +.aksrt-comment__text p:last-child { + margin-bottom: 0; +} + +.aksrt-comment__actions { + display: flex; + gap: 12px; + font-size: 12px; +} + +.aksrt-comment__actions a, +.aksrt-comment__actions button { + color: var(--color-ink-4); + background: none; + border: none; + padding: 0; + cursor: pointer; + font-size: 12px; + display: inline-flex; + align-items: center; + gap: 4px; + transition: color 0.15s ease; +} + +.aksrt-comment__actions a:hover, +.aksrt-comment__actions button:hover { + color: var(--color-primary); +} + +/* 嵌套回复中的头像更小 */ +/* 对齐 zibll: 嵌套头像 26px */ +.children .aksrt-comment__avatar img { + width: 26px; + height: 26px; + margin-right: 6px; + vertical-align: 2px; +} + +/* ============================================================ + * 空状态 + * ============================================================ */ +.comments-empty { + text-align: center; + padding: 40px 20px; +} + +.comments-empty__icon { + font-size: 48px; + color: var(--color-ink-4); + opacity: 0.4; + margin-bottom: 12px; +} + +.comments-empty__text { + font-size: 1rem; + font-weight: 600; + color: var(--color-ink-4); + margin: 0 0 4px; +} + +.comments-empty__hint { + font-size: 0.8125rem; + color: var(--color-ink-4); + margin: 0; +} + +.comments-closed { + text-align: center; + font-size: 14px; + color: var(--color-ink-4); + padding: 20px; +} + +/* ============================================================ + * 评论分页 + * ============================================================ */ +.comment-pagination { + text-align: center; + padding: 16px 0; +} + +/* ============================================================ + * 移动端适配 + * ============================================================ */ +@media (max-width: 767px) { + .comment-form__inner { + flex-direction: column; + gap: 8px; + } + + .comment-form__avatar { + display: none; + } + + .comment-form__submit-area { + flex-wrap: wrap; + } + + .comment-form__guest-field { + width: 100%; + } + + .comment-list .children { + margin-left: 0; + } + + .children .aksrt-comment__avatar img { + width: 36px; + height: 36px; + } + + /* 移动端评论输入吸底 — 模仿 zibll mobile-fixed */ + .comment-respond.comment-form--mobile-fixed { + position: fixed; + bottom: 0; + left: 0; + right: 0; + z-index: var(--z-sticky, 200); + background: var(--surface-1); + border-top: 1px solid var(--color-line); + box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08); + padding: 12px 16px; + padding-bottom: max(12px, env(safe-area-inset-bottom)); + } + + .comment-respond.comment-form--mobile-fixed .comment-form__textarea { + min-height: 44px; + max-height: 120px; + } + + .comment-respond.comment-form--mobile-fixed .comment-form__submit-area { + margin-top: 8px; + } + + /* 当评论区可见时隐藏吸底输入框 */ + .comment-respond.comment-form--mobile-fixed.is-visible { + display: none; + } +} + +/* ============================================================ + * 暗色模式 + * ============================================================ */ +html.dark .comment-form__textarea, +body.dark-theme .comment-form__textarea { + background: var(--surface-2); + border-color: var(--color-line); +} + +.theme-dark .comment-login-prompt__inner, +html.dark .comment-login-prompt__inner, +body.dark-theme .comment-login-prompt__inner { + background: var(--surface-1); +} + +/* ============================================================ + * 评论操作按钮(编辑/删除/审核) + * ============================================================ */ +.aksrt-comment-actions { + display: flex; + align-items: center; + gap: 8px; + margin-top: 8px; +} + +.aksrt-comment-action-btn { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 3px 10px; + border: 1px solid var(--color-line, rgba(50, 50, 50, 0.1)); + border-radius: var(--radius, 8px); + background: var(--surface-1, #fff); + color: var(--color-ink-3, #777); + font-size: 12px; + font-weight: 500; + cursor: pointer; + transition: all 0.15s ease; +} + +.aksrt-comment-action-btn:hover { + border-color: var(--color-primary); + color: var(--color-primary); + background: var(--color-primary-soft, rgba(240, 68, 148, 0.08)); +} + +.aksrt-comment-action-btn--danger:hover { + border-color: var(--color-error); + color: var(--color-error); + background: rgba(239, 68, 68, 0.08); +} + +.aksrt-comment-action-btn--success:hover { + border-color: var(--color-success); + color: var(--color-success); + background: rgba(16, 185, 129, 0.08); +} + +.aksrt-comment-edit-form { + margin: 8px 0; +} + +.aksrt-comment-edit-textarea { + width: 100%; + min-height: 80px; + padding: 8px 12px; + border: 1px solid var(--color-line, #ddd); + border-radius: var(--radius, 8px); + font-size: 14px; + font-family: var(--font-body); + color: var(--color-ink); + background: var(--surface-1, #fff); + resize: vertical; + transition: border-color 0.15s; +} + +.aksrt-comment-edit-textarea:focus { + outline: none; + border-color: var(--color-primary); +} + +/* ============================================================ + * 评论互动:点赞 / 置顶 / 内联管理动作(统一合同) + * 这些动作均渲染在 .aksrt-comment__actions 内,复用其文字链按钮样式, + * 仅补充点赞激活态、置顶徽章与危险/成功色提示。 + * ============================================================ */ +.aksrt-comment__like.is-active, +.aksrt-comment__like.is-active i { + color: var(--color-primary); +} + +.aksrt-comment__like-count { + font-variant-numeric: tabular-nums; +} + +.aksrt-comment__action--danger:hover { + color: var(--color-error, #ef4444); +} + +.aksrt-comment__action--success:hover { + color: var(--color-success, #10b981); +} + +/* 置顶徽章 */ +.aksrt-comment__badge--pinned { + background: var(--color-warning-soft, rgba(245, 158, 11, 0.14)); + color: var(--color-warning, #d97706); + display: inline-flex; + align-items: center; + gap: 3px; +} + +/* 置顶评论容器高亮 */ +.aksrt-comment--pinned > .aksrt-comment__body { + position: relative; +} + +.comment-list .comment.aksrt-comment--pinned { + background: var(--color-warning-soft, rgba(245, 158, 11, 0.06)); + border-radius: var(--radius, 8px); + padding-left: 12px; + padding-right: 12px; +} + +/* zibll compat: emoji icon forced 30px */ +.comment-content .smilie-icon, +.comment-form .smilie-icon { + width: 30px !important; +} + +/* zibll compat: code block in comments */ +.comment-content .enlighter-default { + margin-bottom: 0; + opacity: 0.9; +} + + +/* Identity chips + 神评 */ +.aksrt-identity-chip { + display: inline-flex; + align-items: center; + gap: 3px; + vertical-align: middle; + max-width: 9em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.aksrt-identity-chip--comment { + font-size: 11px; + padding: 0 6px; +} +.medal-icon.img-icon, +.aksrt-identity-medal { + display: inline-block; + width: 1.35em; + height: 1.35em; + object-fit: contain; + vertical-align: middle; + margin-left: 4px; +} +.aksrt-identity-medal--comment { + width: 1.15em; + height: 1.15em; +} +.aksrt-identity-medal.is-wear { + outline: 1px solid rgba(245, 158, 11, 0.45); + border-radius: 3px; +} +.aksrt-comment__badge--hot { + color: #ea580c; + background: rgba(234, 88, 12, 0.1); + border-radius: 999px; + padding: 0 6px; + margin-left: 4px; + font-size: 11px; +} +.aksrt-comment__header .author-box { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 4px; +} diff --git a/assets/img/smilies/OK.gif b/assets/img/smilies/OK.gif new file mode 100644 index 00000000..89eac0e5 Binary files /dev/null and b/assets/img/smilies/OK.gif differ diff --git a/assets/img/smilies/aini.gif b/assets/img/smilies/aini.gif new file mode 100644 index 00000000..67dd43d7 Binary files /dev/null and b/assets/img/smilies/aini.gif differ diff --git a/assets/img/smilies/aixin.gif b/assets/img/smilies/aixin.gif new file mode 100644 index 00000000..13600b90 Binary files /dev/null and b/assets/img/smilies/aixin.gif differ diff --git a/assets/img/smilies/aoman.gif b/assets/img/smilies/aoman.gif new file mode 100644 index 00000000..0088ed6f Binary files /dev/null and b/assets/img/smilies/aoman.gif differ diff --git a/assets/img/smilies/baiyan.gif b/assets/img/smilies/baiyan.gif new file mode 100644 index 00000000..3aba83f9 Binary files /dev/null and b/assets/img/smilies/baiyan.gif differ diff --git a/assets/img/smilies/bangbangtang.gif b/assets/img/smilies/bangbangtang.gif new file mode 100644 index 00000000..c236e5fc Binary files /dev/null and b/assets/img/smilies/bangbangtang.gif differ diff --git a/assets/img/smilies/baojin.gif b/assets/img/smilies/baojin.gif new file mode 100644 index 00000000..3203d387 Binary files /dev/null and b/assets/img/smilies/baojin.gif differ diff --git a/assets/img/smilies/baoquan.gif b/assets/img/smilies/baoquan.gif new file mode 100644 index 00000000..a4aa25f6 Binary files /dev/null and b/assets/img/smilies/baoquan.gif differ diff --git a/assets/img/smilies/bishi.gif b/assets/img/smilies/bishi.gif new file mode 100644 index 00000000..493cae9f Binary files /dev/null and b/assets/img/smilies/bishi.gif differ diff --git a/assets/img/smilies/bizui.gif b/assets/img/smilies/bizui.gif new file mode 100644 index 00000000..f3dc4dab Binary files /dev/null and b/assets/img/smilies/bizui.gif differ diff --git a/assets/img/smilies/cahan.gif b/assets/img/smilies/cahan.gif new file mode 100644 index 00000000..06450cdb Binary files /dev/null and b/assets/img/smilies/cahan.gif differ diff --git a/assets/img/smilies/caidao.gif b/assets/img/smilies/caidao.gif new file mode 100644 index 00000000..3f94a155 Binary files /dev/null and b/assets/img/smilies/caidao.gif differ diff --git a/assets/img/smilies/chi.gif b/assets/img/smilies/chi.gif new file mode 100644 index 00000000..dfdda693 Binary files /dev/null and b/assets/img/smilies/chi.gif differ diff --git a/assets/img/smilies/ciya.gif b/assets/img/smilies/ciya.gif new file mode 100644 index 00000000..f84ea240 Binary files /dev/null and b/assets/img/smilies/ciya.gif differ diff --git a/assets/img/smilies/dabing.gif b/assets/img/smilies/dabing.gif new file mode 100644 index 00000000..e2f17106 Binary files /dev/null and b/assets/img/smilies/dabing.gif differ diff --git a/assets/img/smilies/daku.gif b/assets/img/smilies/daku.gif new file mode 100644 index 00000000..56427e20 Binary files /dev/null and b/assets/img/smilies/daku.gif differ diff --git a/assets/img/smilies/dan.gif b/assets/img/smilies/dan.gif new file mode 100644 index 00000000..48626b07 Binary files /dev/null and b/assets/img/smilies/dan.gif differ diff --git a/assets/img/smilies/deyi.gif b/assets/img/smilies/deyi.gif new file mode 100644 index 00000000..e9b49980 Binary files /dev/null and b/assets/img/smilies/deyi.gif differ diff --git a/assets/img/smilies/doge.gif b/assets/img/smilies/doge.gif new file mode 100644 index 00000000..3f61e751 Binary files /dev/null and b/assets/img/smilies/doge.gif differ diff --git a/assets/img/smilies/fadai.gif b/assets/img/smilies/fadai.gif new file mode 100644 index 00000000..8fe5a4f5 Binary files /dev/null and b/assets/img/smilies/fadai.gif differ diff --git a/assets/img/smilies/fanu.gif b/assets/img/smilies/fanu.gif new file mode 100644 index 00000000..fc20d67d Binary files /dev/null and b/assets/img/smilies/fanu.gif differ diff --git a/assets/img/smilies/fendou.gif b/assets/img/smilies/fendou.gif new file mode 100644 index 00000000..453c2d2c Binary files /dev/null and b/assets/img/smilies/fendou.gif differ diff --git a/assets/img/smilies/ganga.gif b/assets/img/smilies/ganga.gif new file mode 100644 index 00000000..ed2dac28 Binary files /dev/null and b/assets/img/smilies/ganga.gif differ diff --git a/assets/img/smilies/gouyin.gif b/assets/img/smilies/gouyin.gif new file mode 100644 index 00000000..5beb0989 Binary files /dev/null and b/assets/img/smilies/gouyin.gif differ diff --git a/assets/img/smilies/guzhang.gif b/assets/img/smilies/guzhang.gif new file mode 100644 index 00000000..b955b1c6 Binary files /dev/null and b/assets/img/smilies/guzhang.gif differ diff --git a/assets/img/smilies/haixiu.gif b/assets/img/smilies/haixiu.gif new file mode 100644 index 00000000..18025fc0 Binary files /dev/null and b/assets/img/smilies/haixiu.gif differ diff --git a/assets/img/smilies/hanxiao.gif b/assets/img/smilies/hanxiao.gif new file mode 100644 index 00000000..3cce2295 Binary files /dev/null and b/assets/img/smilies/hanxiao.gif differ diff --git a/assets/img/smilies/haobang.gif b/assets/img/smilies/haobang.gif new file mode 100644 index 00000000..d5c704af Binary files /dev/null and b/assets/img/smilies/haobang.gif differ diff --git a/assets/img/smilies/haqian.gif b/assets/img/smilies/haqian.gif new file mode 100644 index 00000000..5ee910db Binary files /dev/null and b/assets/img/smilies/haqian.gif differ diff --git a/assets/img/smilies/hecai.gif b/assets/img/smilies/hecai.gif new file mode 100644 index 00000000..6e842452 Binary files /dev/null and b/assets/img/smilies/hecai.gif differ diff --git a/assets/img/smilies/hexie.gif b/assets/img/smilies/hexie.gif new file mode 100644 index 00000000..9326d1ac Binary files /dev/null and b/assets/img/smilies/hexie.gif differ diff --git a/assets/img/smilies/huaixiao.gif b/assets/img/smilies/huaixiao.gif new file mode 100644 index 00000000..63e37b76 Binary files /dev/null and b/assets/img/smilies/huaixiao.gif differ diff --git a/assets/img/smilies/jie.gif b/assets/img/smilies/jie.gif new file mode 100644 index 00000000..8177e333 Binary files /dev/null and b/assets/img/smilies/jie.gif differ diff --git a/assets/img/smilies/jingkong.gif b/assets/img/smilies/jingkong.gif new file mode 100644 index 00000000..25a0e2ee Binary files /dev/null and b/assets/img/smilies/jingkong.gif differ diff --git a/assets/img/smilies/jingxi.gif b/assets/img/smilies/jingxi.gif new file mode 100644 index 00000000..500abe85 Binary files /dev/null and b/assets/img/smilies/jingxi.gif differ diff --git a/assets/img/smilies/jingya.gif b/assets/img/smilies/jingya.gif new file mode 100644 index 00000000..280d8488 Binary files /dev/null and b/assets/img/smilies/jingya.gif differ diff --git a/assets/img/smilies/juhua.gif b/assets/img/smilies/juhua.gif new file mode 100644 index 00000000..7dfd66e9 Binary files /dev/null and b/assets/img/smilies/juhua.gif differ diff --git a/assets/img/smilies/keai.gif b/assets/img/smilies/keai.gif new file mode 100644 index 00000000..44441d0a Binary files /dev/null and b/assets/img/smilies/keai.gif differ diff --git a/assets/img/smilies/kelian.gif b/assets/img/smilies/kelian.gif new file mode 100644 index 00000000..107647af Binary files /dev/null and b/assets/img/smilies/kelian.gif differ diff --git a/assets/img/smilies/koubi.gif b/assets/img/smilies/koubi.gif new file mode 100644 index 00000000..e3b4eda8 Binary files /dev/null and b/assets/img/smilies/koubi.gif differ diff --git a/assets/img/smilies/ku.gif b/assets/img/smilies/ku.gif new file mode 100644 index 00000000..05b2d290 Binary files /dev/null and b/assets/img/smilies/ku.gif differ diff --git a/assets/img/smilies/kuaikule.gif b/assets/img/smilies/kuaikule.gif new file mode 100644 index 00000000..627ce215 Binary files /dev/null and b/assets/img/smilies/kuaikule.gif differ diff --git a/assets/img/smilies/kulou.gif b/assets/img/smilies/kulou.gif new file mode 100644 index 00000000..842e8a70 Binary files /dev/null and b/assets/img/smilies/kulou.gif differ diff --git a/assets/img/smilies/kun.gif b/assets/img/smilies/kun.gif new file mode 100644 index 00000000..68c70dfd Binary files /dev/null and b/assets/img/smilies/kun.gif differ diff --git a/assets/img/smilies/lanqiu.gif b/assets/img/smilies/lanqiu.gif new file mode 100644 index 00000000..63268ee0 Binary files /dev/null and b/assets/img/smilies/lanqiu.gif differ diff --git a/assets/img/smilies/leiben.gif b/assets/img/smilies/leiben.gif new file mode 100644 index 00000000..ecd47162 Binary files /dev/null and b/assets/img/smilies/leiben.gif differ diff --git a/assets/img/smilies/lenghan.gif b/assets/img/smilies/lenghan.gif new file mode 100644 index 00000000..f4b7abab Binary files /dev/null and b/assets/img/smilies/lenghan.gif differ diff --git a/assets/img/smilies/liuhan.gif b/assets/img/smilies/liuhan.gif new file mode 100644 index 00000000..da474f1e Binary files /dev/null and b/assets/img/smilies/liuhan.gif differ diff --git a/assets/img/smilies/liulei.gif b/assets/img/smilies/liulei.gif new file mode 100644 index 00000000..b50865b7 Binary files /dev/null and b/assets/img/smilies/liulei.gif differ diff --git a/assets/img/smilies/nanguo.gif b/assets/img/smilies/nanguo.gif new file mode 100644 index 00000000..79e8983b Binary files /dev/null and b/assets/img/smilies/nanguo.gif differ diff --git a/assets/img/smilies/penxue.gif b/assets/img/smilies/penxue.gif new file mode 100644 index 00000000..6f568786 Binary files /dev/null and b/assets/img/smilies/penxue.gif differ diff --git a/assets/img/smilies/piezui.gif b/assets/img/smilies/piezui.gif new file mode 100644 index 00000000..fed13970 Binary files /dev/null and b/assets/img/smilies/piezui.gif differ diff --git a/assets/img/smilies/pijiu.gif b/assets/img/smilies/pijiu.gif new file mode 100644 index 00000000..f8e5a2aa Binary files /dev/null and b/assets/img/smilies/pijiu.gif differ diff --git a/assets/img/smilies/qiang.gif b/assets/img/smilies/qiang.gif new file mode 100644 index 00000000..11471071 Binary files /dev/null and b/assets/img/smilies/qiang.gif differ diff --git a/assets/img/smilies/qiaoda.gif b/assets/img/smilies/qiaoda.gif new file mode 100644 index 00000000..3f52e3c9 Binary files /dev/null and b/assets/img/smilies/qiaoda.gif differ diff --git a/assets/img/smilies/qinqin.gif b/assets/img/smilies/qinqin.gif new file mode 100644 index 00000000..5ee1c516 Binary files /dev/null and b/assets/img/smilies/qinqin.gif differ diff --git a/assets/img/smilies/qiudale.gif b/assets/img/smilies/qiudale.gif new file mode 100644 index 00000000..d809261a Binary files /dev/null and b/assets/img/smilies/qiudale.gif differ diff --git a/assets/img/smilies/quantou.gif b/assets/img/smilies/quantou.gif new file mode 100644 index 00000000..a5ffd4ab Binary files /dev/null and b/assets/img/smilies/quantou.gif differ diff --git a/assets/img/smilies/saorao.gif b/assets/img/smilies/saorao.gif new file mode 100644 index 00000000..a35f8fc5 Binary files /dev/null and b/assets/img/smilies/saorao.gif differ diff --git a/assets/img/smilies/se.gif b/assets/img/smilies/se.gif new file mode 100644 index 00000000..74567e8e Binary files /dev/null and b/assets/img/smilies/se.gif differ diff --git a/assets/img/smilies/shengli.gif b/assets/img/smilies/shengli.gif new file mode 100644 index 00000000..5c9c26ed Binary files /dev/null and b/assets/img/smilies/shengli.gif differ diff --git a/assets/img/smilies/shouqiang.gif b/assets/img/smilies/shouqiang.gif new file mode 100644 index 00000000..db0495ce Binary files /dev/null and b/assets/img/smilies/shouqiang.gif differ diff --git a/assets/img/smilies/shuai.gif b/assets/img/smilies/shuai.gif new file mode 100644 index 00000000..541575dc Binary files /dev/null and b/assets/img/smilies/shuai.gif differ diff --git a/assets/img/smilies/shui.gif b/assets/img/smilies/shui.gif new file mode 100644 index 00000000..452d39ac Binary files /dev/null and b/assets/img/smilies/shui.gif differ diff --git a/assets/img/smilies/tiaopi.gif b/assets/img/smilies/tiaopi.gif new file mode 100644 index 00000000..f57d3f0e Binary files /dev/null and b/assets/img/smilies/tiaopi.gif differ diff --git a/assets/img/smilies/touxiao.gif b/assets/img/smilies/touxiao.gif new file mode 100644 index 00000000..17297802 Binary files /dev/null and b/assets/img/smilies/touxiao.gif differ diff --git a/assets/img/smilies/tu.gif b/assets/img/smilies/tu.gif new file mode 100644 index 00000000..c7f9315b Binary files /dev/null and b/assets/img/smilies/tu.gif differ diff --git a/assets/img/smilies/tuosai.gif b/assets/img/smilies/tuosai.gif new file mode 100644 index 00000000..6a8d2648 Binary files /dev/null and b/assets/img/smilies/tuosai.gif differ diff --git a/assets/img/smilies/weiqu.gif b/assets/img/smilies/weiqu.gif new file mode 100644 index 00000000..c73c5c18 Binary files /dev/null and b/assets/img/smilies/weiqu.gif differ diff --git a/assets/img/smilies/weixiao.gif b/assets/img/smilies/weixiao.gif new file mode 100644 index 00000000..771e0917 Binary files /dev/null and b/assets/img/smilies/weixiao.gif differ diff --git a/assets/img/smilies/woshou.gif b/assets/img/smilies/woshou.gif new file mode 100644 index 00000000..88b8dc95 Binary files /dev/null and b/assets/img/smilies/woshou.gif differ diff --git a/assets/img/smilies/wozuimei.gif b/assets/img/smilies/wozuimei.gif new file mode 100644 index 00000000..0e5b7e5e Binary files /dev/null and b/assets/img/smilies/wozuimei.gif differ diff --git a/assets/img/smilies/wunai.gif b/assets/img/smilies/wunai.gif new file mode 100644 index 00000000..a4be9ed7 Binary files /dev/null and b/assets/img/smilies/wunai.gif differ diff --git a/assets/img/smilies/xia.gif b/assets/img/smilies/xia.gif new file mode 100644 index 00000000..5ececcdb Binary files /dev/null and b/assets/img/smilies/xia.gif differ diff --git a/assets/img/smilies/xiaojiujie.gif b/assets/img/smilies/xiaojiujie.gif new file mode 100644 index 00000000..3d9411cd Binary files /dev/null and b/assets/img/smilies/xiaojiujie.gif differ diff --git a/assets/img/smilies/xiaoku.gif b/assets/img/smilies/xiaoku.gif new file mode 100644 index 00000000..2746fb66 Binary files /dev/null and b/assets/img/smilies/xiaoku.gif differ diff --git a/assets/img/smilies/xiaoyanger.gif b/assets/img/smilies/xiaoyanger.gif new file mode 100644 index 00000000..a8c66406 Binary files /dev/null and b/assets/img/smilies/xiaoyanger.gif differ diff --git a/assets/img/smilies/xieyanxiao.gif b/assets/img/smilies/xieyanxiao.gif new file mode 100644 index 00000000..6512cb5c Binary files /dev/null and b/assets/img/smilies/xieyanxiao.gif differ diff --git a/assets/img/smilies/xigua.gif b/assets/img/smilies/xigua.gif new file mode 100644 index 00000000..f7a2426d Binary files /dev/null and b/assets/img/smilies/xigua.gif differ diff --git a/assets/img/smilies/xu.gif b/assets/img/smilies/xu.gif new file mode 100644 index 00000000..ff5f9166 Binary files /dev/null and b/assets/img/smilies/xu.gif differ diff --git a/assets/img/smilies/yangtuo.gif b/assets/img/smilies/yangtuo.gif new file mode 100644 index 00000000..df47ca29 Binary files /dev/null and b/assets/img/smilies/yangtuo.gif differ diff --git a/assets/img/smilies/yinxian.gif b/assets/img/smilies/yinxian.gif new file mode 100644 index 00000000..4a94f636 Binary files /dev/null and b/assets/img/smilies/yinxian.gif differ diff --git a/assets/img/smilies/yiwen.gif b/assets/img/smilies/yiwen.gif new file mode 100644 index 00000000..6b084202 Binary files /dev/null and b/assets/img/smilies/yiwen.gif differ diff --git a/assets/img/smilies/youhengheng.gif b/assets/img/smilies/youhengheng.gif new file mode 100644 index 00000000..f65ad8a4 Binary files /dev/null and b/assets/img/smilies/youhengheng.gif differ diff --git a/assets/img/smilies/youling.gif b/assets/img/smilies/youling.gif new file mode 100644 index 00000000..3719a11f Binary files /dev/null and b/assets/img/smilies/youling.gif differ diff --git a/assets/img/smilies/yun.gif b/assets/img/smilies/yun.gif new file mode 100644 index 00000000..eb3cb995 Binary files /dev/null and b/assets/img/smilies/yun.gif differ diff --git a/assets/img/smilies/zaijian.gif b/assets/img/smilies/zaijian.gif new file mode 100644 index 00000000..7daa1e40 Binary files /dev/null and b/assets/img/smilies/zaijian.gif differ diff --git a/assets/img/smilies/zhayanjian.gif b/assets/img/smilies/zhayanjian.gif new file mode 100644 index 00000000..771e0917 Binary files /dev/null and b/assets/img/smilies/zhayanjian.gif differ diff --git a/assets/img/smilies/zhemo.gif b/assets/img/smilies/zhemo.gif new file mode 100644 index 00000000..c4d0bf14 Binary files /dev/null and b/assets/img/smilies/zhemo.gif differ diff --git a/assets/img/smilies/zhouma.gif b/assets/img/smilies/zhouma.gif new file mode 100644 index 00000000..47d225b0 Binary files /dev/null and b/assets/img/smilies/zhouma.gif differ diff --git a/assets/img/smilies/zhuakuang.gif b/assets/img/smilies/zhuakuang.gif new file mode 100644 index 00000000..45530613 Binary files /dev/null and b/assets/img/smilies/zhuakuang.gif differ diff --git a/assets/img/smilies/zuohengheng.gif b/assets/img/smilies/zuohengheng.gif new file mode 100644 index 00000000..59d08147 Binary files /dev/null and b/assets/img/smilies/zuohengheng.gif differ diff --git a/assets/js/comment-ajax.js b/assets/js/comment-ajax.js index 7a4a8ac4..9e3d3951 100644 --- a/assets/js/comment-ajax.js +++ b/assets/js/comment-ajax.js @@ -1,23 +1,15 @@ /** * AKSRT Comment Actions client * - * Single client for per-comment actions via REST aksrt/v1: - * like / edit / delete / moderate (approve|hold|spam) / pin + * REST aksrt/v1: like / delete / moderate / pin. + * Edit uses moveForm (#respond) via comment-move-form.js — not inline textarea. + * Submit owned by assets/js/core/comments.js (single submit contract). * - * Comment SUBMISSION is owned by main.js initCommentSystem() (the native - * wp-comments-post.php flow, which runs captcha verification, rate limiting and - * the moderation pipeline, then re-renders the list through the canonical - * server callback). This file deliberately does NOT bind the submit form, so - * there is exactly one comment-submit contract. - * - * Markup contract (rendered by aksrt_comment_callback, identical on first - * paint, load-more and post-submit reload): + * Markup (aksrt_comment_callback): * li.aksrt-comment[data-comment-id] - * .aksrt-comment__text (content) - * .aksrt-comment__actions - * [data-comment-action="like|edit|delete|approve|hold|spam|pin"] - * - * Depends on: aksrtData.restNonce (wp_rest) + aksrtData.siteUrl. + * .comment-header .aksrt-comment__like[data-comment-action=like] + * .comment-content#comment-content-{id} + * .comt-meta [data-comment-action=pin|approve|hold|spam|delete] * * @package AKSRT */ @@ -66,11 +58,10 @@ var commentId = getCommentId(commentEl); if (!commentId) return; + // edit is handled by comment-move-form.js (moveForm into #respond). switch (action) { case 'like': handleLike(actionBtn, commentId); break; - case 'edit': handleEdit(commentEl); break; - case 'save-edit': saveEdit(commentEl, commentId, actionBtn); break; - case 'cancel-edit': cancelEdit(commentEl); break; + case 'edit': break; case 'delete': handleDelete(commentEl, commentId); break; case 'pin': handlePin(commentEl, actionBtn, commentId); break; case 'approve': @@ -104,63 +95,6 @@ .finally(function () { btn.dataset.busy = ''; }); } - function handleEdit(commentEl) { - var contentEl = commentEl.querySelector(CONTENT_SELECTOR); - if (!contentEl || commentEl.querySelector('.aksrt-comment-edit-form')) return; - - var temp = document.createElement('div'); - temp.innerHTML = contentEl.innerHTML; - var originalText = (temp.textContent || temp.innerText || '').trim(); - - var editForm = document.createElement('div'); - editForm.className = 'aksrt-comment-edit-form'; - editForm.innerHTML = - '' + - '