2016-04-22 07:36:29 +00:00
|
|
|
tags: $:/tags/Macro
|
2017-07-24 11:41:50 +00:00
|
|
|
title: $:/core/macros/image-picker
|
|
|
|
type: text/vnd.tiddlywiki
|
2016-04-22 07:36:29 +00:00
|
|
|
|
2024-12-05 12:40:13 +00:00
|
|
|
\procedure image-picker-thumbnail(actions)
|
|
|
|
<$button tag="a" tooltip=<<imageTitle>>><$transclude $variable="actions"/><$transclude tiddler=<<imageTitle>>/></$button>
|
2016-04-22 07:36:29 +00:00
|
|
|
\end
|
|
|
|
|
2024-12-05 12:40:13 +00:00
|
|
|
\procedure image-picker-list(filter,actions)
|
2022-03-26 14:16:01 +00:00
|
|
|
\whitespace trim
|
2024-12-05 12:40:13 +00:00
|
|
|
<$list filter=<<filter>> variable="imageTitle">
|
|
|
|
<$transclude $variable="image-picker-thumbnail" actions=<<actions>>/>
|
2022-03-26 14:16:01 +00:00
|
|
|
 
|
2016-04-22 07:36:29 +00:00
|
|
|
</$list>
|
2016-11-29 08:36:07 +00:00
|
|
|
\end
|
2016-04-22 07:36:29 +00:00
|
|
|
|
2024-12-05 12:40:13 +00:00
|
|
|
\procedure image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"")
|
2022-03-26 14:16:01 +00:00
|
|
|
\whitespace trim
|
2016-11-29 08:36:07 +00:00
|
|
|
<div class="tc-image-chooser">
|
2024-12-05 12:40:13 +00:00
|
|
|
<$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">
|
2024-12-05 12:40:13 +00:00
|
|
|
<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">
|
2024-12-05 12:40:13 +00:00
|
|
|
<$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">
|
2024-12-05 12:40:13 +00:00
|
|
|
<$transclude $variable="image-picker-list" filter=<<tv-filter>> actions=<<actions>>/>
|
2016-11-29 08:36:07 +00:00
|
|
|
</$reveal>
|
2024-12-05 12:40:13 +00:00
|
|
|
</$let>
|
2016-11-27 22:34:19 +00:00
|
|
|
</div>
|
|
|
|
\end
|
2016-11-28 10:40:55 +00:00
|
|
|
|
2024-12-05 12:40:13 +00:00
|
|
|
\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
|