1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-04 23:39:57 +00:00
TiddlyWiki5/core/ui/AdvancedSearch/System.tid

117 lines
4.5 KiB
Plaintext
Raw Normal View History

title: $:/core/ui/AdvancedSearch/System
tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/System/Caption}}
first-search-filter: [is[system]search<userInput>sort[title]limit[250]] :except[[$:/temp/advancedsearch]] :except[[$:/temp/advancedsearch/input]] :except[[$:/temp/advancedsearch/selected-item]]
\procedure lingo-base() $:/language/Search/
\procedure set-next-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="after"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\procedure set-previous-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="before"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\procedure cancel-search-actions()
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]"
emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />">
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/>
<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/>
</$list>
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\end
\procedure input-accept-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<tiddler>get[text]] }}}/>
</$list>
\end
\procedure input-accept-variant-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<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>
\end
\whitespace trim
<<lingo System/Hint>>
2014-11-23 16:07:58 +00:00
<div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>>>
<$transclude $variable="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/core/ui/AdvancedSearch/System]]"
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard>
</$keyboard>
&#32;
2014-11-23 16:07:58 +00:00
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible">
<<cancel-search-actions>>
2014-11-23 16:07:58 +00:00
{{$:/core/images/close-button}}
</$button>
</$reveal>
</div>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
<$set name="resultCount" value={{{ [is[system]search{$:/temp/advancedsearch}] :except[[$:/temp/advancedsearch]] :except[[$:/temp/advancedsearch/input]] :except[[$:/temp/advancedsearch/selected-item]] +[count[]] }}}>
<div class="tc-search-results">
<%if [<resultCount>match[0]] %>
{{$:/language/Search/Matches/NoMatch}}
<%else%>
<<lingo System/Matches>>
<%endif%>
<$list filter="[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] :except[[$:/temp/advancedsearch]] :except[[$:/temp/advancedsearch/input]] :except[[$:/temp/advancedsearch/selected-item]]">
<span class={{{[<currentTiddler>addsuffix[-primaryList]] :except[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span>
</$list>
</div>
</$set>
</$list>
</$reveal>
<$reveal state="$:/temp/advancedsearch" type="match" text="">
</$reveal>