From f4f37460b8306b4c15470e7163fc953e06ccc36b Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Mon, 16 Jan 2023 19:56:39 +0000 Subject: [PATCH] Add tour plugin --- editions/prerelease/tiddlywiki.info | 3 ++- editions/tw5.com/tiddlywiki.info | 3 ++- plugins/tiddlywiki/tour/plugin.info | 6 +++++ plugins/tiddlywiki/tour/readme.tid | 2 ++ plugins/tiddlywiki/tour/state-tour-step.tid | 2 ++ .../tour/steps/close-control-panel.tid | 16 ++++++++++++ .../tiddlywiki/tour/steps/create-tiddler.tid | 16 ++++++++++++ plugins/tiddlywiki/tour/steps/finished.tid | 12 +++++++++ .../tour/steps/open-control-panel.tid | 18 +++++++++++++ plugins/tiddlywiki/tour/steps/recent.tid | 20 +++++++++++++++ plugins/tiddlywiki/tour/steps/search.tid | 16 ++++++++++++ plugins/tiddlywiki/tour/styles.tid | 22 ++++++++++++++++ plugins/tiddlywiki/tour/tagsTourStep.tid | 2 ++ plugins/tiddlywiki/tour/tour-panel.tid | 25 +++++++++++++++++++ 14 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 plugins/tiddlywiki/tour/plugin.info create mode 100644 plugins/tiddlywiki/tour/readme.tid create mode 100644 plugins/tiddlywiki/tour/state-tour-step.tid create mode 100644 plugins/tiddlywiki/tour/steps/close-control-panel.tid create mode 100644 plugins/tiddlywiki/tour/steps/create-tiddler.tid create mode 100644 plugins/tiddlywiki/tour/steps/finished.tid create mode 100644 plugins/tiddlywiki/tour/steps/open-control-panel.tid create mode 100644 plugins/tiddlywiki/tour/steps/recent.tid create mode 100644 plugins/tiddlywiki/tour/steps/search.tid create mode 100644 plugins/tiddlywiki/tour/styles.tid create mode 100644 plugins/tiddlywiki/tour/tagsTourStep.tid create mode 100644 plugins/tiddlywiki/tour/tour-panel.tid diff --git a/editions/prerelease/tiddlywiki.info b/editions/prerelease/tiddlywiki.info index 168fbb41f..0878f3711 100644 --- a/editions/prerelease/tiddlywiki.info +++ b/editions/prerelease/tiddlywiki.info @@ -14,7 +14,8 @@ "tiddlywiki/dynannotate", "tiddlywiki/codemirror", "tiddlywiki/menubar", - "tiddlywiki/jszip" + "tiddlywiki/jszip", + "tiddlywiki/tour" ], "themes": [ "tiddlywiki/vanilla", diff --git a/editions/tw5.com/tiddlywiki.info b/editions/tw5.com/tiddlywiki.info index ffca3ae11..c4fc4b315 100644 --- a/editions/tw5.com/tiddlywiki.info +++ b/editions/tw5.com/tiddlywiki.info @@ -7,7 +7,8 @@ "tiddlywiki/evernote", "tiddlywiki/internals", "tiddlywiki/menubar", - "tiddlywiki/confetti" + "tiddlywiki/confetti", + "tiddlywiki/tour" ], "themes": [ "tiddlywiki/vanilla", diff --git a/plugins/tiddlywiki/tour/plugin.info b/plugins/tiddlywiki/tour/plugin.info new file mode 100644 index 000000000..bde8d6829 --- /dev/null +++ b/plugins/tiddlywiki/tour/plugin.info @@ -0,0 +1,6 @@ +{ + "title": "$:/plugins/tiddlywiki/tour", + "name": "Tour", + "description": "A tour of TiddlyWiki", + "list": "readme" +} diff --git a/plugins/tiddlywiki/tour/readme.tid b/plugins/tiddlywiki/tour/readme.tid new file mode 100644 index 000000000..4807aaa36 --- /dev/null +++ b/plugins/tiddlywiki/tour/readme.tid @@ -0,0 +1,2 @@ +title: $:/plugins/tiddlywiki/tour/readme + diff --git a/plugins/tiddlywiki/tour/state-tour-step.tid b/plugins/tiddlywiki/tour/state-tour-step.tid new file mode 100644 index 000000000..9d878ca44 --- /dev/null +++ b/plugins/tiddlywiki/tour/state-tour-step.tid @@ -0,0 +1,2 @@ +title: $:/state/tour/step +text: $:/plugins/tiddlywiki/tour/steps/open-control-panel \ No newline at end of file diff --git a/plugins/tiddlywiki/tour/steps/close-control-panel.tid b/plugins/tiddlywiki/tour/steps/close-control-panel.tid new file mode 100644 index 000000000..27293aaf4 --- /dev/null +++ b/plugins/tiddlywiki/tour/steps/close-control-panel.tid @@ -0,0 +1,16 @@ +title: $:/plugins/tiddlywiki/tour/steps/close-control-panel +tags: $:/tags/TourStep + +! Close the control panel + +Your task now is to close the control panel. + +<$list filter="[[$:/StoryList]!contains[$:/ControlPanel]limit[1]]" variable="ignore"> + +<$confetti/> + +Congratulations, you may proceed + +<> <> + + \ No newline at end of file diff --git a/plugins/tiddlywiki/tour/steps/create-tiddler.tid b/plugins/tiddlywiki/tour/steps/create-tiddler.tid new file mode 100644 index 000000000..effd530fd --- /dev/null +++ b/plugins/tiddlywiki/tour/steps/create-tiddler.tid @@ -0,0 +1,16 @@ +title: $:/plugins/tiddlywiki/tour/steps/create-tiddler +tags: $:/tags/TourStep + +! Creating Tiddlers + +Your task is to create and open a tiddler titled "Congratulations" + +<$list filter="[list[$:/StoryList]match[Congratulations]]" variable="ignore"> + +<$confetti/> + +Congratulations, you may proceed + +<> <> + + \ No newline at end of file diff --git a/plugins/tiddlywiki/tour/steps/finished.tid b/plugins/tiddlywiki/tour/steps/finished.tid new file mode 100644 index 000000000..4d7b4365a --- /dev/null +++ b/plugins/tiddlywiki/tour/steps/finished.tid @@ -0,0 +1,12 @@ +title: $:/plugins/tiddlywiki/tour/steps/finished + +! Congratulations + +<$confetti/> +<$confetti delay=100/> +<$confetti delay=200/> +<$confetti delay=300/> +<$confetti delay=400/> +<$confetti delay=500/> + +You have completed the tour. diff --git a/plugins/tiddlywiki/tour/steps/open-control-panel.tid b/plugins/tiddlywiki/tour/steps/open-control-panel.tid new file mode 100644 index 000000000..11c48176c --- /dev/null +++ b/plugins/tiddlywiki/tour/steps/open-control-panel.tid @@ -0,0 +1,18 @@ +title: $:/plugins/tiddlywiki/tour/steps/open-control-panel +tags: $:/tags/TourStep + +! Welcome to ~TiddlyWiki + +This tour will guide you through the process of learning to use TiddlyWiki. + +Your first task is to open the control panel. + +<$list filter="[[$:/StoryList]contains[$:/ControlPanel]limit[1]]" variable="ignore"> + +<$confetti/> + +Congratulations, you may proceed + +<> <> + + \ No newline at end of file diff --git a/plugins/tiddlywiki/tour/steps/recent.tid b/plugins/tiddlywiki/tour/steps/recent.tid new file mode 100644 index 000000000..d0903e193 --- /dev/null +++ b/plugins/tiddlywiki/tour/steps/recent.tid @@ -0,0 +1,20 @@ +title: $:/plugins/tiddlywiki/tour/steps/recent +tags: $:/tags/TourStep + +! Searching + +Your task is to use the "Recent" tab of the sidebar to open the most recently editted tiddler. + +<$let recentTiddler={{{ [all[tiddlers]!is[system]!sort[modified]] }}}> + +<$list filter="[list[$:/StoryList]match]" variable="ignore"> + +<$confetti/> + +Congratulations! You may now proceed + +<> <> + + + + diff --git a/plugins/tiddlywiki/tour/steps/search.tid b/plugins/tiddlywiki/tour/steps/search.tid new file mode 100644 index 000000000..413f8ea52 --- /dev/null +++ b/plugins/tiddlywiki/tour/steps/search.tid @@ -0,0 +1,16 @@ +title: $:/plugins/tiddlywiki/tour/steps/search +tags: $:/tags/TourStep + +! Searching + +Your task is to search for the phrase "help". + +<$list filter="[{$:/temp/search}match[help]]" variable="ignore"> + +<$confetti/> + +Congratulations! You may now proceed + +<> <> + + \ No newline at end of file diff --git a/plugins/tiddlywiki/tour/styles.tid b/plugins/tiddlywiki/tour/styles.tid new file mode 100644 index 000000000..12ac67b47 --- /dev/null +++ b/plugins/tiddlywiki/tour/styles.tid @@ -0,0 +1,22 @@ +title: $:/plugins/tiddlywiki/tour/styles +tags: $:/tags/Stylesheet + +\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock + +.tc-tour-panel { + position: fixed; + bottom: 0; + left: 0; + width: 310px; + height: 400px; + overflow: auto; + -webkit-overflow-scrolling: touch; + <> + box-shadow: inset 0 -40px 40px rgb(0 0 0 / 6%), inset 0 25px 10px rgb(0 0 0 / 9%), 0 5px 6px 5px rgb(0 0 0 / 7%); + border: 1px solid #ff8; + background: #ffa; + border-radius: 0em; + padding: 1em; + margin: 0.5em; + z-index: 1000; +} diff --git a/plugins/tiddlywiki/tour/tagsTourStep.tid b/plugins/tiddlywiki/tour/tagsTourStep.tid new file mode 100644 index 000000000..345589d7a --- /dev/null +++ b/plugins/tiddlywiki/tour/tagsTourStep.tid @@ -0,0 +1,2 @@ +title: $:/tags/TourStep +list: $:/plugins/tiddlywiki/tour/steps/open-control-panel $:/plugins/tiddlywiki/tour/steps/close-control-panel $:/plugins/tiddlywiki/tour/steps/search $:/plugins/tiddlywiki/tour/steps/recent $:/plugins/tiddlywiki/tour/steps/create-tiddler diff --git a/plugins/tiddlywiki/tour/tour-panel.tid b/plugins/tiddlywiki/tour/tour-panel.tid new file mode 100644 index 000000000..e12686cc5 --- /dev/null +++ b/plugins/tiddlywiki/tour/tour-panel.tid @@ -0,0 +1,25 @@ +title: $:/plugins/tiddlywiki/tour/panel +tags: $:/tags/PageTemplate + +\define tour-previous-step-button() +<$button> +<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]before{$:/state/tour/step}] }}}/> +back + +\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 + +\end + +<$list filter="[{$:/config/ShowTour}!is[blank]else[show]match[show]]" variable="ignore"> +
+
+<$button set="$:/config/ShowTour" setTo="no" class="tc-btn-invisible">{{$:/core/images/close-button}} ''Tour'' +
+<$transclude tiddler={{$:/state/tour/step}} mode="block"/> +
+