1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00
TiddlyWiki5/core/ui/EditTemplate/body-toolbar-button.tid
Jermolene 7224fea961 Introduce "link" editor toolbar button
As proposed by Alex Hough
2016-04-29 18:54:44 +01:00

48 lines
1.6 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>>>
<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>>>
<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>>