mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-23 18:39:50 +00:00
Compare commits
1 Commits
further-tr
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b673651103 |
@@ -15,6 +15,8 @@ Listing/Preview/TextRaw: Text (Raw)
|
||||
Listing/Preview/Fields: Fields
|
||||
Listing/Preview/Diff: Diff
|
||||
Listing/Preview/DiffFields: Diff (Fields)
|
||||
Listing/ImportOptions/Caption: Import options
|
||||
Listing/ImportOptions/NoMatch: No import options apply to these files.
|
||||
Listing/Rename/Tooltip: Rename tiddler before importing
|
||||
Listing/Rename/Prompt: Rename to:
|
||||
Listing/Rename/ConfirmRename: Rename tiddler
|
||||
|
||||
@@ -415,10 +415,9 @@ Widget.prototype.computeAttribute = function(attribute,options) {
|
||||
value;
|
||||
if(attribute.type === "filtered") {
|
||||
value = this.wiki.filterTiddlers(attribute.filter,this);
|
||||
if(!value.length) {
|
||||
value = [""];
|
||||
if(!options.asList) {
|
||||
value = value[0] || "";
|
||||
}
|
||||
value = options.asList ? value : value[0];
|
||||
} else if(attribute.type === "indirect") {
|
||||
value = this.wiki.getTextReference(attribute.textReference,"",this.getVariable("currentTiddler"));
|
||||
if(value && options.asList) {
|
||||
|
||||
@@ -49,23 +49,40 @@ title: $:/core/ui/ImportListing
|
||||
\end
|
||||
|
||||
\whitespace trim
|
||||
<$let importJson={{{ [{$:/Import}] }}}
|
||||
importTitles={{{ [<importJson>jsonindexes[tiddlers]] }}}
|
||||
importTypes={{{ [(importTitles)] :map[<importJson>jsonget[tiddlers],<currentTiddler>,[type]] }}}
|
||||
anyMatch={{{ [all[shadows+tiddlers]tag[$:/tags/ImportOptions]get[condition]] :map[(importTypes)subfilter<currentTiddler>] +[!is[blank]limit[1]] }}}>
|
||||
<%if [<anyMatch>!is[blank]] %>
|
||||
<div class="tc-import-option">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ImportOptions]]" variable="importOption">
|
||||
<$let condition={{{ [<importOption>get[condition]] }}}
|
||||
hasMatch={{{ [(importTypes)subfilter<condition>limit[1]] }}}>
|
||||
<%if [<hasMatch>!is[blank]] %>
|
||||
<$transclude tiddler=<<importOption>>/>
|
||||
<%endif%>
|
||||
</$let>
|
||||
</$list>
|
||||
</div>
|
||||
<%endif%>
|
||||
</$let>
|
||||
<%if [all[shadows+tiddlers]tag[$:/tags/ImportOptions]limit[1]] %>
|
||||
<$reveal type="nomatch" state="$:/state/import/options" text="yes" tag="div">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set="$:/state/import/options" setTo="yes" aria-label={{$:/language/Import/Listing/ImportOptions/Caption}} aria-expanded="false">
|
||||
<span class="tc-small-gap-right">{{$:/core/images/right-arrow}}</span><<lingo Listing/ImportOptions/Caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state="$:/state/import/options" text="yes" tag="div">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set="$:/state/import/options" setTo="no" aria-label={{$:/language/Import/Listing/ImportOptions/Caption}} aria-expanded="true">
|
||||
<span class="tc-small-gap-right">{{$:/core/images/down-arrow}}</span><<lingo Listing/ImportOptions/Caption>>
|
||||
</$button>
|
||||
<$let importJson={{{ [{$:/Import}] }}}
|
||||
importTitles={{{ [<importJson>jsonindexes[tiddlers]] }}}
|
||||
importTypes={{{ [(importTitles)] :map[<importJson>jsonget[tiddlers],<currentTiddler>,[type]] }}}
|
||||
anyMatch={{{ [all[shadows+tiddlers]tag[$:/tags/ImportOptions]get[condition]] :map[(importTypes)subfilter<currentTiddler>] +[!is[blank]limit[1]] }}}>
|
||||
<%if [<anyMatch>!is[blank]] %>
|
||||
<div class="tc-import-option">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ImportOptions]]" variable="importOption">
|
||||
<$let condition={{{ [<importOption>get[condition]] }}}
|
||||
hasMatch={{{ [(importTypes)subfilter<condition>limit[1]] }}}>
|
||||
<%if [<hasMatch>!is[blank]] %>
|
||||
<$transclude tiddler=<<importOption>>/>
|
||||
<%endif%>
|
||||
</$let>
|
||||
</$list>
|
||||
</div>
|
||||
<%else%>
|
||||
<div class="tc-import-option">
|
||||
<<lingo Listing/ImportOptions/NoMatch>>
|
||||
</div>
|
||||
<%endif%>
|
||||
</$let>
|
||||
</$reveal>
|
||||
<%endif%>
|
||||
|
||||
<div class="tc-table-wrapper">
|
||||
<table class="tc-import-table">
|
||||
<tbody>
|
||||
|
||||
@@ -5,6 +5,11 @@ tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\procedure testproc()
|
||||
This is ''wikitext''
|
||||
\end
|
||||
|
||||
|
||||
<$tiddler tiddler="Data">
|
||||
<$transclude $index="testindex"/>
|
||||
-
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
title: Transclude/MissingTiddlerAttributeFiltered
|
||||
description: Missing Tiddler Attribute Filtered
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
<$transclude tiddler={{{ [[sometiddler]get[nosuchfield]] }}}/>
|
||||
-
|
||||
<$transclude tiddler="">fallback content</$transclude>
|
||||
-
|
||||
<$transclude tiddler={{{ [[sometiddler]get[nosuchfield]] }}}>fallback content</$transclude>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>
|
||||
-
|
||||
fallback content
|
||||
-
|
||||
fallback content</p>
|
||||
Reference in New Issue
Block a user