1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-08 02:49:56 +00:00

Use new element spotlight to provide hints

This commit is contained in:
jeremy@jermolene.com 2023-02-01 21:14:29 +00:00
parent 0bc6decefb
commit 5fe542a05b
7 changed files with 16 additions and 9 deletions

View File

@ -8,6 +8,7 @@
"tiddlywiki/internals",
"tiddlywiki/menubar",
"tiddlywiki/confetti",
"tiddlywiki/dynannotate",
"tiddlywiki/tour"
],
"themes": [

View File

@ -1,5 +1,6 @@
title: $:/plugins/tiddlywiki/tour/steps/close-control-panel
tags: $:/tags/TourStep
selector: .tc-story-river div[data-tiddler-title='$:/ControlPanel'] .tc-btn-\%24\%3A\%2Fcore\%2Fui\%2FButtons\%2Fclose
! Close the control panel
@ -11,6 +12,6 @@ Your task now is to close the control panel.
Congratulations, you may proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
<<tour-buttons>>
</$list>

View File

@ -11,6 +11,6 @@ Your task is to create and open a tiddler titled "Congratulations"
Congratulations, you may proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
<<tour-buttons>>
</$list>

View File

@ -1,5 +1,6 @@
title: $:/plugins/tiddlywiki/tour/steps/open-control-panel
tags: $:/tags/TourStep
selector: .tc-btn-\%24\%3A\%2Fcore\%2Fui\%2FButtons\%2Fcontrol-panel
! Welcome to ~TiddlyWiki
@ -13,6 +14,6 @@ Your first task is to open the control panel.
Congratulations, you may proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
<<tour-buttons>>
</$list>

View File

@ -1,5 +1,7 @@
title: $:/plugins/tiddlywiki/tour/steps/recent
tags: $:/tags/TourStep
selector: .tc-sidebar-tabs-main .tc-timeline > .tc-menu-list-item:nth-child(1) .tc-menu-list-subitem:nth-child(1) .tc-tiddlylink
selector-fallback-1: .tc-sidebar-tabs-main button:nth-child(3)
! Searching
@ -13,7 +15,7 @@ Your task is to use the "Recent" tab of the sidebar to open the most recently ed
Congratulations! You may now proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
<<tour-buttons>>
</$list>

View File

@ -1,5 +1,6 @@
title: $:/plugins/tiddlywiki/tour/steps/search
tags: $:/tags/TourStep
selector: .tc-sidebar-search .tc-popup-handle
! Searching
@ -11,6 +12,6 @@ Your task is to search for the phrase "help".
Congratulations! You may now proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
<<tour-buttons>>
</$list>

View File

@ -1,14 +1,11 @@
title: $:/plugins/tiddlywiki/tour/panel
tags: $:/tags/PageTemplate
\define tour-previous-step-button()
\define tour-buttons()
<$button>
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]before{$:/state/tour/step}] }}}/>
back
</$button>
\end
\define tour-next-step-button()
<$button>
<$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]] }}}/>
next
@ -21,5 +18,9 @@ next
<$button set="$:/config/ShowTour" setTo="no" class="tc-btn-invisible">{{$:/core/images/close-button}}</$button> ''Tour''
</div>
<$transclude tiddler={{$:/state/tour/step}} mode="block"/>
<$button>
<$action-sendmessage $message="tm-spotlight-element" selector={{{ [{$:/state/tour/step}get[selector]] }}} selector-fallback-1={{{ [{$:/state/tour/step}get[selector-fallback-1]] }}} selector-fallback-2={{{ [{$:/state/tour/step}get[selector-fallback-2]] }}}/>
show hint
</$button>
</div>
</$list>