Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PageControls buttons to use v5.3.2 syntax #8579

Merged
merged 7 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions core/ui/Actions/new-journal.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ title: $:/core/ui/Actions/new-journal
tags: $:/tags/Actions
description: create a new journal tiddler

\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="<$macrocall $name='now' format=<<journalTitleTemplate>>/>">
<$let journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="<$transclude $variable='now' format=<<journalTitleTemplate>>/>">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}}/>
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=`$(textFieldTags)$ $(tagsFieldTags)$` text={{{ [<journalTitle>get[]] }}}/>
Leilei332 marked this conversation as resolved.
Show resolved Hide resolved
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text=<<journalText>>/>
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=`$(textFieldTags)$ $(tagsFieldTags)$` text=<<journalText>>/>
</$reveal>
</$wikify>
</$vars>
</$let>
7 changes: 3 additions & 4 deletions core/ui/Actions/new-tiddler.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ title: $:/core/ui/Actions/new-tiddler
tags: $:/tags/Actions
description: create a new empty tiddler

\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}>
<$action-sendmessage $message="tm-new-tiddler" tags=<<get-tags>>/>
</$vars>
<$let textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}>
<$action-sendmessage $message="tm-new-tiddler" tags=`$(textFieldTags)$ $(tagsFieldTags)$`/>
</$let>
13 changes: 6 additions & 7 deletions core/ui/PageControls/manager.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ caption: {{$:/core/images/list}} {{$:/language/Buttons/Manager/Caption}}
description: {{$:/language/Buttons/Manager/Hint}}

\whitespace trim
\define manager-button(class)
\whitespace trim
<$button to="$:/Manager" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
\procedure manager-button(class)
<$button to="$:/Manager" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<% if [<tv-config-toolbar-icons>match[yes]] %>
Leilei332 marked this conversation as resolved.
Show resolved Hide resolved
{{$:/core/images/list}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Manager/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
\end

Expand Down
36 changes: 16 additions & 20 deletions core/ui/PageControls/more-page-actions.tid
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,29 @@ description: {{$:/language/Buttons/More/Hint}}
class=<<tv-config-toolbar-class>>
selectedClass="tc-selected"
>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/down-arrow}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>
<% endif %>
</$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"
<$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="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-]]"
>
<$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>
<$transclude tiddler=<<listItem>> mode="inline"/>
</$set>
</$reveal>
</$list>
</$let>
</div>
</$reveal>
8 changes: 4 additions & 4 deletions core/ui/PageControls/network-activity.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/NetworkActivity/Hint}}

\whitespace trim
<$button message="tm-http-cancel-all-requests" tooltip={{$:/language/Buttons/NetworkActivity/Hint}} aria-label={{$:/language/Buttons/NetworkActivity/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/network-activity}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NetworkActivity/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
8 changes: 4 additions & 4 deletions core/ui/PageControls/new-image.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/NewImage/Hint}}

\whitespace trim
<$button tooltip={{$:/language/Buttons/NewImage/Hint}} aria-label={{$:/language/Buttons/NewImage/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-image}}>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/new-image-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NewImage/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
8 changes: 4 additions & 4 deletions core/ui/PageControls/newtiddler.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/NewTiddler/Hint}}

\whitespace trim
<$button actions={{$:/core/ui/Actions/new-tiddler}} tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NewTiddler/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
8 changes: 4 additions & 4 deletions core/ui/PageControls/palette.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/Palette/Hint}}
\whitespace trim
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/palette">> tooltip={{$:/language/Buttons/Palette/Hint}} aria-label={{$:/language/Buttons/Palette/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/palette}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Palette/Caption}}/></span>
</$list>
<% endif %>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/palette">> type="popup" position="below" animate="yes">
Expand Down
8 changes: 4 additions & 4 deletions core/ui/PageControls/print.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Print/Hint}}

\whitespace trim
<$button message="tm-print" tooltip={{$:/language/Buttons/Print/Hint}} aria-label={{$:/language/Buttons/Print/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/print-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Print/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
8 changes: 4 additions & 4 deletions core/ui/PageControls/refresh.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Refresh/Hint}}

\whitespace trim
<$button message="tm-browser-refresh" tooltip={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/refresh-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Refresh/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
8 changes: 4 additions & 4 deletions core/ui/PageControls/savewiki.tid
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ description: {{$:/language/Buttons/SaveWiki/Hint}}
<$action-sendmessage $message="tm-save-wiki" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/>
</$wikify>
<span class="tc-dirty-indicator">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/save-button-dynamic}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/SaveWiki/Caption}}/>
</span>
</$list>
<% endif %>
</span>
</$button>
13 changes: 5 additions & 8 deletions core/ui/PageControls/storyview.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ caption: {{$:/core/images/storyview-classic}} {{$:/language/Buttons/StoryView/Ca
description: {{$:/language/Buttons/StoryView/Hint}}

\whitespace trim
\define icon()
$:/core/images/storyview-$(storyview)$
\end
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/storyview">> tooltip={{$:/language/Buttons/StoryView/Hint}} aria-label={{$:/language/Buttons/StoryView/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
<$set name="storyview" value={{$:/view}}>
<$transclude tiddler=<<icon>>/>
<$transclude tiddler=`$:/core/images/storyview-$(storyview)$`/>
</$set>
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text"><$text text={{$:/language/Buttons/StoryView/Caption}}/></span>
</$list>
<% endif %>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/storyview">> type="popup" position="below" animate="yes">
Expand Down
13 changes: 6 additions & 7 deletions core/ui/PageControls/tag-button.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ caption: {{$:/core/images/tag-button}} {{$:/language/Buttons/TagManager/Caption}
description: {{$:/language/Buttons/TagManager/Hint}}

\whitespace trim
\define control-panel-button(class)
\whitespace trim
<$button to="$:/TagManager" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
\procedure control-panel-button(class)
<$button to="$:/TagManager" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/tag-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/TagManager/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
\end

Expand Down
8 changes: 4 additions & 4 deletions core/ui/PageControls/theme.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/Theme/Hint}}
\whitespace trim
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/theme">> tooltip={{$:/language/Buttons/Theme/Hint}} aria-label={{$:/language/Buttons/Theme/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/theme-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Theme/Caption}}/></span>
</$list>
<% endif %>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/theme">> type="popup" position="below" animate="yes">
Expand Down
16 changes: 8 additions & 8 deletions core/ui/PageControls/timestamp.tid
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ description: {{$:/language/Buttons/Timestamp/Hint}}
<$reveal type="nomatch" state="$:/config/TimestampDisable" text="yes">
<$button tooltip={{$:/language/Buttons/Timestamp/On/Hint}} aria-label={{$:/language/Buttons/Timestamp/On/Caption}} class=<<tv-config-toolbar-class>>>
<$action-setfield $tiddler="$:/config/TimestampDisable" $value="yes"/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/timestamp-on}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Timestamp/On/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
</$reveal>
<$reveal type="match" state="$:/config/TimestampDisable" text="yes">
<$button tooltip={{$:/language/Buttons/Timestamp/Off/Hint}} aria-label={{$:/language/Buttons/Timestamp/Off/Caption}} class=<<tv-config-toolbar-class>>>
<$action-setfield $tiddler="$:/config/TimestampDisable" $value="no"/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/timestamp-off}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Timestamp/Off/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
</$reveal>
8 changes: 4 additions & 4 deletions core/ui/PageControls/unfold-all.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/UnfoldAll/Hint}}
\whitespace trim
<$button tooltip={{$:/language/Buttons/UnfoldAll/Hint}} aria-label={{$:/language/Buttons/UnfoldAll/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-unfold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem">
<% if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/unfold-all-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<% endif %>
<% if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/UnfoldAll/Caption}}/>
</span>
</$list>
<% endif %>
</$button>
Loading