-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLikeTagPills.tid
113 lines (109 loc) · 2.59 KB
/
LikeTagPills.tid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
tags: Templates
title: $:/plugins/OokTech/GenTags/LikeTagPills
\define tag-styles()
background-color:$(backgroundColor)$;
fill:$(foregroundColor)$;
color:$(foregroundColor)$;
\end
\define tag-body-inner(colour,fallbackTarget,colourA,colourB)
<$set
name="foregroundColor"
value=<<contrastcolour
target:"""$colour$"""
fallbackTarget:"""$fallbackTarget$"""
colourA:"""$colourA$"""
colourB:"""$colourB$""">>
>
<$set
name="backgroundColor"
value=<<__colour__>>
>
<$button
popup=<<qualify "$:/state/popup/tag">>
class="tc-btn-invisible tc-tag-label"
style=<<tag-styles>>
>
<$transclude
tiddler={{!!icon}}
/>
<$list
filter='[<WikifyTags>lowercase[]match[true]]'
variable=unused
emptyMessage="""<$view field="title" format="text"/>"""
>
{{!!title}}
</$list>
</$button>
<$reveal
state=<<qualify "$:/state/popup/tag">>
type="popup"
position="below"
animate="yes"
>
<div
class="tc-drop-down"
>
<$list
filter='[<WikifyTags>lowercase[]match[true]]'
variable=unused
emptyMessage="""<$transclude tiddler="$:/core/ui/ListItemTemplate"/>"""
>
{{!!title}}
</$list><$reveal
type='match'
state='$:/settings/GenTags/ShowOpenAll'
text=true
>
<$button
class='tc-btn-invisible'
tooltip='Open All Tagged Tiddlers'
>
{{$:/core/images/tag-button}}
<$list
filter='[<currentTiddler>listed<TheField>]'
>
<$action-navigate
$to=<<currentTiddler>>
$scroll='no'
/>
</$list>
</$button>
</$reveal>
<hr>
<$list
filter="[<currentTiddler>listed<TheField>]"
template="$:/core/ui/ListItemTemplate"
/>
</div>
</$reveal>
</$set>
</$set>
\end
\define tag-body(colour,palette)
<span class="tc-tag-list-item">
<$set
name=TagBackground
filter='[[$:/settings/AlternateTagFields/$(TheField)$]get[color]]'
emptyValue={{$palette$##tag-background}}
>
<$set
name=Color
filter='[<currentTiddler>get[color]]'
emptyValue=<<TagBackground>>
>
<$macrocall
$name="tag-body-inner"
colour=<<Color>>
fallbackTarget=<<TagBackground>>
colourA={{$palette$##foreground}}
colourB={{$palette$##background}}
/>
</$set>
</$set>
</span>
\end
<$macrocall
$name="tag-body"
colour={{!!color}}
palette={{$:/palette}}
/>