1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-02 14:29:55 +00:00

add exclude text-input - works

This commit is contained in:
pmario 2024-04-22 17:01:18 +02:00
parent 12e22190f3
commit 7959ff46eb

View File

@ -12,9 +12,12 @@ tags: $:/tags/Global
\define DV-FILTER-STR() [variables<_tf.dv-type>]
\define DV-TMP-SEARCH() $:/temp/varSearch
\define DV-TMP-EXCLUDE() $:/temp/varExclude
\define DV-TMP-SEARCH-DETAILS() $:/temp/varSearch/details
\define DV-SEARCH-STATE() $:/state/varSearch
\define DV-TMP-EXCLUDE-SUBFILTER() [[]]
\function tf.dv-filterString() [<_tf.dv-sort>match[raw]then<DV-RAW-FILTER-STR>else<DV-FILTER-STR>]
\function tf.dv-formattedVar() [<varname>format:variable<_tf.dv-varFormat>]
@ -65,6 +68,13 @@ tags: $:/tags/Global
</$button>
\end
\procedure dv-clearExcludeButton()
<$button class="tc-btn-invisible tc-tiny-gap-left">
<$action-deletetiddler $tiddler=<<tf.dv-excludeText>>/>
{{$:/core/images/close-button}}
</$button>
\end
\procedure dv-expandAllStatesButton()
<$button class="tc-btn-invisible tc-tiny-gap-left">
<$action-setfield $tiddler=<<DV-SEARCH-STATE>> text={{{ [<tf.dv-toggleInfoState>get[text]] +[toggle[yes],[no]] }}}/>
@ -128,6 +138,10 @@ tags: $:/tags/Global
\function tf.dv-searchText() [<DV-TMP-SEARCH>] [<qualify>] +[join[/]]
\function tf.dv-getSearchText() [<tf.dv-searchText>get[text]]
\function tf.dv-excludeText() [<DV-TMP-EXCLUDE>] [<qualify>] +[join[/]]
\function tf.dv-getExcludeText() [<tf.dv-excludeText>get[text]else<DV-TMP-EXCLUDE-SUBFILTER>]
\function tf.dv-getExcludeText() [<tf.dv-excludeText>get[text]]
\function tf.dv-detailsSearch() [<DV-TMP-SEARCH-DETAILS>] [<varname>] [<qualify>] +[join[/]]
\function tf.dv-getDetailsSearchText() [<tf.dv-detailsSearch>get[text]]
@ -151,19 +165,22 @@ tags: $:/tags/Global
<% endif %>
<div class="tc-dv-search-input">
<% if [<thisTiddler>!match[$:/AdvancedSearch]] %>
<$text text={{$:/language/Search/Variables/Search}}/>
<%if [<sort>!is[blank]] %><code class="tc-small-gap">sort:<<_tf.dv-sort>></code><%endif%>
<%if [<type>!is[blank]] %><code class="tc-small-gap">type:<<_tf.dv-type>></code><%endif%>
<% endif %>
<$edit-text tiddler=<<tf.dv-searchText>> tag=input/> <<dv-clearSearchButton>>
<$text text={{$:/language/Search/Variables/Filter}}/>
<$edit-text tiddler=<<tf.dv-searchText>> tag=input class="tc-tiny-gap-left" placeholder={{$:/language/Search/Variables/Filter/Hint}}/> <<dv-clearSearchButton>>
<% if [<DV-SEARCH-STATE>get[text]match[yes]] %>
<<dv-clearStatesButton>>
<% else %>
<<dv-expandAllStatesButton>>
<% endif %>
<br>
<$text text={{$:/language/Search/Variables/Exclude}}/>
<$edit-text tiddler=<<tf.dv-excludeText>> tag=input class="tc-tiny-gap-left" placeholder={{$:/language/Search/Variables/Exclude/Hint}}/> <<dv-clearExcludeButton>>
</div>
<$list filter="[subfilter<tf.dv-filterString>] +[search::some<tf.dv-getSearchText>] +[filter<subfilter>]" variable="varname">
<div class="tc-var-item">
<$list filter="[subfilter<tf.dv-filterString>] +[search::some<tf.dv-getSearchText>] +[filter<subfilter>] +[!filter<tf.dv-getExcludeText>]" variable="varname">
<div class="tc-var-item">
<$button actions=<<dv-toggleState>> class="tc-small-gap-left tc-btn-invisible">
<% if [<tf.dv-varState>get[text]match[yes]] %>
{{$:/core/images/down-arrow}}
@ -179,11 +196,12 @@ tags: $:/tags/Global
<% if [<tf.dv-varState>get[text]match[yes]] %>
<$button actions=<<dv-toggleInfoState>> class="tc-btn-invisible tc-small-gap-left">
<% if [<tf.dv-toggleInfoState>get[text]match[yes]] %>
{{$:/core/images/down-arrow}}
{{$:/core/images/up-arrow}}
<% else %>
{{$:/core/images/right-arrow}}
{{$:/core/images/advanced-search-button}}
<% endif %>
</$button>
<blockquote class="tc-quote">
<% if [<tf.dv-toggleInfoState>get[text]match[yes]] %>
<div class="tc-labeled-input-wrapper">
<span class="tc-fixed-label tc-align-right">{{$:/language/Search/Variables/Search/Details}}</span>
@ -195,7 +213,8 @@ tags: $:/tags/Global
<$codeblock code={{{ [<varname>getvariable[value]] }}}/>
<% endif %>
<$codeblock code={{{ [<varname>getvariable[]] }}}/>
</blockquote>
<% endif %>
</div>
</div>
</$list>
\end