mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-10 20:09:57 +00:00
32 lines
948 B
Plaintext
32 lines
948 B
Plaintext
title: $:/snippets/paletteswitcher
|
|
|
|
\parameters (palette:"$:/palette" config:"" postFilter:"")
|
|
\whitespace trim
|
|
|
|
\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"/>''
|
|
 - 
|
|
<$view field="description" format="text"/>
|
|
{{||$:/snippets/currpalettepreview}}
|
|
</$link>
|
|
</div>
|
|
</$set>
|
|
</$list>
|
|
</$let>
|
|
</div>
|
|
</$linkcatcher>
|