From 6ce2eaad2ce148ecf732174bfa99e8250da58ccb Mon Sep 17 00:00:00 2001 From: pmario Date: Thu, 8 Feb 2024 12:53:07 +0100 Subject: [PATCH] CTRL click on chevron expands / folds whole branch --- core/wiki/macros/toc.tid | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 5a567d5fb..a86c05153 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -62,7 +62,9 @@ Naming rules / pattern \procedure toc-filterDefault() [all[shadows+tiddlers]tag!has[draft.of]] \procedure toc-filterParent() [has!has[draft.of]] :filter[getmatch] -\procedure toc-filterTagLike() [getenlist-input[]] +\procedure toc-filterTagLike() [getenlist-input[]!has[draft.of]] + + \function tf.toc-filterString() [!is[blank]then] :else[!is[blank]thenelse] @@ -117,12 +119,19 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter <$macrocall $name="toc-body" tag=<> sort=<> exclude=<>/> \end +\procedure toc-tagLikeChildFilter() [getenlist-input[]] +\procedure toc-parentChildFilter() [has] :filter[getmatch<..currentTiddler>] +\procedure toc-tagChildFilter() [tag] + + +\function tf.toc-hasChildren() [!is[blank]then] :else[!is[blank]thenelse] + \procedure toc-openBranch(path,currentTiddler,manual:"no") \procedure recursiveOpen(exclude, path) <$let path={{{ [] "/" [] +[join[]] }}}> - <$list filter="[tag] -[subfilter]" > - <% if [tagging[]] %> + <$list filter="[subfilter] -[subfilter]" > + <% if [subfilter] %> <$set name="_excluded" filter="[subfilter] []"> <$qualify name="toc-state" title=<> > @@ -140,19 +149,19 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter <$macrocall $name="recursiveOpen" exclude=<> path=<> /> <% elseif [match[ctrl]] %> -<$action-log/> <$macrocall $name="recursiveOpen" exclude=<> path=<> /> <% endif %> \end + + \procedure toc-closeBranch(path,currentTiddler,manual:"no") <% if [match[ctrl]] :else[match[yes]] %> - -<$let prefix={{{ [] }}} > - <$action-deletetiddler $filter="[prefix]"/> - + <$let prefix={{{ [] }}} > + <$action-deletetiddler $filter="[prefix]"/> + <% endif %> \end @@ -260,9 +269,7 @@ Shows an expandable toc. Item always have an open/close chevron <$link to={{{ [get[target]else] }}}> - <% if [has] :filter[getmatch<..currentTiddler>] +[limit[1]] %> - <> - <% elseif [all[current]tagging[]] [subfilter] -[subfilter] +[limit[1]] %> + <% if [subfilter] [subfilter] +[limit[1]] %> <> <% else %> <$button class='tc-btn-invisible'> @@ -287,9 +294,7 @@ Shows an expandable toc. Item always have an open/close chevron \procedure toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,tagField,parentField,itemTemplate) <$qualify name="toc-state" title=<> >
  • >> - <% if [has] :filter[getmatch<..currentTiddler>] +[limit[1]] %> - <> - <% elseif [all[current]tagging[]] [subfilter] -[subfilter] +[limit[1]] %> + <% if [subfilter] [subfilter] +[limit[1]] %> <> <% else %> <$button class="tc-btn-invisible">