diff --git a/core/modules/macros/list.js b/core/modules/macros/list.js index e985d63ce..6a562f593 100644 --- a/core/modules/macros/list.js +++ b/core/modules/macros/list.js @@ -26,6 +26,16 @@ exports.info = { } }; +/* +These types are shorthands for particular filters +*/ +var typeMappings = { + all: "[!is[shadow]]", + missing: "[is[missing]]", + orphans: "[is[orphan]]", + shadowed: "[is[shadow]]" +}; + exports.executeMacro = function() { // Get the list of tiddlers object this.getTiddlerList(); @@ -43,7 +53,16 @@ exports.executeMacro = function() { }; exports.getTiddlerList = function() { - this.list = this.wiki.filterTiddlers(this.params.filter,this.tiddlerTitle); + var filter; + if(this.hasParameter("type")) { + filter = typeMappings[this.params.type]; + } else if(this.hasParameter("filter")) { + filter = this.params.filter; + } + if(!filter) { + filter = "[!is[shadow]]"; + } + this.list = this.wiki.filterTiddlers(filter,this.tiddlerTitle); }; /* @@ -83,6 +102,10 @@ exports.createListElementMacro = function(title) { if(draft && this.hasParameter("editTemplateText")) { template = this.params.editTemplateText; } + // Check for no template specified + if(!template && !templateText) { + templateText = "<>"; + } // Create the tiddler macro return $tw.Tree.Macro("tiddler",{ srcParams: {