1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-14 05:44:50 +00:00
TiddlyWiki5/core/wiki/paletteswitcher.tid
2024-01-26 01:35:22 +01:00

33 lines
1020 B
Plaintext

title: $:/snippets/paletteswitcher
\parameters (palette:"$:/palette" config:"" postFilter:"")
\whitespace trim
\procedure 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;
<$view field="color-scheme" format="text"/>
&#32;-&#32;
<$view field="description" format="text"/>
{{||$:/snippets/currpalettepreview}}
</$link>
</div>
</$set>
</$list>
</$let>
</div>
</$linkcatcher>