mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-26 15:23:15 +00:00
![Jermolene](/assets/img/avatar_default.png)
Add a dropdown for choosing available images for a tag. As part of this change we need to tag tiddlers that contain images typed as wikitext (these are inline SVG icons) so that we can display them in the dropdown.
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
title: $:/TagManager
|
|
|
|
\define iconEditor(title)
|
|
<$edit-text field="icon" tag="input"/> <$button popup=<<qualify "$:/state/iconDropdown/$title$">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button>
|
|
<div class="tw-block-dropdown-wrapper">
|
|
<$reveal state=<<qualify "$:/state/iconDropdown/$title$">> type="nomatch" text="" default="">
|
|
<$linkcatcher to="$title$!!icon">
|
|
<div class="tw-block-dropdown tw-edit-type-dropdown">
|
|
<$list filter="[is[shadow]is[image]] [!is[shadow]is[image]] [is[shadow]tag[$:/tags/Image]] [!is[shadow]tag[$:/tags/Image]] +[sort[title]]"><$link to={{!!title}}><$view field="title"/></$link>
|
|
</$list>
|
|
</div>
|
|
</$linkcatcher>
|
|
</$reveal>
|
|
</div>
|
|
\end
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<th>Tag</th>
|
|
<th>Count</th>
|
|
<th>Colour</th>
|
|
<th>Icon</th>
|
|
</tr>
|
|
<$list filter="[tags[]!is[system]sort[title]]">
|
|
<tr>
|
|
<td><$transclude tiddler="$:/core/ui/TagTemplate"/></td>
|
|
<td><$count filter="[is[current]tagging[]]"/></td>
|
|
<td><$edit-text field="color" tag="input" type="color"/></td>
|
|
<td><$macrocall $name="iconEditor" title={{!!title}}/></td>
|
|
</tr>
|
|
</$list>
|
|
</tbody>
|
|
</table>
|