mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-19 08:29:50 +00:00
Compare commits
1 Commits
yet-more-m
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71462143bf |
@@ -25,7 +25,7 @@ Render this widget into the DOM
|
||||
*/
|
||||
TranscludeWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes({asList: true});
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
try {
|
||||
this.renderChildren(parent,nextSibling);
|
||||
|
||||
@@ -377,7 +377,6 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
|
||||
Compute the current values of the attributes of the widget. Returns a hashmap of the names of the attributes that have changed.
|
||||
Options include:
|
||||
filterFn: only include attributes where filterFn(name) returns true
|
||||
asList: boolean if true returns results as an array instead of a single value
|
||||
*/
|
||||
Widget.prototype.computeAttributes = function(options) {
|
||||
options = options || {};
|
||||
@@ -390,7 +389,7 @@ Widget.prototype.computeAttributes = function(options) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
var value = self.computeAttribute(attribute,options),
|
||||
var value = self.computeAttribute(attribute),
|
||||
multiValue = null;
|
||||
if($tw.utils.isArray(value)) {
|
||||
multiValue = value;
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
title: MultiValuedVariables/TranscludeParameterDirectly
|
||||
description: Multi-valued variable passed as procedure parameter via {{{filter}}} syntax
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\procedure showItems(itemList)
|
||||
<$text text={{{ [(itemList)join[-]] }}}/>
|
||||
\end
|
||||
|
||||
<$transclude $variable="showItems" itemList={{{ [all[tiddlers]sort[]] }}}/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>$:/core-ExpectedResult-Output</p>
|
||||
+
|
||||
|
||||
@@ -36,13 +36,56 @@ type: text/vnd.tiddlywiki
|
||||
</h2>
|
||||
<table class="tc-view-field-table">
|
||||
<tbody>
|
||||
<$list filter="[all[current]fields[]sort[title]] -title" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
|
||||
<$list filter="[all[current]fields[]sort[title]] -title -text" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
|
||||
</tbody>
|
||||
</table>
|
||||
<$codeblock code={{{ [<currentTiddler>get[text]] }}}/>
|
||||
</div>
|
||||
</$tiddler>
|
||||
\end
|
||||
|
||||
\procedure .demo-tiddler(tidText)
|
||||
\procedure create-tiddler-actions()
|
||||
<$action-setmultiplefields $tiddler=<<title>> $fields="[<jsonTiddler>jsonindexes[0]sort[]]" $values="[<jsonTiddler>jsonindexes[0]sort[]] :map[<jsonTiddler>jsonget[0],<currentTiddler>]"/>
|
||||
\end create-tiddler-actions
|
||||
<$let
|
||||
jsonTiddler={{{ [<tidText>deserialize[application/x-tiddler]] }}}
|
||||
title={{{ [<jsonTiddler>jsonget[0],[title]] }}}
|
||||
>
|
||||
<div class="doc-tiddler-fields">
|
||||
<h2>
|
||||
<$link to=<<title>>>
|
||||
<$text text=<<title>>/>
|
||||
</$link>
|
||||
</h2>
|
||||
<table class="tc-view-field-table">
|
||||
<tbody>
|
||||
<$list filter="[<jsonTiddler>jsonindexes[0]sort[]] -title -text" variable="listItem">
|
||||
<tr class="tc-view-field">
|
||||
<td class="tc-view-field-name">
|
||||
<$text text=<<listItem>>/>
|
||||
</td>
|
||||
<td class="tc-view-field-value">
|
||||
<$text text={{{ [<jsonTiddler>jsonget[0],<listItem>] }}}/>
|
||||
</td>
|
||||
</tr>
|
||||
</$list>
|
||||
</tbody>
|
||||
</table>
|
||||
<$codeblock code={{{ [<jsonTiddler>jsonget[0],[text]] }}}/>
|
||||
<div>
|
||||
<%if [<title>has[title]] %>
|
||||
The tiddler '<$link to=<<title>>><$text text=<<title>>/></$link>' already exists
|
||||
<%else%>
|
||||
<$button actions=<<create-tiddler-actions>> class="tc-btn-big-green">
|
||||
Create this tiddler
|
||||
</$button>
|
||||
<%endif%>
|
||||
</div>
|
||||
</div>
|
||||
</$let>
|
||||
\end
|
||||
|
||||
\function .mtitle(_) [<_>] Macro +[join[ ]]
|
||||
\function .otitle(_) [<_>] Operator +[join[ ]]
|
||||
\function .vtitle(_) [<_>] Variable +[join[ ]]
|
||||
|
||||
Reference in New Issue
Block a user