From 0b6db6e860ed0fdeab81027a2caddba5a68227e3 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sat, 16 Mar 2024 20:03:36 +0100 Subject: [PATCH] Fix indentation for tiddlers that set tv-config-toolbar-class (#8079) human readable in preparation to add data-title=<> for better UX defining a "read only" theme Changes to be committed: modified: core/ui/EditTemplate/controls.tid modified: core/ui/PageControls.tid modified: core/ui/PageControls/more-page-actions.tid modified: core/ui/ViewTemplate/title.tid modified: core/ui/ViewToolbar/more-tiddler-actions.tid modified: plugins/tiddlywiki/menubar/items/pagecontrols.tid --- core/ui/EditTemplate/controls.tid | 18 +++-- core/ui/PageControls.tid | 23 +++--- core/ui/PageControls/more-page-actions.tid | 79 +++++++++---------- core/ui/ViewTemplate/title.tid | 59 ++++++++------ core/ui/ViewToolbar/more-tiddler-actions.tid | 78 ++++++++---------- .../tiddlywiki/menubar/items/pagecontrols.tid | 19 +++-- 6 files changed, 136 insertions(+), 140 deletions(-) diff --git a/core/ui/EditTemplate/controls.tid b/core/ui/EditTemplate/controls.tid index 3e94d371d..e97cedd78 100644 --- a/core/ui/EditTemplate/controls.tid +++ b/core/ui/EditTemplate/controls.tid @@ -1,12 +1,18 @@ title: $:/core/ui/EditTemplate/controls tags: $:/tags/EditTemplate -\define config-title() -$:/config/EditToolbarButtons/Visibility/$(listItem)$ -\end +\define config-title() $:/config/EditToolbarButtons/Visibility/$(listItem)$ \whitespace trim
-<$view field="title"/> -<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$let tv-config-toolbar-class={{{ [enlist] [encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]]}}}><$reveal type="nomatch" state=<> text="hide"><$transclude tiddler=<>/> -
+ <$view field="title"/> + + <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"> + <$let tv-config-toolbar-class={{{ [enlist] [encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}> + <$reveal type="nomatch" state=<> text="hide"> + <$transclude $tiddler=<>/> + + + + +
diff --git a/core/ui/PageControls.tid b/core/ui/PageControls.tid index 93a7bc224..2b579050c 100644 --- a/core/ui/PageControls.tid +++ b/core/ui/PageControls.tid @@ -1,17 +1,16 @@ title: $:/core/ui/PageTemplate/pagecontrols \whitespace trim -\define config-title() -$:/config/PageControlButtons/Visibility/$(listItem)$ -\end +\define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$ +
-<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem"> -<$set name="hidden" value=<>> -<$list filter="[!text[hide]]" storyview="pop" variable="ignore"> -<$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> -<$transclude tiddler=<> mode="inline"/> - - - - + <$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem"> + <$set name="hidden" value=<>> + <$list filter="[!text[hide]]" storyview="pop" variable="ignore"> + <$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> + <$transclude tiddler=<> mode="inline"/> + + + +
diff --git a/core/ui/PageControls/more-page-actions.tid b/core/ui/PageControls/more-page-actions.tid index b52f99ec9..3acaef2b6 100644 --- a/core/ui/PageControls/more-page-actions.tid +++ b/core/ui/PageControls/more-page-actions.tid @@ -4,48 +4,41 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}} description: {{$:/language/Buttons/More/Hint}} \whitespace trim -\define config-title() -$:/config/PageControlButtons/Visibility/$(listItem)$ -\end -<$button popup=<> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<> selectedClass="tc-selected"> -<$list filter="[match[yes]]"> -{{$:/core/images/down-arrow}} - -<$list filter="[match[yes]]"> - -<$text text={{$:/language/Buttons/More/Caption}}/> - - -<$reveal state=<> type="popup" position="below" animate="yes"> - -
- -<$set name="tv-config-toolbar-icons" value="yes"> - -<$set name="tv-config-toolbar-text" value="yes"> - -<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> - -<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" variable="listItem"> - -<$reveal type="match" state=<> text="hide"> - -<$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> - -<$transclude tiddler=<> mode="inline"/> - - - - - - - - - - - - - -
+\define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$ +<$button popup=<> + tooltip={{$:/language/Buttons/More/Hint}} + aria-label={{$:/language/Buttons/More/Caption}} + class=<> + selectedClass="tc-selected" +> + <$list filter="[match[yes]]"> + {{$:/core/images/down-arrow}} + + <$list filter="[match[yes]]"> + + <$text text={{$:/language/Buttons/More/Caption}}/> + + + +<$reveal state=<> type="popup" position="below" animate="yes"> +
+ <$set name="tv-config-toolbar-icons" value="yes"> + <$set name="tv-config-toolbar-text" value="yes"> + <$set name="tv-config-toolbar-class" value="tc-btn-invisible"> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" + variable="listItem" + > + <$reveal type="match" state=<> text="hide"> + <$set name="tv-config-toolbar-class" + filter="[] [encodeuricomponent[]addprefix[tc-btn-]]" + > + <$transclude tiddler=<> mode="inline"/> + + + + + + +
\ No newline at end of file diff --git a/core/ui/ViewTemplate/title.tid b/core/ui/ViewTemplate/title.tid index 98695f6bf..e5be2eba5 100644 --- a/core/ui/ViewTemplate/title.tid +++ b/core/ui/ViewTemplate/title.tid @@ -2,31 +2,38 @@ title: $:/core/ui/ViewTemplate/title tags: $:/tags/ViewTemplate \whitespace trim -\define title-styles() -fill:$(foregroundColor)$; -\end +\define title-styles() fill:$(foregroundColor)$; +
-
- -<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]" storyview="pop" variable="listItem"><$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"><$transclude tiddler=<>/> - -<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}> -<$link> -<$list filter="[] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]" variable="ignore"> -<$let foregroundColor={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}> ->> -{{||$:/core/ui/TiddlerIcon}} - - - -<$transclude tiddler={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} /> - - -
- -<$reveal type="nomatch" text="" default="" state=<> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes"> - -<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem"><$transclude tiddler=<> mode="block"/> - - +
+ + <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]" + storyview="pop" + variable="listItem" + > + <$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> + <$transclude tiddler=<>/> + + + + <$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}> + <$link> + <$list filter="[] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]" + variable="ignore" + > + <$let foregroundColor={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}> + >> + {{||$:/core/ui/TiddlerIcon}} + + + + <$transclude tiddler={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} /> + + +
+ <$reveal type="nomatch" text="" default="" state=<> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes"> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem"> + <$transclude tiddler=<> mode="block"/> + +
diff --git a/core/ui/ViewToolbar/more-tiddler-actions.tid b/core/ui/ViewToolbar/more-tiddler-actions.tid index 6b24db362..e7e75a79b 100644 --- a/core/ui/ViewToolbar/more-tiddler-actions.tid +++ b/core/ui/ViewToolbar/more-tiddler-actions.tid @@ -4,49 +4,41 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}} description: {{$:/language/Buttons/More/Hint}} \whitespace trim -\define config-title() -$:/config/ViewToolbarButtons/Visibility/$(listItem)$ -\end -<$button popup=<> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<> selectedClass="tc-selected"> -<$list filter="[match[yes]]"> -{{$:/core/images/down-arrow}} - -<$list filter="[match[yes]]"> - -<$text text={{$:/language/Buttons/More/Caption}}/> - - +\define config-title() $:/config/ViewToolbarButtons/Visibility/$(listItem)$ + +<$button popup=<> + tooltip={{$:/language/Buttons/More/Hint}} + aria-label={{$:/language/Buttons/More/Caption}} + class=<> + selectedClass="tc-selected" +> + <$list filter="[match[yes]]"> + {{$:/core/images/down-arrow}} + + <$list filter="[match[yes]]"> + + <$text text={{$:/language/Buttons/More/Caption}}/> + + <$reveal state=<> type="popup" position="belowleft" animate="yes"> - -
- -<$set name="tv-config-toolbar-icons" value="yes"> - -<$set name="tv-config-toolbar-text" value="yes"> - -<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> - -<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" variable="listItem"> - -<$reveal type="match" state=<> text="hide"> - -<$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> - -<$transclude tiddler=<> mode="inline"/> - - - - - - - - - - - - - -
- +
+ <$set name="tv-config-toolbar-icons" value="yes"> + <$set name="tv-config-toolbar-text" value="yes"> + <$set name="tv-config-toolbar-class" value="tc-btn-invisible"> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" + variable="listItem" + > + <$reveal type="match" state=<> text="hide"> + <$set name="tv-config-toolbar-class" + filter="[] [encodeuricomponent[]addprefix[tc-btn-]]" + > + <$transclude tiddler=<> mode="inline"/> + + + + + + +
\ No newline at end of file diff --git a/plugins/tiddlywiki/menubar/items/pagecontrols.tid b/plugins/tiddlywiki/menubar/items/pagecontrols.tid index 833d035f4..af4026664 100644 --- a/plugins/tiddlywiki/menubar/items/pagecontrols.tid +++ b/plugins/tiddlywiki/menubar/items/pagecontrols.tid @@ -5,15 +5,14 @@ caption: Page controls custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/pagecontrols" mode="inline"/> \whitespace trim -\define config-title() -$:/config/PageControlButtons/Visibility/$(listItem)$ -\end +\define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$ + <$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem"> -<$set name="hidden" value=<>> -<$list filter="[!text[hide]]" storyview="pop" variable="ignore"> -<$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> -<$transclude tiddler=<> mode="inline"/> - - - + <$set name="hidden" value=<>> + <$list filter="[!text[hide]]" storyview="pop" variable="ignore"> + <$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> + <$transclude tiddler=<> mode="inline"/> + + +