mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-28 16:23:15 +00:00
Add image-picker-dropdown macro
Still need to add a way to select system images (like in the image dropdown in tag manager)
This commit is contained in:
parent
b00c1c7290
commit
e5af022bd3
|
@ -3,24 +3,31 @@ tags: $:/tags/Macro
|
||||||
|
|
||||||
\define image-picker-inner(actions)
|
\define image-picker-inner(actions)
|
||||||
<$button tag="a" tooltip="""$(imageTitle)$""">
|
<$button tag="a" tooltip="""$(imageTitle)$""">
|
||||||
|
|
||||||
$actions$
|
$actions$
|
||||||
|
|
||||||
<$transclude tiddler=<<imageTitle>>/>
|
<$transclude tiddler=<<imageTitle>>/>
|
||||||
|
|
||||||
</$button>
|
</$button>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define image-picker(actions,subfilter:"")
|
\define image-picker(actions,subfilter:"")
|
||||||
<div class="tc-image-chooser">
|
<div class="tc-image-chooser">
|
||||||
|
|
||||||
<$list filter="[all[shadows+tiddlers]is[image]$subfilter$!has[draft.of]] -[type[application/pdf]] +[sort[title]]" variable="imageTitle">
|
<$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$"""/>
|
<$macrocall $name="image-picker-inner" actions="""$actions$"""/>
|
||||||
|
|
||||||
</$list>
|
</$list>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
\end
|
\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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user