mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-10-04 07:01:42 +00:00
Add pluggable previews to the import listing
This commit is contained in:
@@ -41,12 +41,12 @@ $(currentTiddler)$!!popup-$(payloadTiddler)$
|
||||
<$checkbox field=<<selectionField>> checked="checked" unchecked="unchecked" default="checked"/>
|
||||
</td>
|
||||
<td>
|
||||
<$reveal type="nomatch" state=<<previewPopupState>> text="yes">
|
||||
<$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="yes">
|
||||
{{$:/core/images/right-arrow}} <$text text=<<payloadTiddler>>/>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<previewPopupState>> text="yes">
|
||||
<$reveal type="match" state=<<previewPopupState>> text="yes" tag="div">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no">
|
||||
{{$:/core/images/down-arrow}} <$text text=<<payloadTiddler>>/>
|
||||
</$button>
|
||||
@@ -58,8 +58,10 @@ $(currentTiddler)$!!popup-$(payloadTiddler)$
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<$reveal type="match" text="yes" state=<<previewPopupState>>>
|
||||
<$macrocall $name="compareTiddlerText" sourceTiddlerTitle=<<payloadTiddler>> destTiddlerTitle=<<currentTiddler>> destSubTiddlerTitle=<<payloadTiddler>>/>
|
||||
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="div">
|
||||
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
|
||||
<$transclude tiddler={{$:/state/importpreviewtype}}/>
|
||||
</$list>
|
||||
</$reveal>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
title: $:/core/ui/ImportPreviews/Diff
|
||||
tags: $:/tags/ImportPreview
|
||||
caption: {{$:/language/Import/Listing/Preview/Diff}}
|
||||
|
||||
<$macrocall $name="compareTiddlerText" sourceTiddlerTitle=<<payloadTiddler>> destTiddlerTitle=<<currentTiddler>> destSubTiddlerTitle=<<payloadTiddler>>/>
|
||||
@@ -0,0 +1,5 @@
|
||||
title: $:/core/ui/ImportPreviews/DiffFields
|
||||
tags: $:/tags/ImportPreview
|
||||
caption: {{$:/language/Import/Listing/Preview/DiffFields}}
|
||||
|
||||
<$macrocall $name="compareTiddlers" sourceTiddlerTitle=<<payloadTiddler>> destTiddlerTitle=<<currentTiddler>> destSubTiddlerTitle=<<payloadTiddler>> exclude="text"/>
|
||||
@@ -0,0 +1,7 @@
|
||||
title: $:/core/ui/ImportPreviews/Fields
|
||||
tags: $:/tags/ImportPreview
|
||||
caption: {{$:/language/Import/Listing/Preview/Fields}}
|
||||
|
||||
<$tiddler tiddler=<<payloadTiddler>>>
|
||||
<$transclude tiddler="$:/core/ui/TiddlerFields"/>
|
||||
</$tiddler>
|
||||
@@ -0,0 +1,5 @@
|
||||
title: $:/core/ui/ImportPreviews/Text
|
||||
tags: $:/tags/ImportPreview
|
||||
caption: {{$:/language/Import/Listing/Preview/Text}}
|
||||
|
||||
<$transclude tiddler=<<payloadTiddler>> mode="block"/>
|
||||
@@ -0,0 +1,5 @@
|
||||
title: $:/core/ui/ImportPreviews/TextRaw
|
||||
tags: $:/tags/ImportPreview
|
||||
caption: {{$:/language/Import/Listing/Preview/TextRaw}}
|
||||
|
||||
<pre><code><$view tiddler=<<payloadTiddler>>/></code></pre>
|
||||
@@ -3,19 +3,27 @@ tags: $:/tags/ViewTemplate
|
||||
|
||||
\define lingo-base() $:/language/Import/
|
||||
|
||||
\define buttons()
|
||||
<$button message="tm-delete-tiddler" param=<<currentTiddler>>><<lingo Listing/Cancel/Caption>></$button>
|
||||
<$button message="tm-perform-import" param=<<currentTiddler>>><<lingo Listing/Import/Caption>></$button>
|
||||
<<lingo Listing/Preview>> <$select tiddler="$:/state/importpreviewtype" default="$:/core/ui/ImportPreviews/Text">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ImportPreview]!has[draft.of]]">
|
||||
<option value=<<currentTiddler>>>{{!!caption}}</option>
|
||||
</$list>
|
||||
</$select>
|
||||
\end
|
||||
|
||||
<$list filter="[all[current]field:plugin-type[import]]">
|
||||
|
||||
<div class="tc-import">
|
||||
|
||||
<<lingo Listing/Hint>>
|
||||
|
||||
<$button message="tm-delete-tiddler" param=<<currentTiddler>>><<lingo Listing/Cancel/Caption>></$button>
|
||||
<$button message="tm-perform-import" param=<<currentTiddler>>><<lingo Listing/Import/Caption>></$button>
|
||||
<<buttons>>
|
||||
|
||||
{{||$:/core/ui/ImportListing}}
|
||||
|
||||
<$button message="tm-delete-tiddler" param=<<currentTiddler>>><<lingo Listing/Cancel/Caption>></$button>
|
||||
<$button message="tm-perform-import" param=<<currentTiddler>>><<lingo Listing/Import/Caption>></$button>
|
||||
<<buttons>>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user