mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-29 23:40:45 +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
|
// Server syncing isn't implemented yet
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
tagging: function(wiki,tiddlerTitle) {
|
|
||||||
return wiki.getTiddlersWithTag(tiddlerTitle);
|
|
||||||
},
|
|
||||||
filter: function(wiki) {
|
filter: function(wiki) {
|
||||||
// Filters aren't implemented yet
|
// Filters aren't implemented yet
|
||||||
return [];
|
return [];
|
||||||
|
@ -18,7 +18,8 @@ exports.info = {
|
|||||||
filter: {byPos: 0, type: "filter"},
|
filter: {byPos: 0, type: "filter"},
|
||||||
title: {byPos: 1, type: "tiddler"},
|
title: {byPos: 1, type: "tiddler"},
|
||||||
templateTitle: {byName: true, type: "text"},
|
templateTitle: {byName: true, type: "text"},
|
||||||
templateText: {byName: true, type: "text"}
|
templateText: {byName: true, type: "text"},
|
||||||
|
emptyMessage: {byName: true, type: "text"}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -51,6 +52,13 @@ exports.executeMacro = function() {
|
|||||||
templateParseTree = this.wiki.parseText("text/x-tiddlywiki","<<view text wikified>>");
|
templateParseTree = this.wiki.parseText("text/x-tiddlywiki","<<view text wikified>>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 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
|
// Render the tiddlers through the template
|
||||||
nodes = [];
|
nodes = [];
|
||||||
for(t=0; t<titles.length; t++) {
|
for(t=0; t<titles.length; t++) {
|
||||||
@ -61,6 +69,7 @@ exports.executeMacro = function() {
|
|||||||
nodes.push(node);
|
nodes.push(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Return
|
// Return
|
||||||
var attributes = {"class": ["tw-transclusion"]};
|
var attributes = {"class": ["tw-transclusion"]};
|
||||||
if(this.classes) {
|
if(this.classes) {
|
||||||
|
@ -12,7 +12,11 @@ title: $:/templates/TagTemplate
|
|||||||
<<reveal state:TagDropDownLocation type:popup qualifyTiddlerTitles:yes><
|
<<reveal state:TagDropDownLocation type:popup qualifyTiddlerTitles:yes><
|
||||||
<div class="open">
|
<div class="open">
|
||||||
{{dropdown-menu{
|
{{dropdown-menu{
|
||||||
<<list tagging>>
|
(((
|
||||||
|
|
||||||
|
[is[current]tagging[]]
|
||||||
|
|
||||||
|
)) <<view title link>> )
|
||||||
}}}
|
}}}
|
||||||
</div>
|
</div>
|
||||||
>>
|
>>
|
||||||
|
Loading…
Reference in New Issue
Block a user