1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Refactor AdvancedSearch/Filter to make buttons extensible

This commit is contained in:
Jermolene 2016-02-05 18:43:52 +00:00
parent 147dc128bc
commit 8bc0633b6f
4 changed files with 35 additions and 23 deletions

View File

@ -3,35 +3,13 @@ tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Filter/Caption}}
\define lingo-base() $:/language/Search/
<$linkcatcher to="$:/temp/advancedsearch">
<<lingo Filter/Hint>>
<div class="tc-search tc-advanced-search">
<$edit-text tiddler="$:/temp/advancedsearch" type="search" tag="input"/>
<$button popup=<<qualify "$:/state/filterDropdown">> class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
</$button>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/advancedsearch" $field="text" $value=""/>
{{$:/core/images/close-button}}
</$button>
<$macrocall $name="exportButton" exportFilter={{$:/temp/advancedsearch}} lingoBase="$:/language/Buttons/ExportTiddlers/"/>
</$reveal>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list>
</div>
<div class="tc-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/filterDropdown">> type="nomatch" text="" default="">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
</$list>
</div>
</$reveal>
</div>
</$linkcatcher>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
<div class="tc-search-results">

View File

@ -0,0 +1,9 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/clear
tags: $:/tags/AdvancedSearch/FilterButton
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/advancedsearch" $field="text" $value=""/>
{{$:/core/images/close-button}}
</$button>
</$reveal>

View File

@ -0,0 +1,19 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown
tags: $:/tags/AdvancedSearch/FilterButton
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/filterDropdown">> class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
</$button>
</span>
<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
<$linkcatcher to="$:/temp/advancedsearch">
<div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
</$list>
</div>
</div>
</$linkcatcher>
</$reveal>

View File

@ -0,0 +1,6 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/export
tags: $:/tags/AdvancedSearch/FilterButton
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$macrocall $name="exportButton" exportFilter={{$:/temp/advancedsearch}} lingoBase="$:/language/Buttons/ExportTiddlers/"/>
</$reveal>