2018-08-02 12:22:21 +00:00
|
|
|
title: $:/core/ui/SideBarSegments/search
|
|
|
|
tags: $:/tags/SideBarSegment
|
|
|
|
|
2019-10-12 08:24:05 +00:00
|
|
|
\whitespace trim
|
2020-07-13 16:42:55 +00:00
|
|
|
|
|
|
|
\define count-popup-button()
|
|
|
|
\whitespace trim
|
|
|
|
<$button popup=<<qualify "$:/state/popup/search-dropdown">> class="tc-btn-invisible">
|
|
|
|
{{$:/core/images/down-arrow}}
|
|
|
|
<$list filter="[{$(searchTiddler)$}minlength{$:/config/Search/MinLength}limit[1]]" variable="listItem">
|
2020-12-04 18:27:40 +00:00
|
|
|
<$vars userInput={{{ [<searchTiddler>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} replaceRegexp="limit\[\d+\]">
|
|
|
|
<$vars primaryListFilter={{{ [<configTiddler>get[first-search-filter]search-replace:g:regexp<replaceRegexp>,[]] }}} secondaryListFilter={{{ [<configTiddler>get[second-search-filter]search-replace:g:regexp<replaceRegexp>,[]] }}}>
|
|
|
|
<$set name="resultCount" value="""<$count filter="[subfilter<primaryListFilter>] [subfilter<secondaryListFilter>]"/>""">
|
2020-07-13 16:42:55 +00:00
|
|
|
{{$:/language/Search/Matches}}
|
|
|
|
</$set>
|
2020-11-17 19:05:32 +00:00
|
|
|
</$vars>
|
|
|
|
</$vars>
|
2020-07-13 16:42:55 +00:00
|
|
|
</$list>
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define search-results-list()
|
|
|
|
\whitespace trim
|
2020-10-27 17:33:06 +00:00
|
|
|
<$vars userInput={{$(searchTiddler)$}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}>
|
2020-10-23 14:58:34 +00:00
|
|
|
<$list filter="[<userInput>minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
|
|
|
|
|
2020-10-27 17:33:06 +00:00
|
|
|
<$tiddler tiddler=<<configTiddler>>>
|
2020-07-13 16:42:55 +00:00
|
|
|
|
|
|
|
{{$:/core/ui/SearchResults}}
|
|
|
|
|
2020-10-23 14:58:34 +00:00
|
|
|
</$tiddler>
|
|
|
|
|
2020-07-13 16:42:55 +00:00
|
|
|
</$list>
|
2020-10-27 17:33:06 +00:00
|
|
|
</$vars>
|
2020-07-13 16:42:55 +00:00
|
|
|
\end
|
|
|
|
|
2020-11-02 19:08:24 +00:00
|
|
|
\define cancel-search-actions() <$list filter="[<searchTiddler>get[text]!match{$:/temp/search}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/search]] [<searchTiddler>] [<searchListState>]"/>"""><$action-setfield $tiddler="$:/temp/search" text={{{ [<searchTiddler>get[text]] }}}/><$action-setfield $tiddler="$:/temp/search/refresh" text="yes"/></$list>
|
2020-07-13 16:42:55 +00:00
|
|
|
|
2020-11-08 13:26:02 +00:00
|
|
|
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
|
2020-07-13 16:42:55 +00:00
|
|
|
|
2020-11-08 13:26:02 +00:00
|
|
|
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
|
2020-07-13 16:42:55 +00:00
|
|
|
|
2020-10-23 14:58:34 +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-11-06 16:53:11 +00:00
|
|
|
\define advanced-search-actions() <$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search/input}}/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/search/input}}/><<delete-state-tiddlers>><$action-navigate $to="$:/AdvancedSearch"/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/><$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/><$action-deletetiddler $filter="$:/temp/search $:/temp/search/input $:/temp/search/refresh [<searchListState>]"/>
|
2020-10-27 09:03:34 +00:00
|
|
|
|
2019-07-11 21:00:28 +00:00
|
|
|
<div class="tc-sidebar-lists tc-sidebar-search">
|
2018-08-02 12:22:21 +00:00
|
|
|
|
2020-12-06 17:15:40 +00:00
|
|
|
<$vars editTiddler="$:/temp/search" searchTiddler="$:/temp/search/input" searchListState=<<qualify "$:/state/search-list/selected-item">>>
|
2018-08-02 12:22:21 +00:00
|
|
|
<div class="tc-search">
|
2020-10-23 18:32:40 +00:00
|
|
|
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
|
|
|
|
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
|
2020-10-27 09:03:34 +00:00
|
|
|
<$keyboard key="((advanced-search-sidebar))" actions=<<advanced-search-actions>>>
|
2022-06-17 13:03:36 +00:00
|
|
|
<form class="tc-form-inline">
|
2020-12-06 17:15:40 +00:00
|
|
|
<$macrocall $name="keyboard-driven-input" tiddler=<<editTiddler>> storeTitle=<<searchTiddler>>
|
2020-07-13 16:42:55 +00:00
|
|
|
selectionStateTitle=<<searchListState>> refreshTitle="$:/temp/search/refresh" type="search"
|
|
|
|
tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/search-dropdown">>
|
2024-08-25 10:37:29 +00:00
|
|
|
class="tc-tiny-gap-right tc-popup-handle" filterMinLength={{$:/config/Search/MinLength}} inputCancelActions=<<cancel-search-actions>>
|
2020-10-27 17:33:06 +00:00
|
|
|
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> cancelPopups="yes"
|
|
|
|
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"/>
|
2022-06-14 08:45:49 +00:00
|
|
|
</form>
|
2020-10-23 14:58:34 +00:00
|
|
|
</$keyboard>
|
|
|
|
</$keyboard>
|
2020-10-27 09:03:34 +00:00
|
|
|
</$keyboard>
|
2020-07-13 16:42:55 +00:00
|
|
|
<$reveal state=<<searchTiddler>> type="nomatch" text="">
|
2018-08-02 12:22:21 +00:00
|
|
|
<$button tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="tc-btn-invisible">
|
2020-10-27 09:03:34 +00:00
|
|
|
<<advanced-search-actions>>
|
2018-08-02 12:22:21 +00:00
|
|
|
{{$:/core/images/advanced-search-button}}
|
|
|
|
</$button>
|
|
|
|
<$button class="tc-btn-invisible">
|
2020-11-02 19:08:24 +00:00
|
|
|
<<cancel-search-actions>><$action-sendmessage $message="tm-focus-selector" $param=".tc-search input"/>
|
2018-08-02 12:22:21 +00:00
|
|
|
{{$:/core/images/close-button}}
|
|
|
|
</$button>
|
2020-07-13 16:42:55 +00:00
|
|
|
<<count-popup-button>>
|
2018-08-02 12:22:21 +00:00
|
|
|
</$reveal>
|
2020-07-13 16:42:55 +00:00
|
|
|
<$reveal state=<<searchTiddler>> type="match" text="">
|
2018-08-02 12:22:21 +00:00
|
|
|
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="tc-btn-invisible">
|
|
|
|
{{$:/core/images/advanced-search-button}}
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
|
|
|
</div>
|
|
|
|
|
2020-07-13 16:42:55 +00:00
|
|
|
<$reveal tag="div" class="tc-block-dropdown-wrapper" state=<<searchTiddler>> type="nomatch" text="">
|
2018-08-02 12:22:21 +00:00
|
|
|
|
|
|
|
<$reveal tag="div" class="tc-block-dropdown tc-search-drop-down tc-popup-handle" state=<<qualify "$:/state/popup/search-dropdown">> type="nomatch" text="" default="">
|
|
|
|
|
2020-07-13 16:42:55 +00:00
|
|
|
<<search-results-list>>
|
2018-08-02 12:22:21 +00:00
|
|
|
|
|
|
|
</$reveal>
|
|
|
|
|
|
|
|
</$reveal>
|
|
|
|
|
2020-07-13 16:42:55 +00:00
|
|
|
</$vars>
|
2018-08-02 12:22:21 +00:00
|
|
|
|
|
|
|
</div>
|