1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +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">
<div style="clear: both;"></div> <$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> </div>

View File

@ -1,17 +1,16 @@
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>>>
<$list filter="[<hidden>!text[hide]]" storyview="pop" variable="ignore"> <$list filter="[<hidden>!text[hide]]" storyview="pop" variable="ignore">
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"> <$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>> mode="inline"/> <$transclude tiddler=<<listItem>> mode="inline"/>
</$set> </$set>
</$list> </$list>
</$set> </$set>
</$list> </$list>
</div> </div>

View File

@ -4,48 +4,41 @@ 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">> 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]]">
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
</$button><$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
<$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=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$reveal>
</$list>
</$set>
</$set>
</$set>
</div>
<$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"
>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
</$button>
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
<$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=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class"
filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
>
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$reveal>
</$list>
</$set>
</$set>
</$set>
</div>
</$reveal> </$reveal>

View File

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

View File

@ -4,49 +4,41 @@ 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}}
<$list filter="[<tv-config-toolbar-icons>match[yes]]"> aria-label={{$:/language/Buttons/More/Caption}}
{{$:/core/images/down-arrow}} class=<<tv-config-toolbar-class>>
</$list> selectedClass="tc-selected"
<$list filter="[<tv-config-toolbar-text>match[yes]]"> >
<span class="tc-btn-text"> <$list filter="[<tv-config-toolbar-icons>match[yes]]">
<$text text={{$:/language/Buttons/More/Caption}}/> {{$:/core/images/down-arrow}}
</span> </$list>
</$list> <$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$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-text" value="yes">
<$set name="tv-config-toolbar-icons" 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]]"
<$set name="tv-config-toolbar-text" value="yes"> variable="listItem"
>
<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> <$reveal type="match" state=<<config-title>> text="hide">
<$set name="tv-config-toolbar-class"
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" variable="listItem"> filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
>
<$reveal type="match" state=<<config-title>> text="hide"> <$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"> </$reveal>
</$list>
<$transclude tiddler=<<listItem>> mode="inline"/> </$set>
</$set>
</$set> </$set>
</div>
</$reveal>
</$list>
</$set>
</$set>
</$set>
</div>
</$reveal> </$reveal>

View File

@ -5,15 +5,14 @@ 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">
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"> <$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>> mode="inline"/> <$transclude tiddler=<<listItem>> mode="inline"/>
</$set> </$set>
</$list> </$list>
</$set> </$set>
</$list> </$list>