2020-02-28 14:33:15 +00:00
|
|
|
title: $:/plugins/tiddlywiki/menubar/items/search
|
|
|
|
custom-menu-content: {{$:/plugins/tiddlywiki/menubar/items/search}}
|
|
|
|
description: Search
|
|
|
|
caption: Search
|
|
|
|
tags: $:/tags/MenuBar
|
|
|
|
|
2020-11-02 19:08:24 +00:00
|
|
|
\define cancel-search-actions()
|
|
|
|
<$set name="userInput" value={{{ [<__storeTitle__>get[text]] }}}>
|
|
|
|
<$list filter="[<__tiddler__>get[text]!match<userInput>]" emptyMessage="""<$action-deletetiddler $filter="[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]"/>""">
|
|
|
|
<$action-setfield $tiddler=<<__tiddler__>> text=<<userInput>>/><$action-setfield $tiddler=<<__refreshTitle__>> text="yes"/>
|
|
|
|
</$list>
|
|
|
|
</$set>
|
|
|
|
\end
|
2020-02-28 14:33:15 +00:00
|
|
|
|
2020-07-14 11:32:40 +00:00
|
|
|
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
|
2020-02-28 14:33:15 +00:00
|
|
|
|
2020-10-28 10:55:16 +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-07-14 11:32:40 +00:00
|
|
|
\whitespace trim
|
2020-10-28 10:55:16 +00:00
|
|
|
<$vars searchTiddler="$:/temp/menubarsearch/input" searchListState=<<qualify "$:/state/search-list/selected-item">>>
|
2020-07-14 11:32:40 +00:00
|
|
|
<span style="margin: 0 0.5em;">
|
2020-10-28 10:55:16 +00:00
|
|
|
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
|
|
|
|
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
|
2020-07-14 11:32:40 +00:00
|
|
|
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/menubarsearch" storeTitle=<<searchTiddler>> selectionStateTitle=<<searchListState>>
|
|
|
|
refreshTitle="$:/temp/menubarsearch/refresh" tag="input" type="search" focusPopup="$:/state/popup/menubar-search-dropdown"
|
|
|
|
class="tc-popup-handle tc-menu-show-when-wide" placeholder="Search..." default="" cancelPopups="yes"
|
2020-10-28 10:55:16 +00:00
|
|
|
inputAcceptActions=<<input-accept-actions>> inputCancelActions=<<cancel-search-actions>>
|
|
|
|
filterMinLength={{$:/config/Search/MinLength}} configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" />
|
|
|
|
</$keyboard>
|
|
|
|
</$keyboard>
|
2020-02-28 14:33:15 +00:00
|
|
|
</span>
|
|
|
|
<$reveal tag="div" class="tc-block-dropdown-wrapper" state="$:/state/popup/menubar-search-dropdown" type="nomatch" text="" default="">
|
|
|
|
|
|
|
|
<div class="tc-block-dropdown tc-search-drop-down">
|
|
|
|
|
|
|
|
<$list filter="[<searchTiddler>get[text]minlength[1]]" emptyMessage="""<div class="tc-search-results">Type your search terms</div>""" variable="ignore">
|
|
|
|
|
|
|
|
<$list filter="[<searchTiddler>get[text]minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
|
|
|
|
|
2020-10-28 10:55:16 +00:00
|
|
|
<$vars configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} userInput={{{ [<searchTiddler>get[text]] }}}>
|
|
|
|
|
2020-02-28 14:33:15 +00:00
|
|
|
{{$:/core/ui/SearchResults}}
|
|
|
|
|
2020-10-28 10:55:16 +00:00
|
|
|
</$vars>
|
|
|
|
|
2020-02-28 14:33:15 +00:00
|
|
|
</$list>
|
|
|
|
|
|
|
|
</$list>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</$reveal>
|
|
|
|
|
2020-07-14 11:32:40 +00:00
|
|
|
</$vars>
|