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

Trim Saga: whitespace trimming three big tiddlers (#6265)

* whitespace trimming three big tiddlers

* Forgot one macro

* This emptyMessage needed trimming too

* Switching to more consistent emptyMessage quotes
This commit is contained in:
Cameron Fischer 2022-04-01 07:09:30 -04:00 committed by GitHub
parent 5e38f1b0b8
commit 4a9cf67a25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 20 deletions

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Modals/AddPlugins
subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/Add/Caption}}
\define install-plugin-actions()
\whitespace trim
<$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/>
<$set name="url" value={{!!url}}>
<$set name="currentTiddler" value=<<assetInfo>>>
@ -13,18 +14,21 @@ subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/
\end
\define install-plugin-button()
\whitespace trim
<div>
<$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}>
<$set name="installedVersion" value={{{ [<assetInfo>get[original-title]get[version]] }}}>
<$set name="reinstall-type" value={{{ [<libraryVersion>compare:version:eq<installedVersion>then[tc-reinstall]] [<libraryVersion>compare:version:gt<installedVersion>then[tc-reinstall-upgrade]] [<libraryVersion>compare:version:lt<installedVersion>then[tc-reinstall-downgrade]] }}}>
<$button actions=<<install-plugin-actions>> class={{{ [<assetInfo>get[original-title]has[version]then<reinstall-type>] tc-btn-invisible tc-install-plugin +[join[ ]] }}}>
{{$:/core/images/download-button}}
&#32;
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Install/Caption}}">
<$list filter="[<libraryVersion>compare:version:gt<installedVersion>]" variable="ignore" emptyMessage="""
<$list filter="[<libraryVersion>compare:version:lt<installedVersion>]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}">
<$list filter="[<libraryVersion>compare:version:gt<installedVersion>]" variable="ignore" emptyMessage="
\whitespace trim
<$list filter='[<libraryVersion>compare:version:lt<installedVersion>]' variable='ignore' emptyMessage='{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}'>
{{$:/language/ControlPanel/Plugins/Downgrade/Caption}}
</$list>
""">
">
{{$:/language/ControlPanel/Plugins/Update/Caption}}
</$list>
</$list>
@ -43,6 +47,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define display-plugin-info(type)
\whitespace trim
<$set name="popup-state" value=<<popup-state-macro>>>
<div class="tc-plugin-info">
<div class="tc-plugin-info-chunk tc-plugin-info-toggle">
@ -63,7 +68,9 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
</$list>
</div>
<div class="tc-plugin-info-chunk tc-plugin-info-description">
<h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>: <$view tiddler=<<assetInfo>> field="description"/></h1>
<h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>:
&#32;
<$view tiddler=<<assetInfo>> field="description"/></h1>
<h2><$view tiddler=<<assetInfo>> field="original-title"/></h2>
<div><em><$view tiddler=<<assetInfo>> field="version"/></em></div>
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion"><div><em>{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}</em></div></$list>
@ -83,9 +90,9 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<$set name="currentTiddler" value=<<assetInfo>>>
<$list filter="[enlist{!!dependents}] [<currentTiddler>get[parent-plugin]] +[limit[1]]" variable="ignore">
<div>
{{$:/language/ControlPanel/Plugins/AlsoRequires}}
{{$:/language/ControlPanel/Plugins/AlsoRequires}}&#32;
<$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[name]]" variable="dependency">
<$text text=<<dependency>>/>
<$text text=<<dependency>>/>&#32;
</$list>
</div>
</$list>
@ -118,16 +125,21 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define load-plugin-library-button()
\whitespace trim
<$list filter="[<currentTiddler>get[enabled]else[yes]match[yes]]" variable="ignore">
<$button class="tc-btn-big-green">
<$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/>
{{$:/core/images/chevron-right}} {{$:/language/ControlPanel/Plugins/OpenPluginLibrary}}
{{$:/core/images/chevron-right}}&#32;{{$:/language/ControlPanel/Plugins/OpenPluginLibrary}}
</$button>
</$list>
\end
\define display-server-assets(type)
{{$:/language/Search/Search}}: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
\whitespace trim
{{$:/language/Search/Search}}:
&#32;
<$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
&#32;
<$reveal state="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" $field="text" $value=""/>
@ -144,6 +156,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define display-server-connection()
\whitespace trim
<$list filter="[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]" variable="connectionTiddler" emptyMessage=<<load-plugin-library-button>>>
<$set name="transclusion" value=<<connectionTiddler>>>
@ -156,16 +169,18 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define close-library-button()
\whitespace trim
<$reveal type='nomatch' state='$:/temp/ServerConnection/$(PluginLibraryURL)$' text=''>
<$button class='tc-btn-big-green'>
<$action-sendmessage $message="tm-unload-plugin-library" url={{!!url}}/>
{{$:/core/images/chevron-left}} {{$:/language/ControlPanel/Plugins/ClosePluginLibrary}}
{{$:/core/images/chevron-left}}&#32;{{$:/language/ControlPanel/Plugins/ClosePluginLibrary}}
<$action-deletetiddler $filter="[prefix[$:/temp/ServerConnection/$(PluginLibraryURL)$]][prefix[$:/temp/RemoteAssetInfo/$(PluginLibraryURL)$]]"/>
</$button>
</$reveal>
\end
\define plugin-library-listing()
\whitespace trim
<div class="tc-tab-set">
<$set name="defaultTab" value={{{ [all[tiddlers+shadows]tag[$:/tags/PluginLibrary]] }}}>
<div class="tc-tab-buttons">
@ -187,6 +202,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<$set name=PluginLibraryURL value={{!!url}}>
<<close-library-button>>
</$set>
&#32;
<<display-server-connection>>
</$reveal>
</$list>
@ -196,6 +212,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
\whitespace trim
<div>
<<plugin-library-listing>>

View File

@ -7,6 +7,7 @@ title: $:/core/ui/ImportListing
\define payloadTitleFilter() [<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]
\define overWriteWarning()
\whitespace trim
<$list filter="[<currentTiddler>!has<suppressedField>]">
<$text text={{{[subfilter<payloadTitleFilter>!is[tiddler]then[]] ~[<lingo-base>addsuffix[Listing/Rename/OverwriteWarning]get[text]]}}}/>
</$list>
@ -43,16 +44,19 @@ title: $:/core/ui/ImportListing
\define renameFieldState() $(currentTiddler)$!!state-rename-$(payloadTiddler)$
\define select-all-actions()
\whitespace trim
<$list filter="[all[current]plugintiddlers[]sort[title]]" variable="payloadTiddler">
<$action-setfield $field={{{ [<payloadTiddler>addprefix[selection-]] }}} $value={{$:/state/import/select-all}}/>
</$list>
\end
\whitespace trim
<table class="tc-import-table">
<tbody>
<tr>
<th align="left">
<$checkbox tiddler="$:/state/import/select-all" field="text" checked="checked" unchecked="unchecked" default="checked" actions=<<select-all-actions>>>
&#32;
<<lingo Listing/Select/Caption>>
</$checkbox>
</th>
@ -88,14 +92,28 @@ title: $:/core/ui/ImportListing
</td>
<td>
<<selectionInfo>>
&#32;
<<libraryInfo>>
&#32;
<<overWriteWarning>>
</td>
</tr>
<$reveal type="match" state=<<renameFieldState>> text="yes" tag="tr">
<td colspan="3">
<div class="tc-flex">
<$edit-text tiddler=<<newImportTitleTiddler>> default={{{[subfilter<payloadTitleFilter>]}}} tag="input" class="tc-import-rename tc-flex-grow-1"/><span class="tc-small-gap-left"><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button><span class="tc-small-gap-right"/></span><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<<renameField>> $value={{{[<newImportTitleTiddler>get[text]minlength[1]else<payloadTiddler>]}}} /><$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button>
<$edit-text tiddler=<<newImportTitleTiddler>> default={{{[subfilter<payloadTitleFilter>]}}} tag="input" class="tc-import-rename tc-flex-grow-1"/>
<span class="tc-small-gap-left">
<$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/CancelRename]get[text]]}}}>
{{$:/core/images/close-button}}
<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/>
</$button>
<span class="tc-small-gap-right"/>
</span>
<$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>
{{$:/core/images/done-button}}
<$action-setfield $field=<<renameField>> $value={{{[<newImportTitleTiddler>get[text]minlength[1]else<payloadTiddler>]}}} />
<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/>
</$button>
</div>
</td>
</$reveal>

View File

@ -5,16 +5,17 @@ color: #bbb
\define lingo-base() $:/language/Manager/
\define list-item-content-item()
\whitespace trim
<div class="tc-manager-list-item-content-item">
<$vars state-title="""$:/state/popup/manager/item/$(listItem)$""">
<$reveal state=<<state-title>> type="match" text="show" default="show" tag="div">
<$button set=<<state-title>> setTo="hide" class="tc-btn-invisible tc-manager-list-item-content-item-heading">
{{$:/core/images/down-arrow}} <$transclude tiddler=<<listItem>> field="caption"/>
{{$:/core/images/down-arrow}}&#32;<$transclude tiddler=<<listItem>> field="caption"/>
</$button>
</$reveal>
<$reveal state=<<state-title>> type="nomatch" text="show" default="show" tag="div">
<$button set=<<state-title>> setTo="show" class="tc-btn-invisible tc-manager-list-item-content-item-heading">
{{$:/core/images/right-arrow}} <$transclude tiddler=<<listItem>> field="caption"/>
{{$:/core/images/right-arrow}}&#32;<$transclude tiddler=<<listItem>> field="caption"/>
</$button>
</$reveal>
<$reveal state=<<state-title>> type="match" text="show" default="show" tag="div" class="tc-manager-list-item-content-item-body">
@ -24,19 +25,20 @@ color: #bbb
</div>
\end
\whitespace trim
<div class="tc-manager-wrapper">
<div class="tc-manager-controls">
<div class="tc-manager-control">
<<lingo Controls/Show/Prompt>> <$select tiddler="$:/config/Manager/Show" default="tiddlers">
<<lingo Controls/Show/Prompt>>&#32;<$select tiddler="$:/config/Manager/Show" default="tiddlers">
<option value="tiddlers"><<lingo Controls/Show/Option/Tiddlers>></option>
<option value="tags"><<lingo Controls/Show/Option/Tags>></option>
</$select>
</div>
<div class="tc-manager-control">
<<lingo Controls/Search/Prompt>> <$edit-text tiddler="$:/config/Manager/Filter" tag="input" default="" placeholder={{$:/language/Manager/Controls/Search/Placeholder}}/>
<<lingo Controls/Search/Prompt>>&#32;<$edit-text tiddler="$:/config/Manager/Filter" tag="input" default="" placeholder={{$:/language/Manager/Controls/Search/Placeholder}}/>
</div>
<div class="tc-manager-control">
<<lingo Controls/FilterByTag/Prompt>> <$select tiddler="$:/config/Manager/Tag" default="">
<<lingo Controls/FilterByTag/Prompt>>&#32;<$select tiddler="$:/config/Manager/Tag" default="">
<option value=""><<lingo Controls/FilterByTag/None>></option>
<$list filter="[!is{$:/config/Manager/System}tags[]!is[system]sort[title]]" variable="tag">
<option value=<<tag>>><$text text=<<tag>>/></option>
@ -44,7 +46,7 @@ color: #bbb
</$select>
</div>
<div class="tc-manager-control">
<<lingo Controls/Sort/Prompt>> <$select tiddler="$:/config/Manager/Sort" default="title">
<<lingo Controls/Sort/Prompt>>&#32;<$select tiddler="$:/config/Manager/Sort" default="title">
<optgroup label="Common">
<$list filter="title modified modifier created creator created" variable="field">
<option value=<<field>>><$text text=<<field>>/></option>
@ -56,12 +58,15 @@ color: #bbb
</$list>
</optgroup>
</$select>
&#32;
<$checkbox tiddler="$:/config/Manager/Order" field="text" checked="reverse" unchecked="forward" default="forward">
&#32;
<<lingo Controls/Order/Prompt>>
</$checkbox>
</div>
<div class="tc-manager-control">
<$checkbox tiddler="$:/config/Manager/System" field="text" checked="" unchecked="system" default="system">
&#32;
{{$:/language/SystemTiddlers/Include/Prompt}}
</$checkbox>
</div>