From a42f5f41ca99c8ccba44bc350afcd648305757b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Thu, 22 May 2025 19:24:20 +0800 Subject: [PATCH] 0.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新预览 --- functions.php | 172 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 135 insertions(+), 37 deletions(-) diff --git a/functions.php b/functions.php index 1cfdc74..4d209a1 100644 --- a/functions.php +++ b/functions.php @@ -605,60 +605,158 @@ function commentApprove($widget, $email = NULL) } /** - * 修改附件插入功能 + * Typecho后台附件增强:图片预览、批量插入、保留官方删除按钮与逻辑 + * @author 老孙博客 + * @date 2025-04-25 */ -// 添加批量插入按钮的JavaScript -// 避免重复注册,使用条件判断 -if (!Typecho_Plugin::exists('admin/write-post.php', 'bottom')) { - Typecho_Plugin::factory('admin/write-post.php')->bottom = array('MyHelper', 'addBatchInsertButton'); - Typecho_Plugin::factory('admin/write-page.php')->bottom = array('MyHelper', 'addBatchInsertButton'); -} +Typecho_Plugin::factory('admin/write-post.php')->bottom = array('AttachmentHelper', 'addEnhancedFeatures'); +Typecho_Plugin::factory('admin/write-page.php')->bottom = array('AttachmentHelper', 'addEnhancedFeatures'); -class MyHelper { - public static function addBatchInsertButton() { +class AttachmentHelper { + public static function addEnhancedFeatures() { ?> + \ No newline at end of file