1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-28 15:08:46 +00:00

Allow filter operators to return an iterator

Previously filter operators were only permitted to return an array of
tiddler titles
This commit is contained in:
Jermolene 2014-04-30 22:50:17 +01:00
parent bd3e955821
commit 21b2d6fdc7

View File

@ -203,9 +203,21 @@ exports.compileFilter = function(filterString) {
wiki: self,
widget: widget
});
accumulator = self.makeTiddlerIterator(results);
if($tw.utils.isArray(results)) {
accumulator = self.makeTiddlerIterator(results);
} else {
accumulator = results;
}
});
return results;
if($tw.utils.isArray(results)) {
return results;
} else {
var resultArray = [];
results(function(tiddler,title) {
resultArray.push(title);
});
return resultArray;
}
};
// Wrap the operator functions in a wrapper function that depends on the prefix
operationFunctions.push((function() {