|
1 | 1 | caption: Supp Notes Template |
2 | 2 | created: 20251107152410791 |
3 | | -modified: 20251117194827143 |
| 3 | +modified: 20251117211857042 |
4 | 4 | query: [prefix[$:/supp-info]] |
5 | 5 | tags: $:/tags/ViewTemplate |
6 | 6 | title: $:/supp-info/notes/view-template |
7 | 7 | type: text/vnd.tiddlywiki |
8 | 8 |
|
9 | 9 | \procedure add-note() |
10 | | - <$let count={{{ [{$:/supp-info/notes/content}jsonindexes<currentTiddler>last[]add[1]] }}} css-index={{{ [<count>add[1]] }}}> |
| 10 | + <$let count={{{ [{$:/supp-info/notes/content}jsonindexes<currentTiddler>last[]add[1]] }}} css-index={{{ [<count>else[0]add[1]] }}}> |
| 11 | + <% if [{$:/supp-info/notes/content}jsonindexes<currentTiddler>count[]match[0]] %> |
| 12 | +<$action-log message="AAA" count=<<count>> css-index=<<css-index>> /> |
| 13 | + <$action-setfield |
| 14 | + $tiddler="$:/supp-info/notes/content" |
| 15 | + $value={{{ [{$:/supp-info/notes/content}jsonset:array<currentTiddler>format:json[2]] }}} |
| 16 | + /> |
| 17 | + <% else %> |
| 18 | + <% endif %> |
11 | 19 | <$action-setfield |
12 | 20 | $tiddler="$:/supp-info/notes/content" |
13 | 21 | $value={{{ [{$:/supp-info/notes/content}jsonset<currentTiddler>,<count>,[Dummy text]format:json[2]] }}} |
14 | 22 | /> |
15 | 23 | <$action-setfield $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$` $field="state" $value="show" /> |
16 | | - <$action-setfield $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$/$(count)$` $field="mode" $value="edit" /> |
17 | | - <!-- todo: find out why this doesn't work --> |
18 | | - <$action-sendmessage $message="tm-focus-selector" $param=`div[data-tiddler-title="$(currentTiddler)$"] div.note-row:nth-child($(css-index)$) textarea` /> |
| 24 | + <$let key={{{ [<count>else[0]add[1]subtract[1]] }}}> <!-- TODO: fix this ridiculous hack! --> |
| 25 | + <$action-setfield $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$/$(key)$` $field="mode" $value="edit" /> |
| 26 | + <!-- TODO: find out why this doesn't work --> |
| 27 | + <$action-sendmessage $message="tm-focus-selector" $param=`div[data-tiddler-title="$(currentTiddler)$"] div.note-row:nth-child($(css-index)$) textarea` /> |
| 28 | + </$let> |
19 | 29 | </$let> |
20 | 30 | \end add-note |
21 | 31 |
|
@@ -46,9 +56,9 @@ type: text/vnd.tiddlywiki |
46 | 56 | /> |
47 | 57 | \end save-note |
48 | 58 |
|
49 | | -<% if [{$:/supp-info/notes/content}jsonget<currentTiddler>] %> |
| 59 | +<% if [<currentTiddler>is[tiddler]!is[system]] %> |
50 | 60 | <div class="supp-notes"> |
51 | | -<$let count={{{ [{$:/supp-info/notes/content}jsonindexes<currentTiddler>last[]add[1]] }}}> |
| 61 | +<$let count={{{ [{$:/supp-info/notes/content}jsonindexes<currentTiddler>last[]add[1]] :else[[0]] }}}> |
52 | 62 |
|
53 | 63 |
|
54 | 64 | <div class="summary"> |
|
0 commit comments