1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-10 20:09:57 +00:00
TiddlyWiki5/core/wiki/paletteswitcher.tid

33 lines
1017 B
Plaintext
Raw Normal View History

title: $:/snippets/paletteswitcher
2024-01-25 15:53:21 +00:00
\parameters (palette:"$:/palette" config:"" postFilter:"")
\whitespace trim
2024-01-25 15:53:21 +00:00
\define catchActions()
<$action-setfield $tiddler=<<palette>> $field=text text=<<navigateTo>>/>
<$list filter="[<config>!is[blank]]">
<$action-setfield $tiddler=<<config>> text=<<navigateTo>>/>
</$filter>
\end
<$linkcatcher actions=<<catchActions>>>
<div class="tc-chooser">
<$let pre={{{ [<palette>get[text]] }}} >
<$list filter=`[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]] $(postFilter)$`>
<$set name="class" filter="[all[current]prefix<pre>]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
<div class=<<class>> >
<$link to={{!!title}}>
''<$view field="name" format="text"/>''
&#32;-&#32;
2024-01-25 19:42:00 +00:00
<$view field="color-scheme" format="text"/>
&#32;-&#32;
2024-01-25 15:53:21 +00:00
<$view field="description" format="text"/>
{{||$:/snippets/currpalettepreview}}
</$link>
</div>
</$set>
</$list>
</$let>
</div>
</$linkcatcher>