mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-08 17:58:05 +00:00
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:
@@ -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>
|
||||
|
||||
@@ -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>> <$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"> <<lingo Caption/Tag>></$checkbox>
|
||||
|
||||
<<lingo Caption/Replace>> <$select tiddler="""$config-title$/type""" default="transclude">
|
||||
<<lingo Caption/Replace>> <$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>> <$edit-text tag="input" tiddler="""$config-title$/macro-title""" default="translink"/>
|
||||
</$reveal>
|
||||
|
||||
<$button>
|
||||
|
||||
@@ -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>
|
||||
 
|
||||
<$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]]">
|
||||
|
||||
@@ -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"/>
|
||||
 
|
||||
<$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]]">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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>> <$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">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user