1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-03-13 06:58:09 +00:00
TiddlyWiki5/core/wiki/paletteswitcher.tid
2025-02-14 16:46:02 +00:00

31 lines
1.0 KiB
Plaintext

title: $:/snippets/paletteswitcher
\parameters (thumbnails)
\whitespace trim
\procedure actions()
<$action-setfield $tiddler="$:/palette" text=<<navigateTo>>/>
\end actions
<!-- Display palette in currentTiddler with selection logic -->
\procedure palette-entry(thumbnails)
<div class={{{ [<currentTiddler>match{$:/palette}then[tc-chosen]] tc-chooser-item +[join[ ]] }}}>
<$link to={{!!title}} aria-label=`${[[$:/language/ControlPanel/Palette/Caption]get[text]]}$ - ${[all[current]get[name]]}$. ${[all[current]get[description]]}$`>
<%if [<thumbnails>match[yes]] %>
{{||$:/snippets/currpalettepreview}}
<%endif%>
''<$view field="name" format="text"/>''
<br>
<$view field="description" format="text"/>
</$link>
</div>
\end palette-entry
<$linkcatcher actions=<<actions>>>
<div class={{{ tc-chooser [<thumbnails>match[yes]then[tc-chooser-cards]] +[join[ ]] }}}>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]!is[draft]sort[name]]">
<$transclude $variable="palette-entry" thumbnails=<<thumbnails>>/>
</$list>
</div>
</$linkcatcher>