2019-03-30 10:52:49 +00:00
|
|
|
title: $:/core/macros/dumpvariables
|
2024-02-21 16:39:00 +00:00
|
|
|
tags: $:/tags/Global
|
2019-03-30 10:52:49 +00:00
|
|
|
|
2022-04-16 16:19:05 +00:00
|
|
|
\whitespace trim
|
2024-02-15 21:08:39 +00:00
|
|
|
|
2024-02-21 16:39:00 +00:00
|
|
|
\procedure _initRawFilter() [variables:raw<type>]
|
|
|
|
\procedure _initFilter() [variables<type>]
|
|
|
|
|
|
|
|
\function _f.filterString() [<sort>match[raw]then<_initRawFilter>else<_initFilter>]
|
|
|
|
\function _f.varFormat() [<format>!is[blank]then<format>else[$type$ $name$($params$)]]
|
|
|
|
\function _f.formattedVar() [<varname>format:variable<_f.varFormat>]
|
|
|
|
|
2024-02-16 15:20:48 +00:00
|
|
|
<!-- =================== -->
|
2024-02-21 16:39:00 +00:00
|
|
|
\procedure dumpvariables(type sort:"sort" subfilter:"[[]]" format)
|
2019-03-30 10:52:49 +00:00
|
|
|
<ul>
|
2024-02-21 16:39:00 +00:00
|
|
|
<li><<transclusion>></li>
|
|
|
|
<$list filter="[subfilter<_f.filterString>] +[filter<subfilter>]" variable="varname">
|
2024-02-15 21:08:39 +00:00
|
|
|
<li>
|
2024-02-21 16:39:00 +00:00
|
|
|
<code><$text text=<<_f.formattedVar>>/></code><br/>
|
|
|
|
<% if [<_f.formattedVar>prefix[\function]] %>
|
|
|
|
<$codeblock code={{{ [<varname>getvariable[value]] }}}/>
|
|
|
|
<% endif %>
|
2024-02-15 21:08:39 +00:00
|
|
|
<$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
|
|
|
|
|
|
|
\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]] }}}/>
|
2024-02-21 16:39:00 +00:00
|
|
|
<$action-setfield $tiddler=<<getSubSearch>> text={{{ [<getSubSearchText>!is[blank]then<getSubSearchText>] :else[<varname>format:variable[$type$ $name$$params$]] }}} />
|
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]] }}}/>
|
2024-02-21 16:39:00 +00:00
|
|
|
<$list filter="[subfilter<_f.filterString>] +[search::some<getSearchText>] +[filter<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>]
|
|
|
|
-[[$:/config/OriginalTiddlerPaths]]
|
2024-02-21 16:39:00 +00:00
|
|
|
-[[$:/HistoryList]]
|
|
|
|
-[[$:/StoryList]]
|
2024-02-15 21:08:39 +00:00
|
|
|
-[[$:/core]]
|
2024-02-21 16:39:00 +00:00
|
|
|
:filter[!type[application/javascript]]
|
|
|
|
:filter[!prefix[$:/temp]]
|
|
|
|
:filter[!prefix[$:/state]]
|
2024-02-15 21:08:39 +00:00
|
|
|
: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-21 16:39:00 +00:00
|
|
|
<!-- =================== -->
|
|
|
|
\procedure search-variables(type sort:"sort" subfilter:"[[]]" format)
|
|
|
|
\function _f.varFormat() [<format>!is[blank]then<format>else[$type$ $name$($params$) $firstLine$]]
|
|
|
|
|
|
|
|
<$text text="Search Variables - "/><%if [<thisTiddler>!match[$:/AdvancedSearch]]%><code class="tc-small-gap-right">sort: <<sort>>, type:<<type>></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-21 16:39:00 +00:00
|
|
|
<!-- <$list filter="[subfilter<subfilter>] +[search::some<getSearchText>]" variable="varname"> -->
|
|
|
|
<$list filter="[subfilter<_f.filterString>] +[search::some<getSearchText>] +[filter<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 %>
|
2024-02-21 16:39:00 +00:00
|
|
|
<code class="tc-tiny-gap-right"><$text text=<<_f.formattedVar>>/></code>
|
|
|
|
<!-- <$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 %>
|
2024-02-21 16:39:00 +00:00
|
|
|
<% if [<varname>prefix[\function]] %>
|
|
|
|
<$codeblock code={{{ [<varname>getvariable[value]] }}}/>
|
|
|
|
<% endif %>
|
2024-02-15 21:08:39 +00:00
|
|
|
<$codeblock code={{{ [<varname>getvariable[]] }}}/>
|
|
|
|
<% endif %>
|
|
|
|
</div>
|
|
|
|
</$list>
|
|
|
|
<hr>
|
|
|
|
\end
|