mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-07 07:50:26 +00:00
toc - replace reveal with conditional if
This commit is contained in:
parent
955d5a299b
commit
b322a70b86
@ -8,7 +8,8 @@ tags: $:/tags/Macro
|
|||||||
\procedure toc-closed-icon() $:/core/images/right-arrow
|
\procedure toc-closed-icon() $:/core/images/right-arrow
|
||||||
|
|
||||||
<!-- v5.3.4 complrete rewrite -->
|
<!-- v5.3.4 complrete rewrite -->
|
||||||
\function tf.toc-stateTitle() [[$:/state/toc]addsuffix<path>addsuffix[/]addsuffix<currentTiddler>]
|
\function tf.toc-stateTitle() [[$:/state/toc]] [<path>] "/" [<currentTiddler>] +[join[]]
|
||||||
|
|
||||||
\function tf.toc-newPath() [<path>addsuffix[/]addsuffix<tag>]
|
\function tf.toc-newPath() [<path>addsuffix[/]addsuffix<tag>]
|
||||||
|
|
||||||
<!-- At the moment the following function is only used by "tabbed" tocs -->
|
<!-- At the moment the following function is only used by "tabbed" tocs -->
|
||||||
@ -63,22 +64,21 @@ This macro is _not_ used by other toc-macros
|
|||||||
If a toc-item should not show a link, the toc-caption is part of the button. So it can be clicked to open / close the branch
|
If a toc-item should not show a link, the toc-caption is part of the button. So it can be clicked to open / close the branch
|
||||||
-->
|
-->
|
||||||
\procedure toc-item(isUnlinked:"")
|
\procedure toc-item(isUnlinked:"")
|
||||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
<% if [<toc-state>get[text]else[close]match[close]] %>
|
||||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep" tooltip=<<toc-state>>>
|
||||||
<$transclude tiddler=<<toc-closed-icon>> />
|
<$transclude tiddler=<<toc-closed-icon>> />
|
||||||
<% if [<isUnlinked>match[yes]] %>
|
<% if [<isUnlinked>match[yes]] %>
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
<% endif %>
|
<% endif %>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
<% elseif [<toc-state>get[text]match[open]] %>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep" tooltip=<<toc-state>>>
|
||||||
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
|
|
||||||
<$transclude tiddler=<<toc-open-icon>> />
|
<$transclude tiddler=<<toc-open-icon>> />
|
||||||
<% if [<isUnlinked>match[yes]] %>
|
<% if [<isUnlinked>match[yes]] %>
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
<% endif %>
|
<% endif %>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
<% endif %>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\procedure toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
|
\procedure toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
|
||||||
@ -88,12 +88,13 @@ This macro is _not_ used by other toc-macros
|
|||||||
<<toc-item>>
|
<<toc-item>>
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</$link>
|
</$link>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<!-- TODO auto expand -->
|
||||||
|
<% if [<toc-state>get[text]match[open]] %>
|
||||||
<$macrocall
|
<$macrocall
|
||||||
$name="toc-expandable"
|
$name="toc-expandable"
|
||||||
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
||||||
/>
|
/>
|
||||||
</$reveal>
|
<% endif %>
|
||||||
</li>
|
</li>
|
||||||
</$qualify>
|
</$qualify>
|
||||||
\end
|
\end
|
||||||
@ -102,12 +103,13 @@ This macro is _not_ used by other toc-macros
|
|||||||
<$qualify name="toc-state" title=<<tf.toc-stateTitle>>>
|
<$qualify name="toc-state" title=<<tf.toc-stateTitle>>>
|
||||||
<li class=<<tf.toc-getItemClass>>>
|
<li class=<<tf.toc-getItemClass>>>
|
||||||
<<toc-item isUnlinked:"yes">>
|
<<toc-item isUnlinked:"yes">>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<!-- TODO auto expand -->
|
||||||
|
<% if [<toc-state>get[text]match[open]] %>
|
||||||
<$macrocall
|
<$macrocall
|
||||||
$name="toc-expandable"
|
$name="toc-expandable"
|
||||||
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
||||||
/>
|
/>
|
||||||
</$reveal>
|
<% endif %>
|
||||||
</li>
|
</li>
|
||||||
</$qualify>
|
</$qualify>
|
||||||
\end
|
\end
|
||||||
@ -151,12 +153,13 @@ Shows an expandable toc. Item always have an open/close chevron
|
|||||||
<% endif %>
|
<% endif %>
|
||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</$link>
|
</$link>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<!-- TODO auto expand -->
|
||||||
|
<% if [<toc-state>get[text]match[open]] %>
|
||||||
<$macrocall
|
<$macrocall
|
||||||
$name="toc-selective-expandable"
|
$name="toc-selective-expandable"
|
||||||
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
||||||
/>
|
/>
|
||||||
</$reveal>
|
<% endif %>
|
||||||
</li>
|
</li>
|
||||||
</$qualify>
|
</$qualify>
|
||||||
\end
|
\end
|
||||||
@ -174,12 +177,13 @@ Shows an expandable toc. Item always have an open/close chevron
|
|||||||
<<toc-caption>>
|
<<toc-caption>>
|
||||||
</span>
|
</span>
|
||||||
<% endif %>
|
<% endif %>
|
||||||
<$reveal type="match" stateTitle=<<toc-state>> text="open">
|
<!-- TODO auto expand -->
|
||||||
|
<% if [<toc-state>get[text]match[open]] %>
|
||||||
<$macrocall
|
<$macrocall
|
||||||
$name="toc-selective-expandable"
|
$name="toc-selective-expandable"
|
||||||
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
tag=<<currentTiddler>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<exclude>> path=<<path>>
|
||||||
/>
|
/>
|
||||||
</$reveal>
|
<% endif %>
|
||||||
</li>
|
</li>
|
||||||
</$qualify>
|
</$qualify>
|
||||||
\end
|
\end
|
||||||
|
Loading…
Reference in New Issue
Block a user