11created: 20251107152410791
2- modified: 20251112195543403
2+ modified: 20251115161001828
33tags: $:/tags/ViewTemplate
44title: $:/supp-info/notes/view-template
55type: text/vnd.tiddlywiki
@@ -21,18 +21,22 @@ type: text/vnd.tiddlywiki
2121\end delete-note
2222
2323\procedure edit-note(index)
24- <$action-setfield
25- $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$/$(index)$`
26- $field=mode
27- $value=save
28- />
24+ <$action-setfield $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$/$(index)$` $field="mode" $value="save" />
25+ <$let
26+ temp=`$:/temp/supp-info/notes/$(currentTiddler)$/$(index)$`
27+ text={{{ [<temp>get[text]] }}}
28+ json={{{ [{$:/supp-info/notes/content}jsonset<currentTiddler>,<index>,<text>format:json[2]] }}}
29+ >
30+ <$action-setfield $tiddler="$:/supp-info/notes/content" $field="text" $value=<<json>> />
31+ </$let>
2932\end edit-note
3033
3134\procedure save-note(index)
35+ <$action-setfield $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$/$(index)$` $field="mode" $value="edit" />
3236 <$action-setfield
3337 $tiddler=`$:/temp/supp-info/notes/$(currentTiddler)$/$(index)$`
34- $field=mode
35- $value=edit
38+ $field="text"
39+ $value={{{ [{$:/supp-info/notes/content}jsonget<currentTiddler>,<index>] }}}
3640 />
3741\end save-note
3842
@@ -58,9 +62,15 @@ type: text/vnd.tiddlywiki
5862 <$button actions=`<<save-note $(index)$>>` ><span class="icon">{{$:/core/images/edit-button}}</span></$button>
5963 <% endif %>
6064 <div class="note">
61- <$wikify name="note" text={{{ [{$:/supp-info/notes/content}jsonget<currentTiddler>,<index>] }}} output="html">
62- <<note>>
63- </$wikify>
65+ <% if [<mode>match[edit]] %>
66+ <$wikify name="note" text={{{ [{$:/supp-info/notes/content}jsonget<currentTiddler>,<index>] }}} output="html">
67+ <<note>>
68+ </$wikify>
69+ <% else %>
70+ <$wikify name="note" text={{{ [{$:/supp-info/notes/content}jsonget<currentTiddler>,<index>] }}} output="html">
71+ <<note>>
72+ </$wikify>
73+ <% endif %>
6474 </div>
6575 </$let>
6676 </div>
0 commit comments