mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-27 01:14:44 +00:00
Refactor to use global procedures to control the tour
This commit is contained in:
parent
d28cf74115
commit
c9d8806682
@ -1,8 +1,23 @@
|
||||
title: $:/plugins/tiddlywiki/tour/globals
|
||||
tags: $:/tags/Global
|
||||
|
||||
\procedure tour-initialise-current-tour-step()
|
||||
<$transclude $tiddler={{$:/state/tour/step}} $field="startup-actions"/>
|
||||
\end
|
||||
|
||||
\procedure tour-restart()
|
||||
<$action-setfield $tiddler="$:/config/ShowTour" text="show"/>
|
||||
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]first[]] }}}/>
|
||||
{{$:/plugins/tiddlywiki/tour/actions/initialise-current-tour-step}}
|
||||
<<tour-initialise-current-tour-step>>
|
||||
\end
|
||||
|
||||
\procedure tour-next-step()
|
||||
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]after{$:/state/tour/step}else[$:/plugins/tiddlywiki/tour/steps/finished]] }}}/>
|
||||
<<tour-initialise-current-tour-step>>
|
||||
\end
|
||||
|
||||
\procedure tour-previous-step()
|
||||
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]before{$:/state/tour/step}] :else[all[shadows+tiddlers]tag[$:/tags/TourStep]first[]] }}}/>
|
||||
<<tour-initialise-current-tour-step>>
|
||||
\end
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
title: $:/plugins/tiddlywiki/tour/actions/initialise-current-tour-step
|
||||
|
||||
<$transclude $tiddler={{$:/state/tour/step}} $field="startup-actions"/>
|
@ -1,4 +1,4 @@
|
||||
title: $:/plugins/tiddlywiki/tour/startup-actions
|
||||
tags: $:/tags/StartupAction
|
||||
|
||||
{{$:/plugins/tiddlywiki/tour/actions/initialise-current-tour-step}}
|
||||
<<tour-restart>>
|
||||
|
@ -6,14 +6,12 @@ tags: $:/tags/PageTemplate
|
||||
<div class="tc-tour-panel-navigation">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TourStep]before{$:/state/tour/step}count[]compare:number:gt[0]]" variable="ignore">
|
||||
<$button class="tc-btn-big-green" style="background-color: red;">
|
||||
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]before{$:/state/tour/step}] :else[all[shadows+tiddlers]tag[$:/tags/TourStep]first[]] }}}/>
|
||||
{{$:/plugins/tiddlywiki/tour/actions/initialise-current-tour-step}}
|
||||
<<tour-previous-step>>
|
||||
back
|
||||
</$button>
|
||||
</$list>
|
||||
<$button class="tc-btn-big-green" style="background-color: purple;">
|
||||
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]after{$:/state/tour/step}else[$:/plugins/tiddlywiki/tour/steps/finished]] }}}/>
|
||||
{{$:/plugins/tiddlywiki/tour/actions/initialise-current-tour-step}}
|
||||
<<tour-next-step>>
|
||||
next
|
||||
</$button>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user