diff --git a/core/ui/EditorToolbar/stamp-dropdown-item-template.tid b/core/ui/EditorToolbar/stamp-dropdown-item-template.tid new file mode 100644 index 000000000..3c2b26c71 --- /dev/null +++ b/core/ui/EditorToolbar/stamp-dropdown-item-template.tid @@ -0,0 +1,53 @@ +title: $:/core/ui/EditorToolbar/StampDropdown/ItemTemplate + +<$linkcatcher actions=""" + +<$list filter="[!match[ctrl]]" variable="ignore"> + +<$list filter="[addsuffix[/prefix]is[missing]removesuffix[/prefix]addsuffix[/suffix]is[missing]]" variable="ignore"> + +<$action-sendmessage + $message="tm-edit-text-operation" + $param="replace-selection" + text={{{ [get[text]] }}} +/> + + + + +<$list filter="[addsuffix[/prefix]is[missing]removesuffix[/prefix]addsuffix[/suffix]!is[missing]] [addsuffix[/prefix]!is[missing]removesuffix[/prefix]addsuffix[/suffix]is[missing]] [addsuffix[/prefix]!is[missing]removesuffix[/prefix]addsuffix[/suffix]!is[missing]]" variable="ignore"> + +<$action-sendmessage + $message="tm-edit-text-operation" + $param="wrap-selection" + prefix={{{ [addsuffix[/prefix]get[text]] }}} + suffix={{{ [addsuffix[/suffix]get[text]] }}} +/> + + + + + +<$list filter="[match[ctrl]]" variable="ignore"> + +<$action-sendmessage $message="tm-edit-tiddler"/> + + + +<$action-deletetiddler + $tiddler=<> +/> + +"""> + +<$link tooltip={{{ [get[description]] }}}> + +<$transclude tiddler=<> field="caption" mode="inline"> + +<$view tiddler=<> field="title" /> + + + + + + diff --git a/core/ui/EditorToolbar/stamp-dropdown.tid b/core/ui/EditorToolbar/stamp-dropdown.tid index 761e05fc9..04649ecfd 100644 --- a/core/ui/EditorToolbar/stamp-dropdown.tid +++ b/core/ui/EditorToolbar/stamp-dropdown.tid @@ -1,48 +1,6 @@ title: $:/core/ui/EditorToolbar/stamp-dropdown -\define toolbar-button-stamp-inner() -<$button tag="a"> - -<$list filter="[[$(snippetTitle)$]addsuffix[/prefix]is[missing]removesuffix[/prefix]addsuffix[/suffix]is[missing]]"> - -<$action-sendmessage - $message="tm-edit-text-operation" - $param="replace-selection" - text={{$(snippetTitle)$}} -/> - - - - -<$list filter="[[$(snippetTitle)$]addsuffix[/prefix]is[missing]removesuffix[/prefix]addsuffix[/suffix]!is[missing]] [[$(snippetTitle)$]addsuffix[/prefix]!is[missing]removesuffix[/prefix]addsuffix[/suffix]is[missing]] [[$(snippetTitle)$]addsuffix[/prefix]!is[missing]removesuffix[/prefix]addsuffix[/suffix]!is[missing]]"> - -<$action-sendmessage - $message="tm-edit-text-operation" - $param="wrap-selection" - prefix={{{ [[$(snippetTitle)$]addsuffix[/prefix]get[text]] }}} -suffix={{{ [[$(snippetTitle)$]addsuffix[/suffix]get[text]] }}} -/> - - - -<$action-deletetiddler - $tiddler=<> -/> - -<$transclude tiddler=<> field="caption" mode="inline"> - -<$view tiddler=<> field="title" /> - - - - -\end - -<$list filter="[all[shadows+tiddlers]tag[$:/tags/TextEditor/Snippet]!has[draft.of]sort[caption]]" variable="snippetTitle"> - -<> - - +<$macrocall $name="list-tagged-draggable" tag="$:/tags/TextEditor/Snippet" subFilter="!is[draft]" itemTemplate="$:/core/ui/EditorToolbar/StampDropdown/ItemTemplate"/> ---- diff --git a/core/ui/EditorToolbar/stamp.tid b/core/ui/EditorToolbar/stamp.tid index 67080636a..15c97fc34 100644 --- a/core/ui/EditorToolbar/stamp.tid +++ b/core/ui/EditorToolbar/stamp.tid @@ -6,4 +6,5 @@ description: {{$:/language/Buttons/Stamp/Hint}} condition: [type[]] [get[type]prefix[text/]] [get[type]match[application/javascript]] [get[type]match[application/json]] [get[type]match[application/x-tiddler-dictionary]] [get[type]match[image/svg+xml]] +[first[]] shortcuts: ((stamp)) dropdown: $:/core/ui/EditorToolbar/stamp-dropdown +button-classes: tc-editortoolbar-stamp-button text: diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 4e639a9a8..2207789f2 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1321,6 +1321,15 @@ html body.tc-body.tc-single-tiddler-window { padding: 0; } +.tc-editor-toolbar button.tc-editortoolbar-stamp-button + .tc-popup .tc-drop-down > p { + margin: 0; + padding: 0; +} + +.tc-editor-toolbar button.tc-editortoolbar-stamp-button + .tc-popup .tc-drop-down a.tc-tiddlylink { + font-weight: normal; +} + /* ** Adjustments for fluid-fixed mode */