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

37 lines
1.6 KiB
Plaintext
Raw Normal View History

tags: $:/tags/Macro
title: $:/core/macros/image-picker
type: text/vnd.tiddlywiki
\procedure image-picker-thumbnail(actions)
<$button tag="a" tooltip=<<imageTitle>>><$transclude $variable="actions"/><$transclude tiddler=<<imageTitle>>/></$button>
\end
\procedure image-picker-list(filter,actions)
\whitespace trim
<$list filter=<<filter>> variable="imageTitle">
<$transclude $variable="image-picker-thumbnail" actions=<<actions>>/>
&#32;
</$list>
2016-11-29 08:36:07 +00:00
\end
\procedure image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"")
\whitespace trim
2016-11-29 08:36:07 +00:00
<div class="tc-image-chooser">
<$let state-system=<<qualify "$:/state/image-picker/system">> tv-filter={{{ [<filter>search-replace[$subfilter$],<subfilter>] }}}>
2016-11-29 08:36:07 +00:00
<$checkbox tiddler=<<state-system>> field="text" checked="show" unchecked="hide" default="hide">
<span class="tc-tiny-gap-left">{{$:/language/SystemTiddlers/Include/Prompt}}</span>
2016-11-29 08:36:07 +00:00
</$checkbox>
<$reveal state=<<state-system>> type="match" text="hide" default="hide" tag="div">
<$transclude $variable="image-picker-list" filter=`$(tv-filter)$ +[!is[system]]` actions=<<actions>>/>
2016-11-29 08:36:07 +00:00
</$reveal>
<$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div">
<$transclude $variable="image-picker-list" filter=<<tv-filter>> actions=<<actions>>/>
2016-11-29 08:36:07 +00:00
</$reveal>
</$let>
</div>
\end
\procedure image-picker-include-tagged-images(actions)
<$transclude $variable="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions=<<actions>>/>
2016-11-29 08:36:07 +00:00
\end