1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-29 08:43:14 +00:00
TiddlyWiki5/core/ui/PageControls/new-journal.tid
Jermolene b95aa6ec6a Fix problem with repeated "new journal" with text set
Fixes problem whereby a repeated "new journal" would replace the text of the existing journal tiddler if the control panel new journal text was set.

Fixes #3028 and #3265
2018-05-10 11:28:07 +01:00

28 lines
1.3 KiB
Plaintext

title: $:/core/ui/Buttons/new-journal
tags: $:/tags/PageControls
caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/Caption}}
description: {{$:/language/Buttons/NewJournal/Hint}}
\define journalButton()
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text=<<journalText>>/>
</$reveal>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-journal-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewJournal/Caption}}/></span>
</$list>
</$wikify>
</$button>
\end
<$set name="journalTitleTemplate" value={{$:/config/NewJournal/Title}}>
<$set name="journalTags" value={{$:/config/NewJournal/Tags}}>
<$set name="journalText" value={{$:/config/NewJournal/Text}}>
<<journalButton>>
</$set></$set></$set>