diff --git a/core/modules/filters/is.js b/core/modules/filters/is.js index 514443a62..99d86597f 100644 --- a/core/modules/filters/is.js +++ b/core/modules/filters/is.js @@ -26,16 +26,9 @@ function getIsFilterOperators() { Export our filter function */ exports.is = function(source,operator,options) { - // Dispatch to the correct isfilteroperator - var isFilterOperators = getIsFilterOperators(); - if(operator.operand) { - var isFilterOperator = isFilterOperators[operator.operand]; - if(isFilterOperator) { - return isFilterOperator(source,operator.prefix,options); - } else { - return [$tw.language.getString("Error/IsFilterOperator")]; - } - } else { + + + if( !operator.operand) { // Return all tiddlers if the operand is missing var results = []; source(function(tiddler,title) { @@ -43,6 +36,31 @@ exports.is = function(source,operator,options) { }); return results; } + + // Get our isfilteroperators + var isFilterOperators = getIsFilterOperators(), + subops = operator.operand.split("+"), + filteredResults = {}, + results = []; + for (var t=0; t> <<.operator-example 6 "[is[shadow]]" "overridden shadow tiddlers">> <<.operator-example 7 "[is[missing]]" "empty because its input contains only tiddlers that exist">> +<<.operator-example 8 "[all[tiddlers+shadows]is[tiddler+shadow]]" "contains the entire input list">> diff --git a/editions/tw5.com/tiddlers/filters/is.tid b/editions/tw5.com/tiddlers/filters/is.tid index fb7f6a26c..214661839 100644 --- a/editions/tw5.com/tiddlers/filters/is.tid +++ b/editions/tw5.com/tiddlers/filters/is.tid @@ -11,7 +11,11 @@ op-parameter-name: C op-output: those input tiddlers that belong to category <<.place C>> op-neg-output: those input tiddlers that do <<.em not>> belong to category <<.place C>> -The parameter <<.place C>> is one of the following fundamental categories: +The parameter <<.place C>> specifies zero or more fundamental categories using the following syntax: + +<$railroad text=""" +[{: ("current" | "missing" |: "orphans" | "shadows" | "tags" | "tiddlers" ) +"+" }] +"""/> |!Category |!Matches any tiddler that... | |^`current` |is the [[current tiddler|Current Tiddler]] |