2016-04-29 17:54:41 +00:00
|
|
|
title: $:/core/ui/EditorToolbar/link-dropdown
|
|
|
|
|
|
|
|
\define lingo-base() $:/language/Buttons/Link/
|
|
|
|
|
2018-04-24 21:02:04 +00:00
|
|
|
\define add-link-actions()
|
2022-04-01 11:10:29 +00:00
|
|
|
\whitespace trim
|
2018-04-24 21:02:04 +00:00
|
|
|
<$action-sendmessage $message="tm-edit-text-operation" $param="make-link" text={{$(linkTiddler)$}} />
|
2020-10-28 12:01:05 +00:00
|
|
|
<$action-deletetiddler $filter="[<dropdown-state>] [<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]"/>
|
2016-04-29 17:54:41 +00:00
|
|
|
\end
|
|
|
|
|
2020-11-02 19:08:24 +00:00
|
|
|
\define get-focus-selector() [data-tiddler-title="$(cssEscapedTitle)$"] .tc-create-wikitext-link input
|
|
|
|
|
|
|
|
\define cancel-search-actions-inner()
|
2022-04-01 11:10:29 +00:00
|
|
|
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}><$list filter="[<searchTiddler>get[text]!match<userInput>]" emptyMessage="<$action-deletetiddler $filter='[<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]'/>"><$action-setfield $tiddler=<<searchTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/></$list></$set>
|
2020-11-02 19:08:24 +00:00
|
|
|
\end
|
|
|
|
|
2022-04-01 11:10:29 +00:00
|
|
|
\define cancel-search-actions() <$list filter="[<storeTitle>!has[text]] +[<searchTiddler>!has[text]]" emptyMessage="<<cancel-search-actions-inner>>"><$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/></$list>
|
2020-10-28 12:01:05 +00:00
|
|
|
|
2016-08-07 09:18:53 +00:00
|
|
|
\define external-link()
|
2022-04-01 11:10:29 +00:00
|
|
|
\whitespace trim
|
2023-06-13 10:22:11 +00:00
|
|
|
<$button class="tc-btn-invisible tc-btn-mini" style="width: auto; display: inline-block; background-colour: inherit;" actions=<<add-link-actions>>>
|
2016-08-07 09:18:53 +00:00
|
|
|
{{$:/core/images/chevron-right}}
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
2022-04-01 11:10:29 +00:00
|
|
|
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/search/currentTab' text=<<nextTab>>/>"/>
|
2020-10-28 12:01:05 +00:00
|
|
|
|
2016-04-29 18:19:18 +00:00
|
|
|
\define body(config-title)
|
2022-04-01 11:10:29 +00:00
|
|
|
\whitespace trim
|
2016-04-29 17:54:41 +00:00
|
|
|
''<<lingo Hint>>''
|
|
|
|
|
2020-10-28 12:01:05 +00:00
|
|
|
<$vars searchTiddler="""$config-title$/search""" linkTiddler="""$config-title$/link""" linktext="" searchListState=<<qualify "$:/temp/link-search/selected-item">> refreshTitle=<<qualify "$:/temp/link-search/refresh">> storeTitle=<<qualify "$:/temp/link-search/input">>>
|
2016-04-29 17:54:41 +00:00
|
|
|
|
2018-04-24 21:02:04 +00:00
|
|
|
<$vars linkTiddler=<<searchTiddler>>>
|
2020-10-28 12:01:05 +00:00
|
|
|
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
|
2020-11-02 19:08:24 +00:00
|
|
|
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">> class="tc-create-wikitext-link">
|
|
|
|
<$macrocall $name="keyboard-driven-input" tiddler=<<searchTiddler>> storeTitle=<<storeTitle>>
|
|
|
|
selectionStateTitle=<<searchListState>> refreshTitle=<<refreshTitle>> type="search" filterMinLength="1"
|
2022-04-01 11:10:29 +00:00
|
|
|
tag="input" focus="true" class="tc-popup-handle" inputCancelActions=<<cancel-search-actions>>
|
|
|
|
inputAcceptActions=<<add-link-actions>> placeholder={{$:/language/Search/Search}} default=""
|
2020-10-28 12:01:05 +00:00
|
|
|
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" />
|
|
|
|
</$keyboard>
|
|
|
|
</$keyboard>
|
2022-04-01 11:10:29 +00:00
|
|
|
 
|
2020-10-28 12:01:05 +00:00
|
|
|
<$reveal tag="span" state=<<storeTitle>> type="nomatch" text="">
|
2016-08-07 09:18:53 +00:00
|
|
|
<<external-link>>
|
2022-04-01 11:10:29 +00:00
|
|
|
 
|
2023-06-13 10:22:11 +00:00
|
|
|
<$button class="tc-btn-invisible tc-btn-mini" style="width: auto; display: inline-block; background-colour: inherit;">
|
2020-11-02 19:08:24 +00:00
|
|
|
<<cancel-search-actions>><$set name="cssEscapedTitle" value={{{ [<storyTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<get-focus-selector>>/></$set>
|
2016-04-29 17:54:41 +00:00
|
|
|
{{$:/core/images/close-button}}
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
2018-04-24 21:02:04 +00:00
|
|
|
</$vars>
|
2016-04-29 17:54:41 +00:00
|
|
|
|
2020-10-28 12:01:05 +00:00
|
|
|
<$reveal tag="div" state=<<storeTitle>> type="nomatch" text="">
|
2016-04-29 17:54:41 +00:00
|
|
|
|
2018-04-24 21:02:04 +00:00
|
|
|
<$linkcatcher actions=<<add-link-actions>> to=<<linkTiddler>>>
|
2016-04-29 17:54:41 +00:00
|
|
|
|
2020-10-28 12:01:05 +00:00
|
|
|
<$vars userInput={{{ [<storeTitle>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}>
|
2020-10-27 17:33:06 +00:00
|
|
|
|
2016-04-29 17:54:41 +00:00
|
|
|
{{$:/core/ui/SearchResults}}
|
|
|
|
|
2020-10-27 17:33:06 +00:00
|
|
|
</$vars>
|
|
|
|
|
2016-04-29 17:54:41 +00:00
|
|
|
</$linkcatcher>
|
|
|
|
|
|
|
|
</$reveal>
|
|
|
|
|
2016-04-29 18:19:18 +00:00
|
|
|
</$vars>
|
|
|
|
|
|
|
|
\end
|
|
|
|
|
2020-10-27 17:33:06 +00:00
|
|
|
<$macrocall $name="body" config-title=<<qualify "$:/state/Link/">>/>
|