1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-03 02:33:15 +00:00
TiddlyWiki5/core/ui/EditTemplate/tags.tid
Simon Huber 31b141097d Tags edittemplate: replace × with svg (#3859)
* tags edittemplate: replace × with close-button svg

* make close-button smaller + v-aligned middle
2019-06-26 12:34:18 +01:00

46 lines
1.5 KiB
Plaintext

title: $:/core/ui/EditTemplate/tags
tags: $:/tags/EditTemplate
\whitespace trim
\define lingo-base() $:/language/EditTemplate/
\define tag-styles()
background-color:$(backgroundColor)$;
fill:$(foregroundColor)$;
color:$(foregroundColor)$;
\end
\define tag-body-inner(colour,fallbackTarget,colourA,colourB,icon)
\whitespace trim
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<span style=<<tag-styles>> class="tc-tag-label tc-tag-list-item">
<$transclude tiddler="""$icon$"""/>&nbsp;<$view field="title" format="text" />
<$button message="tm-remove-tag" param={{!!title}} class="tc-btn-invisible tc-remove-tag-button">{{$:/core/images/close-button}}</$button>
</span>
</$vars>
\end
\define tag-body(colour,palette,icon)
<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} icon="""$icon$"""/>
\end
\define tag-picker-actions()
<$action-listops
$tiddler=<<currentTiddler>>
$field="tags"
$subfilter="[<tag>] [all[current]tags[]]"
/>
\end
<div class="tc-edit-tags">
<$fieldmangler>
<$list filter="[all[current]tags[]sort[title]]" storyview="pop">
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}} icon={{!!icon}}/>
</$list>
</$fieldmangler>
<$set name="tabIndex" value={{$:/config/EditTabIndex}}>
<$macrocall $name="tag-picker" actions=<<tag-picker-actions>>/>
</$set>
</div>