From ba10b4fb0071aee24168cfaa95b86058b2654123 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Thu, 30 Jan 2020 13:50:19 +0100 Subject: [PATCH] Docs: bring tm-fold-xxx message docs on par with the code, that is executed. (#4353) --- .../WidgetMessage_ tm-fold-all-tiddlers.tid | 2 +- .../WidgetMessage_ tm-fold-other-tiddlers.tid | 6 +++--- .../WidgetMessage_ tm-fold-tiddler.tid | 18 +++++++++++++----- .../WidgetMessage_ tm-unfold-all-tiddlers.tid | 8 ++++---- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-all-tiddlers.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-all-tiddlers.tid index bb2d4a576..d29183a0a 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-all-tiddlers.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-all-tiddlers.tid @@ -1,6 +1,6 @@ caption: tm-fold-all-tiddlers created: 20160424230908388 -modified: 20190205154007291 +modified: 20191028113838596 tags: Messages title: WidgetMessage: tm-fold-all-tiddlers type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-other-tiddlers.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-other-tiddlers.tid index 09fd8a751..af5a3b4eb 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-other-tiddlers.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-other-tiddlers.tid @@ -1,6 +1,6 @@ caption: tm-fold-other-tiddlers created: 20160424232355215 -modified: 20160424233338710 +modified: 20191028113932268 tags: Messages title: WidgetMessage: tm-fold-other-tiddlers type: text/vnd.tiddlywiki @@ -11,8 +11,8 @@ The `tm-fold-other-tiddlers` message folds all tiddlers in the current story lis |param|Title of the tiddler that should be ignored by the fold operation. | |foldedStatePrefix |Prefix for the state tiddler in which the fold state is stored. | -<<.tip "The core uses a foldStatePrefix of '$:/state/folded/' to store the fold states for the default story view.">> -<<.warning "The state tiddlers title is computed as 'foldStatePrefix + TiddlerTitle'. If the foldStatePrefix is not set, it will overwrite the text of the tiddler(s) itself, resulting in data loss. ">> +<<.tip "The core uses a foldStatePrefix of `$:/state/folded/` to store the fold states for the default story view.">> +<<.warning "The state tiddlers title is computed as `foldStatePrefix + TiddlerTitle`. If the foldStatePrefix is not set, it will overwrite the text of the tiddler(s) itself, resulting in data loss. ">> The `tm-fold-other-tiddlers` message is usually generated with the ButtonWidget and is handled by the surrounding NavigatorWidget. diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-tiddler.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-tiddler.tid index 872272128..6d6eee517 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-tiddler.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-fold-tiddler.tid @@ -1,16 +1,24 @@ caption: tm-fold-tiddler created: 20160424232749223 -modified: 20160424233102003 +modified: 20191028113537119 tags: Messages title: WidgetMessage: tm-fold-tiddler type: text/vnd.tiddlywiki -The `tm-fold-tiddler` message folds the tiddler specified in the `param` parameter. It does so by setting the text of a state tiddler to either "<<.value "show">>" or "<<.value "hide">>", according to the fold state. +The `tm-fold-tiddler` message toggles the value of a state tiddler. It does so by setting the text of a state tiddler to either "<<.value "show">>" or "<<.value "hide">>", according to the fold state. |!Name |!Description | -|param|Title of the tiddler that should be folded. If the tiddler is already folded, it will be unfolded instead. | -|foldedStatePrefix |Prefix for the state tiddler in which the fold state is stored. If no state prefix is provided, `tm-fold-tiddler` will do nothing. | +|param |ignored ... foldedState must be used | +|foldedState |State tiddler in which the fold state is stored | -<<.tip "The core uses a foldStatePrefix of '$:/state/folded/' to store the fold states for the default story view.">> +<<.tip "The core uses a foldState prefix of `$:/state/folded/` + `tiddler title` to store the fold states for the default story view.">> The `tm-fold-tiddler` message is usually generated with the ButtonWidget and is handled by the surrounding NavigatorWidget. + +The core $:/core/ui/ViewTemplate defines a global variable `folded-state`, that is used with every tiddler. It's created like this: + +``` +\define folded-state() +$:/state/folded/$(currentTiddler)$ +\end +``` diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-unfold-all-tiddlers.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-unfold-all-tiddlers.tid index 906d8fabe..db324699e 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-unfold-all-tiddlers.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-unfold-all-tiddlers.tid @@ -1,16 +1,16 @@ caption: tm-unfold-all-tiddlers created: 20160424233133261 -modified: 20160424233427308 +modified: 20191028113810219 tags: Messages title: WidgetMessage: tm-unfold-all-tiddlers type: text/vnd.tiddlywiki -The `tm-unfold-all-tiddlers` message unfolds all tiddlers in the current story list. It does so by setting the text of a state tiddler to either "<<.value "show">>" or "<<.value "hide">>", according to the fold state. +The `tm-unfold-all-tiddlers` message unfolds all tiddlers in the current story list. It does so by setting the text of all state tiddlers to: "<<.value "show">>". |!Name |!Description | |foldedStatePrefix |Prefix for the state tiddler in which the fold state is stored. | -<<.tip "The core uses a foldStatePrefix of '$:/state/folded/' to store the fold states for the default story view.">> -<<.warning "The state tiddlers title is computed as 'foldStatePrefix + TiddlerTitle'. If the foldStatePrefix is not set, it will overwrite the text of the tiddler(s) itself, resulting in data loss. ">> +<<.tip "The core uses a foldStatePrefix of `$:/state/folded/` to store the fold states for the default story view.">> +<<.warning "The state tiddlers title is computed as `foldStatePrefix + TiddlerTitle`. If the foldStatePrefix is not set, it will overwrite the text of the tiddler(s) itself, resulting in data loss. ">> The `tm-unfold-all-tiddlers` message is usually generated with the ButtonWidget and is handled by the surrounding NavigatorWidget.