mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-02 22:39:56 +00:00
a3521eb67d
* Use qualified-preview-state to reuse in preview button Somehow the editor-body template and the preview button don't qualify the same showeditpreview anymore * Update preview.tid to use qualified-preview-state * Update preview.tid * Update default.tid * Update preview.tid
48 lines
1.7 KiB
Plaintext
48 lines
1.7 KiB
Plaintext
title: $:/core/ui/EditTemplate/body/default
|
|
|
|
\function edit-preview-state()
|
|
[{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualified-preview-state>] +[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
|
|
qualified-preview-state=<<qualify "$:/state/showeditpreview">>
|
|
editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualified-preview-state>] }}}
|
|
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={{{ [<edit-preview-state>match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}>
|
|
|
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
|
|
|
<$list filter="[<editPreviewStateTiddler>get[text]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>
|