mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Use the transclude macro instead of list tagging
in the tag popup
This commit is contained in:
parent
ec3f16f50f
commit
cabc11d517
@ -29,9 +29,6 @@ var handlers = {
|
||||
// Server syncing isn't implemented yet
|
||||
return [];
|
||||
},
|
||||
tagging: function(wiki,tiddlerTitle) {
|
||||
return wiki.getTiddlersWithTag(tiddlerTitle);
|
||||
},
|
||||
filter: function(wiki) {
|
||||
// Filters aren't implemented yet
|
||||
return [];
|
||||
|
@ -18,7 +18,8 @@ exports.info = {
|
||||
filter: {byPos: 0, type: "filter"},
|
||||
title: {byPos: 1, type: "tiddler"},
|
||||
templateTitle: {byName: true, type: "text"},
|
||||
templateText: {byName: true, type: "text"}
|
||||
templateText: {byName: true, type: "text"},
|
||||
emptyMessage: {byName: true, type: "text"}
|
||||
}
|
||||
};
|
||||
|
||||
@ -51,14 +52,22 @@ exports.executeMacro = function() {
|
||||
templateParseTree = this.wiki.parseText("text/x-tiddlywiki","<<view text wikified>>");
|
||||
}
|
||||
}
|
||||
// Render the tiddlers through the template
|
||||
nodes = [];
|
||||
for(t=0; t<titles.length; t++) {
|
||||
title = titles[t];
|
||||
for(c=0; c<templateParseTree.tree.length; c++) {
|
||||
node = templateParseTree.tree[c].clone();
|
||||
node.execute(parents,title);
|
||||
nodes.push(node);
|
||||
// Use the empty message if the list is empty
|
||||
if(titles.length === 0 && this.hasParameter("emptyMessage")) {
|
||||
nodes = this.wiki.parseText("text/x-tiddlywiki",this.params.emptyMessage).tree;
|
||||
for(c=0; c<nodes.length; c++) {
|
||||
nodes[c].execute(this.parents,this.tiddlerTitle);
|
||||
}
|
||||
} else {
|
||||
// Render the tiddlers through the template
|
||||
nodes = [];
|
||||
for(t=0; t<titles.length; t++) {
|
||||
title = titles[t];
|
||||
for(c=0; c<templateParseTree.tree.length; c++) {
|
||||
node = templateParseTree.tree[c].clone();
|
||||
node.execute(parents,title);
|
||||
nodes.push(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Return
|
||||
|
@ -12,7 +12,11 @@ title: $:/templates/TagTemplate
|
||||
<<reveal state:TagDropDownLocation type:popup qualifyTiddlerTitles:yes><
|
||||
<div class="open">
|
||||
{{dropdown-menu{
|
||||
<<list tagging>>
|
||||
(((
|
||||
|
||||
[is[current]tagging[]]
|
||||
|
||||
)) <<view title link>> )
|
||||
}}}
|
||||
</div>
|
||||
>>
|
||||
|
Loading…
Reference in New Issue
Block a user