1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 01:20:30 +00:00
TiddlyWiki5/core/ui/EditorToolbar/excise-dropdown.tid
Jermolene ffae85140f Fix state cleanup for excise toolbar button
We were deleting the wrong tiddler
2016-08-18 08:59:09 +01:00

50 lines
1.5 KiB
Plaintext

title: $:/core/ui/EditorToolbar/excise-dropdown
\define lingo-base() $:/language/Buttons/Excise/
\define body(config-title)
''<<lingo Hint>>''
<<lingo Caption/NewTitle>> <$edit-text tag="input" tiddler="$config-title$/new-title" default="" focus="true"/>
<$set name="new-title" value={{$config-title$/new-title}}>
<$list filter="""[<new-title>is[tiddler]]""">
<div class="tc-error">
<<lingo Caption/TiddlerExists>>
</div>
</$list>
</$set>
<$checkbox tiddler="""$config-title$/tagnew""" field="text" checked="yes" unchecked="no" default="false"> <<lingo Caption/Tag>></$checkbox>
<<lingo Caption/Replace>> <$select tiddler="""$config-title$/type""" default="transclude">
<option value="link"><<lingo Caption/Replace/Link>></option>
<option value="transclude"><<lingo Caption/Replace/Transclusion>></option>
<option value="macro"><<lingo Caption/Replace/Macro>></option>
</$select>
<$reveal state="""$config-title$/type""" type="match" text="macro">
<<lingo Caption/MacroName>> <$edit-text tag="input" tiddler="""$config-title$/macro-title""" default="translink"/>
</$reveal>
<$button>
<$action-sendmessage
$message="tm-edit-text-operation"
$param="excise"
title={{$config-title$/new-title}}
type={{$config-title$/type}}
macro={{$config-title$/macro-title}}
tagnew={{$config-title$/tagnew}}
/>
<$action-deletetiddler
$tiddler="$config-title$/new-title"
/>
<$action-deletetiddler
$tiddler=<<dropdown-state>>
/>
<<lingo Caption/Excise>>
</$button>
\end
<$macrocall $name="body" config-title=<<qualify "$:/state/Excise/">>/>