~hokiegeek/tw5-checklist

ref: ba38a3e9371e30f2b40f89e90ce9d199d00cb76a tw5-checklist/ShoppingList_buttons_NewItem.tid -rw-r--r-- 1.3 KiB
ba38a3e9HokieGeek Ok, that was more work than I expected, but I have replicated the same functionality 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
creator: hokiegeek
created: 20181022145158481
list-before: 
modified: 20181024014100060
tags: $:/tags/ViewToolbar
title: $:/plugins/hokiegeek/checklist/ShoppingList/buttons/NewItem
type: text/vnd.tiddlywiki

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

<$set name="list-tag" value={{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/tag}}>
<$list filter="[all[current]is[tiddler]!is[system]tag<list-tag>]">
<$set name="item-tags" filter="[list[!!tags]]-[{$:/plugins/hokiegeek/checklist/ShoppingList/config/List/tag}]">
<<newShoppingListItem>>
</$set>
</$list>
</$set>