mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-06 02:30:46 -08:00
* Improve theme switcher accessibility * Improve view switcher accessibility * Replace set widgets with filters * Improve languageswitcher & layoutswitcher accessibility * Add indentation inside list widget * Switch to functions
28 lines
1.3 KiB
Text
28 lines
1.3 KiB
Text
title: $:/snippets/LayoutSwitcher
|
|
tags: $:/tags/ControlPanel/Appearance
|
|
caption: {{$:/language/ControlPanel/LayoutSwitcher/Caption}}
|
|
|
|
\whitespace trim
|
|
\function layout.filter() [all[current]field:title[$:/core/ui/PageTemplate]]
|
|
\function layout.empty.filter() [all[current]field:title{$:/layout}]
|
|
|
|
<$linkcatcher to="$:/layout">
|
|
<div class="tc-chooser" role="listbox">
|
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Layout]] [[$:/core/ui/PageTemplate]] +[!is[draft]sort[name]]">
|
|
<$list filter="[{$:/layout}!has[text]]" variable="ignore">
|
|
<$list-empty>
|
|
<div class={{{ [layout.empty.filter[]then[tc-chooser-item tc-chosen]else[tc-chooser-item]] }}}>
|
|
<$link to={{!!title}} role="option" aria-selected={{{ [layout.empty.filter[]then[true]else[false]] }}}>
|
|
''<$transclude tiddler={{{ [<currentTiddler>get[icon]] }}}/><$transclude field="name"/>'' - <$transclude field="description"/>
|
|
</$link>
|
|
</div>
|
|
</$list-empty>
|
|
<div class={{{ [layout.filter[]then[tc-chooser-item tc-chosen]else[tc-chooser-item]] }}}>
|
|
<$link to={{!!title}} role="option" aria-selected={{{ [layout.filter[]then[true]else[false]] }}}>
|
|
''<$transclude tiddler={{{ [<currentTiddler>get[icon]] }}}/><$transclude field="name"/>'' - <$transclude field="description"/>
|
|
</$link>
|
|
</div>
|
|
</$list>
|
|
</$list>
|
|
</div>
|
|
</$linkcatcher>
|