1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 01:20:30 +00:00

Fix problem with formatting toolbar dropdowns

Cruft left over from the last big refactoring…
This commit is contained in:
Jermolene 2016-04-26 07:43:13 +01:00
parent 0151363b74
commit 6f6cdc1bd0
3 changed files with 31 additions and 26 deletions

View File

@ -1,11 +1,13 @@
title: $:/core/ui/EditorToolbar/excise-dropdown title: $:/core/ui/EditorToolbar/excise-dropdown
\define lingo-base() $:/language/Buttons/Excise/ \define lingo-base() $:/language/Buttons/Excise/
\define body(config-title)
''<<lingo Hint>>'' ''<<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}}> <$set name="new-title" value={{$config-title$/new-title}}>
<$list filter="""[<new-title>is[tiddler]]"""> <$list filter="""[<new-title>is[tiddler]]""">
<div class="tc-error"> <div class="tc-error">
<<lingo Caption/TiddlerExists>> <<lingo Caption/TiddlerExists>>
@ -13,33 +15,35 @@ title: $:/core/ui/EditorToolbar/excise-dropdown
</$list> </$list>
</$set> </$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="link"><<lingo Caption/Replace/Link>></option>
<option value="transclude"><<lingo Caption/Replace/Transclusion>></option> <option value="transclude"><<lingo Caption/Replace/Transclusion>></option>
<option value="macro"><<lingo Caption/Replace/Macro>></option> <option value="macro"><<lingo Caption/Replace/Macro>></option>
</$select> </$select>
<$reveal state="""$(config-title)$/type""" type="match" text="macro"> <$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> </$reveal>
<$button> <$button>
<$action-sendmessage <$action-sendmessage
$message="tm-edit-text-operation" $message="tm-edit-text-operation"
$param="excise" $param="excise"
title={{$(config-title)$/new-title}} title={{$config-title$/new-title}}
type={{$(config-title)$/type}} type={{$config-title$/type}}
macro={{$(config-title)$/macro-title}} macro={{$config-title$/macro-title}}
tagnew={{$(config-title)$/tagnew}} tagnew={{$config-title$/tagnew}}
/> />
<$action-deletetiddler <$action-deletetiddler
$tiddler="""$(config-title)$/new-title""" $tiddler=<<qualify "$:/state/Excise/NewTitle">>
/> />
<$action-deletetiddler <$action-deletetiddler
$tiddler=<<dropdown-state>> $tiddler=<<dropdown-state>>
/> />
<<lingo Caption/Excise>> <<lingo Caption/Excise>>
</$button> </$button>
\end
<$macrocall $name="body" config-title=<<qualify "$:/state/Excise/">>/>

View File

@ -1,7 +1,8 @@
title: $:/core/ui/EditorToolbar/size-dropdown title: $:/core/ui/EditorToolbar/size-dropdown
\define lingo-base() $:/language/Buttons/Size/ \define lingo-base() $:/language/Buttons/Size/
\define toolbar-button-size-preset()
\define toolbar-button-size-preset(config-title)
<$set name="width" filter="$(sizePair)$ +[first[]]"> <$set name="width" filter="$(sizePair)$ +[first[]]">
<$set name="height" filter="$(sizePair)$ +[last[]]"> <$set name="height" filter="$(sizePair)$ +[last[]]">
@ -9,17 +10,17 @@ title: $:/core/ui/EditorToolbar/size-dropdown
<$button tag="a"> <$button tag="a">
<$action-setfield <$action-setfield
$tiddler="""$(config-title)$/new-width""" $tiddler="""$config-title$/new-width"""
$value=<<width>> $value=<<width>>
/> />
<$action-setfield <$action-setfield
$tiddler="""$(config-title)$/new-height""" $tiddler="""$config-title$/new-height"""
$value=<<height>> $value=<<height>>
/> />
<$action-deletetiddler <$action-deletetiddler
$tiddler="""$(config-title)$/presets-popup""" $tiddler="""$config-title$/presets-popup"""
/> />
<$text text=<<width>>/> &times; <$text text=<<height>>/> <$text text=<<width>>/> &times; <$text text=<<height>>/>
@ -31,20 +32,20 @@ title: $:/core/ui/EditorToolbar/size-dropdown
</$set> </$set>
\end \end
\define toolbar-button-size() \define toolbar-button-size(config-title)
''{{$:/language/Buttons/Size/Hint}}'' ''{{$:/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}} {{$:/core/images/down-arrow}}
</$button> </$button>
<$reveal tag="span" state="""$(config-title)$/presets-popup""" type="popup" position="belowleft" animate="yes"> <$reveal tag="span" state="""$config-title$/presets-popup""" type="popup" position="belowleft" animate="yes">
<div class="tc-drop-down tc-popup-keep"> <div class="tc-drop-down tc-popup-keep">
<$list filter={{$:/config/BitmapEditor/ImageSizes}} variable="sizePair"> <$list filter={{$:/config/BitmapEditor/ImageSizes}} variable="sizePair">
<<toolbar-button-size-preset>> <$macrocall $name="toolbar-button-size-preset" config-title="$config-title$"/>
</$list> </$list>
@ -56,14 +57,14 @@ title: $:/core/ui/EditorToolbar/size-dropdown
<$action-sendmessage <$action-sendmessage
$message="tm-edit-bitmap-operation" $message="tm-edit-bitmap-operation"
$param="resize" $param="resize"
width={{$(config-title)$/new-width}} width={{$config-title$/new-width}}
height={{$(config-title)$/new-height}} height={{$config-title$/new-height}}
/> />
<$action-deletetiddler <$action-deletetiddler
$tiddler="""$(config-title)$/new-width""" $tiddler="""$config-title$/new-width"""
/> />
<$action-deletetiddler <$action-deletetiddler
$tiddler="""$(config-title)$/new-height""" $tiddler="""$config-title$/new-height"""
/> />
<$action-deletetiddler <$action-deletetiddler
$tiddler=<<dropdown-state>> $tiddler=<<dropdown-state>>
@ -72,4 +73,4 @@ title: $:/core/ui/EditorToolbar/size-dropdown
</$button> </$button>
\end \end
<<toolbar-button-size>> <$macrocall $name="toolbar-button-size" config-title=<<qualify "$:/state/Size/">>/>

View File

@ -57,8 +57,8 @@ An example can be seen in [[$:/core/ui/EditorToolbar/size-dropdown]]:
<$action-sendmessage <$action-sendmessage
$message="tm-edit-bitmap-operation" $message="tm-edit-bitmap-operation"
$param="resize" $param="resize"
width={{$(config-title)$/new-width}} width={{$config-title$/new-width}}
height={{$(config-title)$/new-height}} height={{$config-title$/new-height}}
/> />
... ...
Resize Resize