mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-26 18:10:27 +00:00
d1948621d3
* make stamp-button optionally wrap selection * Update Using Stamp.tid
69 lines
1.6 KiB
Plaintext
69 lines
1.6 KiB
Plaintext
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>
|
|
|
|
|
|
<$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]] }}}
|
|
/>
|
|
|
|
</$list>
|
|
|
|
<$action-deletetiddler
|
|
$tiddler=<<dropdown-state>>
|
|
/>
|
|
|
|
<$view tiddler=<<snippetTitle>> field="caption" mode="inline">
|
|
|
|
<$view tiddler=<<snippetTitle>> field="title" mode="inline"/>
|
|
|
|
</$view>
|
|
|
|
</$button>
|
|
\end
|
|
|
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TextEditor/Snippet]!has[draft.of]sort[caption]]" variable="snippetTitle">
|
|
|
|
<<toolbar-button-stamp-inner>>
|
|
|
|
</$list>
|
|
|
|
----
|
|
|
|
<$button tag="a">
|
|
|
|
<$action-sendmessage
|
|
$message="tm-new-tiddler"
|
|
tags="$:/tags/TextEditor/Snippet"
|
|
caption={{$:/language/Buttons/Stamp/New/Title}}
|
|
text={{$:/language/Buttons/Stamp/New/Text}}
|
|
/>
|
|
|
|
<$action-deletetiddler
|
|
$tiddler=<<dropdown-state>>
|
|
/>
|
|
|
|
<em>
|
|
|
|
<$text text={{$:/language/Buttons/Stamp/Caption/New}}/>
|
|
|
|
</em>
|
|
|
|
</$button>
|