mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
allows to add link via ENTER in input (#2703)
simplified / refactored actions
This commit is contained in:
parent
7e58866499
commit
61f9adb710
@ -2,51 +2,26 @@ title: $:/core/ui/EditorToolbar/link-dropdown
|
||||
|
||||
\define lingo-base() $:/language/Buttons/Link/
|
||||
|
||||
\define link-actions()
|
||||
<$action-sendmessage
|
||||
$message="tm-edit-text-operation"
|
||||
$param="make-link"
|
||||
text={{$(linkTiddler)$}}
|
||||
/>
|
||||
|
||||
<$action-deletetiddler
|
||||
$tiddler=<<dropdown-state>>
|
||||
/>
|
||||
|
||||
<$action-deletetiddler
|
||||
$tiddler=<<searchTiddler>>
|
||||
/>
|
||||
|
||||
<$action-deletetiddler
|
||||
$tiddler=<<linkTiddler>>
|
||||
/>
|
||||
\define add-link-actions()
|
||||
<$action-sendmessage $message="tm-edit-text-operation" $param="make-link" text={{$(linkTiddler)$}} />
|
||||
<$action-deletetiddler $tiddler=<<dropdown-state>> />
|
||||
<$action-deletetiddler $tiddler=<<searchTiddler>> />
|
||||
<$action-deletetiddler $tiddler=<<linkTiddler>> />
|
||||
\end
|
||||
|
||||
\define external-link()
|
||||
<$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;">
|
||||
<$action-sendmessage $message="tm-edit-text-operation" $param="make-link" text={{$(searchTiddler)$}}
|
||||
/>
|
||||
<$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;" actions=<<add-link-actions>>>
|
||||
{{$:/core/images/chevron-right}}
|
||||
<$action-deletetiddler
|
||||
$tiddler=<<dropdown-state>>
|
||||
/>
|
||||
|
||||
<$action-deletetiddler
|
||||
$tiddler=<<searchTiddler>>
|
||||
/>
|
||||
|
||||
<$action-deletetiddler
|
||||
$tiddler=<<linkTiddler>>
|
||||
/>
|
||||
</$button>
|
||||
\end
|
||||
|
||||
|
||||
\define body(config-title)
|
||||
''<<lingo Hint>>''
|
||||
|
||||
<$vars searchTiddler="""$config-title$/search""" linkTiddler="""$config-title$/link""" linktext="" >
|
||||
|
||||
<$vars linkTiddler=<<searchTiddler>>>
|
||||
<$keyboard key="ENTER" actions=<<add-link-actions>>>
|
||||
<$edit-text tiddler=<<searchTiddler>> type="search" tag="input" focus="true" placeholder={{$:/language/Search/Search}} default=""/>
|
||||
<$reveal tag="span" state=<<searchTiddler>> type="nomatch" text="">
|
||||
<<external-link>>
|
||||
@ -55,10 +30,12 @@ title: $:/core/ui/EditorToolbar/link-dropdown
|
||||
{{$:/core/images/close-button}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
</$keyboard>
|
||||
</$vars>
|
||||
|
||||
<$reveal tag="div" state=<<searchTiddler>> type="nomatch" text="">
|
||||
|
||||
<$linkcatcher actions=<<link-actions>> to=<<linkTiddler>>>
|
||||
<$linkcatcher actions=<<add-link-actions>> to=<<linkTiddler>>>
|
||||
|
||||
{{$:/core/ui/SearchResults}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user