2019-03-30 10:52:49 +00:00
|
|
|
title: $:/core/macros/dumpvariables
|
|
|
|
tags: $:/tags/Macro
|
|
|
|
|
2022-04-16 16:19:05 +00:00
|
|
|
\whitespace trim
|
2024-02-15 21:08:39 +00:00
|
|
|
|
2024-02-16 15:20:48 +00:00
|
|
|
<!-- =================== -->
|
|
|
|
\procedure dumpvariables(subfilter:"[variables[]]")
|
2019-03-30 10:52:49 +00:00
|
|
|
<ul>
|
2024-02-16 15:20:48 +00:00
|
|
|
<$list filter="[variables[]] :and[subfilter<subfilter>]" variable="varname">
|
2024-02-15 21:08:39 +00:00
|
|
|
<li>
|
|
|
|
<strong><code><$text text=<<varname>>/></code></strong>:<br/>
|
|
|
|
<$codeblock code={{{ [<varname>getvariable[]] }}}/>
|
|
|
|
</li>
|
|
|
|
</$list>
|
2019-03-30 10:52:49 +00:00
|
|
|
</ul>
|
|
|
|
\end
|
2024-02-15 21:08:39 +00:00
|
|
|
|
2024-02-16 15:20:48 +00:00
|
|
|
<!-- =================== -->
|
2024-02-16 20:36:15 +00:00
|
|
|
\procedure search-variables(subfilter:"[variables[]]")
|
2024-02-16 15:20:48 +00:00
|
|
|
|
|
|
|
\procedure search() $:/temp/search/dump
|
|
|
|
\procedure sub-search() $:/temp/search/sub-dump
|
|
|
|
\procedure state() $:/state/search/var/
|
2024-02-15 21:08:39 +00:00
|
|
|
|
|
|
|
\procedure toggleState()
|
|
|
|
<$action-setfield $tiddler=<<getVarState>> text={{{ [<getVarState>get[text]] +[toggle[yes],[no]] }}}/>
|
2024-02-16 15:20:48 +00:00
|
|
|
\end toggleState
|
2024-02-15 21:08:39 +00:00
|
|
|
|
|
|
|
\procedure toggleInfoState()
|
|
|
|
<$action-setfield $tiddler=<<getToggleInfoState>> text={{{ [<getToggleInfoState>get[text]] +[toggle[yes],[no]] }}}/>
|
|
|
|
<$action-setfield $tiddler=<<getSubSearch>> text={{{ [<getSubSearchText>!is[blank]then<getSubSearchText>] :else[<varname>] }}} />
|
2024-02-16 15:20:48 +00:00
|
|
|
\end toggleInfoState
|
2024-02-15 21:08:39 +00:00
|
|
|
|
|
|
|
\procedure clearStatesButton()
|
|
|
|
<$button class="tc-btn-invisible tc-tiny-gap-left">
|
|
|
|
<$action-deletetiddler $filter="[prefix<state>] [prefix[$:/temp]]"/>
|
|
|
|
{{$:/core/images/fold-all-button}}
|
|
|
|
</$button>
|
2024-02-16 15:20:48 +00:00
|
|
|
\end clearStatesButton
|
2024-02-15 21:08:39 +00:00
|
|
|
|
|
|
|
\procedure clearSearchButton()
|
|
|
|
<$button class="tc-btn-invisible tc-tiny-gap-left">
|
|
|
|
<$action-deletetiddler $tiddler=<<search>>/>
|
|
|
|
{{$:/core/images/close-button}}
|
|
|
|
</$button>
|
2024-02-16 15:20:48 +00:00
|
|
|
\end clearSearchButton
|
2024-02-15 21:08:39 +00:00
|
|
|
|
|
|
|
\procedure expandAllStatesButton()
|
|
|
|
<$button class="tc-btn-invisible tc-tiny-gap-left">
|
2024-02-16 15:20:48 +00:00
|
|
|
<$action-setfield $tiddler=<<state>> text={{{ [<getToggleInfoState>get[text]] +[toggle[yes],[no]] }}}/>
|
|
|
|
<$list filter="[variables[]] +[search::some<getSearchText>] :filter[subfilter<subfilter>]" variable="varname">
|
2024-02-15 21:08:39 +00:00
|
|
|
<$action-setfield $tiddler=<<getVarState>> text="yes"/>
|
|
|
|
</$list>
|
|
|
|
{{$:/core/images/unfold-all-button}}
|
|
|
|
</$button>
|
2024-02-16 15:20:48 +00:00
|
|
|
\end expandAllStatesButton
|
2024-02-15 21:08:39 +00:00
|
|
|
|
|
|
|
\procedure info()
|
|
|
|
<div class="multi-columns">
|
|
|
|
<$list filter="[all[tiddlers+shadows]] :filter[search:text,tags:words<getSubSearchText>]
|
|
|
|
:filter[!prefix[$:/temp]]
|
|
|
|
:filter[!prefix[$:/state]]
|
|
|
|
-[[$:/config/OriginalTiddlerPaths]]
|
|
|
|
:filter[!type[application/javascript]]
|
|
|
|
-[[$:/core]]
|
|
|
|
:filter[!plugin-type[plugin]]"
|
|
|
|
>
|
|
|
|
<$link class="tc-small-gap-left"/><br>
|
|
|
|
</$list>
|
|
|
|
</div>
|
2024-02-16 15:20:48 +00:00
|
|
|
\end info
|
2024-02-15 21:08:39 +00:00
|
|
|
|
|
|
|
\function getSearchText() [<search>get[text]]
|
|
|
|
|
|
|
|
\function getSubSearch() [<sub-search>] [<varname>] [<qualify>] +[join[/]]
|
|
|
|
\function getSubSearchText() [<getSubSearch>get[text]]
|
|
|
|
|
|
|
|
\function getVarState() [<state>addsuffix<varname>] [<qualify>] +[join[]]
|
|
|
|
\function getToggleInfoState() [<state>addsuffix<varname>]
|
|
|
|
|
2024-02-16 20:36:15 +00:00
|
|
|
<$text text="Search Variables - "/><%if [<thisTiddler>!match[$:/AdvancedSearch]]%><code class="tc-small-gap-right"><<subfilter>></code><%endif%>
|
2024-02-16 15:20:48 +00:00
|
|
|
<$edit-text tiddler=<<search>> tag=input/> <<clearSearchButton>>
|
|
|
|
<% if [<state>get[text]match[yes]] %>
|
|
|
|
<<clearStatesButton>>
|
|
|
|
<% else %>
|
|
|
|
<<expandAllStatesButton>>
|
|
|
|
<% endif %>
|
2024-02-15 21:08:39 +00:00
|
|
|
|
2024-02-16 20:36:15 +00:00
|
|
|
<!-- <$list filter="[variables[]] +[search::some<getSearchText>] :filter[subfilter<subfilter>]" variable="varname"> -->
|
|
|
|
<$list filter="[variables[]] +[search::some<getSearchText>] :and[subfilter<subfilter>]" variable="varname">
|
2024-02-16 15:20:48 +00:00
|
|
|
<div class="tc-var-item">
|
2024-02-15 21:08:39 +00:00
|
|
|
<$button actions=<<toggleState>> class="tc-small-gap-left tc-btn-invisible">
|
|
|
|
<% if [<getVarState>get[text]match[yes]] %>
|
|
|
|
{{$:/core/images/down-arrow}}
|
|
|
|
<% else %>
|
|
|
|
{{$:/core/images/right-arrow}}
|
|
|
|
<% endif %>
|
|
|
|
<strong class="tc-tiny-gap-right"><code><$text text=<<varname>>/></code></strong>
|
2024-02-16 15:20:48 +00:00
|
|
|
<$text text={{{ "#" [<varname>getvariable[]length[]] +[join[ ]] }}}/>
|
2024-02-15 21:08:39 +00:00
|
|
|
</$button>
|
|
|
|
|
|
|
|
<% if [<getVarState>get[text]match[yes]] %>
|
|
|
|
<$button actions=<<toggleInfoState>> class="tc-btn-invisible tc-small-gap-left" disabledX={{{[<getSearchText>is[blank]then[yes]else[no]] }}}>
|
|
|
|
<% if [<getToggleInfoState>get[text]match[yes]] %>
|
|
|
|
{{$:/core/images/down-arrow}}
|
|
|
|
<% else %>
|
|
|
|
{{$:/core/images/right-arrow}}
|
|
|
|
<% endif %>
|
|
|
|
</$button>
|
|
|
|
<% if [<getToggleInfoState>get[text]match[yes]] %>
|
|
|
|
<div class="tc-labeled-input-wrapper">
|
|
|
|
<span class="tc-fixed-label tc-align-right">Search text, tags:</span>
|
|
|
|
<$edit-text tiddler=<<getSubSearch>> tag=input class="tc-fluid-input tc-small-gap-left"/>
|
|
|
|
</div>
|
|
|
|
<<info>>
|
|
|
|
<% endif %>
|
|
|
|
<$codeblock code={{{ [<varname>getvariable[]] }}}/>
|
|
|
|
<% endif %>
|
|
|
|
</div>
|
|
|
|
</$list>
|
|
|
|
<hr>
|
|
|
|
\end
|