2016-04-29 17:54:41 +00:00
|
|
|
title: $:/core/ui/EditorToolbar/link-dropdown
|
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\procedure lingo-base() $:/language/Buttons/Link/
|
2016-04-29 17:54:41 +00:00
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\procedure add-link-actions()
|
2022-04-01 11:10:29 +00:00
|
|
|
\whitespace trim
|
2024-10-24 13:34:23 +00:00
|
|
|
<$action-sendmessage $message="tm-edit-text-operation" $param="make-link" text={{{ [<linkTiddler>get[text]] }}} />
|
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
|
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\procedure prefix.bracket() [
|
|
|
|
\procedure suffix.bracket() ]
|
2020-11-02 19:08:24 +00:00
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\function tf.get-focus-selector() [[data-tiddler-title=]addprefix[$(prefix.bracket)$]substitute[]addsuffix<cssEscapedTitle>addsuffix[$(suffix.bracket)$]substitute[]] .tc-create-wikitext-link input :and[join[ ]]
|
|
|
|
|
|
|
|
\procedure 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
|
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\procedure cancel-search-actions() <$list filter="[<storeTitle>!has[text]] :and[<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
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\procedure 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
|
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\procedure set-next-input-tab() <$transclude $variable="change-input-tab-after" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/search/currentTab' text=<<nextTab>>/>"/>
|
|
|
|
|
|
|
|
\procedure set-previous-input-tab() <$transclude $variable="change-input-tab-before" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/search/currentTab' text=<<nextTab>>/>"/>
|
2020-10-28 12:01:05 +00:00
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
\procedure body(config-title)
|
2022-04-01 11:10:29 +00:00
|
|
|
\whitespace trim
|
2016-04-29 17:54:41 +00:00
|
|
|
''<<lingo Hint>>''
|
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
<$vars searchTiddler={{{ [<config-title>addsuffix[/search]] }}} linkTiddler={{{ [<config-title>addsuffix[/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>>>
|
2024-10-24 13:34:23 +00:00
|
|
|
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>> class="tc-create-wikitext-link">
|
|
|
|
<$transclude $variable="keyboard-driven-input" tiddler=<<searchTiddler>> storeTitle=<<storeTitle>>
|
2020-11-02 19:08:24 +00:00
|
|
|
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=""
|
2024-10-24 13:34:23 +00:00
|
|
|
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]" />
|
2020-10-28 12:01:05 +00:00
|
|
|
</$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;">
|
2024-10-24 13:34:23 +00:00
|
|
|
<<cancel-search-actions>><$set name="cssEscapedTitle" value={{{ [<storyTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<tf.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
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
<$vars userInput={{{ [<storeTitle>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/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
|
|
|
|
|
2024-10-24 13:34:23 +00:00
|
|
|
<$transclude $variable="body" config-title=<<qualify "$:/state/Link/">>/>
|