1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-06 10:46:57 +00:00

Add "inspect" tab to advanced search and make the search box into a textarea

This commit is contained in:
Jeremy Ruston 2025-04-01 12:43:13 +01:00
parent d4043fc1f4
commit 27075acbc6
7 changed files with 45 additions and 40 deletions

View File

@ -4,6 +4,8 @@ DefaultResults/Caption: List
Filter/Caption: Filter
Filter/Hint: Search via a [[filter expression|https://tiddlywiki.com/static/Filters.html]]
Filter/Matches: //<small><<resultCount>> matches</small>//
Filter/FilterResults/Results/Caption: Results
Filter/FilterResults/Inspect/Caption: Inspect
Matches: //<small><<resultCount>> matches</small>//
Matches/All: All matches:
Matches/NoMatch: //No match//

View File

@ -34,39 +34,11 @@ caption: {{$:/language/Search/Filter/Caption}}
</$list>
\end
\procedure input-accept-actions()
\whitespace trim
<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]">
<$list-empty>
<$list filter="[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]">
<$action-navigate $to={{{ [<tiddler>get[text]] }}}/>
</$list>
<$/list-empty>
<$action-navigate $to={{{ [<tiddler>get[text]] }}}/>
</$list>
\end
\procedure input-accept-variant-actions()
\whitespace trim
<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]">
<$list-empty>
<$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-empty>
<$list filter="[<tiddler>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/>
</$list>
</$list>
\end
\whitespace trim
<<lingo Filter/Hint>>
<div class="tc-search tc-advanced-search">
<div class="tc-search tc-advanced-search tc-edit-max-width">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>> class="tc-small-gap-right">
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>>>
<$transclude $variable="keyboard-driven-input"
@ -75,13 +47,15 @@ caption: {{$:/language/Search/Filter/Caption}}
refreshTitle="$:/temp/advancedsearch/refresh"
selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search"
tag="input"
tag="textarea"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/temp/advancedsearch]]"
firstSearchFilterField="text"
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
inputAcceptActions=""
inputAcceptVariantActions=""
inputCancelActions=<<cancel-search-actions>>
minHeight="2em"
autoHeight="yes"
/>
</$keyboard>
</$keyboard>
@ -91,12 +65,10 @@ caption: {{$:/language/Search/Filter/Caption}}
</div>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="" tag="div" class="tc-search-results">
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>">
<p><<lingo Filter/Matches>></p>
<$list filter={{$:/temp/advancedsearch}}>
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span>
</$list>
</$set>
<$macrocall
$name="tabs"
tabsList="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterResults]!has[draft.of]]"
default="$:/core/ui/AdvancedSearch/Filter/FilterResults/Results"
explicitState="$:/state/tab-1749438307"
/>
</$reveal>

View File

@ -0,0 +1,12 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterResults/Inspect
tags: $:/tags/AdvancedSearch/FilterResults
caption: {{$:/language/Search/Filter/FilterResults/Inspect/Caption}}
\procedure lingo-base() $:/language/Search/
<$let json={{{ [inspect{$:/temp/advancedsearch}] }}}>
<$transclude $variable="copy-to-clipboard-above-right" src=<<json>>/>
<$codeblock code=<<json>> language="application/json" }}}/>
<$codeblock code=/>

View File

@ -0,0 +1,13 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterResults/Results
tags: $:/tags/AdvancedSearch/FilterResults
caption: {{$:/language/Search/Filter/FilterResults/Results/Caption}}
\procedure lingo-base() $:/language/Search/
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>">
<p><<lingo Filter/Matches>></p>
<$list filter={{$:/temp/advancedsearch}}>
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span>
</$list>
</$set>

View File

@ -0,0 +1,2 @@
title: $:/state/tab--1498284803
text: $:/core/ui/AdvancedSearch/Filter

View File

@ -0,0 +1,2 @@
title: $:/state/tab-1749438307
text: $:/core/ui/AdvancedSearch/Filter/FilterResults/Results

View File

@ -0,0 +1,2 @@
title: $:/tags/AdvancedSearch/FilterResults
list: $:/core/ui/AdvancedSearch/Filter/FilterResults/Results $:/core/ui/AdvancedSearch/Filter/FilterResults/Inspect