mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-16 06:44:50 +00:00
109 lines
1.8 KiB
Plaintext
109 lines
1.8 KiB
Plaintext
title: $:/core/ui/EditTemplate/body/toolbar/button
|
|
|
|
\define toolbar-button-icon()
|
|
<$list
|
|
|
|
filter="[all[current]!has[custom-icon]]"
|
|
variable="no-custom-icon"
|
|
|
|
><$transclude
|
|
|
|
tiddler={{!!icon}}
|
|
|
|
/></$list>
|
|
\end
|
|
|
|
\define toolbar-button-tooltip()
|
|
{{!!description}}<$macrocall $name="displayshortcuts" $output="text/plain" shortcuts={{!!shortcuts}} prefix="` - [" separator="] [" suffix="]`"/>
|
|
\end
|
|
|
|
\define toolbar-button()
|
|
<$list
|
|
|
|
filter={{!!condition}}
|
|
variable="list-condition"
|
|
|
|
><$wikify
|
|
|
|
name="tooltip-text"
|
|
text=<<toolbar-button-tooltip>>
|
|
mode="inline"
|
|
output="text"
|
|
|
|
><$list
|
|
|
|
filter="[all[current]!has[dropdown]]"
|
|
variable="no-dropdown"
|
|
|
|
><$button
|
|
|
|
class="tc-btn-invisible $(buttonClasses)$"
|
|
tooltip=<<tooltip-text>>
|
|
actions={{!!actions}}
|
|
|
|
><span
|
|
|
|
data-tw-keyboard-shortcut={{!!shortcuts}}
|
|
|
|
/><<toolbar-button-icon>><$transclude
|
|
|
|
tiddler=<<currentTiddler>>
|
|
field="text"
|
|
|
|
/></$button></$list><$list
|
|
|
|
filter="[all[current]has[dropdown]]"
|
|
variable="dropdown"
|
|
|
|
><$set
|
|
|
|
name="dropdown-state"
|
|
value=<<qualify "$:/state/EditorToolbarDropdown">>
|
|
|
|
><$button
|
|
|
|
popup=<<dropdown-state>>
|
|
class="tc-popup-keep tc-btn-invisible $(buttonClasses)$"
|
|
selectedClass="tc-selected"
|
|
tooltip=<<tooltip-text>>
|
|
actions={{!!actions}}
|
|
|
|
><span
|
|
|
|
data-tw-keyboard-shortcut={{!!shortcuts}}
|
|
|
|
/><<toolbar-button-icon>><$transclude
|
|
|
|
tiddler=<<currentTiddler>>
|
|
field="text"
|
|
|
|
/></$button><$reveal
|
|
|
|
state=<<dropdown-state>>
|
|
type="popup"
|
|
position="below"
|
|
animate="yes"
|
|
tag="span"
|
|
|
|
><div
|
|
|
|
class="tc-drop-down tc-popup-keep"
|
|
|
|
><$transclude
|
|
|
|
tiddler={{!!dropdown}}
|
|
mode="block"
|
|
|
|
/></div></$reveal></$set></$list></$wikify></$list>
|
|
\end
|
|
|
|
\define toolbar-button-outer()
|
|
<$set
|
|
|
|
name="buttonClasses"
|
|
value={{!!button-classes}}
|
|
|
|
><<toolbar-button>></$set>
|
|
\end
|
|
|
|
<<toolbar-button-outer>> |