Skip to content

Commit e3b6003

Browse files
committed
Make save button work, add sidebar
1 parent 6fc19b9 commit e3b6003

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
caption: Supp
2+
created: 20251113195712539
3+
modified: 20251113200504449
4+
tags: $:/tags/SideBar
5+
title: $:/supp-info/core/sidebar/supp-info
6+
type: text/vnd.tiddlywiki
7+
8+
----------
9+
<<list-links "[prefix[$:/supp-info]] -[[$:/supp-info/core/sidebar/supp-info]]">>
10+
11+
----------
12+
<<list-links "HelloThere [[Quick Start]] [[Find Out More]]">>
13+
14+
----------
15+
<<list-links "[prefix[$:/temp/supp-info]]">>
16+
17+
----------
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
%: true
12
created: 20251107151758434
2-
modified: 20251111000119326
3+
modified: 20251115161104742
34
tags: $:/tags/SupplementaryInfo
45
title: $:/supp-info/notes/content
56
type: application/json

tiddlers/$__supp-info_notes_view-template.tid

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
created: 20251107152410791
2-
modified: 20251112195543403
2+
modified: 20251115161001828
33
tags: $:/tags/ViewTemplate
44
title: $:/supp-info/notes/view-template
55
type: 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

Comments
 (0)