mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 15:36:52 +00:00
Import UI: add warning about tiddlers that already exist (#4956)
* Added message when tiddler being imported already exists * Refactored some filters into a shared subfilter, optimized macro definitions
This commit is contained in:
parent
ef1b7d619a
commit
9fbcdeb29e
@ -15,8 +15,9 @@ Listing/Preview/Diff: Diff
|
|||||||
Listing/Preview/DiffFields: Diff (Fields)
|
Listing/Preview/DiffFields: Diff (Fields)
|
||||||
Listing/Rename/Tooltip: Rename tiddler before importing
|
Listing/Rename/Tooltip: Rename tiddler before importing
|
||||||
Listing/Rename/Prompt: Rename to:
|
Listing/Rename/Prompt: Rename to:
|
||||||
Listing/Rename/ConfirmRename : Rename tiddler
|
Listing/Rename/ConfirmRename: Rename tiddler
|
||||||
Listing/Rename/CancelRename : Cancel
|
Listing/Rename/CancelRename: Cancel
|
||||||
|
Listing/Rename/OverwriteWarning: A tiddler with this title already exists.
|
||||||
Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin
|
Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin
|
||||||
Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)
|
Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)
|
||||||
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>
|
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>
|
||||||
|
@ -2,27 +2,23 @@ title: $:/core/ui/ImportListing
|
|||||||
|
|
||||||
\define lingo-base() $:/language/Import/
|
\define lingo-base() $:/language/Import/
|
||||||
|
|
||||||
\define messageField()
|
\define messageField() message-$(payloadTiddler)$
|
||||||
message-$(payloadTiddler)$
|
|
||||||
|
\define payloadTitleFilter() [<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]
|
||||||
|
|
||||||
|
\define overWriteWarning()
|
||||||
|
<$text text={{{[subfilter<payloadTitleFilter>!is[tiddler]then[]] ~[<lingo-base>addsuffix[Listing/Rename/OverwriteWarning]get[text]]}}}/>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define selectionField()
|
\define selectionField() selection-$(payloadTiddler)$
|
||||||
selection-$(payloadTiddler)$
|
|
||||||
\end
|
|
||||||
|
|
||||||
\define renameField()
|
\define renameField() rename-$(payloadTiddler)$
|
||||||
rename-$(payloadTiddler)$
|
|
||||||
\end
|
|
||||||
|
|
||||||
\define newImportTitleTiddler() $:/temp/NewImportTitle-$(payloadTiddler)$
|
\define newImportTitleTiddler() $:/temp/NewImportTitle-$(payloadTiddler)$
|
||||||
|
|
||||||
\define previewPopupState()
|
\define previewPopupState() $(currentTiddler)$!!popup-$(payloadTiddler)$
|
||||||
$(currentTiddler)$!!popup-$(payloadTiddler)$
|
|
||||||
\end
|
|
||||||
|
|
||||||
\define renameFieldState()
|
\define renameFieldState() $(currentTiddler)$!!state-rename-$(payloadTiddler)$
|
||||||
$(currentTiddler)$!!state-rename-$(payloadTiddler)$
|
|
||||||
\end
|
|
||||||
|
|
||||||
\define select-all-actions()
|
\define select-all-actions()
|
||||||
<$list filter="[all[current]plugintiddlers[]sort[title]]" variable="payloadTiddler">
|
<$list filter="[all[current]plugintiddlers[]sort[title]]" variable="payloadTiddler">
|
||||||
@ -54,13 +50,13 @@ $(currentTiddler)$!!state-rename-$(payloadTiddler)$
|
|||||||
<$reveal type="nomatch" state=<<renameFieldState>> text="yes" tag="div">
|
<$reveal type="nomatch" state=<<renameFieldState>> text="yes" tag="div">
|
||||||
<$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div" class="tc-flex">
|
<$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div" class="tc-flex">
|
||||||
<$button class="tc-btn-invisible tc-btn-dropdown tc-flex-grow-1" set=<<previewPopupState>> setTo="yes">
|
<$button class="tc-btn-invisible tc-btn-dropdown tc-flex-grow-1" set=<<previewPopupState>> setTo="yes">
|
||||||
<span class="tc-small-gap-right">{{$:/core/images/right-arrow}}</span><$text text={{{[<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]}}}/>
|
<span class="tc-small-gap-right">{{$:/core/images/right-arrow}}</span><$text text={{{[subfilter<payloadTitleFilter>]}}}/>
|
||||||
</$button>
|
</$button>
|
||||||
<$button class="tc-btn-invisible tc-small-gap-left" set=<<renameFieldState>> setTo="yes" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/Tooltip]get[text]]}}}>{{$:/core/images/edit-button}}</$button>
|
<$button class="tc-btn-invisible tc-small-gap-left" set=<<renameFieldState>> setTo="yes" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/Tooltip]get[text]]}}}>{{$:/core/images/edit-button}}</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" state=<<previewPopupState>> text="yes" tag="div">
|
<$reveal type="match" state=<<previewPopupState>> text="yes" tag="div">
|
||||||
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no">
|
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no">
|
||||||
<span class="tc-small-gap-right">{{$:/core/images/down-arrow}}</span><$text text={{{[<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]}}}/>
|
<span class="tc-small-gap-right">{{$:/core/images/down-arrow}}</span><$text text={{{[subfilter<payloadTitleFilter>]}}}/>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
@ -70,12 +66,13 @@ $(currentTiddler)$!!state-rename-$(payloadTiddler)$
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<$view field=<<messageField>>/>
|
<$view field=<<messageField>>/>
|
||||||
|
<<overWriteWarning>>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<$reveal type="match" state=<<renameFieldState>> text="yes" tag="tr">
|
<$reveal type="match" state=<<renameFieldState>> text="yes" tag="tr">
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<div class="tc-flex">
|
<div class="tc-flex">
|
||||||
<$edit-text tiddler=<<newImportTitleTiddler>> default={{{[<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]}}} tag="input" class="tc-import-rename tc-flex-grow-1"/><span class="tc-small-gap-left"><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button><span class="tc-small-gap-right"/></span><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<<renameField>> $value={{{[<newImportTitleTiddler>get[text]minlength[1]else<payloadTiddler>]}}} /><$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button>
|
<$edit-text tiddler=<<newImportTitleTiddler>> default={{{[subfilter<payloadTitleFilter>]}}} tag="input" class="tc-import-rename tc-flex-grow-1"/><span class="tc-small-gap-left"><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button><span class="tc-small-gap-right"/></span><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<<renameField>> $value={{{[<newImportTitleTiddler>get[text]minlength[1]else<payloadTiddler>]}}} /><$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
@ -91,4 +88,3 @@ $(currentTiddler)$!!state-rename-$(payloadTiddler)$
|
|||||||
</$list>
|
</$list>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user