1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-08 10:59:57 +00:00
TiddlyWiki5/plugins/tiddlywiki/tour/settings.tid

135 lines
3.9 KiB
Plaintext
Raw Normal View History

title: $:/plugins/tiddlywiki/tour/settings
\procedure button-expand-collapse-all(caption,text)
<$button>
<$list filter="[all[shadows+tiddlers]tag<currentTourTag>]" variable="currentStep">
<$let
collapseState={{{ [[$:/state/Tour/Settings/Tour/Visibility/]addsuffix<currentTour>addsuffix<currentStep>] }}}
>
<$action-setfield $tiddler=<<collapseState>> text=<<text>>/>
</$let>
</$list>
<$text text=<<caption>>/>
</$button>
\end
\procedure display-tour-step-field-text(fieldName,fieldCaption)
<$list filter="[<currentStep>has<fieldName>]" variable="ignore">
<tr>
<th>
<$text text=<<fieldCaption>>/>
</th>
<td>
<$text text={{{ [<currentStep>get<fieldName>] }}}/>
</td>
</tr>
</$list>
\end
<$let
stateCurrentTour=<<qualify "$:/state/Tour/Settings/Current">>
defaultTour={{{ [{$:/config/CurrentTour}] :else[all[shadows+tiddlers]tag[$:/tags/Tour]] }}}
>
! Tour Overview
Select a tour:
<$select tiddler=<<stateCurrentTour>> default=<<defaultTour>>>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Tour]]">
<option value=<<currentTiddler>>>
<$transclude $field="description">
<$text text=<<currentTiddler>>/>
</$transclude>
</option>
</$list>
</$select>
<$let
currentTour={{{ [<stateCurrentTour>get[text]] :else[<defaultTour>] }}}
currentTourTag={{{ [<currentTour>get[tour-tag]] }}}
>
<table class="tc-tour-settings-tour-details">
<tbody>
<tr>
<th>
Tour title
</th>
<td>
<$link to=<<currentTour>>><$text text=<<currentTour>>/></$link>
</td>
</tr>
<tr>
<th>
Tour description
</th>
<td>
<div class="tc-tour-settings-tour-details-description">
<$transclude $tiddler=<<currentTour>>>
(No description available)
</$transclude>
</div>
</td>
</tr>
<tr>
<th>
Tour logo
</th>
<td>
<div class="tc-tour-settings-tour-details-logo">
<$image source={{{ [<currentTour>get[logo]] }}}/>
</div>
</td>
</tr>
<tr>
<th>
Tour step tag
</th>
<td>
<$transclude $variable="tag" tag=<<currentTourTag>>/>
</td>
</tr>
</tbody>
</table>
<p>
<<button-expand-collapse-all "Expand All" "show">>
<<button-expand-collapse-all "Collapse All" "hide">>
</p>
<$list filter="[all[shadows+tiddlers]tag<currentTourTag>]" variable="currentStep" counter="stepNumber">
<$let
collapseState={{{ [[$:/state/Tour/Settings/Tour/Visibility/]addsuffix<currentTour>addsuffix<currentStep>] }}}
>
<div class="tc-tour-settings-tour-step">
<$button class="tc-btn-invisible tc-tour-settings-tour-step-heading">
<$action-setfield $tiddler=<<collapseState>> text={{{ [<collapseState>get[text]else[hide]match[show]then[hide]else[show]] }}}/>
<$list filter="[<collapseState>get[text]else[hide]match[show]]" variable="ignore" emptyMessage="{{$:/core/images/right-arrow}}">
{{$:/core/images/down-arrow}}
</$list>
<span class="tc-tour-settings-tour-step-heading-step-number">
<$text text=<<stepNumber>>/>
</span>
<$text text=<<currentStep>>/>
</$button>
<$reveal state=<<collapseState>> text="show" type="match" default="hide" animate="yes">
<table class="tc-tour-settings-tour-step-details">
<tbody>
<<display-tour-step-field-text "title" "Title">>
<<display-tour-step-field-text "condition" "Condition">>
<<display-tour-step-field-text "condition-var" "Condition Variable">>
<<display-tour-step-field-text "display-mode" "Display Mode">>
<<display-tour-step-field-text "enter-actions" "Enter Actions">>
<<display-tour-step-field-text "selector" "Hint Selector">>
<<display-tour-step-field-text "selector-fallback-1" "Hint Selector Fallback 1">>
<<display-tour-step-field-text "selector-fallback-2" "Hint Selector Fallback 2">>
</tbody>
</table>
<div class="tc-tour-settings-tour-step-body">
<$transclude $tiddler=<<currentStep>> $mode="block"/>
</div>
</$reveal>
</div>
</$let>
</$list>
</$let>
</$let>