From 6963a54c6618c767e3d2659dffa2b64943596810 Mon Sep 17 00:00:00 2001 From: Matt Lauber Date: Mon, 19 Mar 2018 14:01:24 -0400 Subject: [PATCH] Better Editor Toolbar Conditions (#3180) * The Excise tool only works with tiddlywiki5 format, so only display it on tiddlers that use the tiddlywiki5 parser. * The Editor Height tool and stamp tool only make sense with text editors, so only display them when the content type starts with text --- core/ui/EditorToolbar/editor-height.tid | 2 +- core/ui/EditorToolbar/excise.tid | 2 +- core/ui/EditorToolbar/stamp.tid | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/ui/EditorToolbar/editor-height.tid b/core/ui/EditorToolbar/editor-height.tid index c6c45775f..a8bb2ca13 100644 --- a/core/ui/EditorToolbar/editor-height.tid +++ b/core/ui/EditorToolbar/editor-height.tid @@ -4,7 +4,7 @@ icon: $:/core/images/fixed-height custom-icon: yes caption: {{$:/language/Buttons/EditorHeight/Caption}} description: {{$:/language/Buttons/EditorHeight/Hint}} -condition: [!is[image]] +condition: [type[]] [get[type]prefix[text/]] +[first[]] dropdown: $:/core/ui/EditorToolbar/editor-height-dropdown <$reveal tag="span" state="$:/config/TextEditor/EditorHeight/Mode" type="match" text="fixed"> diff --git a/core/ui/EditorToolbar/excise.tid b/core/ui/EditorToolbar/excise.tid index dc2b34d3b..7eb505c23 100644 --- a/core/ui/EditorToolbar/excise.tid +++ b/core/ui/EditorToolbar/excise.tid @@ -3,7 +3,7 @@ tags: $:/tags/EditorToolbar icon: $:/core/images/excise caption: {{$:/language/Buttons/Excise/Caption}} description: {{$:/language/Buttons/Excise/Hint}} -condition: [!is[image]] +condition: [type[]] [type[text/vnc.tiddlywiki]] +[first[]] shortcuts: ((excise)) dropdown: $:/core/ui/EditorToolbar/excise-dropdown diff --git a/core/ui/EditorToolbar/stamp.tid b/core/ui/EditorToolbar/stamp.tid index bd83a2928..af57feb4b 100644 --- a/core/ui/EditorToolbar/stamp.tid +++ b/core/ui/EditorToolbar/stamp.tid @@ -3,7 +3,7 @@ tags: $:/tags/EditorToolbar icon: $:/core/images/stamp caption: {{$:/language/Buttons/Stamp/Caption}} description: {{$:/language/Buttons/Stamp/Hint}} -condition: [!is[image]] +condition: [type[]] [get[type]prefix[text/]] +[first[]] shortcuts: ((stamp)) dropdown: $:/core/ui/EditorToolbar/stamp-dropdown text: