1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-16 06:44:50 +00:00

Fix initialisation when jumping to a tour step

This commit is contained in:
Jeremy Ruston 2023-10-05 14:10:00 +01:00
parent 6f46775e94
commit 906cb8f92b

View File

@ -34,6 +34,7 @@ These config tiddlers may be changed directly as required:
\end \end
\procedure tour-initialise-current-tour-step() \procedure tour-initialise-current-tour-step()
\procedure tv-action-refresh-policy() always
<$transclude $tiddler={{$:/state/tour/step}} $field="enter-actions"/> <$transclude $tiddler={{$:/state/tour/step}} $field="enter-actions"/>
\end \end
@ -58,22 +59,26 @@ These config tiddlers may be changed directly as required:
\end tour-chooser \end tour-chooser
\procedure tour-start(title,step) \procedure tour-start(title,step)
\procedure tv-action-refresh-policy() always
<$action-setfield $tiddler="$:/config/CurrentTour" text=<<title>>/> <$action-setfield $tiddler="$:/config/CurrentTour" text=<<title>>/>
<$transclude $variable="tour-restart" step=<<step>>/> <$transclude $variable="tour-restart" step=<<step>>/>
\end \end
\procedure tour-restart(step) \procedure tour-restart(step)
\procedure tv-action-refresh-policy() always
<$action-setfield $tiddler="$:/config/ShowTour" text="show"/> <$action-setfield $tiddler="$:/config/ShowTour" text="show"/>
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [<step>!is[blank]] :else[all[shadows+tiddlers]tag<tour-current-tag>first[]] }}}/> <$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [<step>!is[blank]] :else[all[shadows+tiddlers]tag<tour-current-tag>first[]] }}}/>
<<tour-initialise-current-tour-step>> <<tour-initialise-current-tour-step>>
\end \end
\procedure tour-next-step() \procedure tour-next-step()
\procedure tv-action-refresh-policy() always
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag<tour-current-tag>after{$:/state/tour/step}else[$:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/steps/finished]] }}}/> <$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag<tour-current-tag>after{$:/state/tour/step}else[$:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/steps/finished]] }}}/>
<<tour-initialise-current-tour-step>> <<tour-initialise-current-tour-step>>
\end \end
\procedure tour-previous-step() \procedure tour-previous-step()
\procedure tv-action-refresh-policy() always
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag<tour-current-tag>before{$:/state/tour/step}] :else[all[shadows+tiddlers]tag<tour-current-tag>first[]] }}}/> <$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag<tour-current-tag>before{$:/state/tour/step}] :else[all[shadows+tiddlers]tag<tour-current-tag>first[]] }}}/>
<<tour-initialise-current-tour-step>> <<tour-initialise-current-tour-step>>
\end \end