mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Make editor-preview open on a per-tiddler basis (#5998)
* make editor-preview open on a per-tiddler basis * use qualified state for showeditpreview * fix added p tag * Make tiddler-preview per-tiddler configurable * Create ShowEditPreviewPerTiddler.tid * Update ControlPanel.multids * Create ShowEditPreviewPerTiddler.tid * Update body.tid * Update ShowEditPreviewPerTiddler.tid * Update ControlPanel.multids * Delete ShowEditPreviewPerTiddler.tid * Delete ShowEditPreviewPerTiddler.tid * Create Hidden Setting ShowEditPreviewPerTiddler.tid
This commit is contained in:
parent
b5c81d2721
commit
3287cf56bb
@ -24,9 +24,10 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
||||
|
||||
</$list>
|
||||
|
||||
<$set name="edit-preview-state" value={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}}>
|
||||
<$list filter="[all[current]!has[_canonical_uri]]">
|
||||
<$vars 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>> ><$reveal state="$:/state/showeditpreview" type="match" text="yes">
|
||||
<$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>> ><$reveal stateTitle=<<edit-preview-state>> type="match" text="yes">
|
||||
<div class="tc-tiddler-preview">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
@ -44,11 +45,12 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
<$reveal state="$:/state/showeditpreview" type="nomatch" text="yes">
|
||||
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes">
|
||||
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||
|
||||
</$reveal>
|
||||
</$dropzone>
|
||||
</$vars>
|
||||
</$list>
|
||||
</$list>
|
||||
</$set>
|
||||
|
@ -8,11 +8,11 @@ condition: [<targetTiddler>]
|
||||
button-classes: tc-text-editor-toolbar-item-start-group
|
||||
shortcuts: ((preview))
|
||||
|
||||
<$reveal state="$:/state/showeditpreview" type="match" text="yes" tag="span">
|
||||
<$reveal state=<<edit-preview-state>> type="match" text="yes" tag="span">
|
||||
{{$:/core/images/preview-open}}
|
||||
<$action-setfield $tiddler="$:/state/showeditpreview" $value="no"/>
|
||||
<$action-setfield $tiddler=<<edit-preview-state>> $value="no"/>
|
||||
</$reveal>
|
||||
<$reveal state="$:/state/showeditpreview" type="nomatch" text="yes" tag="span">
|
||||
<$reveal state=<<edit-preview-state>> type="nomatch" text="yes" tag="span">
|
||||
{{$:/core/images/preview-closed}}
|
||||
<$action-setfield $tiddler="$:/state/showeditpreview" $value="yes"/>
|
||||
<$action-setfield $tiddler=<<edit-preview-state>> $value="yes"/>
|
||||
</$reveal>
|
||||
|
@ -0,0 +1,8 @@
|
||||
title: Hidden Setting: Show Edit Preview per Tiddler
|
||||
tags: [[Hidden Settings]]
|
||||
created: 20211028083211182
|
||||
modified: 20211028083211182
|
||||
|
||||
The Tiddler Edit-Preview can be shown for all Tiddlers (no) or on a per-Tiddler basis (yes)
|
||||
|
||||
$:/config/ShowEditPreview/PerTiddler
|
Loading…
Reference in New Issue
Block a user