From 5d69fe7bef55359dc1164ba37b9854abcfa16384 Mon Sep 17 00:00:00 2001 From: Cameron Fischer Date: Sat, 26 Mar 2022 11:18:42 -0400 Subject: [PATCH] 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 --- .../AdvancedSearch/FilterButtons/delete.tid | 1 + core/ui/AdvancedSearch/Standard.tid | 55 ++++++++++++------- core/ui/EditTemplate/fields.tid | 13 ++++- core/ui/PaletteManager.tid | 17 ++++-- core/ui/ViewToolbar/new-here.tid | 1 + core/wiki/currpalettepreview.tid | 9 ++- core/wiki/macros/timeline.tid | 1 + 7 files changed, 68 insertions(+), 29 deletions(-) diff --git a/core/ui/AdvancedSearch/FilterButtons/delete.tid b/core/ui/AdvancedSearch/FilterButtons/delete.tid index fea48a667..85d9b224e 100644 --- a/core/ui/AdvancedSearch/FilterButtons/delete.tid +++ b/core/ui/AdvancedSearch/FilterButtons/delete.tid @@ -1,6 +1,7 @@ title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete tags: $:/tags/AdvancedSearch/FilterButton +\whitespace trim <$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$button popup=<> class="tc-btn-invisible"> {{$:/core/images/delete-button}} diff --git a/core/ui/AdvancedSearch/Standard.tid b/core/ui/AdvancedSearch/Standard.tid index d3616de33..0690130e4 100644 --- a/core/ui/AdvancedSearch/Standard.tid +++ b/core/ui/AdvancedSearch/Standard.tid @@ -3,15 +3,17 @@ tags: $:/tags/AdvancedSearch caption: {{$:/language/Search/Standard/Caption}} \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=<>/>"""/> +\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=<>/>"/> -\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=<>/>"""/> +\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=<>/>"/> -\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"/><$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"/><$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]] }}}/>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> +\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]] }}}/>"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> -\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 filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> +\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 filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + +\whitespace trim <> @@ -20,12 +22,19 @@ caption: {{$:/language/Search/Standard/Caption}} <$keyboard key="((input-tab-left))" actions=<>> <$keyboard key="shift-alt-Right" actions=<>> <$keyboard key="shift-alt-Left" actions=<>> -<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch" - refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search" - tag="input" focus={{$:/config/Search/AutoFocus}} inputCancelActions=<> - inputAcceptActions=<> inputAcceptVariantActions=<> - configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" - filterMinLength={{$:/config/Search/MinLength}}/> +<$macrocall $name="keyboard-driven-input" + tiddler="$:/temp/advancedsearch/input" + storeTitle="$:/temp/advancedsearch" + refreshTitle="$:/temp/advancedsearch/refresh" + selectionStateTitle="$:/temp/advancedsearch/selected-item" + type="search" + tag="input" + focus={{$:/config/Search/AutoFocus}} + inputCancelActions=<> + inputAcceptActions=<> + inputAcceptVariantActions=<> + configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" + filterMinLength={{$:/config/Search/MinLength}}/> @@ -39,14 +48,22 @@ caption: {{$:/language/Search/Standard/Caption}} <$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> -<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> -<$vars userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} 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/> - -"""> -<$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=<>/>""" explicitState="$:/state/tab/search-results/advancedsearch" /> +<$list + filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" + emptyMessage="
{{$:/language/Search/Search/TooShort}}
" + variable="listItem"> +<$vars + userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} + configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} + 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/>"> +<$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=<>/>" + explicitState="$:/state/tab/search-results/advancedsearch" /> diff --git a/core/ui/EditTemplate/fields.tid b/core/ui/EditTemplate/fields.tid index 5a1aca083..c57bfb679 100644 --- a/core/ui/EditTemplate/fields.tid +++ b/core/ui/EditTemplate/fields.tid @@ -15,6 +15,7 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$ \end \define new-field-actions() +\whitespace trim <$action-sendmessage $message="tm-add-field" $name={{{ [get[text]] }}} $value={{{ [get[text]] :map[get] }}}/> <$action-deletetiddler $filter="[] [] [] []"/> <$action-sendmessage $message="tm-focus-selector" $param=<>/> @@ -23,20 +24,28 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$ \define delete-state-tiddlers() <$action-deletetiddler $filter="[] [] []"/> \define cancel-search-actions-inner() -<$list filter="[has[text]] [has[text]]" variable="ignore" emptyMessage="""<>"""> +\whitespace trim +<$list + filter="[has[text]] [has[text]]" + variable="ignore" + emptyMessage="<>"> <> \end \define cancel-search-actions() +\whitespace trim <$set name="userInput" value={{{ [get[text]] }}}> -<$list filter="[get[text]!match]" emptyMessage="""<>"""> +<$list + filter="[get[text]!match]" + emptyMessage="<>"> <$action-setfield $tiddler=<> text=<>/><$action-setfield $tiddler=<> text="yes"/> \end \define new-field() +\whitespace trim <$vars name={{{ [get[text]] }}}> <$reveal type="nomatch" text="" default=<>> <$button tooltip=<>> diff --git a/core/ui/PaletteManager.tid b/core/ui/PaletteManager.tid index e9953729f..c39bbee45 100644 --- a/core/ui/PaletteManager.tid +++ b/core/ui/PaletteManager.tid @@ -8,6 +8,7 @@ title: $:/PaletteManager edit $(colourName)$ \end \define colour-tooltip(showhide) $showhide$ editor for $(newColourName)$ + \define resolve-colour(macrocall) \import $:/core/macros/utils \whitespace trim @@ -15,6 +16,7 @@ title: $:/PaletteManager <> \end + \define delete-colour-index-actions() <$action-setfield $index=<>/> \define palette-manager-colour-row-segment() \whitespace trim @@ -41,6 +43,7 @@ title: $:/PaletteManager \end + \define palette-manager-colour-row() \whitespace trim @@ -57,28 +60,30 @@ title: $:/PaletteManager \end + \define palette-manager-table() \whitespace trim <$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]indexes[]]" variable="colourName"> -<$list filter="[indexes[]removeprefixsuffix[]]" variable="ignore" emptyMessage=""" -<$list filter="[{$:/state/palettemanager/showexternal}removeprefix[yes]suffix[]]" variable="ignore"> -<> - -"""> +<$list + filter="[indexes[]removeprefixsuffix[]]" + variable="ignore" + emptyMessage="<$list filter='[{$:/state/palettemanager/showexternal}removeprefix[yes]suffix[]]' variable='ignore'><>"> <>
\end +\whitespace trim <$set name="currentTiddler" value={{$:/palette}}> -<> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/> +<> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/> <$list filter="[all[current]is[shadow]is[tiddler]]" variable="listItem"> <> + <$button message="tm-delete-tiddler" param={{$:/palette}}><> diff --git a/core/ui/ViewToolbar/new-here.tid b/core/ui/ViewToolbar/new-here.tid index dd4a969e1..25721f5fd 100644 --- a/core/ui/ViewToolbar/new-here.tid +++ b/core/ui/ViewToolbar/new-here.tid @@ -5,6 +5,7 @@ description: {{$:/language/Buttons/NewHere/Hint}} \whitespace trim \define newHereActions() +\whitespace trim <$set name="tags" filter="[] [{$:/config/NewTiddler/Tags}]"> <$action-sendmessage $message="tm-new-tiddler" tags=<>/> diff --git a/core/wiki/currpalettepreview.tid b/core/wiki/currpalettepreview.tid index b5f549666..61356edd0 100644 --- a/core/wiki/currpalettepreview.tid +++ b/core/wiki/currpalettepreview.tid @@ -11,31 +11,36 @@ title: $:/snippets/currpalettepreview background-color: $(swatchColour)$; \end \define swatch-inner() +\whitespace trim <$set name="swatchColour" value={{##$(colourResolved)$}}> <$list filter="[!prefix[<>]]" variable="ignore">
> title=<>/> + <$list filter="[prefix[<>]]" variable="ignore"> -<$wikify name="colourResolved" text="""<$macrocall $name="resolve-colour" macrocall=<>/>"""> +<$wikify name="colourResolved" text="<$macrocall $name='resolve-colour' macrocall=<>/>"> <> \end \define swatch() +\whitespace trim <$set name="swatchColour" value={{##$(colour)$}}> <$set name="swatchTitle" value=<>> <$list filter="[!prefix[<>]]" variable="ignore">
> title=<>/> + <$list filter="[prefix[<>]]" variable="ignore"> -<$wikify name="colourResolved" text="""<$macrocall $name="resolve-colour" macrocall=<>/>"""> +<$wikify name="colourResolved" text="<$macrocall $name='resolve-colour' macrocall=<>/>"> <> \end +\whitespace trim
<$list filter=" foreground background diff --git a/core/wiki/macros/timeline.tid b/core/wiki/macros/timeline.tid index b949d0432..a01c4bdaf 100644 --- a/core/wiki/macros/timeline.tid +++ b/core/wiki/macros/timeline.tid @@ -12,6 +12,7 @@ title: $:/core/macros/timeline <$view field="title"/> \end \define timeline(limit:"100",format:"DDth MMM YYYY",subfilter:"",dateField:"modified") +\whitespace trim
<$list filter="[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]">