1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-11 10:40:29 +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-FILTER-STR() [variables<_tf.dv-type>]
\define DV-TMP-SEARCH() $:/temp/varSearch \define DV-TMP-SEARCH() $:/temp/varSearch
\define DV-TMP-EXCLUDE() $:/temp/varExclude
\define DV-TMP-SEARCH-DETAILS() $:/temp/varSearch/details \define DV-TMP-SEARCH-DETAILS() $:/temp/varSearch/details
\define DV-SEARCH-STATE() $:/state/varSearch \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-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>] \function tf.dv-formattedVar() [<varname>format:variable<_tf.dv-varFormat>]
@ -65,6 +68,13 @@ tags: $:/tags/Global
</$button> </$button>
\end \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() \procedure dv-expandAllStatesButton()
<$button class="tc-btn-invisible tc-tiny-gap-left"> <$button class="tc-btn-invisible tc-tiny-gap-left">
<$action-setfield $tiddler=<<DV-SEARCH-STATE>> text={{{ [<tf.dv-toggleInfoState>get[text]] +[toggle[yes],[no]] }}}/> <$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-searchText() [<DV-TMP-SEARCH>] [<qualify>] +[join[/]]
\function tf.dv-getSearchText() [<tf.dv-searchText>get[text]] \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-detailsSearch() [<DV-TMP-SEARCH-DETAILS>] [<varname>] [<qualify>] +[join[/]]
\function tf.dv-getDetailsSearchText() [<tf.dv-detailsSearch>get[text]] \function tf.dv-getDetailsSearchText() [<tf.dv-detailsSearch>get[text]]
@ -151,18 +165,21 @@ tags: $:/tags/Global
<% endif %> <% endif %>
<div class="tc-dv-search-input"> <div class="tc-dv-search-input">
<% if [<thisTiddler>!match[$:/AdvancedSearch]] %> <% 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 [<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%> <%if [<type>!is[blank]] %><code class="tc-small-gap">type:<<_tf.dv-type>></code><%endif%>
<% 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]] %> <% if [<DV-SEARCH-STATE>get[text]match[yes]] %>
<<dv-clearStatesButton>> <<dv-clearStatesButton>>
<% else %> <% else %>
<<dv-expandAllStatesButton>> <<dv-expandAllStatesButton>>
<% endif %> <% 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> </div>
<$list filter="[subfilter<tf.dv-filterString>] +[search::some<tf.dv-getSearchText>] +[filter<subfilter>]" variable="varname"> <$list filter="[subfilter<tf.dv-filterString>] +[search::some<tf.dv-getSearchText>] +[filter<subfilter>] +[!filter<tf.dv-getExcludeText>]" variable="varname">
<div class="tc-var-item"> <div class="tc-var-item">
<$button actions=<<dv-toggleState>> class="tc-small-gap-left tc-btn-invisible"> <$button actions=<<dv-toggleState>> class="tc-small-gap-left tc-btn-invisible">
<% if [<tf.dv-varState>get[text]match[yes]] %> <% if [<tf.dv-varState>get[text]match[yes]] %>
@ -179,11 +196,12 @@ tags: $:/tags/Global
<% if [<tf.dv-varState>get[text]match[yes]] %> <% if [<tf.dv-varState>get[text]match[yes]] %>
<$button actions=<<dv-toggleInfoState>> class="tc-btn-invisible tc-small-gap-left"> <$button actions=<<dv-toggleInfoState>> class="tc-btn-invisible tc-small-gap-left">
<% if [<tf.dv-toggleInfoState>get[text]match[yes]] %> <% if [<tf.dv-toggleInfoState>get[text]match[yes]] %>
{{$:/core/images/down-arrow}} {{$:/core/images/up-arrow}}
<% else %> <% else %>
{{$:/core/images/right-arrow}} {{$:/core/images/advanced-search-button}}
<% endif %> <% endif %>
</$button> </$button>
<blockquote class="tc-quote">
<% if [<tf.dv-toggleInfoState>get[text]match[yes]] %> <% if [<tf.dv-toggleInfoState>get[text]match[yes]] %>
<div class="tc-labeled-input-wrapper"> <div class="tc-labeled-input-wrapper">
<span class="tc-fixed-label tc-align-right">{{$:/language/Search/Variables/Search/Details}}</span> <span class="tc-fixed-label tc-align-right">{{$:/language/Search/Variables/Search/Details}}</span>
@ -195,6 +213,7 @@ tags: $:/tags/Global
<$codeblock code={{{ [<varname>getvariable[value]] }}}/> <$codeblock code={{{ [<varname>getvariable[value]] }}}/>
<% endif %> <% endif %>
<$codeblock code={{{ [<varname>getvariable[]] }}}/> <$codeblock code={{{ [<varname>getvariable[]] }}}/>
</blockquote>
<% endif %> <% endif %>
</div> </div>
</$list> </$list>