1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00
TiddlyWiki5/core/wiki/macros/image-picker.tid

34 lines
1020 B
Plaintext
Raw Normal View History

title: $:/core/macros/image-picker
tags: $:/tags/Macro
\define image-picker-inner(actions)
<$button tag="a" tooltip="""$(imageTitle)$""">
$actions$
<$transclude tiddler=<<imageTitle>>/>
</$button>
\end
\define image-picker(actions,subfilter:"")
<div class="tc-image-chooser">
<$list filter="[all[shadows+tiddlers]is[image]$subfilter$!has[draft.of]] -[type[application/pdf]] +[sort[title]]" variable="imageTitle">
<$macrocall $name="image-picker-inner" actions="""$actions$"""/>
</$list>
</div>
\end
\define image-picker-dropdown(image-tiddler,fallback,actions)
<div class="tc-image-chooser-wrapper">
<$button popup=<<qualify "$:/state/popup/image-picker">> class="tc-btn-invisible">
<$transclude tiddler="""$image-tiddler$""">
$fallback$
</$transclude>
</$button>
<div class="tc-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/popup/image-picker">> type="nomatch" text="" default="">
<div class="tc-block-dropdown">
<$macrocall $name="image-picker" actions="""$actions$"""/>
</div>
</$reveal>
</div>
\end