diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 6348a9ba0..8fa9a5c77 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -35,12 +35,40 @@ The very first toc macro is _not_ reused. So it can be used as a simple referenc > <$transclude $field=<>/> + <> + \end +\procedure toc-newChildButton() + \procedure _newChild(field:"parent") + <$button actions=<<__actions>> tooltip=`New Child -> "$(field)$: $(currentTiddler)$"` + aria-label="new child here" class="tc-btn-invisible" + > + <$action-sendmessage $message="tm-new-tiddler" $name=<> $value=<>/> + <% if [<_mode>match[tagLikeMode]] %> + {{$:/core/images/new-here-button}} + <% else %> + {{$:/wikilabs/images/new-child-alone}} + <% endif %> + + \end _newChild + + <% if [match[yes]] %> + <% if [<_mode>match[tagMode]] %> + {{||$:/core/ui/Buttons/new-here}} + <% elseif [<_mode>match[tocpMode]] %> + <$macrocall $name="_newChild" field=<>/> + <% elseif [<_mode>match[tagLikeMode]] %> + <$macrocall $name="_newChild" field=<>/> + <% endif %> + <% endif %> +\end + \function tf.toc-getItemTemplateTitle() [get[toc-itemTemplate]] :filter[has[text]] :else[has[text]then] @@ -87,6 +115,9 @@ It can be a macro parameter: itemTemplate or a tiddler field: toc-itemTemplate. \function tf.toc-filterString() [!is[blank]then] :else[!is[blank]thenelse] + +\function tf.toc-mode() [matchthen[tagLikeMode]] :else[matchthen[tocpMode]else[tagMode]] + \function tf.toc-newPath() [addsuffix[/]addsuffix] @@ -109,7 +140,7 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i :else[subfilter$(sort)$] [subfilter] -[] -[subfilter]`> <%if [] -[subfilter] %> - <$let _path=<> > + <$let _path=<> _mode=<> > <$set name="_excluded" filter="[subfilter] [] [subfilter]">
  • >> @@ -266,7 +297,7 @@ Shows an expandable toc. Item always have an open/close chevron :else[subfilter$(sort)$] [subfilter] -[] -[subfilter]`> <%if [] -[subfilter] %> - <$let _path=<>> + <$let _path=<> _mode=<> > <$set name="_excluded" filter="[subfilter] [] [subfilter]"> <% if [all[current]toc-link[no]] %> <$macrocall $name="toc-unlinked-expandable-body" @@ -367,7 +398,7 @@ If an item has no children, there is no open/close chevron :else[subfilter$(sort)$] [subfilter] -[] -[subfilter]`> <%if [] -[subfilter] %> - <$let _path=<>> + <$let _path=<> _mode=<> > <$set name="_excluded" filter="[subfilter] [] [subfilter]"> <% if [all[current]toc-link[no]] %> <$macrocall $name="toc-unlinked-selective-expandable-body"