From b3273bcbda6bcb9f3a0670b79ea598c3674c5012 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 23 Nov 2016 18:17:54 +0000 Subject: [PATCH] Add "sticky" mode for tiddler info panel A new option in control panel to cause the info panel to stay open until it is explicitly closed --- core/language/en-GB/ControlPanel.multids | 4 ++++ .../ControlPanel/Settings/InfoPanelMode.tid | 10 +++++++++ core/ui/TiddlerInfo.tid | 10 +++++++++ core/ui/ViewToolbar/info.tid | 21 +++++++++++++++++-- core/wiki/config/TiddlerInfoMode.tid | 2 ++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 core/ui/ControlPanel/Settings/InfoPanelMode.tid create mode 100644 core/wiki/config/TiddlerInfoMode.tid diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index 5204d62aa..f94319c53 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -103,6 +103,10 @@ Settings/Caption: Settings Settings/EditorToolbar/Caption: Editor Toolbar Settings/EditorToolbar/Hint: Enable or disable the editor toolbar: Settings/EditorToolbar/Description: Show editor toolbar +Settings/InfoPanelMode/Caption: Tiddler Info Panel Mode +Settings/InfoPanelMode/Hint: Control when the tiddler info panel closes: +Settings/InfoPanelMode/Popup/Description: Tiddler info panel closes automatically +Settings/InfoPanelMode/Sticky/Description: Tiddler info panel stays open until explicitly closed Settings/Hint: These settings let you customise the behaviour of TiddlyWiki. Settings/NavigationAddressBar/Caption: Navigation Address Bar Settings/NavigationAddressBar/Hint: Behaviour of the browser address bar when navigating to a tiddler: diff --git a/core/ui/ControlPanel/Settings/InfoPanelMode.tid b/core/ui/ControlPanel/Settings/InfoPanelMode.tid new file mode 100644 index 000000000..371b6d61b --- /dev/null +++ b/core/ui/ControlPanel/Settings/InfoPanelMode.tid @@ -0,0 +1,10 @@ +title: $:/core/ui/ControlPanel/Settings/InfoPanelMode +tags: $:/tags/ControlPanel/Settings +caption: {{$:/language/ControlPanel/Settings/InfoPanelMode/Caption}} + +\define lingo-base() $:/language/ControlPanel/Settings/InfoPanelMode/ +<$link to="$:/config/TiddlerInfo/Mode"><> + +<$radio tiddler="$:/config/TiddlerInfo/Mode" value="popup"> <> + +<$radio tiddler="$:/config/TiddlerInfo/Mode" value="sticky"> <> diff --git a/core/ui/TiddlerInfo.tid b/core/ui/TiddlerInfo.tid index 3e51e4855..f7447fea1 100644 --- a/core/ui/TiddlerInfo.tid +++ b/core/ui/TiddlerInfo.tid @@ -1,3 +1,13 @@ title: $:/core/ui/TiddlerInfo +
+
+<$reveal state="$:/config/TiddlerInfo/Mode" type="match" text="sticky"> +<$button set=<> setTo="" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class="tc-btn-invisible"> +{{$:/core/images/close-button}} + + +
+
+ <$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]" default={{$:/config/TiddlerInfo/Default}}/> \ No newline at end of file diff --git a/core/ui/ViewToolbar/info.tid b/core/ui/ViewToolbar/info.tid index f6f40860f..5eb6cd2d4 100644 --- a/core/ui/ViewToolbar/info.tid +++ b/core/ui/ViewToolbar/info.tid @@ -3,11 +3,28 @@ tags: $:/tags/ViewToolbar caption: {{$:/core/images/info-button}} {{$:/language/Buttons/Info/Caption}} description: {{$:/language/Buttons/Info/Hint}} -<$button popup=<> tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<> selectedClass="tc-selected"> +\define button-content() <$list filter="[prefix[yes]]"> {{$:/core/images/info-button}} <$list filter="[prefix[yes]]"> <$text text={{$:/language/Buttons/Info/Caption}}/> - \ No newline at end of file +\end +<$reveal state="$:/config/TiddlerInfo/Mode" type="match" text="popup"> +<$button popup=<> tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<> selectedClass="tc-selected"> +<$macrocall $name="button-content" mode="inline"/> + + +<$reveal state="$:/config/TiddlerInfo/Mode" type="match" text="sticky"> +<$reveal state=<> type="match" text="" default=""> +<$button set=<> setTo="yes" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<> selectedClass="tc-selected"> +<$macrocall $name="button-content" mode="inline"/> + + +<$reveal state=<> type="nomatch" text="" default=""> +<$button set=<> setTo="" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<> selectedClass="tc-selected"> +<$macrocall $name="button-content" mode="inline"/> + + + \ No newline at end of file diff --git a/core/wiki/config/TiddlerInfoMode.tid b/core/wiki/config/TiddlerInfoMode.tid new file mode 100644 index 000000000..80947122b --- /dev/null +++ b/core/wiki/config/TiddlerInfoMode.tid @@ -0,0 +1,2 @@ +title: $:/config/TiddlerInfo/Mode +text: popup \ No newline at end of file