mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-17 23:34:50 +00:00
327ecf8f66
* Don't refresh the body editor when switching the preview on and off * Focus editor when switching the preview on or off
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
title: $:/core/ui/EditTemplate/body/default
|
|
|
|
\function edit-preview-state()
|
|
[{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] +[get[text]] :else[[no]]
|
|
\end
|
|
|
|
\define config-visibility-title()
|
|
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
|
\end
|
|
|
|
\define importFileActions()
|
|
<$action-popup $state=<<importState>> $coords="(0,0,0,0)" $floating="yes"/>
|
|
\end
|
|
|
|
\whitespace trim
|
|
<$let
|
|
importTitle=<<qualify $:/ImportImage>>
|
|
importState=<<qualify $:/state/ImportImage>> >
|
|
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> >
|
|
<div>
|
|
<div class={{{ [function[edit-preview-state]match[yes]then[tc-tiddler-preview]] +[join[ ]] }}}>
|
|
|
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
|
|
|
<$list filter="[function[edit-preview-state]match[yes]]" variable="ignore">
|
|
|
|
<div class="tc-tiddler-preview-preview" data-tiddler-title={{!!draft.title}} data-tags={{!!tags}}>
|
|
|
|
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
|
|
|
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/>
|
|
|
|
</$transclude>
|
|
|
|
</div>
|
|
|
|
</$list>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</$dropzone>
|
|
|
|
</$let>
|