~hokiegeek/tw5-image-carousel

7a4f4f684cc315f9e66935fa17d4fe90c020bd6b — HokieGeek 5 months ago 43f15aa main 0.3.2
Better implementation
2 files changed, 12 insertions(+), 9 deletions(-)

M macro.tid
M plugin.info
M macro.tid => macro.tid +11 -8
@@ 7,18 7,21 @@ title: $:/plugins/hokiegeek/image-carousel/macros
type: text/vnd.tiddlywiki

\whitespace trim
\define image-carousel(images)
<$list filter="[all[current]get[image-selected]] =[list[!!images]] +[first[1]]">
<$image width=1000 source=<<currentTiddler>> />
</$list>
<$list filter="[list[!!images]count[]compare:number:gt[1]]">
many
\define image-carousel(field:"images", width:1000)
<$set name="tiddler" value=<<currentTiddler>>>
<$set name="images-list" tiddler=<<tiddler>> field=$field$>
<$list filter="[all[current]get[image-carousel-selected]] =[enlist<images-list>] +[first[1]]">
<$image width=$width$ source=<<currentTiddler>> />
</$list>
<$list filter="[enlist<images-list>count[]compare:number:gt[1]]">
<div class="tc-image-chooser">
<$macrocall $name="image-picker-list" filter="[list[!!images]]" actions="
<$macrocall $name="image-picker-list" filter="[enlist<images-list>]" actions="

<$action-setfield $tiddler=<<currentTiddler>> $field='image-selected' $value=<<imageTitle>> />
<$action-setfield $tiddler=<<tiddler>> $field='image-carousel-selected' $value=<<imageTitle>> />

"/>
</div>
</$list>
</$set>
</$set>
\end

M plugin.info => plugin.info +1 -1
@@ 2,7 2,7 @@
    "title": "$:/plugins/hokiegeek/image-carousel",
    "description": "Displays images with thumbnails",
    "author": "hokiegeek",
    "version": "0.1.0",
    "version": "0.3.2",
    "core-version": ">=5.2.1",
    "source": "https://git.sr.ht/~hokiegeek/tw5-image-carousel",
    "plugin-type": "plugin",