Skip to content

Commit d923432

Browse files
committed
Add notes to all plain tiddlers, not just predefined
1 parent 70161e4 commit d923432

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

tiddlers/$__supp-info_core_sidebar_supp-info.tid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
caption: Supp
22
created: 20251113195712539
3-
modified: 20251115171220091
3+
modified: 20251117202206225
44
tags: $:/tags/SideBar
55
title: $:/supp-info/core/sidebar/supp-info
66
type: text/vnd.tiddlywiki
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
caption: Supp Notes Content
22
created: 20251107151758434
3-
modified: 20251117175059373
3+
modified: 20251117211714179
44
tags: $:/tags/SupplementaryInfo
55
title: $:/supp-info/notes/content
66
type: application/json

tiddlers/$__supp-info_notes_view-template.tid

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
caption: Supp Notes Template
22
created: 20251107152410791
3-
modified: 20251117194827143
3+
modified: 20251117211857042
44
query: [prefix[$:/supp-info]]
55
tags: $:/tags/ViewTemplate
66
title: $:/supp-info/notes/view-template
77
type: text/vnd.tiddlywiki
88

99
\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 %>
1119
<$action-setfield
1220
$tiddler="$:/supp-info/notes/content"
1321
$value={{{ [{$:/supp-info/notes/content}jsonset<currentTiddler>,<count>,[Dummy text]format:json[2]] }}}
1422
/>
1523
<$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>
1929
</$let>
2030
\end add-note
2131

@@ -46,9 +56,9 @@ type: text/vnd.tiddlywiki
4656
/>
4757
\end save-note
4858

49-
<% if [{$:/supp-info/notes/content}jsonget<currentTiddler>] %>
59+
<% if [<currentTiddler>is[tiddler]!is[system]] %>
5060
<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]] }}}>
5262

5363

5464
<div class="summary">

0 commit comments

Comments
 (0)