~hokiegeek/tw5-checklist

ref: 849832820648a0a032dffbc94c33c15028a5fed2 tw5-checklist/macro_NewItem.tid -rw-r--r-- 1.2 KiB
84983282HokieGeek Refactored to be more generic 2 years ago
                                                                                
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
creator: hokiegeek
modified: 20181029004217000
created: 20181029004217000
tags: $:/tags/Macro
title: $:/plugins/hokiegeek/checklist/NewItem
type: text/vnd.tiddlywiki

\whitespace trim
\define newListItem(parent-list-tags, item-tag)
<$button tooltip={{$:/plugins/hokiegeek/checklist/config/buttons/NewItem/hint}} aria-label={{$:/plugins/hokiegeek/checklist/config/buttons/NewItem/caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" title="Item Name" tags="$parent-list-tags$" />
<$action-sendmessage $message="tm-add-tag" $param="$item-tag$" />
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
<span class="new-item-btn">
{{$:/core/images/new-button}}
</span>
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text">
<$text text={{$:/plugins/hokiegeek/checklist/config/buttons/NewItem/caption}}/>
</span>
</$list>
</$button>
\end

\define newChecklistItem()
<$set name="item-tags" filter="[{$:/plugins/hokiegeek/checklist/config/Item/tag}][list[!!tags]]-[{$:/plugins/hokiegeek/checklist/config/List/tag}]">
<$macrocall $name="newListItem"
            parent-list-tags=<<item-tags>>
            item-tag={{$:/plugins/hokiegeek/checklist/config/Item/tag}}
            />
</$set>
\end