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">
|
|
|
|
<$set name="searchTerm" value={{{ [<searchTiddler>get[text]] }}}>
|
|
|
|
<$set name="resultCount" value="""<$count filter="[!is[system]search<searchTerm>]"/>""">
|
|
|
|
{{$:/language/Search/Matches}}
|
|
|
|
</$set>
|
|
|
|
</$set>
|
|
|
|
</$list>
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define search-results-list()
|
|
|
|
\whitespace trim
|
|
|
|
<$list filter="[{$(searchTiddler)$}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
|
|
|
|
|
|
|
|
{{$:/core/ui/SearchResults}}
|
|
|
|
|
|
|
|
</$list>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define delete-state-tiddlers() <$action-deletetiddler $filter="[[$:/temp/search]] [<searchTiddler>] [<searchListState>]"/>
|
|
|
|
|
|
|
|
\define cancel-search-actions() <$action-deletetiddler $filter="[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]"/>
|
|
|
|
|
|
|
|
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
|
|
|
|
|
|
|
|
\define input-accept-variant-actions() <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
|
|
|
|
|
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-07-13 16:42:55 +00:00
|
|
|
<$vars searchTiddler="$:/temp/search/input" searchListState=<<qualify "$:/state/search-list/selected-item">> titleSearchFilter="[!is[system]search:title<userInput>sort[title]limit[250]]" allSearchFilter="[!is[system]search<userInput>sort[title]limit[250]]">
|
2018-08-02 12:22:21 +00:00
|
|
|
<div class="tc-search">
|
2020-07-13 16:42:55 +00:00
|
|
|
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/search" storeTitle=<<searchTiddler>>
|
|
|
|
selectionStateTitle=<<searchListState>> refreshTitle="$:/temp/search/refresh" type="search"
|
|
|
|
tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/search-dropdown">>
|
|
|
|
class="tc-popup-handle" primaryListFilter=<<titleSearchFilter>> secondaryListFilter=<<allSearchFilter>>
|
|
|
|
filterMinLength={{$:/config/Search/MinLength}} inputCancelActions=<<cancel-search-actions>>
|
|
|
|
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> cancelPopups="yes" />
|
|
|
|
<$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">
|
|
|
|
<$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search}}/>
|
2020-07-13 16:42:55 +00:00
|
|
|
<<delete-state-tiddlers>>
|
2018-08-02 12:22:21 +00:00
|
|
|
<$action-navigate $to="$:/AdvancedSearch"/>
|
|
|
|
{{$:/core/images/advanced-search-button}}
|
|
|
|
</$button>
|
|
|
|
<$button class="tc-btn-invisible">
|
2020-07-13 16:42:55 +00:00
|
|
|
<<delete-state-tiddlers>>
|
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>
|