From d4abd1722c05e0f7b5664e3f676dc33900f17d3b Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 2 Dec 2014 23:47:23 +0000 Subject: [PATCH] Fixes for tabbed TOC Re-fixes #1185 --- core/wiki/macros/toc.tid | 13 +++++++++---- .../TableOfContentsMacro Tabbed Example.tid | 5 +++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index add37b856..7db721d28 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -162,7 +162,7 @@ tags: $:/tags/Macro [all[current]field:title{$selectedTiddler$}] \end -\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,template:"") +\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"") <$tiddler tiddler={{$selectedTiddler$}}>
<$linkcatcher to="$selectedTiddler$"> @@ -171,18 +171,23 @@ tags: $:/tags/Macro
+<$reveal state="""$selectedTiddler$""" type="nomatch" text=""> <$transclude mode="block" tiddler="$template$">

<$view field="caption"><$view field="title"/>

-<$transclude mode="block">$unselectedText$ +<$transclude mode="block">$missingText$ + +<$reveal state="""$selectedTiddler$""" type="match" text=""> +$unselectedText$ +
\end -\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,template:"") +\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"") <$linkcatcher to="""$selectedTiddler$"""> -<$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$""" template="""$template$"""/> +<$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$""" missingText="""$missingText$""" template="""$template$"""/> \end diff --git a/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid b/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid index 60a545d8e..dd6a6b287 100644 --- a/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid +++ b/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Tabbed Example.tid @@ -13,7 +13,8 @@ The tabbed table of contents macro renders a selective expandable table of conte |2nd |sort |Optional sorting subfilter (eg `sort[title]`) | | |3rd |selectedTiddler |Title of the tiddler containing the title of the currently displayed tiddler |"$:/temp/toc/selectedTiddler" | |4th |unselectedText |Text to be displayed when no tiddler is selected | | -|5th |template |Optional title of a tiddler to be used as a template for rendering the selected tiddler | | +|5th |missingText |Text to be displayed when the selected tiddler is missing | | +|6th |template |Optional title of a tiddler to be used as a template for rendering the selected tiddler | | !!! Internal navigation @@ -38,4 +39,4 @@ Type: <$select tiddler="TabbedExampleType"> -<$macrocall $name={{TabbedExampleType}} tag="TableOfContents" selectedTiddler="$:/temp/toc/selectedTiddler" unselectedText="Select a topic in the table of contents. Click the arrow to expand a topic."/> +<$macrocall $name={{TabbedExampleType}} tag="TableOfContents" selectedTiddler="$:/temp/toc/selectedTiddler" unselectedText="

Select a topic in the table of contents. Click the arrow to expand a topic.

" missingText="

Missing tiddler.

"/>