When you press show preview or hide preview in a Draft tiddler then this
affects all open Draft tiddlers. When tiddler above the current tiddler
expand the tiddler is moved out of view. If you only want the preview of
the current tiddler to be switched on or off (TW5.1.11) the current tiddler
stays in view.
Edit the $:/core/ui/EditTemplate/body tiddler. In bold the changes compared
to the original tiddler.
How it works: When you press show preview it creates an extra field in the
current tiddler called editpreview and fills it with the value "yes" . When
you press hide preview this extra field is deleted. Only if the field value
= "yes" the preview is shown.
---
\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="*!!editpreview*" type="match" text="yes">
<em class="tc-edit"><<lingo Hint>></em> *<$button><$action-deletefield
editpreview />*<<lingo Preview/Button/Hide>></$button>
<div class="tc-tiddler-preview">
<div class="tc-tiddler-preview-preview">
<$set name="tv-tiddler-preview" value="yes">
<$transclude />
</$set>
</div>
<div class="tc-tiddler-preview-edit">
<$edit field="text" class="tc-edit-texteditor"
placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>
</div>
</div>
</$reveal>
<$reveal state="*!!editpreview*" type="nomatch" text="yes">
<em class="tc-edit"><<lingo Hint>></em> <$button type="set" set="
*!!editpreview*" setTo="yes"><<lingo Preview/Button/Show>></$button>
<$edit field="text" class="tc-edit-texteditor"
placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>
</$reveal>
</$list>
----
On request (min 10) I'll try to convert this into a widget.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/c6135642-2594-4735-bb01-afa4bc093d1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.