mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-01 04:50:27 +00:00
b95aa6ec6a
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
28 lines
1.3 KiB
Plaintext
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> |