1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-23 07:26:54 +00:00

dumpvariables, search-variables -- add Type, Sort labels, fix layout spacing

This commit is contained in:
pmario 2024-02-23 01:19:15 +01:00
parent fab815e128
commit 143315ed36

View File

@ -21,9 +21,11 @@ tags: $:/tags/Global
<!-- =================== --> <!-- =================== -->
<!-- dumpvariables main --> <!-- dumpvariables main -->
<!-- =================== --> <!-- =================== -->
\procedure dumpvariables(type sort:"sort" subfilter:"[[]]" format) \procedure dumpvariables(type sort subfilter:"[[]]" format)
<!-- The following function default value may be different for dumpvariables and search-variables --> <!-- The following function is needed since the "format" string can contain closing brackets ")" -->
\function _tf.dv-varFormat() [<format>!is[blank]then<format>else[$type$ $name$($params$)]] \function _tf.dv-varFormat() [<format>!is[blank]then<format>else[$type$ $name$($params$)]]
\function _tf.dv-type() [<type>]
\function _tf.dv-sort() [<sort>]
<ul> <ul>
<$list filter="[subfilter<tf.dv-filterString>] +[filter<subfilter>]" variable="varname"> <$list filter="[subfilter<tf.dv-filterString>] +[filter<subfilter>]" variable="varname">
<li> <li>
@ -98,27 +100,29 @@ tags: $:/tags/Global
margin-right: .25em; margin-right: .25em;
} }
</style> </style>
<span class="tc-dv-filterOptions"> <span class="tc-dv-filterOptions tc-small-gap-right">
{{$:/language/Search/Variables/Option/Type}}
<$list filter="[enlist<DV-VAR-FILTER-OPTIONS>]" variable="option"> <$list filter="[enlist<DV-VAR-FILTER-OPTIONS>]" variable="option">
<$checkbox tiddler=<<tf.dv-tmpFilterOptions>> listField="text" checked=<<option>> <$checkbox tiddler=<<tf.dv-tmpTypeOptions>> listField="text" checked=<<option>>
class="tc-big-gap-right" data-gap="right" class="tc-small-gap-left tc-small-gap-right" data-gap="right"
> >
<<option>> <<option>>
</$checkbox> </$checkbox>
</$list> </$list>|
</span> </span>
\end \end
\procedure dv-sortOptions() \procedure dv-sortOptions()
<span> <span class="tc-dv-sortOptions">
<$select tiddler=<<tf.dv-tmpSortOptions>> default="alphabetical"> {{$:/language/Search/Variables/Option/Sort}}
<$select tiddler=<<tf.dv-tmpSortOptions>> default="alphabetical" class="tc-tiny-gap-left">
<option value="alphabetical">alphabetical</option> <option value="alphabetical">alphabetical</option>
<option value="raw">raw</option> <option value="raw">raw</option>
</$select> </$select>
</span> </span>
\end \end
\function tf.dv-tmpFilterOptions() [<DV-TMP-FILTER-OPTIONS>] [<qualify>] +[join[/]] \function tf.dv-tmpTypeOptions() [<DV-TMP-FILTER-OPTIONS>] [<qualify>] +[join[/]]
\function tf.dv-tmpSortOptions() [<DV-TMP-SORT-OPTIONS>] [<qualify>] +[join[/]] \function tf.dv-tmpSortOptions() [<DV-TMP-SORT-OPTIONS>] [<qualify>] +[join[/]]
\function tf.dv-searchText() [<DV-TMP-SEARCH>] [<qualify>] +[join[/]] \function tf.dv-searchText() [<DV-TMP-SEARCH>] [<qualify>] +[join[/]]
@ -134,9 +138,9 @@ tags: $:/tags/Global
<!-- search-variables main function --> <!-- search-variables main function -->
<!-- ============================== --> <!-- ============================== -->
\procedure search-variables(type sort subfilter:"[[]]" format) \procedure search-variables(type sort subfilter:"[[]]" format)
<!-- The following function default value may be different for dumpvariables and search-variables --> <!-- The following function is needed since the "format" string can contain closing brackets ")" -->
\function _tf.dv-varFormat() [<format>!is[blank]then<format>else[$type$ $name$($params$)]] \function _tf.dv-varFormat() [<format>!is[blank]then<format>else[$type$ $name$($params$)]]
\function _tf.dv-type() [<type>!is[blank]then<type>] :else[<tf.dv-tmpFilterOptions>get[text]] \function _tf.dv-type() [<type>!is[blank]then<type>] :else[<tf.dv-tmpTypeOptions>get[text]]
\function _tf.dv-sort() [<sort>!is[blank]then<sort>] :else[<tf.dv-tmpSortOptions>get[text]] :else[[alphabetical]] \function _tf.dv-sort() [<sort>!is[blank]then<sort>] :else[<tf.dv-tmpSortOptions>get[text]] :else[[alphabetical]]
<% if [<type>is[blank]] %> <% if [<type>is[blank]] %>
@ -149,7 +153,7 @@ tags: $:/tags/Global
<% if [<thisTiddler>!match[$:/AdvancedSearch]] %> <% if [<thisTiddler>!match[$:/AdvancedSearch]] %>
<$text text={{$:/language/Search/Variables/Search}}/> <$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-sort>></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>> <$edit-text tiddler=<<tf.dv-searchText>> tag=input/> <<dv-clearSearchButton>>
<% if [<DV-SEARCH-STATE>get[text]match[yes]] %> <% if [<DV-SEARCH-STATE>get[text]match[yes]] %>
@ -168,7 +172,7 @@ tags: $:/tags/Global
<% endif %> <% endif %>
<code class="tc-small-gap-right"><$text text=<<tf.dv-formattedVar>>/></code> <code class="tc-small-gap-right"><$text text=<<tf.dv-formattedVar>>/></code>
<% if [<tf.dv-formattedVar>prefix[\function]] %> <% if [<tf.dv-formattedVar>prefix[\function]] %>
<code class="tc-tiny-gap-right"><$text text={{{ [<varname>format:variable[$firstLine$]] }}}/></code> <span class="tc-tiny-gap-right"><$text text={{{ [<varname>format:variable[$firstLine$]] }}}/></span>
<% endif %> <% endif %>
</$button> </$button>