From 23ca665d190bcda11f1db12de0e110916f66422f Mon Sep 17 00:00:00 2001 From: hongweipeng Date: Thu, 10 Dec 2020 00:14:30 +0800 Subject: [PATCH] =?UTF-8?q?anchor=E9=94=9A=E7=82=B9=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E5=81=8F=E7=A7=BB=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugin.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Plugin.php b/Plugin.php index 53e49f2..97ded40 100644 --- a/Plugin.php +++ b/Plugin.php @@ -66,6 +66,9 @@ class MenuTree_Plugin implements Typecho_Plugin_Interface { ), 0, _t('文章无标题时隐藏'), _t('文章中无h1、h2、h3...时隐藏')); $form->addInput($hidden_set->addRule('enum', _t('必须选择一个模式'), array(0, 1))); + $anchor_offset = new Typecho_Widget_Helper_Form_Element_Text('anchor_offset', NULL, '0', _t('标题链接偏移量(单位 em)'), _t('填入数字,支持负数')); + $form->addInput($anchor_offset); + } /** @@ -138,7 +141,7 @@ class MenuTree_Plugin implements Typecho_Plugin_Interface { } } self::$id++; - return "" . $html; + return "" . $html; } /** @@ -203,7 +206,19 @@ class MenuTree_Plugin implements Typecho_Plugin_Interface { return; } $cssUrl = Helper::options()->pluginUrl . '/MenuTree/menutree.css?v=' . self::$v; - echo ''; + $anchor_offset = Helper::options()->plugin('MenuTree')->anchor_offset; + + echo << + +EOF; } /**