1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Fix indentation for tiddlers that set tv-config-toolbar-class (#8079)

human readable in preparation to add data-title=<<listItem>>
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
This commit is contained in:
Mario Pietsch 2024-03-16 20:03:36 +01:00 committed by GitHub
parent 3657e59a08
commit 0b6db6e860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 136 additions and 140 deletions

View File

@ -1,12 +1,18 @@
title: $:/core/ui/EditTemplate/controls title: $:/core/ui/EditTemplate/controls
tags: $:/tags/EditTemplate tags: $:/tags/EditTemplate
\define config-title() \define config-title() $:/config/EditToolbarButtons/Visibility/$(listItem)$
$:/config/EditToolbarButtons/Visibility/$(listItem)$
\end
\whitespace trim \whitespace trim
<div class="tc-tiddler-title tc-tiddler-edit-title"> <div class="tc-tiddler-title tc-tiddler-edit-title">
<$view field="title"/> <$view field="title"/>
<span class="tc-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]]}}}><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$let></$list></span> <span class="tc-tiddler-controls tc-titlebar">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem">
<$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}>
<$reveal type="nomatch" state=<<config-title>> text="hide">
<$transclude $tiddler=<<listItem>>/>
</$reveal>
</$let>
</$list>
</span>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>

View File

@ -1,9 +1,8 @@
title: $:/core/ui/PageTemplate/pagecontrols title: $:/core/ui/PageTemplate/pagecontrols
\whitespace trim \whitespace trim
\define config-title() \define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$
$:/config/PageControlButtons/Visibility/$(listItem)$
\end
<div class="tc-page-controls"> <div class="tc-page-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem">
<$set name="hidden" value=<<config-title>>> <$set name="hidden" value=<<config-title>>>

View File

@ -4,10 +4,14 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}
description: {{$:/language/Buttons/More/Hint}} description: {{$:/language/Buttons/More/Hint}}
\whitespace trim \whitespace trim
\define config-title() \define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$
$:/config/PageControlButtons/Visibility/$(listItem)$
\end <$button popup=<<qualify "$:/state/popup/more">>
<$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> tooltip={{$:/language/Buttons/More/Hint}}
aria-label={{$:/language/Buttons/More/Caption}}
class=<<tv-config-toolbar-class>>
selectedClass="tc-selected"
>
<$list filter="[<tv-config-toolbar-icons>match[yes]]"> <$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}} {{$:/core/images/down-arrow}}
</$list> </$list>
@ -16,36 +20,25 @@ $:/config/PageControlButtons/Visibility/$(listItem)$
<$text text={{$:/language/Buttons/More/Caption}}/> <$text text={{$:/language/Buttons/More/Caption}}/>
</span> </span>
</$list> </$list>
</$button><$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes"> </$button>
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
<div class="tc-drop-down"> <div class="tc-drop-down">
<$set name="tv-config-toolbar-icons" value="yes"> <$set name="tv-config-toolbar-icons" value="yes">
<$set name="tv-config-toolbar-text" value="yes"> <$set name="tv-config-toolbar-text" value="yes">
<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> <$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]]"
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" variable="listItem"> variable="listItem"
>
<$reveal type="match" state=<<config-title>> text="hide"> <$reveal type="match" state=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class"
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"> filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
>
<$transclude tiddler=<<listItem>> mode="inline"/> <$transclude tiddler=<<listItem>> mode="inline"/>
</$set> </$set>
</$reveal> </$reveal>
</$list> </$list>
</$set> </$set>
</$set> </$set>
</$set> </$set>
</div> </div>
</$reveal> </$reveal>

View File

@ -2,17 +2,25 @@ title: $:/core/ui/ViewTemplate/title
tags: $:/tags/ViewTemplate tags: $:/tags/ViewTemplate
\whitespace trim \whitespace trim
\define title-styles() \define title-styles() fill:$(foregroundColor)$;
fill:$(foregroundColor)$;
\end
<div class="tc-tiddler-title"> <div class="tc-tiddler-title">
<div class="tc-titlebar"> <div class="tc-titlebar">
<span class="tc-tiddler-controls"> <span class="tc-tiddler-controls">
<$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="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"><$transclude tiddler=<<listItem>>/></$set></$list> <$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="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>>/>
</$set>
</$list>
</span> </span>
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}> <$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
<$link> <$link>
<$list filter="[<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]" variable="ignore"> <$list filter="[<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]"
variable="ignore"
>
<$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}> <$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<span class="tc-tiddler-title-icon" style=<<title-styles>>> <span class="tc-tiddler-title-icon" style=<<title-styles>>>
{{||$:/core/ui/TiddlerIcon}} {{||$:/core/ui/TiddlerIcon}}
@ -23,10 +31,9 @@ fill:$(foregroundColor)$;
</$link> </$link>
</$set> </$set>
</div> </div>
<$reveal type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes"> <$reveal type="nomatch" text="" default="" state=<<tiddlerInfoState>> 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">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem"><$transclude tiddler=<<listItem>> mode="block"/></$list> <$transclude tiddler=<<listItem>> mode="block"/>
</$list>
</$reveal> </$reveal>
</div> </div>

View File

@ -4,10 +4,14 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}
description: {{$:/language/Buttons/More/Hint}} description: {{$:/language/Buttons/More/Hint}}
\whitespace trim \whitespace trim
\define config-title() \define config-title() $:/config/ViewToolbarButtons/Visibility/$(listItem)$
$:/config/ViewToolbarButtons/Visibility/$(listItem)$
\end <$button popup=<<qualify "$:/state/popup/more">>
<$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> tooltip={{$:/language/Buttons/More/Hint}}
aria-label={{$:/language/Buttons/More/Caption}}
class=<<tv-config-toolbar-class>>
selectedClass="tc-selected"
>
<$list filter="[<tv-config-toolbar-icons>match[yes]]"> <$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}} {{$:/core/images/down-arrow}}
</$list> </$list>
@ -18,35 +22,23 @@ $:/config/ViewToolbarButtons/Visibility/$(listItem)$
</$list> </$list>
</$button> </$button>
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="belowleft" animate="yes"> <$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="belowleft" animate="yes">
<div class="tc-drop-down"> <div class="tc-drop-down">
<$set name="tv-config-toolbar-icons" value="yes"> <$set name="tv-config-toolbar-icons" value="yes">
<$set name="tv-config-toolbar-text" value="yes"> <$set name="tv-config-toolbar-text" value="yes">
<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> <$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]]"
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" variable="listItem"> variable="listItem"
>
<$reveal type="match" state=<<config-title>> text="hide"> <$reveal type="match" state=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class"
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"> filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
>
<$transclude tiddler=<<listItem>> mode="inline"/> <$transclude tiddler=<<listItem>> mode="inline"/>
</$set> </$set>
</$reveal> </$reveal>
</$list> </$list>
</$set> </$set>
</$set> </$set>
</$set> </$set>
</div> </div>
</$reveal> </$reveal>

View File

@ -5,9 +5,8 @@ caption: Page controls
custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/pagecontrols" mode="inline"/> custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/pagecontrols" mode="inline"/>
\whitespace trim \whitespace trim
\define config-title() \define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$
$:/config/PageControlButtons/Visibility/$(listItem)$
\end
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem">
<$set name="hidden" value=<<config-title>>> <$set name="hidden" value=<<config-title>>>
<$list filter="[<hidden>!text[hide]]" storyview="pop" variable="ignore"> <$list filter="[<hidden>!text[hide]]" storyview="pop" variable="ignore">