1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 02:50:27 +00:00

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.
This commit is contained in:
Jermolene 2016-02-15 11:38:21 +00:00
parent df3e39d97a
commit 7daebba46b
3 changed files with 24 additions and 4 deletions

View File

@ -5,6 +5,8 @@ Body/Hint: Use [[wiki text|http://tiddlywiki.com/static/WikiText.html]] to add f
Body/Placeholder: Type the text for this tiddler
Body/Preview/Button/Hide: hide preview
Body/Preview/Button/Show: show preview
Body/Preview/Type: preview type:
Body/Preview/Type/Output: output
Field/Remove/Caption: remove field
Field/Remove/Hint: Remove field
Fields/Add/Button: add

View File

@ -0,0 +1,9 @@
title: $:/core/ui/EditTemplate/body/preview/output
tags: $:/tags/EditPreview
caption: {{$:/language/EditTemplate/Body/Preview/Type/Output}}
<$set name="tv-tiddler-preview" value="yes">
<$transclude />
</$set>

View File

@ -20,15 +20,24 @@ tags: $:/tags/EditTemplate
<$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>
<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">
<$set name="tv-tiddler-preview" value="yes">
<$transclude />
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/>
</$transclude>
</$set>
</div>
<div class="tc-tiddler-preview-edit">