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 4 commits
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
12 changes: 6 additions & 6 deletions core/ui/Actions/new-journal.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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>>/>">
\function tf.get-tags() [<textFieldTags>] [<tagsFieldTags>] +[join[ ]]
Leilei332 marked this conversation as resolved.
Show resolved Hide resolved
<$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=<<tf.get-tags>> text={{{ [<journalTitle>get[]] }}}/>
</$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=<<tf.get-tags>> text=<<journalText>>/>
</$reveal>
</$wikify>
</$vars>
</$let>
8 changes: 4 additions & 4 deletions core/ui/Actions/new-tiddler.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ 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>
\function tf.get-tags() [<textFieldTags>] [<tagsFieldTags>] +[join[ ]]
<$let textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}>
<$action-sendmessage $message="tm-new-tiddler" tags=<<tf.get-tags>>/>
</$let>
13 changes: 6 additions & 7 deletions core/ui/PageControls/advanced-search.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ caption: {{$:/core/images/advanced-search-button}} {{$:/language/Buttons/Advance
description: {{$:/language/Buttons/AdvancedSearch/Hint}}

\whitespace trim
\define advanced-search-button(class)
\whitespace trim
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
\procedure advanced-search-button(class)
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/advanced-search-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/AdvancedSearch/Caption}}/></span>
</$list>
<%endif%>
</$button>
\end

Expand Down
10 changes: 5 additions & 5 deletions core/ui/PageControls/closeall.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/CloseAll/Hint}}

\whitespace trim
<$button message="tm-close-all-tiddlers" tooltip={{$:/language/Buttons/CloseAll/Hint}} aria-label={{$:/language/Buttons/CloseAll/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/close-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/CloseAll/Caption}}/>
</span>
</$list>
</$button>
<%endif%>
</$button>
13 changes: 6 additions & 7 deletions core/ui/PageControls/controlpanel.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ caption: {{$:/core/images/options-button}} {{$:/language/Buttons/ControlPanel/Ca
description: {{$:/language/Buttons/ControlPanel/Hint}}

\whitespace trim
\define control-panel-button(class)
\whitespace trim
<$button to="$:/ControlPanel" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
\procedure control-panel-button(class)
<$button to="$:/ControlPanel" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/options-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/ControlPanel/Caption}}/></span>
</$list>
<%endif%>
</$button>
\end

Expand Down
16 changes: 8 additions & 8 deletions core/ui/PageControls/encryption.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ description: {{$:/language/Buttons/Encryption/Hint}}
\whitespace trim
<$reveal type="match" state="$:/isEncrypted" text="yes">
<$button message="tm-clear-password" tooltip={{$:/language/Buttons/Encryption/ClearPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/ClearPassword/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/locked-padlock}}
</$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/Encryption/ClearPassword/Caption}}/>
</span>
</$list>
<%endif%>
</$button>
</$reveal>
<$reveal type="nomatch" state="$:/isEncrypted" text="yes">
<$button message="tm-set-password" tooltip={{$:/language/Buttons/Encryption/SetPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/SetPassword/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/unlocked-padlock}}
</$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/Encryption/SetPassword/Caption}}/>
</span>
</$list>
<%endif%>
</$button>
</$reveal>
2 changes: 1 addition & 1 deletion core/ui/PageControls/export-page.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/export-button}} {{$:/language/Buttons/ExportPage/Caption}}
description: {{$:/language/Buttons/ExportPage/Hint}}

<$macrocall $name="exportButton" exportFilter="[!is[system]sort[title]]" lingoBase="$:/language/Buttons/ExportPage/"/>
<$transclude $variable="exportButton" exportFilter="[!is[system]sort[title]]" lingoBase="$:/language/Buttons/ExportPage/"/>
10 changes: 5 additions & 5 deletions core/ui/PageControls/fold-all.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/FoldAll/Hint}}
\whitespace trim
<$button tooltip={{$:/language/Buttons/FoldAll/Hint}} aria-label={{$:/language/Buttons/FoldAll/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-fold-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/fold-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/FoldAll/Caption}}/>
</span>
</$list>
</$button>
<%endif%>
</$button>
10 changes: 5 additions & 5 deletions core/ui/PageControls/full-screen.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/FullScreen/Hint}}

\whitespace trim
<$button message="tm-full-screen" tooltip={{$:/language/Buttons/FullScreen/Hint}} aria-label={{$:/language/Buttons/FullScreen/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/full-screen-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/FullScreen/Caption}}/>
</span>
</$list>
</$button>
<%endif%>
</$button>
10 changes: 5 additions & 5 deletions core/ui/PageControls/home.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Home/Hint}}

\whitespace trim
<$button message="tm-home" tooltip={{$:/language/Buttons/Home/Hint}} aria-label={{$:/language/Buttons/Home/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/home-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/Home/Caption}}/>
</span>
</$list>
</$button>
<%endif%>
</$button>
10 changes: 5 additions & 5 deletions core/ui/PageControls/import.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ description: {{$:/language/Buttons/Import/Hint}}
\whitespace trim
<div class="tc-file-input-wrapper">
<$button tooltip={{$:/language/Buttons/Import/Hint}} aria-label={{$:/language/Buttons/Import/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/import-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/Import/Caption}}/>
</span>
</$list>
<%endif%>
</$button>
<$browse tooltip={{$:/language/Buttons/Import/Hint}}/>
</div>
</div>
21 changes: 9 additions & 12 deletions core/ui/PageControls/language.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ caption: {{$:/core/images/globe}} {{$:/language/Buttons/Language/Caption}}
description: {{$:/language/Buttons/Language/Hint}}

\whitespace trim
\define flag-title()
$(languagePluginTitle)$/icon
\end
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/language">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<span class="tc-image-button">
<$set name="languagePluginTitle" value={{$:/language}}>
<$image source=<<flag-title>>/>
</$set>
</span>
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
<span class="tc-image-button">
<$set name="languagePluginTitle" value={{$:/language}}>
<$image source=`$(languagePluginTitle)$/icon`/>
</$set>
</span>
<%endif%>
<%if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Language/Caption}}/></span>
</$list>
<%endif%>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/language">> type="popup" position="below" animate="yes">
Expand Down
8 changes: 4 additions & 4 deletions core/ui/PageControls/layout.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ description: {{$:/language/LayoutSwitcher/Description}}
\whitespace trim
<$button tooltip={{$:/language/Buttons/LayoutSwitcher/Hint}} aria-label={{$:/language/Buttons/LayoutSwitcher/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-show-switcher" switch="layout"/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/layout-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/LayoutSwitcher/Caption}}/></span>
</$list>
<%endif%>
</$button>
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]] %>
{{$:/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
38 changes: 17 additions & 21 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>
</$reveal>
10 changes: 5 additions & 5 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>
</$button>
<%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>
11 changes: 5 additions & 6 deletions core/ui/PageControls/new-journal.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/
description: {{$:/language/Buttons/NewJournal/Hint}}

\whitespace trim
\define journalButton()
\whitespace trim
\procedure journalButton()
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-journal}}>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/new-journal-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/NewJournal/Caption}}/>
</span>
</$list>
<%endif%>
</$button>
\end
<<journalButton>>
Loading
Loading