Trim Saga: Control panel and Editor Toolbar (#6600)

Shout out to the TiddlySpot tiddler macro for being completely broken, but also being completely unused, so no one noticed.
This commit is contained in:
Cameron Fischer 2022-04-06 03:27:05 -04:00 committed by GitHub
parent ad512be04e
commit c5ea6628f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 68 additions and 11 deletions

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Advanced
tags: $:/tags/ControlPanel/Info
caption: {{$:/language/ControlPanel/Advanced/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Advanced/Hint}}
<div class="tc-control-panel">

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Appearance
tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Appearance/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Appearance/Hint}}
<div class="tc-control-panel">

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Cascades
tags: $:/tags/ControlPanel/Advanced
caption: {{$:/language/ControlPanel/Cascades/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Cascades/Hint}}
<div class="tc-control-panel">

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Info
tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Info/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Info/Hint}}
<div class="tc-control-panel">

View File

@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Parsing/Caption}}
\define lingo-base() $:/language/ControlPanel/Parsing/
\define toggle(Type)
\whitespace trim
<$checkbox
tiddler="""$:/config/WikiParserRules/$Type$/$(rule)$"""
field="text"
@ -16,10 +17,12 @@ default="enable">
\end
\define rules(type,Type)
\whitespace trim
<$list filter="[wikiparserrules[$type$]]" variable="rule">
<dd><<toggle $Type$>></dd>
</$list>
\end
\whitespace trim
<<lingo Hint>>

View File

@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Plugins/Caption}}
\define lingo-base() $:/language/ControlPanel/Plugins/
\define plugin-table(type)
\whitespace trim
<$set name="plugin-type" value="""$type$""">
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
<$list filter="[!has[draft.of]plugin-type[$type$]sort[name]]" emptyMessage=<<lingo "Empty/Hint">> template="$:/core/ui/Components/plugin-info"/>

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Plugins/Add/Updates
caption: <$importvariables filter="$:/core/ui/ControlPanel/Plugins/Add/Updates">{{$:/language/ControlPanel/Plugins/Updates/Caption}} (<<update-count>>)</$importvariables>
\define each-updateable-plugin(body)
\whitespace trim
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}sort[title]]" variable="assetInfo">
<$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}>
<$list filter="[<assetInfo>get[original-title]has[version]!version<libraryVersion>]" variable="ignore">
@ -25,8 +26,11 @@ $body$
<$wikify name="count-filter" text=<<each-updateable-plugin "&#91;&#91;<$text text=<<assetInfo>>/>]]">>><$count filter=<<count-filter>>/></$wikify>
\end
\whitespace trim
<$button actions=<<update-all-actions>> class="tc-btn-invisible tc-install-plugin tc-reinstall-upgrade">
{{$:/core/images/download-button}} {{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
{{$:/core/images/download-button}}
&#32;
{{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
</$button>
<div class="tc-plugin-library-listing">

View File

@ -1,7 +1,10 @@
title: $:/core/ui/ControlPanel/Plugins/AddPlugins
\define lingo-base() $:/language/ControlPanel/Plugins/
\whitespace trim
<$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green tc-primary-btn">
{{$:/core/images/download-button}} <<lingo Add/Caption>>
{{$:/core/images/download-button}}
&#32;
<<lingo Add/Caption>>
</$button>

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Saving
tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Saving/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Saving/Hint}}
<div class="tc-control-panel">

View File

@ -8,13 +8,14 @@ caption: {{$:/language/ControlPanel/Saving/TiddlySpot/Caption}}
http://$(userName)$.tiddlyspot.com/$path$/
\end
\define siteLink(path)
\whitespace trim
<$reveal type="nomatch" state="$:/UploadName" text="">
<$set name="userName" value={{$:/UploadName}}>
<$reveal type="match" state="$:/UploadURL" text="">
<<siteURL $path$>>
</$reveal>
<$reveal type="nomatch" state="$:/UploadURL" text="">
<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}>>
<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}/>
</$reveal>
</$set>
</$reveal>

View File

@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
title: $:/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab
\define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/
\whitespace trim
<$link to="$:/config/DefaultMoreSidebarTab"><<lingo Hint>></$link>

View File

@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
title: $:/core/ui/ControlPanel/Settings/DefaultSidebarTab
\define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/
\whitespace trim
<$link to="$:/config/DefaultSidebarTab"><<lingo Hint>></$link>

View File

@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}}
\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/
\whitespace trim
<$link to="$:/config/Navigation/openLinkFromInsideRiver"><<lingo "InsideRiver/Hint">></$link>

View File

@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}}
\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/
\whitespace trim
<$link to="$:/config/Toolbar/ButtonClass"><<lingo "Hint">></$link>
<$select tiddler="$:/config/Toolbar/ButtonClass">

View File

@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Toolbars
tags: $:/tags/ControlPanel/Appearance
caption: {{$:/language/ControlPanel/Toolbars/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Toolbars/Hint}}
<div class="tc-control-panel">

View File

@ -3,7 +3,14 @@ title: $:/core/ui/ControlPanel/Toolbars/EditorItemTemplate
\define config-title()
$(config-base)$$(currentTiddler)$
\end
\whitespace trim
<$draggable tiddler=<<currentTiddler>>>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <span class="tc-icon-wrapper"><$transclude tiddler={{!!icon}}/></span> <$transclude field="caption"/> -- <i class="tc-muted"><$transclude field="description"/></i>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/>
&#32;
<span class="tc-icon-wrapper"><$transclude tiddler={{!!icon}}/></span>
&#32;
<$transclude field="caption"/>
&#32;--&#32;
<i class="tc-muted"><$transclude field="description"/></i>
</$draggable>

View File

@ -3,7 +3,17 @@ title: $:/core/ui/ControlPanel/Toolbars/ItemTemplate
\define config-title()
$(config-base)$$(currentTiddler)$
\end
\whitespace trim
<$draggable tiddler=<<currentTiddler>>>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <span class="tc-icon-wrapper"> <$transclude field="caption"/> <i class="tc-muted">-- <$transclude field="description"/></i></span>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/>
&#32;
<span class="tc-icon-wrapper">
&#32;
<$transclude field="caption"/>
&#32;
<i class="tc-muted">
--&#32;
<$transclude field="description"/>
</i></span>
</$draggable>

View File

@ -5,6 +5,7 @@ first-search-filter: [!is[system]search:title<userInput>sort[title]limit[250]]
second-search-filter: [!is[system]search<userInput>sort[title]limit[250]]
\define searchResultList()
\whitespace trim
//<small>{{$:/language/Search/Matches/Title}}</small>//
<$list filter="[<userInput>minlength[1]]" variable="ignore">

View File

@ -7,6 +7,7 @@ description: {{$:/language/Buttons/EditorHeight/Hint}}
condition: [<targetTiddler>type[]] [<targetTiddler>get[type]prefix[text/]] [<targetTiddler>get[type]match[application/javascript]] [<targetTiddler>get[type]match[application/json]] [<targetTiddler>get[type]match[application/x-tiddler-dictionary]] [<targetTiddler>get[type]match[image/svg+xml]] +[first[]]
dropdown: $:/core/ui/EditorToolbar/editor-height-dropdown
\whitespace trim
<$reveal tag="span" state="$:/config/TextEditor/EditorHeight/Mode" type="match" text="fixed">
{{$:/core/images/fixed-height}}
</$reveal>

View File

@ -3,9 +3,10 @@ title: $:/core/ui/EditorToolbar/excise-dropdown
\define lingo-base() $:/language/Buttons/Excise/
\define body(config-title)
\whitespace trim
''<<lingo Hint>>''
<<lingo Caption/NewTitle>> <$edit-text tag="input" tiddler="$config-title$/new-title" default="" focus="true"/>
<<lingo Caption/NewTitle>>&#32;<$edit-text tag="input" tiddler="$config-title$/new-title" default="" focus="true"/>
<$set name="new-title" value={{$config-title$/new-title}}>
<$list filter="""[<new-title>is[tiddler]]""">
@ -15,16 +16,16 @@ title: $:/core/ui/EditorToolbar/excise-dropdown
</$list>
</$set>
<$checkbox tiddler="""$config-title$/tagnew""" field="text" checked="yes" unchecked="no" default="false"> <<lingo Caption/Tag>></$checkbox>
<$checkbox tiddler="""$config-title$/tagnew""" field="text" checked="yes" unchecked="no" default="false">&#32;<<lingo Caption/Tag>></$checkbox>
<<lingo Caption/Replace>> <$select tiddler="""$config-title$/type""" default="transclude">
<<lingo Caption/Replace>>&#32;<$select tiddler="""$config-title$/type""" default="transclude">
<option value="link"><<lingo Caption/Replace/Link>></option>
<option value="transclude"><<lingo Caption/Replace/Transclusion>></option>
<option value="macro"><<lingo Caption/Replace/Macro>></option>
</$select>
<$reveal state="""$config-title$/type""" type="match" text="macro">
<<lingo Caption/MacroName>> <$edit-text tag="input" tiddler="""$config-title$/macro-title""" default="translink"/>
<<lingo Caption/MacroName>>&#32;<$edit-text tag="input" tiddler="""$config-title$/macro-title""" default="translink"/>
</$reveal>
<$button>

View File

@ -13,6 +13,7 @@ condition: [<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]
\define replacement-text-file() [[$title$]]
\define postImportActions()
\whitespace trim
<$list filter="[<importTitle>links[]] :reduce[get[type]prefix[image]then<replacement-text-image>else<replacement-text-file>search-replace[$title$],<currentTiddler>addprefix<accumulator>]" variable="imageTitle">
<$action-sendmessage
$message="tm-edit-text-operation"
@ -24,10 +25,13 @@ condition: [<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]
\end
\define buttons()
\whitespace trim
<$button class="tc-btn-invisible" actions=<<closePopupActions>> ><<lingo Listing/Cancel/Caption>></$button>
&#32;
<$button class="tc-btn-invisible" message="tm-perform-import" param=<<importTitle>> actions=<<postImportActions>> ><<lingo Listing/Import/Caption>></$button>
\end
\whitespace trim
<$reveal type="popup" state=<<importState>> tag="div" class="tc-editor-importpopup">
<div class="tc-editor-import">
<$list filter="[<importTitle>field:plugin-type[import]]">

View File

@ -5,10 +5,14 @@ $:/config/EditorToolbarButtons/Visibility/$(toolbarItem)$
\end
\define conditional-button()
\whitespace trim
<$list filter={{$(toolbarItem)$!!condition}} variable="condition">
<$transclude tiddler="$:/core/ui/EditTemplate/body/toolbar/button" mode="inline"/> <$transclude tiddler=<<toolbarItem>> field="description"/>
<$transclude tiddler="$:/core/ui/EditTemplate/body/toolbar/button" mode="inline"/>
&#32;
<$transclude tiddler=<<toolbarItem>> field="description"/>
</$list>
\end
\whitespace trim
<div class="tc-text-editor-toolbar-more">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditorToolbar]!has[draft.of]] -[[$:/core/ui/EditorToolbar/more]]">

View File

@ -9,6 +9,7 @@ dropdown: $:/core/ui/EditorToolbar/paint-dropdown
\define toolbar-paint()
<div style="display: inline-block; vertical-align: middle; background-color: $(colour-picker-value)$; width: 1em; height: 1em; border-radius: 50%;"/>
\end
\whitespace trim
<$set name="colour-picker-value" value={{$:/config/BitmapEditor/Colour}}>
<<toolbar-paint>>
</$set>

View File

@ -8,6 +8,7 @@ condition: [<targetTiddler>]
button-classes: tc-text-editor-toolbar-item-start-group
shortcuts: ((preview))
\whitespace trim
<$reveal state=<<edit-preview-state>> type="match" text="yes" tag="span">
{{$:/core/images/preview-open}}
<$action-setfield $tiddler=<<edit-preview-state>> $value="no"/>

View File

@ -33,9 +33,14 @@ title: $:/core/ui/EditorToolbar/size-dropdown
\end
\define toolbar-button-size(config-title)
\whitespace trim
''{{$:/language/Buttons/Size/Hint}}''
<<lingo Caption/Width>> <$edit-text tag="input" tiddler="""$config-title$/new-width""" default=<<tv-bitmap-editor-width>> focus="true" size="8"/> <<lingo Caption/Height>> <$edit-text tag="input" tiddler="""$config-title$/new-height""" default=<<tv-bitmap-editor-height>> size="8"/> <$button popup="""$config-title$/presets-popup""" class="tc-btn-invisible tc-popup-keep" style="width: auto; display: inline-block; background-colour: inherit;" selectedClass="tc-selected">
<<lingo Caption/Width>>&#32;<$edit-text tag="input" tiddler="""$config-title$/new-width""" default=<<tv-bitmap-editor-width>> focus="true" size="8"/>
&#32;
<<lingo Caption/Height>>&#32;<$edit-text tag="input" tiddler="""$config-title$/new-height""" default=<<tv-bitmap-editor-height>> size="8"/>
&#32;
<$button popup="""$config-title$/presets-popup""" class="tc-btn-invisible tc-popup-keep" style="width: auto; display: inline-block; background-colour: inherit;" selectedClass="tc-selected">
{{$:/core/images/down-arrow}}
</$button>