1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00
TiddlyWiki5/core/ui/EditTemplate/body.tid
Jermolene 7daebba46b Make edit preview pane extensible
Additional preview panes are tagged “$:/tags/EditPreview“. A dropdown
is shown if there is more than one edit preview loaded.
2016-02-15 11:38:21 +00:00

60 lines
1.8 KiB
Plaintext

title: $:/core/ui/EditTemplate/body
tags: $:/tags/EditTemplate
\define lingo-base() $:/language/EditTemplate/Body/
<$list filter="[is[current]has[_canonical_uri]]">
<div class="tc-message-box">
<<lingo External/Hint>>
<a href={{!!_canonical_uri}}><$text text={{!!_canonical_uri}}/></a>
<$edit-text field="_canonical_uri" class="tc-edit-fields"></$edit-text>
</div>
</$list>
<$list filter="[is[current]!has[_canonical_uri]]">
<$reveal state="$:/state/showeditpreview" type="match" text="yes">
<em class="tc-edit"><<lingo Hint>></em> <$button type="set" set="$:/state/showeditpreview" setTo="no"><<lingo Preview/Button/Hide>></$button> <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditPreview]!has[draft.of]butfirst[]limit[1]]" variable="listItem">
<em class="tc-edit"><<lingo Preview/Type>></em> <$select tiddler="$:/state/editpreviewtype" default="$:/core/ui/EditTemplate/body/preview/output">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditPreview]!has[draft.of]]">
<option value=<<currentTiddler>>>{{!!caption}}</option>
</$list>
</$select>
</$list>
<div class="tc-tiddler-preview">
<div class="tc-tiddler-preview-preview">
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/>
</$transclude>
</div>
<div class="tc-tiddler-preview-edit">
<$edit field="text" class="tc-edit-texteditor" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>
</div>
</div>
</$reveal>
<$reveal state="$:/state/showeditpreview" type="nomatch" text="yes">
<em class="tc-edit"><<lingo Hint>></em> <$button type="set" set="$:/state/showeditpreview" setTo="yes"><<lingo Preview/Button/Show>></$button>
<$edit field="text" class="tc-edit-texteditor" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>
</$reveal>
</$list>