From 71de85651462ea23036071e50f488a1fc4485ab0 Mon Sep 17 00:00:00 2001 From: tw-FRed <95534072+tw-FRed@users.noreply.github.com> Date: Wed, 12 Jul 2023 23:02:11 +0000 Subject: [PATCH 1/2] Make the "Contents" menu item caption configurable --- plugins/tiddlywiki/menubar/config.tid | 8 +++++--- plugins/tiddlywiki/menubar/items/contents.tid | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/tiddlywiki/menubar/config.tid b/plugins/tiddlywiki/menubar/config.tid index abcb8fcea..ea4f07ad0 100644 --- a/plugins/tiddlywiki/menubar/config.tid +++ b/plugins/tiddlywiki/menubar/config.tid @@ -1,6 +1,8 @@ -title: $:/plugins/tiddlywiki/menubar/config -tags: $:/tags/ControlPanel/Toolbars caption: Menu Bar +created: 20230519012218346 +modified: 20230712224614730 +tags: $:/tags/ControlPanel/Toolbars +title: $:/plugins/tiddlywiki/menubar/config \define config-base() $:/config/plugins/menubar/MenuItems/Visibility/ @@ -28,7 +30,7 @@ The breakpoint position between narrow and wide screens. Should include CSS unit !! Contents Tag -The tag for the ~TableOfContents used in the Contents dropdown +The tag for the ~TableOfContents used in the Contents dropdown. Add //caption// and //description// fields to the tag tiddler to change ~TableOfContents' menu label. <$edit-text tiddler="$:/config/plugins/menubar/TableOfContents/Tag" default="" tag="input"/> diff --git a/plugins/tiddlywiki/menubar/items/contents.tid b/plugins/tiddlywiki/menubar/items/contents.tid index f4fbdb2c2..69a0bc99a 100644 --- a/plugins/tiddlywiki/menubar/items/contents.tid +++ b/plugins/tiddlywiki/menubar/items/contents.tid @@ -1,8 +1,10 @@ -title: $:/plugins/tiddlywiki/menubar/items/contents -caption: Contents -description: Table of Contents +caption: <$text text={{{ [{$:/config/plugins/menubar/TableOfContents/Tag}get[caption]else[Contents]] }}}/> +created: 20230519010904497 +description: <$text text={{{ [{$:/config/plugins/menubar/TableOfContents/Tag}get[description]else[Table of Contents]] }}}/> is-dropdown: yes +modified: 20230712225429073 tags: $:/tags/MenuBar +title: $:/plugins/tiddlywiki/menubar/items/contents
From e4ba007bcb8ae00e3d0495c011f96115c4757fd8 Mon Sep 17 00:00:00 2001 From: tw-FRed <95534072+tw-FRed@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:11:23 +0000 Subject: [PATCH 2/2] Second try... Fixed @Jermolene's review comments. Checked the fix works on tiddlywiki.com and French translation. --- plugins/tiddlywiki/menubar/config.tid | 14 +++++++++++--- plugins/tiddlywiki/menubar/items/contents.tid | 4 +--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/tiddlywiki/menubar/config.tid b/plugins/tiddlywiki/menubar/config.tid index ea4f07ad0..0f6cdf44a 100644 --- a/plugins/tiddlywiki/menubar/config.tid +++ b/plugins/tiddlywiki/menubar/config.tid @@ -1,6 +1,4 @@ caption: Menu Bar -created: 20230519012218346 -modified: 20230712224614730 tags: $:/tags/ControlPanel/Toolbars title: $:/plugins/tiddlywiki/menubar/config @@ -30,10 +28,20 @@ The breakpoint position between narrow and wide screens. Should include CSS unit !! Contents Tag -The tag for the ~TableOfContents used in the Contents dropdown. Add //caption// and //description// fields to the tag tiddler to change ~TableOfContents' menu label. +The tag for the ~TableOfContents used in the Contents dropdown. <$edit-text tiddler="$:/config/plugins/menubar/TableOfContents/Tag" default="" tag="input"/> +Caption of the Contents menu item (stored in the tag's //caption// field): + +<$edit-text tiddler={{$:/config/plugins/menubar/TableOfContents/Tag}} field="caption" default="Contents" tag="input" size=50/> + +Description of the contents menu item (stored in the tag's //description// field): + +<$edit-text tiddler={{$:/config/plugins/menubar/TableOfContents/Tag}} field="description" default="Table of Contents" tag="input" size=50/> + + + !! Menu Bar Colours To change the colour of the menu bar, define the colours `menubar-foreground` and `menubar-background` in the currently selected palette diff --git a/plugins/tiddlywiki/menubar/items/contents.tid b/plugins/tiddlywiki/menubar/items/contents.tid index 69a0bc99a..edbb742ea 100644 --- a/plugins/tiddlywiki/menubar/items/contents.tid +++ b/plugins/tiddlywiki/menubar/items/contents.tid @@ -1,8 +1,6 @@ -caption: <$text text={{{ [{$:/config/plugins/menubar/TableOfContents/Tag}get[caption]else[Contents]] }}}/> -created: 20230519010904497 +caption: <$list filter="[{$:/config/plugins/menubar/TableOfContents/Tag}has[caption]]" emptyMessage="Contents"><$transclude $field="caption"/> description: <$text text={{{ [{$:/config/plugins/menubar/TableOfContents/Tag}get[description]else[Table of Contents]] }}}/> is-dropdown: yes -modified: 20230712225429073 tags: $:/tags/MenuBar title: $:/plugins/tiddlywiki/menubar/items/contents