From daee4cd67f571e75872784b9ad0565212477bef9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 6 Sep 2026 10:10:12 +0800 Subject: [PATCH] feat(submit): make video cover row icon-only with hover titles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the video-pic/video/clear button labels with icon-only buttons carrying title + aria-label (设置视频封面/视频/清除), center the glyphs via flex to fix the upward icon shift, rename the media picker title to 为视频设置封面, and drop the unused setVideoCover i18n key. Contract test updated to pin the new markup and string set. --- assets/js/front-submit.js | 4 ++-- templates/pages/page-submit.php | 3 +-- templates/parts/submit/featured.php | 18 ++++++++++++------ .../front-submit/video-cover-contract.test.cjs | 18 ++++++++++++++---- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/assets/js/front-submit.js b/assets/js/front-submit.js index 1a0ece2e..db942467 100644 --- a/assets/js/front-submit.js +++ b/assets/js/front-submit.js @@ -522,7 +522,7 @@ type: 'image', multiple: false, allowExternal: false, - title: i18n.setVideoCoverTitle || '为视频设置首图封面', + title: i18n.setVideoCoverTitle || '为视频设置封面', onSelect: function (cover) { self.setFeatured('video', { url: current.data.url, @@ -554,7 +554,7 @@ type: 'image', multiple: false, allowExternal: false, - title: i18n.setVideoCoverTitle || '为视频设置首图封面', + title: i18n.setVideoCoverTitle || '为视频设置封面', onSelect: function (cover) { self.setFeatured('video', { url: video.url, diff --git a/templates/pages/page-submit.php b/templates/pages/page-submit.php index 697b521b..4a9b6c80 100644 --- a/templates/pages/page-submit.php +++ b/templates/pages/page-submit.php @@ -147,8 +147,7 @@ if (file_exists($js)) { 'fileTooLarge' => __('文件大小超过限制', 'aksrt'), 'lastSaved' => __('最后保存:', 'aksrt'), 'preview' => __('预览文章', 'aksrt'), - 'setVideoCover' => __('设置视频首图封面', 'aksrt'), - 'setVideoCoverTitle' => __('为视频设置首图封面', 'aksrt'), + 'setVideoCoverTitle' => __('为视频设置封面', 'aksrt'), 'close' => __('关闭', 'aksrt'), 'insertImage' => __('插入图片', 'aksrt'), 'uploadImage' => __('上传图片', 'aksrt'), diff --git a/templates/parts/submit/featured.php b/templates/parts/submit/featured.php index be258163..9cc37b92 100644 --- a/templates/parts/submit/featured.php +++ b/templates/parts/submit/featured.php @@ -47,8 +47,10 @@ $can_video = !empty($ctx['can_cover_video']); - @@ -57,12 +59,16 @@ $can_video = !empty($ctx['can_cover_video']); - - diff --git a/tests/front-submit/video-cover-contract.test.cjs b/tests/front-submit/video-cover-contract.test.cjs index 62cfad18..1625b35f 100644 --- a/tests/front-submit/video-cover-contract.test.cjs +++ b/tests/front-submit/video-cover-contract.test.cjs @@ -17,7 +17,12 @@ test('featured box renders a playable video preview and a video-cover button', ( assert.match(featured, /fa fas fa-play-circle/); // The video-cover button is capability-gated like the video button. - assert.match(featured, /if \(\$can_video\) : \?>\s*\n\s*