2017-07-24 11:41:50 +00:00
|
|
|
created: 20170715180840889
|
|
|
|
modified: 20170715180914005
|
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
|
|
|
|
2016-11-29 08:36:07 +00:00
|
|
|
\define image-picker-thumbnail(actions)
|
2016-04-22 07:36:29 +00:00
|
|
|
<$button tag="a" tooltip="""$(imageTitle)$""">
|
|
|
|
$actions$
|
|
|
|
<$transclude tiddler=<<imageTitle>>/>
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
2016-11-29 08:36:07 +00:00
|
|
|
\define image-picker-list(filter,actions)
|
|
|
|
<$list filter="""$filter$""" variable="imageTitle">
|
|
|
|
<$macrocall $name="image-picker-thumbnail" actions="""$actions$"""/>
|
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
|
|
|
|
2017-07-24 11:41:50 +00:00
|
|
|
\define image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"")
|
2016-11-29 08:36:07 +00:00
|
|
|
<div class="tc-image-chooser">
|
|
|
|
<$vars state-system=<<qualify "$:/state/image-picker/system">>>
|
|
|
|
<$checkbox tiddler=<<state-system>> field="text" checked="show" unchecked="hide" default="hide">
|
|
|
|
{{$:/language/SystemTiddlers/Include/Prompt}}
|
|
|
|
</$checkbox>
|
|
|
|
<$reveal state=<<state-system>> type="match" text="hide" default="hide" tag="div">
|
|
|
|
<$macrocall $name="image-picker-list" filter="""$filter$ +[!is[system]]""" actions="""$actions$"""/>
|
|
|
|
</$reveal>
|
|
|
|
<$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div">
|
|
|
|
<$macrocall $name="image-picker-list" filter="""$filter$""" actions="""$actions$"""/>
|
|
|
|
</$reveal>
|
|
|
|
</$vars>
|
2016-11-27 22:34:19 +00:00
|
|
|
</div>
|
|
|
|
\end
|
2016-11-28 10:40:55 +00:00
|
|
|
|
2016-11-29 08:36:07 +00:00
|
|
|
\define image-picker-include-tagged-images(actions)
|
|
|
|
<$macrocall $name="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions="""$actions$"""/>
|
|
|
|
\end
|