1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Trim Saga: Making existing trim tiddlers consistent (#6272)

* adding trim: AdvancedSearch Standard

* adding trim: tiddlers that had SOME trim already

* making all existing trim tiddlers consistent

* Forgot to properly indent this widget

* I don't THINK that space was important...

but I'm putting it back in

* Forgot one whitespace trim
This commit is contained in:
Cameron Fischer 2022-03-26 11:18:42 -04:00 committed by GitHub
parent b9ae6607c0
commit 5d69fe7bef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 29 deletions

View File

@ -1,6 +1,7 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete
tags: $:/tags/AdvancedSearch/FilterButton tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible"> <$button popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible">
{{$:/core/images/delete-button}} {{$:/core/images/delete-button}}

View File

@ -3,15 +3,17 @@ tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Standard/Caption}} caption: {{$:/language/Search/Standard/Caption}}
\define lingo-base() $:/language/Search/ \define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/> \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/advancedsearch/standard/currentTab" text=<<nextTab>>/>"""/> \define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/>
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/> \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list> \define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list> \define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\whitespace trim
<<lingo Standard/Hint>> <<lingo Standard/Hint>>
@ -20,10 +22,17 @@ caption: {{$:/language/Search/Standard/Caption}}
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$keyboard key="shift-alt-Right" actions=<<next-search-tab>>> <$keyboard key="shift-alt-Right" actions=<<next-search-tab>>>
<$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>> <$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch" <$macrocall $name="keyboard-driven-input"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search" tiddler="$:/temp/advancedsearch/input"
tag="input" focus={{$:/config/Search/AutoFocus}} inputCancelActions=<<cancel-search-actions>> storeTitle="$:/temp/advancedsearch"
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> refreshTitle="$:/temp/advancedsearch/refresh"
selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"
filterMinLength={{$:/config/Search/MinLength}}/> filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard> </$keyboard>
@ -39,14 +48,22 @@ caption: {{$:/language/Search/Standard/Caption}}
</div> </div>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem"> <$list
<$vars userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} searchListState="$:/temp/advancedsearch/selected-item"> filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]"
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]" emptyMessage=""" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>"
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"> variable="listItem">
<$transclude/> <$vars
</$list> userInput={{{ [[$:/temp/advancedsearch]get[text]] }}}
"""> configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]" default={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/advancedsearch/standard/currentTab" text=<<currentTab>>/>""" explicitState="$:/state/tab/search-results/advancedsearch" /> searchListState="$:/temp/advancedsearch/selected-item">
<$list
filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]"
emptyMessage="<$list filter='[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]'><$transclude/></$list>">
<$macrocall $name="tabs"
tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"
default={{$:/config/SearchResults/Default}}
actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<currentTab>>/>"
explicitState="$:/state/tab/search-results/advancedsearch" />
</$list> </$list>
</$vars> </$vars>
</$list> </$list>

View File

@ -15,6 +15,7 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
\end \end
\define new-field-actions() \define new-field-actions()
\whitespace trim
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldNameTiddler>get[text]] :map[<newFieldValueTiddler>get<currentTiddler>] }}}/> <$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldNameTiddler>get[text]] :map[<newFieldValueTiddler>get<currentTiddler>] }}}/>
<$action-deletetiddler $filter="[<newFieldNameTiddler>] [<newFieldValueTiddler>] [<storeTitle>] [<searchListState>]"/> <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<newFieldValueTiddler>] [<storeTitle>] [<searchListState>]"/>
<$action-sendmessage $message="tm-focus-selector" $param=<<current-tiddler-new-field-selector>>/> <$action-sendmessage $message="tm-focus-selector" $param=<<current-tiddler-new-field-selector>>/>
@ -23,20 +24,28 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
\define delete-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<storeTitle>] [<searchListState>]"/> \define delete-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<storeTitle>] [<searchListState>]"/>
\define cancel-search-actions-inner() \define cancel-search-actions-inner()
<$list filter="[<storeTitle>has[text]] [<newFieldNameTiddler>has[text]]" variable="ignore" emptyMessage="""<<cancel-delete-tiddler-actions "cancel">>"""> \whitespace trim
<$list
filter="[<storeTitle>has[text]] [<newFieldNameTiddler>has[text]]"
variable="ignore"
emptyMessage="<<cancel-delete-tiddler-actions 'cancel'>>">
<<delete-state-tiddlers>> <<delete-state-tiddlers>>
</$list> </$list>
\end \end
\define cancel-search-actions() \define cancel-search-actions()
\whitespace trim
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}> <$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
<$list filter="[<newFieldNameTiddler>get[text]!match<userInput>]" emptyMessage="""<<cancel-search-actions-inner>>"""> <$list
filter="[<newFieldNameTiddler>get[text]!match<userInput>]"
emptyMessage="<<cancel-search-actions-inner>>">
<$action-setfield $tiddler=<<newFieldNameTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/> <$action-setfield $tiddler=<<newFieldNameTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
</$list> </$list>
</$set> </$set>
\end \end
\define new-field() \define new-field()
\whitespace trim
<$vars name={{{ [<newFieldNameTiddler>get[text]] }}}> <$vars name={{{ [<newFieldNameTiddler>get[text]] }}}>
<$reveal type="nomatch" text="" default=<<name>>> <$reveal type="nomatch" text="" default=<<name>>>
<$button tooltip=<<lingo Fields/Add/Button/Hint>>> <$button tooltip=<<lingo Fields/Add/Button/Hint>>>

View File

@ -8,6 +8,7 @@ title: $:/PaletteManager
edit $(colourName)$ edit $(colourName)$
\end \end
\define colour-tooltip(showhide) $showhide$ editor for $(newColourName)$ \define colour-tooltip(showhide) $showhide$ editor for $(newColourName)$
\define resolve-colour(macrocall) \define resolve-colour(macrocall)
\import $:/core/macros/utils \import $:/core/macros/utils
\whitespace trim \whitespace trim
@ -15,6 +16,7 @@ title: $:/PaletteManager
<<name>> <<name>>
</$wikify> </$wikify>
\end \end
\define delete-colour-index-actions() <$action-setfield $index=<<colourName>>/> \define delete-colour-index-actions() <$action-setfield $index=<<colourName>>/>
\define palette-manager-colour-row-segment() \define palette-manager-colour-row-segment()
\whitespace trim \whitespace trim
@ -41,6 +43,7 @@ title: $:/PaletteManager
</$set> </$set>
</$list> </$list>
\end \end
\define palette-manager-colour-row() \define palette-manager-colour-row()
\whitespace trim \whitespace trim
<tr> <tr>
@ -57,28 +60,30 @@ title: $:/PaletteManager
</td> </td>
</tr> </tr>
\end \end
\define palette-manager-table() \define palette-manager-table()
\whitespace trim \whitespace trim
<table> <table>
<tbody> <tbody>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]indexes[]]" variable="colourName"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]indexes[]]" variable="colourName">
<$list filter="[<currentTiddler>indexes[]removeprefix<colourName>suffix[]]" variable="ignore" emptyMessage=""" <$list
<$list filter="[{$:/state/palettemanager/showexternal}removeprefix[yes]suffix[]]" variable="ignore"> filter="[<currentTiddler>indexes[]removeprefix<colourName>suffix[]]"
<<palette-manager-colour-row>> variable="ignore"
</$list> emptyMessage="<$list filter='[{$:/state/palettemanager/showexternal}removeprefix[yes]suffix[]]' variable='ignore'><<palette-manager-colour-row>></$list>">
""">
<<palette-manager-colour-row>> <<palette-manager-colour-row>>
</$list> </$list>
</$list> </$list>
</tbody> </tbody>
</table> </table>
\end \end
\whitespace trim
<$set name="currentTiddler" value={{$:/palette}}> <$set name="currentTiddler" value={{$:/palette}}>
<<lingo Prompt>> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/></$link> <<lingo Prompt>>&#32;<$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/></$link>
<$list filter="[all[current]is[shadow]is[tiddler]]" variable="listItem"> <$list filter="[all[current]is[shadow]is[tiddler]]" variable="listItem">
<<lingo Prompt/Modified>> <<lingo Prompt/Modified>>
&#32;
<$button message="tm-delete-tiddler" param={{$:/palette}}><<lingo Reset/Caption>></$button> <$button message="tm-delete-tiddler" param={{$:/palette}}><<lingo Reset/Caption>></$button>
</$list> </$list>

View File

@ -5,6 +5,7 @@ description: {{$:/language/Buttons/NewHere/Hint}}
\whitespace trim \whitespace trim
\define newHereActions() \define newHereActions()
\whitespace trim
<$set name="tags" filter="[<currentTiddler>] [{$:/config/NewTiddler/Tags}]"> <$set name="tags" filter="[<currentTiddler>] [{$:/config/NewTiddler/Tags}]">
<$action-sendmessage $message="tm-new-tiddler" tags=<<tags>>/> <$action-sendmessage $message="tm-new-tiddler" tags=<<tags>>/>
</$set> </$set>

View File

@ -11,31 +11,36 @@ title: $:/snippets/currpalettepreview
background-color: $(swatchColour)$; background-color: $(swatchColour)$;
\end \end
\define swatch-inner() \define swatch-inner()
\whitespace trim
<$set name="swatchColour" value={{##$(colourResolved)$}}> <$set name="swatchColour" value={{##$(colourResolved)$}}>
<$list filter="[<swatchColour>!prefix[<<colour ]!suffix[>>]]" variable="ignore"> <$list filter="[<swatchColour>!prefix[<<colour ]!suffix[>>]]" variable="ignore">
<div class="tc-swatch" style=<<swatchStyle>> title=<<swatchTitle>>/> <div class="tc-swatch" style=<<swatchStyle>> title=<<swatchTitle>>/>
&#32;
</$list> </$list>
<$list filter="[<swatchColour>prefix[<<colour ]suffix[>>]]" variable="ignore"> <$list filter="[<swatchColour>prefix[<<colour ]suffix[>>]]" variable="ignore">
<$wikify name="colourResolved" text="""<$macrocall $name="resolve-colour" macrocall=<<swatchColour>>/>"""> <$wikify name="colourResolved" text="<$macrocall $name='resolve-colour' macrocall=<<swatchColour>>/>">
<<swatch-inner>> <<swatch-inner>>
</$wikify> </$wikify>
</$list> </$list>
</$set> </$set>
\end \end
\define swatch() \define swatch()
\whitespace trim
<$set name="swatchColour" value={{##$(colour)$}}> <$set name="swatchColour" value={{##$(colour)$}}>
<$set name="swatchTitle" value=<<colour>>> <$set name="swatchTitle" value=<<colour>>>
<$list filter="[<swatchColour>!prefix[<<colour ]!suffix[>>]]" variable="ignore"> <$list filter="[<swatchColour>!prefix[<<colour ]!suffix[>>]]" variable="ignore">
<div class="tc-swatch" style=<<swatchStyle>> title=<<swatchTitle>>/> <div class="tc-swatch" style=<<swatchStyle>> title=<<swatchTitle>>/>
&#32;
</$list> </$list>
<$list filter="[<swatchColour>prefix[<<colour ]suffix[>>]]" variable="ignore"> <$list filter="[<swatchColour>prefix[<<colour ]suffix[>>]]" variable="ignore">
<$wikify name="colourResolved" text="""<$macrocall $name="resolve-colour" macrocall=<<swatchColour>>/>"""> <$wikify name="colourResolved" text="<$macrocall $name='resolve-colour' macrocall=<<swatchColour>>/>">
<<swatch-inner>> <<swatch-inner>>
</$wikify> </$wikify>
</$list> </$list>
</$set> </$set>
</$set> </$set>
\end \end
\whitespace trim
<div class="tc-swatches-horiz"><$list filter=" <div class="tc-swatches-horiz"><$list filter="
foreground foreground
background background

View File

@ -12,6 +12,7 @@ title: $:/core/macros/timeline
<$view field="title"/> <$view field="title"/>
\end \end
\define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified") \define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified")
\whitespace trim
<div class="tc-timeline"> <div class="tc-timeline">
<$list filter="[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]"> <$list filter="[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]">
<div class="tc-menu-list-item"> <div class="tc-menu-list-item">